aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtk.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-01-12 01:09:34 +0000
committerStu Grossman <grossman@cygnus>1995-01-12 01:09:34 +0000
commit724498fdc04f83e5d450268ee11e602814945103 (patch)
tree4cdd3f38fbb8dc83ab2d8d9ead6a02457c279956 /gdb/gdbtk.c
parentb04a78d48726802327923f5a4d6b5f57fe69c798 (diff)
downloadgdb-724498fdc04f83e5d450268ee11e602814945103.zip
gdb-724498fdc04f83e5d450268ee11e602814945103.tar.gz
gdb-724498fdc04f83e5d450268ee11e602814945103.tar.bz2
* gdbtk.c (gdbtk_init): Improve handling for errors in gdbtk.tcl
during startup.
Diffstat (limited to 'gdb/gdbtk.c')
-rw-r--r--gdb/gdbtk.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c
index c97d244..ff9397f 100644
--- a/gdb/gdbtk.c
+++ b/gdb/gdbtk.c
@@ -1096,7 +1096,6 @@ gdbtk_init ()
Tcl_CreateCommand (interp, "gdb_eval", call_wrapper, gdb_eval, NULL);
command_loop_hook = Tk_MainLoop;
- fputs_unfiltered_hook = gdbtk_fputs;
print_frame_info_listing_hook = null_routine;
query_hook = gdbtk_query;
flush_hook = gdbtk_flush;
@@ -1154,8 +1153,19 @@ gdbtk_init ()
else
gdbtk_filename = GDBTK_FILENAME;
+/* Defer setup of fputs_unfiltered_hook to near the end so that error messages
+ prior to this point go to stdout/stderr. */
+
+ fputs_unfiltered_hook = gdbtk_fputs;
+
if (Tcl_EvalFile (interp, gdbtk_filename) != TCL_OK)
- error ("Failure reading %s: %s", gdbtk_filename, interp->result);
+ {
+ fputs_unfiltered_hook = NULL; /* Force errors to stdout/stderr */
+
+ fprintf_unfiltered (stderr, "%s:%d: %s\n", gdbtk_filename,
+ interp->errorLine, interp->result);
+ error ("Stack trace:\n%s", Tcl_GetVar (interp, "errorInfo", 0));
+ }
discard_cleanups (old_chain);
}