1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

Added completion info for buffers in crash/debug dump

This commit is contained in:
Sebastien Helleu
2006-06-14 15:43:33 +00:00
parent 98338e2e20
commit f6ff17ebb0
10 changed files with 126 additions and 6 deletions
+34
View File
@@ -30,6 +30,7 @@
#include "weechat.h"
#include "completion.h"
#include "command.h"
#include "log.h"
#include "utf8.h"
#include "weelist.h"
#include "weeconfig.h"
@@ -1350,3 +1351,36 @@ completion_search (t_completion *completion, int direction,
}
}
}
/*
* completion_print_log: print completion list in log (usually for crash dump)
*/
void
completion_print_log (t_completion *completion)
{
weechat_log_printf ("[completion (addr:0x%X)]\n", completion);
weechat_log_printf (" server . . . . . . . . : 0x%X\n", completion->server);
weechat_log_printf (" channel. . . . . . . . : 0x%X\n", completion->channel);
weechat_log_printf (" context. . . . . . . . : %d\n", completion->context);
weechat_log_printf (" base_command . . . . . : '%s'\n", completion->base_command);
weechat_log_printf (" base_command_arg . . . : %d\n", completion->base_command_arg);
weechat_log_printf (" arg_is_nick. . . . . . : %d\n", completion->arg_is_nick);
weechat_log_printf (" base_word. . . . . . . : '%s'\n", completion->base_word);
weechat_log_printf (" base_word_pos. . . . . : %d\n", completion->base_word_pos);
weechat_log_printf (" position . . . . . . . : %d\n", completion->position);
weechat_log_printf (" args . . . . . . . . . : '%s'\n", completion->args);
weechat_log_printf (" direction. . . . . . . : %d\n", completion->direction);
weechat_log_printf (" completion_list. . . . : 0x%X\n", completion->completion_list);
weechat_log_printf (" last_completion. . . . : 0x%X\n", completion->last_completion);
weechat_log_printf (" word_found . . . . . . : '%s'\n", completion->word_found);
weechat_log_printf (" position_replace . . . : %d\n", completion->position_replace);
weechat_log_printf (" diff_size. . . . . . . : %d\n", completion->diff_size);
weechat_log_printf (" diff_length. . . . . . : %d\n", completion->diff_length);
if (completion->completion_list)
{
weechat_log_printf ("\n");
weelist_print_log (completion->completion_list,
"completion list element");
}
}
+1
View File
@@ -59,5 +59,6 @@ struct t_completion
extern void completion_init (t_completion *, void *, void *);
extern void completion_free (t_completion *);
extern void completion_search (t_completion *, int, char *, int, int);
extern void completion_print_log (t_completion *);
#endif /* completion.h */
+20
View File
@@ -29,6 +29,7 @@
#include "weechat.h"
#include "weelist.h"
#include "log.h"
/*
@@ -163,3 +164,22 @@ weelist_remove (t_weelist **weelist, t_weelist **last_weelist, t_weelist *elemen
free (element);
*weelist = new_weelist;
}
/*
* weelist_print_log: print weelist in log (usually for crash dump)
*/
void
weelist_print_log (t_weelist *weelist, char *name)
{
t_weelist *ptr_weelist;
for (ptr_weelist = weelist; ptr_weelist;
ptr_weelist = ptr_weelist->next_weelist)
{
weechat_log_printf ("[%s (addr:0x%X)]\n", name, ptr_weelist);
weechat_log_printf (" data . . . . . . . . . : '%s'\n", ptr_weelist->data);
weechat_log_printf (" prev_weelist . . . . . : 0x%X\n", ptr_weelist->prev_weelist);
weechat_log_printf (" next_weelist . . . . . : 0x%X\n", ptr_weelist->next_weelist);
}
}
+4 -3
View File
@@ -30,8 +30,9 @@ struct t_weelist
t_weelist *next_weelist;
};
t_weelist *weelist_search (t_weelist *, char *);
t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
extern t_weelist *weelist_search (t_weelist *, char *);
extern t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
extern void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
extern void weelist_print_log (t_weelist *, char *);
#endif /* weelist.h */
+4
View File
@@ -906,6 +906,7 @@ gui_buffer_print_log (t_gui_buffer *buffer)
weechat_log_printf (" input_buffer_length. . : %d\n", buffer->input_buffer_length);
weechat_log_printf (" input_buffer_pos . . . : %d\n", buffer->input_buffer_pos);
weechat_log_printf (" input_buffer_1st_disp. : %d\n", buffer->input_buffer_1st_display);
weechat_log_printf (" completion . . . . . . : 0x%X\n", &(buffer->completion));
weechat_log_printf (" history. . . . . . . . : 0x%X\n", buffer->history);
weechat_log_printf (" last_history . . . . . : 0x%X\n", buffer->last_history);
weechat_log_printf (" ptr_history. . . . . . : 0x%X\n", buffer->ptr_history);
@@ -935,4 +936,7 @@ gui_buffer_print_log (t_gui_buffer *buffer)
ptr_line = ptr_line->next_line;
}
weechat_log_printf ("\n");
completion_print_log (&(buffer->completion));
}
+34
View File
@@ -30,6 +30,7 @@
#include "weechat.h"
#include "completion.h"
#include "command.h"
#include "log.h"
#include "utf8.h"
#include "weelist.h"
#include "weeconfig.h"
@@ -1350,3 +1351,36 @@ completion_search (t_completion *completion, int direction,
}
}
}
/*
* completion_print_log: print completion list in log (usually for crash dump)
*/
void
completion_print_log (t_completion *completion)
{
weechat_log_printf ("[completion (addr:0x%X)]\n", completion);
weechat_log_printf (" server . . . . . . . . : 0x%X\n", completion->server);
weechat_log_printf (" channel. . . . . . . . : 0x%X\n", completion->channel);
weechat_log_printf (" context. . . . . . . . : %d\n", completion->context);
weechat_log_printf (" base_command . . . . . : '%s'\n", completion->base_command);
weechat_log_printf (" base_command_arg . . . : %d\n", completion->base_command_arg);
weechat_log_printf (" arg_is_nick. . . . . . : %d\n", completion->arg_is_nick);
weechat_log_printf (" base_word. . . . . . . : '%s'\n", completion->base_word);
weechat_log_printf (" base_word_pos. . . . . : %d\n", completion->base_word_pos);
weechat_log_printf (" position . . . . . . . : %d\n", completion->position);
weechat_log_printf (" args . . . . . . . . . : '%s'\n", completion->args);
weechat_log_printf (" direction. . . . . . . : %d\n", completion->direction);
weechat_log_printf (" completion_list. . . . : 0x%X\n", completion->completion_list);
weechat_log_printf (" last_completion. . . . : 0x%X\n", completion->last_completion);
weechat_log_printf (" word_found . . . . . . : '%s'\n", completion->word_found);
weechat_log_printf (" position_replace . . . : %d\n", completion->position_replace);
weechat_log_printf (" diff_size. . . . . . . : %d\n", completion->diff_size);
weechat_log_printf (" diff_length. . . . . . : %d\n", completion->diff_length);
if (completion->completion_list)
{
weechat_log_printf ("\n");
weelist_print_log (completion->completion_list,
"completion list element");
}
}
+1
View File
@@ -59,5 +59,6 @@ struct t_completion
extern void completion_init (t_completion *, void *, void *);
extern void completion_free (t_completion *);
extern void completion_search (t_completion *, int, char *, int, int);
extern void completion_print_log (t_completion *);
#endif /* completion.h */
+20
View File
@@ -29,6 +29,7 @@
#include "weechat.h"
#include "weelist.h"
#include "log.h"
/*
@@ -163,3 +164,22 @@ weelist_remove (t_weelist **weelist, t_weelist **last_weelist, t_weelist *elemen
free (element);
*weelist = new_weelist;
}
/*
* weelist_print_log: print weelist in log (usually for crash dump)
*/
void
weelist_print_log (t_weelist *weelist, char *name)
{
t_weelist *ptr_weelist;
for (ptr_weelist = weelist; ptr_weelist;
ptr_weelist = ptr_weelist->next_weelist)
{
weechat_log_printf ("[%s (addr:0x%X)]\n", name, ptr_weelist);
weechat_log_printf (" data . . . . . . . . . : '%s'\n", ptr_weelist->data);
weechat_log_printf (" prev_weelist . . . . . : 0x%X\n", ptr_weelist->prev_weelist);
weechat_log_printf (" next_weelist . . . . . : 0x%X\n", ptr_weelist->next_weelist);
}
}
+4 -3
View File
@@ -30,8 +30,9 @@ struct t_weelist
t_weelist *next_weelist;
};
t_weelist *weelist_search (t_weelist *, char *);
t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
extern t_weelist *weelist_search (t_weelist *, char *);
extern t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
extern void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
extern void weelist_print_log (t_weelist *, char *);
#endif /* weelist.h */
+4
View File
@@ -906,6 +906,7 @@ gui_buffer_print_log (t_gui_buffer *buffer)
weechat_log_printf (" input_buffer_length. . : %d\n", buffer->input_buffer_length);
weechat_log_printf (" input_buffer_pos . . . : %d\n", buffer->input_buffer_pos);
weechat_log_printf (" input_buffer_1st_disp. : %d\n", buffer->input_buffer_1st_display);
weechat_log_printf (" completion . . . . . . : 0x%X\n", &(buffer->completion));
weechat_log_printf (" history. . . . . . . . : 0x%X\n", buffer->history);
weechat_log_printf (" last_history . . . . . : 0x%X\n", buffer->last_history);
weechat_log_printf (" ptr_history. . . . . . : 0x%X\n", buffer->ptr_history);
@@ -935,4 +936,7 @@ gui_buffer_print_log (t_gui_buffer *buffer)
ptr_line = ptr_line->next_line;
}
weechat_log_printf ("\n");
completion_print_log (&(buffer->completion));
}