aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtk.tcl
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1994-12-19 08:01:45 +0000
committerStu Grossman <grossman@cygnus>1994-12-19 08:01:45 +0000
commit546b8ca76053d0f3a3b4a2ec6051060a7fca3225 (patch)
tree1b25a040e2265218f4688e6639ecac6b180b07c8 /gdb/gdbtk.tcl
parent6cb4e9e036eebe517285a4c346edefd68ff6e306 (diff)
downloadgdb-546b8ca76053d0f3a3b4a2ec6051060a7fca3225.zip
gdb-546b8ca76053d0f3a3b4a2ec6051060a7fca3225.tar.gz
gdb-546b8ca76053d0f3a3b4a2ec6051060a7fca3225.tar.bz2
* gdbtk.c (gdbtk_wait gdbtk_init): Use different method of
enabling I/O interrupts for SVR4 (streams). * (start_saving_output save_output get_saved_output finish_saving_output flush_holdbuf gdbtk_flush gdbtk_fputs gdbtk_init): Totally revamp to use TCLs dynamic string functions. Also, quote all data passed back to TCL to prevent errors with unmatched braces, odd characters, etc... This fixes several wierd problems with outputting strings containing unmatched braces. * (breakpoint_notify gdb_loc): Use long hex format to output addresses of breakpoints and PCs. This fixes some Alpha problems. * (breakpoint_notify): Add stream arg to call to gdbtk_fputs. * (gdb_listfiles): Also, go through the symtabs when looking for files. This makes xcoff work (sort of), but probably breaks something else. * (gdb_stop): Return TCL_OK instead of nothing. This fixes odd TCL errors when hitting stop button. * (tk_command): Don't pass interp->result on to Tcl_{Var}Eval, as that will trash the result. strdup the result instead and pass that on. Improve error handling as well. * gdbtk.tcl (gdbtk_tcl_flush): Use global def of current_output_win. Makes flushing actually work! * (asm_win_name create_asm_win update_assembly): Bunch of fixes to make assembly windows stop flashing when loading a new file. * (gdbtk_tcl_busy gdbtk_tcl_idle): Use catch to prevent gdb_cmd errors from losing control. * (create_source_window): Add source file selection to View menu. * (create_command_window (<Key-Return> binding): Quote text fed into gdb_cmd to prevent eval errors.
Diffstat (limited to 'gdb/gdbtk.tcl')
-rw-r--r--gdb/gdbtk.tcl90
1 files changed, 46 insertions, 44 deletions
diff --git a/gdb/gdbtk.tcl b/gdb/gdbtk.tcl
index f8ce86c..82610d7 100644
--- a/gdb/gdbtk.tcl
+++ b/gdb/gdbtk.tcl
@@ -9,6 +9,7 @@ set screen_bot 0
set current_output_win .cmd.text
set cfunc NIL
set line_numbers 1
+set breakpoint_file(-1) {[garbage]}
#option add *Foreground Black
#option add *Background White
@@ -64,6 +65,8 @@ proc gdbtk_tcl_fputs_error {arg} {
#
proc gdbtk_tcl_flush {} {
+ global current_output_win
+
$current_output_win yview -pickplace end
update idletasks
}
@@ -137,6 +140,8 @@ proc gdbtk_tcl_breakpoint {action bpnum file line pc} {
}
proc asm_win_name {funcname} {
+ if {$funcname == "*None*"} {return .asm.text}
+
regsub -all {\.} $funcname _ temp
return .asm.func_${temp}
@@ -362,50 +367,50 @@ proc delete_breakpoint_tag {win line} {
proc gdbtk_tcl_busy {} {
if [winfo exists .src] {
- .src.start configure -state disabled
- .src.stop configure -state normal
- .src.step configure -state disabled
- .src.next configure -state disabled
- .src.continue configure -state disabled
- .src.finish configure -state disabled
- .src.up configure -state disabled
- .src.down configure -state disabled
- .src.bottom configure -state disabled
+ catch {.src.start configure -state disabled}
+ catch {.src.stop configure -state normal}
+ catch {.src.step configure -state disabled}
+ catch {.src.next configure -state disabled}
+ catch {.src.continue configure -state disabled}
+ catch {.src.finish configure -state disabled}
+ catch {.src.up configure -state disabled}
+ catch {.src.down configure -state disabled}
+ catch {.src.bottom configure -state disabled}
}
if [winfo exists .asm] {
- .asm.stepi configure -state disabled
- .asm.nexti configure -state disabled
- .asm.continue configure -state disabled
- .asm.finish configure -state disabled
- .asm.up configure -state disabled
- .asm.down configure -state disabled
- .asm.bottom configure -state disabled
- .asm.close configure -state disabled
+ catch {.asm.stepi configure -state disabled}
+ catch {.asm.nexti configure -state disabled}
+ catch {.asm.continue configure -state disabled}
+ catch {.asm.finish configure -state disabled}
+ catch {.asm.up configure -state disabled}
+ catch {.asm.down configure -state disabled}
+ catch {.asm.bottom configure -state disabled}
+ catch {.asm.close configure -state disabled}
}
}
proc gdbtk_tcl_idle {} {
if [winfo exists .src] {
- .src.start configure -state normal
- .src.stop configure -state disabled
- .src.step configure -state normal
- .src.next configure -state normal
- .src.continue configure -state normal
- .src.finish configure -state normal
- .src.up configure -state normal
- .src.down configure -state normal
- .src.bottom configure -state normal
+ catch {.src.start configure -state normal}
+ catch {.src.stop configure -state disabled}
+ catch {.src.step configure -state normal}
+ catch {.src.next configure -state normal}
+ catch {.src.continue configure -state normal}
+ catch {.src.finish configure -state normal}
+ catch {.src.up configure -state normal}
+ catch {.src.down configure -state normal}
+ catch {.src.bottom configure -state normal}
}
if [winfo exists .asm] {
- .asm.stepi configure -state normal
- .asm.nexti configure -state normal
- .asm.continue configure -state normal
- .asm.finish configure -state normal
- .asm.up configure -state normal
- .asm.down configure -state normal
- .asm.bottom configure -state normal
- .asm.close configure -state normal
+ catch {.asm.stepi configure -state normal}
+ catch {.asm.nexti configure -state normal}
+ catch {.asm.continue configure -state normal}
+ catch {.asm.finish configure -state normal}
+ catch {.asm.up configure -state normal}
+ catch {.asm.down configure -state normal}
+ catch {.asm.bottom configure -state normal}
+ catch {.asm.close configure -state normal}
}
}
@@ -1134,15 +1139,11 @@ proc create_asm_window {} {
update
- pack forget .asm.text
-
update_assembly [gdb_loc]
}
}
proc reg_config_menu {} {
- global reg_format
-
catch {destroy .reg.config}
toplevel .reg.config
wm geometry .reg.config +300+300
@@ -1431,7 +1432,7 @@ proc update_assembly {linespec} {
# stick in the new one.
if {$funcname != $cfunc } {
- pack forget $win
+ set oldwin $win
set cfunc $funcname
set win [asm_win_name $cfunc]
@@ -1446,6 +1447,7 @@ proc update_assembly {linespec} {
# Pack the text widget, and scroll to the right place
+ pack forget $oldwin
pack $win -side left -expand yes -fill both \
-after .asm.scroll
.asm.scroll configure -command "$win yview"
@@ -1457,7 +1459,6 @@ proc update_assembly {linespec} {
if {$current_asm_label != "$pc $funcname"} then {
set .asm.label "$pc $funcname"
-# .asm.label configure -text "$pc $funcname"
set current_asm_label "$pc $funcname"
}
@@ -1491,9 +1492,6 @@ proc update_assembly {linespec} {
$win yview [expr $line - $asm_screen_height / 2]
}
-# echo "Picking line $line"
-# $win yview -pickplace $line
-
$win configure -state disabled
}
}
@@ -1631,6 +1629,10 @@ proc create_source_window {} {
.src.menubar.view.menu delete 0 last
+# Source file selection
+ .src.menubar.view.menu add command -label "Select source file" \
+ -command files_command
+
# Line numbers enable/disable menu item
.src.menubar.view.menu add checkbutton -variable line_numbers \
-label "Line numbers" -onvalue 1 -offvalue 0 -command {
@@ -1713,7 +1715,7 @@ proc create_command_window {} {
%W insert end \n
%W yview -pickplace end
- catch "gdb_cmd {$command_line}"
+ catch "gdb_cmd [list $command_line]"
set command_line {}
update_ptr
%W insert end "(gdb) "