From b66051ec1950ddd647fbfa629bcec40ba8bd5d25 Mon Sep 17 00:00:00 2001 From: Stu Grossman Date: Thu, 26 Jan 1995 02:27:06 +0000 Subject: [PATCH] * gdbtk.c (gdbtk_init): Prevent segfault when gdbtk.tcl can't be found. * gdbtk.tcl: Initialize expr_update_list() to prevent errors when popping up expression window for the first time. --- gdb/ChangeLog | 7 +++++++ gdb/gdbtk.c | 7 ++++++- gdb/gdbtk.tcl | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3cc3a3436b6..9dac0e49de7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +Wed Jan 25 18:23:46 1995 Stu Grossman (grossman@cygnus.com) + + * gdbtk.c (gdbtk_init): Prevent segfault when gdbtk.tcl can't be + found. + * gdbtk.tcl: Initialize expr_update_list() to prevent errors when + popping up expression window for the first time. + Wed Jan 25 18:13:14 1995 Per Bothner * eval.c (evaluate_subexp case OP_ARRAY): Fix calls to memset: diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index ca7ef40913d..35b2a91f7ff 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -1184,11 +1184,16 @@ gdbtk_init () if (Tcl_EvalFile (interp, gdbtk_filename) != TCL_OK) { + char *err; + 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)); + + fputs_unfiltered ("Stack trace:\n", gdb_stderr); + fputs_unfiltered (Tcl_GetVar (interp, "errorInfo", 0), gdb_stderr); + error (""); } discard_cleanups (old_chain); diff --git a/gdb/gdbtk.tcl b/gdb/gdbtk.tcl index f44dc741fd5..2df9cf08ddd 100644 --- a/gdb/gdbtk.tcl +++ b/gdb/gdbtk.tcl @@ -31,6 +31,7 @@ set cfunc NIL set line_numbers 1 set breakpoint_file(-1) {[garbage]} set disassemble_with_source nosource +set expr_update_list(0) 0 #option add *Foreground Black #option add *Background White -- 2.30.2