OSDN Git Service

* library/session.tcl (SESSION_recreate_bps): Use
authortromey <tromey>
Sat, 6 Oct 2001 18:10:50 +0000 (18:10 +0000)
committertromey <tromey>
Sat, 6 Oct 2001 18:10:50 +0000 (18:10 +0000)
gdb_run_readline_command_no_output to recreate breakpoints.
* library/interface.tcl (gdb_run_readline_command): Set
readlineShowUser element of gdbtk_state.
(gdb_run_readline_command_no_output): New proc.
(initialize_gdbtk): Initialize readlineShowUser element.
(gdbtk_tcl_readline_begin): Use readlineShowUser element.
(gdbtk_tcl_readline): Likewise.

gdb/gdbtk/ChangeLog
gdb/gdbtk/library/interface.tcl
gdb/gdbtk/library/session.tcl

index 5e8f43d..df03f0f 100644 (file)
@@ -1,3 +1,14 @@
+2001-10-06  Tom Tromey  <tromey@redhat.com>
+
+       * library/session.tcl (SESSION_recreate_bps): Use
+       gdb_run_readline_command_no_output to recreate breakpoints.
+       * library/interface.tcl (gdb_run_readline_command): Set
+       readlineShowUser element of gdbtk_state.
+       (gdb_run_readline_command_no_output): New proc.
+       (initialize_gdbtk): Initialize readlineShowUser element.
+       (gdbtk_tcl_readline_begin): Use readlineShowUser element.
+       (gdbtk_tcl_readline): Likewise.
+
 2001-10-05  Keith Seitz  <keiths@redhat.com>
 
        * generic/gdbtk-bp.c (get_breakpoint_commands): New function.
index 8b41b8b..7dea405 100644 (file)
@@ -509,6 +509,19 @@ proc gdb_run_readline_command {command args} {
   global gdbtk_state
 #  debug "$command $args"
   set gdbtk_state(readlineArgs) $args
+  set gdbtk_state(readlineShowUser) 1
+  gdb_cmd $command
+}
+
+# ------------------------------------------------------------------
+# PROC: gdb_run_readline_command_no_output
+# Run a readline command, but don't show the commands to the user.
+# ------------------------------------------------------------------
+proc gdb_run_readline_command_no_output {command args} {
+  global gdbtk_state
+#  debug "$command $args"
+  set gdbtk_state(readlineArgs) $args
+  set gdbtk_state(readlineShowUser) 0
   gdb_cmd $command
 }
 
@@ -519,7 +532,7 @@ proc gdbtk_tcl_readline_begin {message} {
   global gdbtk_state
 #  debug "readline begin"
   set gdbtk_state(readline) 0
-  if {$gdbtk_state(console) != ""} {
+  if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
     $gdbtk_state(console) insert $message
   }
 }
@@ -533,7 +546,9 @@ proc gdbtk_tcl_readline {prompt} {
   if {[info exists gdbtk_state(readlineArgs)]} {
     # Not interactive, so pop the list, and print element.
     set cmd [lvarpop gdbtk_state(readlineArgs)]
-    command::insert_command $cmd
+    if {$gdbtk_state(readlineShowUser)} {
+      command::insert_command $cmd
+    }
   } else {
     # Interactive.
 #    debug "interactive"
@@ -1718,6 +1733,7 @@ proc initialize_gdbtk {} {
     # Only do this once...
     set gdbtk_state(readline) 0
     set gdbtk_state(console) ""
+    set gdbtk_state(readlineShowUser) 1
   }
 
   # check for existence of a kod command and get it's name and
index 4c47770..d7a2bbe 100644 (file)
@@ -91,7 +91,8 @@ proc SESSION_recreate_bps {specs} {
 
     if {[llength $commands]} {
       lappend commands end
-      gdb_cmd "commands \$bpnum\n[join $commands \n]"
+      eval gdb_run_readline_command_no_output [list "commands \$bpnum"] \
+       $commands
     }
   }
 }