* 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-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>:
# Attach
if {$gdb_target_name == "" || [pref get gdb/src/run_attach]} {
- if {[gdbtk_attach_target] == "ATTACH_CANCELED"} {
+ if {[gdbtk_attach_remote] == "ATTACH_CANCELED"} {
return
}
}
}
# ------------------------------------------------------------------
-# 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.
# 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...."
}
# ------------------------------------------------------------------
+# 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 {} {
# 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
}
# ------------------------------------------------------------------
gdbtk_busy
- set result [gdbtk_attach_target]
+ set result [gdbtk_attach_remote]
switch $result {
ATTACH_ERROR {
set successful 0
}
default {
- dbug E "Unhandled response from gdbtk_attach_target: \"$result\""
+ dbug E "Unhandled response from gdbtk_attach_remote: \"$result\""
set successful 0
}
}
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
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\""
}
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]]
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]]