OSDN Git Service

2000-03-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Fri, 10 Mar 2000 18:53:05 +0000 (18:53 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Fri, 10 Mar 2000 18:53:05 +0000 (18:53 +0000)
* srcbar.tcl (do_attach): Just call gdbtk_attach_native.
        (do_connect): Replace gdbtk_attach_target call with
        gdbtk_attach_remote call.

* interface.tcl (gdbtk_attach_native): Renamed from do_attach method
        and moved from srcbar.tcl.
        (gdbtk_attach_remote): New proc. Renamed from gdb_attach_target,
to better distinguish from the native version.
        (run_executable): Change gdbtk_attach_target call into
        gdbtk_attach_remote.

        * srctextwin.itb: Add keyboard accelerator for Attach command.

        * tclIndex: Rebuild.

gdb/gdbtk/library/ChangeLog
gdb/gdbtk/library/interface.tcl
gdb/gdbtk/library/srcbar.tcl
gdb/gdbtk/library/srctextwin.itb
gdb/gdbtk/library/tclIndex

index 4d80b66..9a65d40 100644 (file)
@@ -1,3 +1,20 @@
+2000-03-10  Elena Zannoni  <ezannoni@kwikemart.cygnus.com>
+
+       * srcbar.tcl (do_attach): Just call gdbtk_attach_native.
+        (do_connect): Replace gdbtk_attach_target call with
+        gdbtk_attach_remote call.
+
+       * interface.tcl (gdbtk_attach_native): Renamed from do_attach method
+        and moved from srcbar.tcl.
+        (gdbtk_attach_remote): New proc. Renamed from gdb_attach_target, 
+       to better distinguish from the native version.
+        (run_executable): Change gdbtk_attach_target call into
+        gdbtk_attach_remote.
+
+        * srctextwin.itb: Add keyboard accelerator for Attach command.
+
+        * tclIndex: Rebuild.
+
 2000-03-09  Elena Zannoni  <ezannoni@kwikemart.cygnus.com>
 
        From: James Ingham <jingham@leda.cygnus.com>: 
index 62b43be..b7b9ddf 100644 (file)
@@ -985,7 +985,7 @@ proc run_executable { {auto_start 1} } {
 
     # Attach
     if {$gdb_target_name == "" || [pref get gdb/src/run_attach]} {
-      if {[gdbtk_attach_target] == "ATTACH_CANCELED"} {
+      if {[gdbtk_attach_remote] == "ATTACH_CANCELED"} {
        return
       }
     }
@@ -1103,7 +1103,7 @@ proc run_executable { {auto_start 1} } {
 }
 
 # ------------------------------------------------------------------
-#  PROC: gdbtk_attach_target - attach to the target
+#  PROC: gdbtk_attach_remote - attach to the target
 #        This proc returns the following status messages:
 #
 #        ATTACH_ERROR: An error occurred connecting to target.
@@ -1112,7 +1112,7 @@ proc run_executable { {auto_start 1} } {
 #        ATTACH_TARGET_UNCHANGED: Successfully attached, target unchanged.
 #        UNKNOWN: An unknown error occurred.
 # ------------------------------------------------------------------
-proc gdbtk_attach_target {} {
+proc gdbtk_attach_remote {} {
   global gdb_loaded
 
   debug "Attaching...."
@@ -1308,6 +1308,31 @@ proc gdbtk_run {} {
 }
 
 # ------------------------------------------------------------------
+# PROC:  gdbtk_attach_native: attach to a running target
+# ------------------------------------------------------------------
+proc gdbtk_attach_native {} {
+    ManagedWin::open_dlg AttachDlg ;#-transient
+
+    debug "ManagedWin got [AttachDlg::last_button] [AttachDlg::pid]"
+
+    if {[AttachDlg::last_button]} {
+       set pid [AttachDlg::pid]
+       set symbol_file [AttachDlg::symbol_file]
+       if {![_open_file $symbol_file]} {
+           ManagedWin::open WarningDlg -transient \
+                   -message "Could not load symbols from $symbol_file."
+           return
+       }
+       
+       if {[catch {gdb_cmd "attach $pid"} result]} {
+           ManagedWin::open WarningDlg -transient \
+                   -message [list "Could not attach to $pid:\n$result"]
+           return
+       }
+    }
+}
+
+# ------------------------------------------------------------------
 # PROC: set_baud -  Tell GDB the baud rate.
 # ------------------------------------------------------------------
 proc set_baud {} {
index 9317752..bfd1dcd 100644 (file)
@@ -469,27 +469,7 @@ class GDBSrcBar {
   # METHOD:  do_attach: attach to a running target
   # ------------------------------------------------------------------
   method do_attach {menu} {
-    ManagedWin::open_dlg AttachDlg ;#-transient
-
-    debug "ManagedWin got [AttachDlg::last_button] [AttachDlg::pid]"
-
-    if {[AttachDlg::last_button]} {
-      set pid [AttachDlg::pid]
-      set symbol_file [AttachDlg::symbol_file]
-      if {![_open_file $symbol_file]} {
-       ManagedWin::open WarningDlg -transient \
-         -message "Could not load symbols from $symbol_file."
-       return
-      }
-      
-      if {[catch {gdb_cmd "attach $pid"} result]} {
-       ManagedWin::open WarningDlg -transient \
-         -message [list "Could not attach to $pid:\n$result"]
-       return
-      }
-
-    }
-
+      gdbtk_attach_native
   }
 
   # ------------------------------------------------------------------
@@ -519,7 +499,7 @@ class GDBSrcBar {
 
     gdbtk_busy
 
-    set result [gdbtk_attach_target]
+    set result [gdbtk_attach_remote]
     switch $result {
       ATTACH_ERROR {
        set successful 0
@@ -554,7 +534,7 @@ class GDBSrcBar {
       }
 
       default {
-       dbug E "Unhandled response from gdbtk_attach_target: \"$result\""
+       dbug E "Unhandled response from gdbtk_attach_remote: \"$result\""
        set successful 0
       }
     }
index bc3f9b8..8ed0988 100644 (file)
@@ -578,6 +578,7 @@ body SrcTextWin::config_win {win {asm ""}} {
   bind_plain_key $win Control-p "$this do_key print"
   bind_plain_key $win Control-u "$this do_key debug; break"
   bind_plain_key $win Control-o [list $this do_key open]
+  bind_plain_key $win Control-a [list $this do_key attach]
   
   if {!$Browsing && [pref get gdb/control_target]} {
     # Ctrl+F5 is another accelerator for Run
@@ -1973,6 +1974,7 @@ body SrcTextWin::do_key {key} {
       thread_list  { catch {ManagedWin::open ProcessWin} }
       debug         { catch {ManagedWin::open DebugWin} }
       kod          { catch {ManagedWin::open KodWin} }
+      attach       { catch {gdbtk_attach_native} }
       default      {
        dbug E "Unknown key binding: \"$key\""
       }
index 73ea49c..35d05d6 100644 (file)
@@ -50,7 +50,7 @@ set auto_index(_open_file) [list source [file join $dir interface.tcl]]
 set auto_index(set_target_name) [list source [file join $dir interface.tcl]]
 set auto_index(set_target) [list source [file join $dir interface.tcl]]
 set auto_index(run_executable) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_attach_target) [list source [file join $dir interface.tcl]]
+set auto_index(gdbtk_attach_remote) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_step) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_next) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_finish) [list source [file join $dir interface.tcl]]
@@ -63,6 +63,7 @@ set auto_index(gdbtk_stop) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_stop_idle_callback) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_detach) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_run) [list source [file join $dir interface.tcl]]
+set auto_index(gdbtk_attach_native) [list source [file join $dir interface.tcl]]
 set auto_index(set_baud) [list source [file join $dir interface.tcl]]
 set auto_index(do_state_hook) [list source [file join $dir interface.tcl]]
 set auto_index(disconnect) [list source [file join $dir interface.tcl]]