aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtk.tcl
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-05-17 02:36:13 +0000
committerFred Fish <fnf@specifix.com>1996-05-17 02:36:13 +0000
commit5bac2b50e214842ff064da8690073479d3007976 (patch)
treeb386a4198a855aa602f2fd963b8d5db533f4821b /gdb/gdbtk.tcl
parent954a4a2ab18ba02f274e6fd4304aa8c17c016d95 (diff)
downloadgdb-5bac2b50e214842ff064da8690073479d3007976.zip
gdb-5bac2b50e214842ff064da8690073479d3007976.tar.gz
gdb-5bac2b50e214842ff064da8690073479d3007976.tar.bz2
* gdbtk.tcl (gdb_prompt): Set this early on.
(create_command_window): Use gdb_prompt rather than "(gdb) ". (gdbtk_tcl_preloop): Proc executed just prior to Tk main loop. (tclsh): If an evaluation window already exists, just bring it to the front instead of trying to create another. * gdbtk.c (tk_command_loop): New function. (gdbtk_init): Call tk_command_loop rather than Tk_MainLoop.
Diffstat (limited to 'gdb/gdbtk.tcl')
-rw-r--r--gdb/gdbtk.tcl17
1 files changed, 15 insertions, 2 deletions
diff --git a/gdb/gdbtk.tcl b/gdb/gdbtk.tcl
index 39afddb..3fcf2ce 100644
--- a/gdb/gdbtk.tcl
+++ b/gdb/gdbtk.tcl
@@ -28,6 +28,7 @@ set line_numbers 1
set breakpoint_file(-1) {[garbage]}
set disassemble_with_source nosource
set expr_update_list(0) 0
+set gdb_prompt "(gdb) "
set debug_interface 0
@@ -2291,6 +2292,7 @@ proc find_completion {cmd completions} {
proc create_command_window {} {
global command_line
global saw_tab
+ global gdb_prompt
set saw_tab 0
if {[winfo exists .cmd]} {raise .cmd ; return}
@@ -2340,7 +2342,7 @@ proc create_command_window {} {
# %W insert end $result
set command_line {}
# update_ptr
- %W insert end "(gdb) "
+ %W insert end "$gdb_prompt"
%W see end
break
}
@@ -2391,7 +2393,7 @@ proc create_command_window {} {
if {[regexp ".* " $command_line prefix]} {
regsub -all $prefix $choices {} choices
}
- %W insert end "\n[join $choices { }]\n(gdb) $command_line"
+ %W insert end "\n[join $choices { }]\n$gdb_prompt$command_line"
%W see end
}
break
@@ -3128,6 +3130,9 @@ proc evaluate_tcl_command { twidget } {
proc tclsh {} {
global tcl_prompt
+ # If another evaluation window already exists, just bring it to the front.
+ if {[winfo exists .eval]} {raise .eval ; return}
+
# Create top level frame with scrollbar and text widget.
toplevel .eval
wm title .eval "Tcl Evaluation"
@@ -3156,6 +3161,14 @@ proc tclsh {} {
bindtags .eval.text {.eval.text Text all}
}
+# This proc is executed just prior to falling into the Tk main event loop.
+proc gdbtk_tcl_preloop {} {
+ global gdb_prompt
+ .cmd.text insert end "$gdb_prompt"
+ .cmd.text see end
+ update
+}
+
# FIXME need to handle mono here. In Tk4 that is more complicated.
set highlight "-background red2 -borderwidth 2 -relief sunken"