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
# 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
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)
}
}
}
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"
set width [expr $max_regname_width + 15]
- set height [llength $regnames]
+ set height [expr [llength $regnames] + 1]
if {$height > 60} {set height 60}
pack .files_window.close -side bottom -fill x -expand no -anchor s
pack .files_window.scroll -side right -fill both
pack .files_window.list -side left -fill both -expand yes
- bind .files_window.list <Any-ButtonRelease-1> {
+ bind .files_window.list <ButtonRelease-1> {
set file [%W get [%W curselection]]
gdb_cmd "list $file:1,0"
update_listing [gdb_loc $file:1]
destroy .files_window
}
+ # We must execute the listbox binding first, because it
+ # references the widget that will be destroyed by the widget
+ # binding for Button-Release-1. Otherwise we try to use
+ # .files_window.list after the .files_window is destroyed.
+ bind_widget_after_class .files_window.list
}
button .files -text Files -command files_command