diff options
author | Fred Fish <fnf@specifix.com> | 1996-07-20 17:21:36 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1996-07-20 17:21:36 +0000 |
commit | efd14e4595e06eb83df1a858e8ba19e33f8e9f83 (patch) | |
tree | 6cc16a7de48739da377aeb806627a039d2849d73 /gdb/gdbtk.tcl | |
parent | 194141a9b87dcacd3f896400eab8b0549db5a12e (diff) | |
download | gdb-efd14e4595e06eb83df1a858e8ba19e33f8e9f83.zip gdb-efd14e4595e06eb83df1a858e8ba19e33f8e9f83.tar.gz gdb-efd14e4595e06eb83df1a858e8ba19e33f8e9f83.tar.bz2 |
* 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
Diffstat (limited to 'gdb/gdbtk.tcl')
-rw-r--r-- | gdb/gdbtk.tcl | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gdb/gdbtk.tcl b/gdb/gdbtk.tcl index f517245..6d027cc 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" |