From efd14e4595e06eb83df1a858e8ba19e33f8e9f83 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Sat, 20 Jul 1996 17:21:36 +0000 Subject: [PATCH] * gdbtk.tcl (delete_expr): Unset corresponding element of expr_update_list when destroying an expression. (create_expr_window): Initialize expr_num, delete_expr_num, and expr_update_list here when each new expression window is created, rather than once at startup. PR 9383 --- gdb/ChangeLog | 8 ++++++++ gdb/gdbtk.tcl | 21 +++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d0fabdef697..bb030eb1677 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +Sat Jul 20 10:09:28 1996 Fred Fish + + * gdbtk.tcl (delete_expr): Unset corresponding element of + expr_update_list when destroying an expression. + (create_expr_window): Initialize expr_num, delete_expr_num, + and expr_update_list here when each new expression window + is created, rather than once at startup. + Fri Jul 19 14:05:57 1996 Stan Shebs * dwarf2read.c: New file, DWARF 2 reader originally contributed by diff --git a/gdb/gdbtk.tcl b/gdb/gdbtk.tcl index f517245cfa3..6d027cca303 100644 --- a/gdb/gdbtk.tcl +++ b/gdb/gdbtk.tcl @@ -27,7 +27,6 @@ set cfunc NIL set line_numbers 1 set breakpoint_file(-1) {[garbage]} set disassemble_with_source nosource -set expr_update_list(0) 0 set gdb_prompt "(gdb) " # Hint: The following can be toggled from a tclsh window after @@ -1089,9 +1088,6 @@ proc not_implemented_yet {message} { # Create the expression display window. # -set expr_num 0 -set delete_expr_num 0 - # Set delete_expr_num, and set -state of Delete button. proc expr_update_button {num} { global delete_expr_num @@ -1135,13 +1131,14 @@ proc add_expr {expr} { proc delete_expr {} { global delete_expr_num + global expr_update_list + if {$delete_expr_num > 0} then { set e .expr.exprs set f e${delete_expr_num} destroy $e.updates.$f $e.expressions.$f $e.values.$f - - # FIXME should we unset an element of expr_update_list here? + unset expr_update_list($delete_expr_num) } } @@ -1171,9 +1168,21 @@ proc update_exprs {} { } proc create_expr_window {} { + global expr_num + global delete_expr_num + global expr_update_list if {[winfo exists .expr]} {raise .expr ; return} + # All the state about individual expressions is stored in the + # expression window widgets, so when it is deleted, the + # previous values of the expression global variables become + # invalid. Reset to a known initial state. + set expr_num 0 + set delete_expr_num 0 + catch {unset expr_update_list} + set expr_update_list(0) 0 + toplevel .expr wm title .expr "GDB Expressions" wm iconname .expr "Expressions" -- 2.30.2