Update of /cvsroot/gqclient/gq/src
In directory usw-pr-cvs1:/tmp/cvs-serv17599
Modified Files:
errorchain.c
Log Message:
* Possibility for error reporting including source position (good for
debugging)
Index: errorchain.c
===================================================================
RCS file: /cvsroot/gqclient/gq/src/errorchain.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** errorchain.c 21 Jun 2002 00:30:29 -0000 1.7
--- errorchain.c 27 Jun 2002 08:13:21 -0000 1.8
***************
*** 68,73 ****
}
!
! void error_push(int context, char *msg)
{
struct errchain *chain;
--- 68,73 ----
}
! #ifdef ERROR_SHOW_LINE
! void error_push_production(int context, char *msg)
{
struct errchain *chain;
***************
*** 91,94 ****
--- 91,104 ----
}
+ #endif
+
+ void error_push_debug(int context, char *msg, char *file, int line)
+ {
+ int len = strlen(msg) + strlen(file) + 100;
+ char *s = g_malloc(len);
+ snprintf(s, len, "%s:%d %s", file, line, msg);
+ error_push_production(context, s);
+ g_free(s);
+ }
/*
***************
*** 208,212 ****
msg_label = gtk_label_new(cur_msg->msg);
gtk_label_set_justify(GTK_LABEL(msg_label), GTK_JUSTIFY_LEFT);
!
gtk_widget_show(msg_label);
gtk_box_pack_start(GTK_BOX(vbox), msg_label, FALSE, FALSE, 0);
--- 218,222 ----
msg_label = gtk_label_new(cur_msg->msg);
gtk_label_set_justify(GTK_LABEL(msg_label), GTK_JUSTIFY_LEFT);
! gtk_misc_set_alignment(GTK_MISC(msg_label), 0, 0);
gtk_widget_show(msg_label);
gtk_box_pack_start(GTK_BOX(vbox), msg_label, FALSE, FALSE, 0);
|