summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2001-05-31 15:21:41 +0000
committerKeith Seitz <keiths@redhat.com>2001-05-31 15:21:41 +0000
commitb8df5aa863cd59505a40f8fb40d62f1b746152e1 (patch)
tree3f2a9de903ffe3edfdc0bd3c439f714e08024db3
parent69e37fd3a8cde8b74d9ab7a84260f082a6787a7f (diff)
downloadgdb-b8df5aa863cd59505a40f8fb40d62f1b746152e1.tar.gz
* library/interface.tcl (gdb_busy_hook): Deprecate.
(gdbtk_busy): Create and dispatch a BusyEvent instead of running hooks. * library/ehandler.ith (busy): New event handler. * library/gdbevent.ith (BusyEvent): New event class. * library/console.ith: Inherit from GDBEventHandler. (busy): Match event handler definition. * library/console.itb (busy): Ditto. (constructor): Remove gdb_busy_event. (destructor): Ditto. * library/kod.ith (busy): Match event handler definition. * library/kod.itb (busy): Ditto. (constructor): Remove gdb_busy_hook. (destructor): Ditto. * library/memwin.ith (busy): Match event handler definition. * library/memwin.itb (busy): Ditto. (constructor): Remove gdb_busy_hook. (destructor): Ditto. * library/pluginwin.itcl (running): Rename to "busy" and match event handler definition. (consturctor): Remove gdb_busy_hook. (destructor): Ditto. * library/process.ith (busy): Match event handler definition. * library/process.itb (busy): Ditto. (constructor): Remove gdb_busy_hook. (destructor): Ditto. * library/regwin.ith (busy): Match event handler definition. * library/regwin.itb (busy): Ditto. (constructor): Remove gdb_busy_hook. (destructor): Ditto. * library/srcbar.itcl (constructor): Remove gdb_busy_hook. (destructor): Ditto. (busy): New method. * library/srcwin.ith (busy): Match event handler definition. * library/srcwin.itb (busy): Ditto. Only do the "busy" stuff if do_updates is set. (toggle_updates): Remove gdb_busy_hook. (constructor): Ditto. (destructor): Ditto. * library/stackwin.ith (busy): Match event handler definition. * library/stackwin.itb (busy): Ditto. (constructor): Remove gdb_busy_hook. (destructor): Ditto. * library/variables.tcl (constructor): Ditto. (destructor): Ditto. (disable_ui): Rename to "busy" and match event handler definition. * library/plugins/rhabout/rhabout.itcl (running): Rename to "busy" and match new event handler definition. * library/tclIndex: Regenerated.
-rw-r--r--gdb/gdbtk/ChangeLog53
-rw-r--r--gdb/gdbtk/library/console.itb7
-rw-r--r--gdb/gdbtk/library/console.ith8
-rw-r--r--gdb/gdbtk/library/ehandler.ith3
-rw-r--r--gdb/gdbtk/library/gdbevent.ith12
-rw-r--r--gdb/gdbtk/library/interface.tcl15
-rw-r--r--gdb/gdbtk/library/kod.itb6
-rw-r--r--gdb/gdbtk/library/kod.ith2
-rw-r--r--gdb/gdbtk/library/memwin.itb7
-rw-r--r--gdb/gdbtk/library/memwin.ith6
-rw-r--r--gdb/gdbtk/library/plugins/rhabout/rhabout.itcl6
-rw-r--r--gdb/gdbtk/library/pluginwin.itcl10
-rw-r--r--gdb/gdbtk/library/process.itb6
-rw-r--r--gdb/gdbtk/library/process.ith6
-rw-r--r--gdb/gdbtk/library/regwin.itb6
-rw-r--r--gdb/gdbtk/library/regwin.ith2
-rw-r--r--gdb/gdbtk/library/srcbar.itcl9
-rw-r--r--gdb/gdbtk/library/srcwin.itb26
-rw-r--r--gdb/gdbtk/library/srcwin.ith6
-rw-r--r--gdb/gdbtk/library/stackwin.itb12
-rw-r--r--gdb/gdbtk/library/stackwin.ith6
-rw-r--r--gdb/gdbtk/library/tclIndex3
-rw-r--r--gdb/gdbtk/library/variables.tcl6
23 files changed, 151 insertions, 72 deletions
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog
index 6409e7243f8..8f2c7a9351e 100644
--- a/gdb/gdbtk/ChangeLog
+++ b/gdb/gdbtk/ChangeLog
@@ -1,3 +1,56 @@
+2001-05-31 Keith Seitz <keiths@redhat.com>
+
+ * library/interface.tcl (gdb_busy_hook): Deprecate.
+ (gdbtk_busy): Create and dispatch a BusyEvent instead
+ of running hooks.
+ * library/ehandler.ith (busy): New event handler.
+ * library/gdbevent.ith (BusyEvent): New event class.
+ * library/console.ith: Inherit from GDBEventHandler.
+ (busy): Match event handler definition.
+ * library/console.itb (busy): Ditto.
+ (constructor): Remove gdb_busy_event.
+ (destructor): Ditto.
+ * library/kod.ith (busy): Match event handler definition.
+ * library/kod.itb (busy): Ditto.
+ (constructor): Remove gdb_busy_hook.
+ (destructor): Ditto.
+ * library/memwin.ith (busy): Match event handler definition.
+ * library/memwin.itb (busy): Ditto.
+ (constructor): Remove gdb_busy_hook.
+ (destructor): Ditto.
+ * library/pluginwin.itcl (running): Rename to "busy" and
+ match event handler definition.
+ (consturctor): Remove gdb_busy_hook.
+ (destructor): Ditto.
+ * library/process.ith (busy): Match event handler definition.
+ * library/process.itb (busy): Ditto.
+ (constructor): Remove gdb_busy_hook.
+ (destructor): Ditto.
+ * library/regwin.ith (busy): Match event handler definition.
+ * library/regwin.itb (busy): Ditto.
+ (constructor): Remove gdb_busy_hook.
+ (destructor): Ditto.
+ * library/srcbar.itcl (constructor): Remove gdb_busy_hook.
+ (destructor): Ditto.
+ (busy): New method.
+ * library/srcwin.ith (busy): Match event handler definition.
+ * library/srcwin.itb (busy): Ditto.
+ Only do the "busy" stuff if do_updates is set.
+ (toggle_updates): Remove gdb_busy_hook.
+ (constructor): Ditto.
+ (destructor): Ditto.
+ * library/stackwin.ith (busy): Match event handler definition.
+ * library/stackwin.itb (busy): Ditto.
+ (constructor): Remove gdb_busy_hook.
+ (destructor): Ditto.
+ * library/variables.tcl (constructor): Ditto.
+ (destructor): Ditto.
+ (disable_ui): Rename to "busy" and match event handler
+ definition.
+ * library/plugins/rhabout/rhabout.itcl (running): Rename
+ to "busy" and match new event handler definition.
+ * library/tclIndex: Regenerated.
+
2001-05-25 Keith Seitz <keiths@cygnus.com>
* generic/gdbtk-cmds.c (bin2hex): New function.
diff --git a/gdb/gdbtk/library/console.itb b/gdb/gdbtk/library/console.itb
index 26e0946814e..120208bd607 100644
--- a/gdb/gdbtk/library/console.itb
+++ b/gdb/gdbtk/library/console.itb
@@ -19,7 +19,6 @@ body Console::constructor {args} {
debug "$args"
_build_win
eval itk_initialize $args
- add_hook gdb_busy_hook [list $this busy]
add_hook gdb_idle_hook [list $this idle]
add_hook gdb_no_inferior_hook [list $this idle]
@@ -40,7 +39,6 @@ body Console::constructor {args} {
body Console::destructor {} {
global gdbtk_state
set gdbtk_state(console) ""
- remove_hook gdb_busy_hook [list $this busy]
remove_hook gdb_idle_hook [list $this idle]
remove_hook gdb_no_inferior_hook [list $this idle]
@@ -205,7 +203,10 @@ body Console::idle {} {
set _running 0
}
-body Console::busy {} {
+# ------------------------------------------------------------------
+# METHOD: busy - busy event handler
+# ------------------------------------------------------------------
+body Console::busy {event} {
set _running 1
}
diff --git a/gdb/gdbtk/library/console.ith b/gdb/gdbtk/library/console.ith
index b214e54655d..82fc4c8684d 100644
--- a/gdb/gdbtk/library/console.ith
+++ b/gdb/gdbtk/library/console.ith
@@ -18,7 +18,7 @@
# ----------------------------------------------------------------------
class Console {
- inherit EmbeddedWin
+ inherit EmbeddedWin GDBEventHandler
public {
#Approximate maximum number of lines allowed in widget
@@ -27,13 +27,17 @@ class Console {
method constructor {args}
method destructor {}
method idle {}
- method busy {}
method insert {line}
method einsert {line tag}
method invoke {}
method _insertion {args}
method get_text {}
method activate {{prompt {}}}
+
+ #
+ # GDB Events
+ #
+ method busy {event}
}
private {
diff --git a/gdb/gdbtk/library/ehandler.ith b/gdb/gdbtk/library/ehandler.ith
index f38e666cfcc..54e4baee9f0 100644
--- a/gdb/gdbtk/library/ehandler.ith
+++ b/gdb/gdbtk/library/ehandler.ith
@@ -32,5 +32,8 @@ class GDBEventHandler {
# Set variable
method set_variable {event} {}
+
+ # Busy event
+ method busy {event} {}
}
}
diff --git a/gdb/gdbtk/library/gdbevent.ith b/gdb/gdbtk/library/gdbevent.ith
index 6166edc7cf0..b523379b8c2 100644
--- a/gdb/gdbtk/library/gdbevent.ith
+++ b/gdb/gdbtk/library/gdbevent.ith
@@ -147,3 +147,15 @@ class SetVariableEvent {
public method get {what}
public method handler {} { return "set_variable" }
}
+
+# BUSY EVENT
+#
+# This event is created/dispatched whenever the GUI or GDB is "busy".
+# This could happen when the inferior is executing or when the GUI
+# is, for example, fetching memory from the target.
+
+class BusyEvent {
+ inherit GDBEvent
+
+ public method handler {} { return "busy" }
+}
diff --git a/gdb/gdbtk/library/interface.tcl b/gdb/gdbtk/library/interface.tcl
index ca046e86dc4..3c1259f980f 100644
--- a/gdb/gdbtk/library/interface.tcl
+++ b/gdb/gdbtk/library/interface.tcl
@@ -47,6 +47,7 @@ proc gdbtk_tcl_set_variable {var val} {
# For debugging purposes, please put debug statements at the very
# beginning and ends of all GUI state hooks.
+# *** DEPRECATED: Use GDBEventHandler::busy instead.
# GDB_BUSY_HOOK
# This hook is used to register a callback when the UI should
# be disabled because the debugger is either busy or talking
@@ -54,7 +55,7 @@ proc gdbtk_tcl_set_variable {var val} {
#
# All callbacks should disable ALL user input which could cause
# any state changes in either the target or the debugger.
-define_hook gdb_busy_hook
+#define_hook gdb_busy_hook
# GDB_IDLE_HOOK
# This hook is used to register a callback when the UI should
@@ -122,19 +123,17 @@ proc gdbtk_tcl_preloop { } {
# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_busy - run all busy hooks
+# PROCEDURE: gdbtk_busy - Dispatch a busy event
#
# Use this procedure from within GUI code to indicate that
# the debugger is busy, either running the inferior or
-# talking to the target. This will call all the registered
-# gdb_busy_hook's.
+# talking to the target.
# ------------------------------------------------------------------
proc gdbtk_busy {} {
- set err [catch {run_hooks gdb_busy_hook} txt]
- if {$err} {
- dbug E "$txt"
- }
+ set e [BusyEvent \#auto]
+ GDBEventHandler::dispatch $e
+ delete object $e
# Force the screen to update
update
diff --git a/gdb/gdbtk/library/kod.itb b/gdb/gdbtk/library/kod.itb
index 22a7af40950..981e6c1b748 100644
--- a/gdb/gdbtk/library/kod.itb
+++ b/gdb/gdbtk/library/kod.itb
@@ -34,7 +34,6 @@ body KodWin::constructor {args} {
# Add hooks for this object
add_hook gdb_update_hook [code $this update]
- add_hook gdb_busy_hook [code $this busy]
add_hook gdb_idle_hook [code $this idle]
}
@@ -400,7 +399,6 @@ body KodWin::destructor {} {
remove_hook gdb_update_hook [code $this update]
remove_hook gdb_idle_hook [code $this idle]
- remove_hook gdb_busy_hook [code $this busy]
}
# ------------------------------------------------------------------
@@ -427,13 +425,13 @@ body KodWin::reconfig {} {
}
# ------------------------------------------------------------------
-# METHOD: busy - gdb_busy_hook
+# METHOD: busy - BusyEvent handler
#
# This method should accomplish blocking
# - clicks in the window
# - change mouse pointer
# ------------------------------------------------------------------
-body KodWin::busy {} {
+body KodWin::busy {event} {
set Running 1
_disable_buttons
cursor watch
diff --git a/gdb/gdbtk/library/kod.ith b/gdb/gdbtk/library/kod.ith
index c2a5e552241..0324d973bd1 100644
--- a/gdb/gdbtk/library/kod.ith
+++ b/gdb/gdbtk/library/kod.ith
@@ -43,7 +43,6 @@ class KodWin {
method clear {}
method top {}
method up {}
- method busy {}
method idle {}
method cursor {glyph}
method _disable_buttons {}
@@ -59,5 +58,6 @@ class KodWin {
# Gdb Events
#
method set_variable {event}
+ method busy {event}
}
}
diff --git a/gdb/gdbtk/library/memwin.itb b/gdb/gdbtk/library/memwin.itb
index fb2164a2d93..58f1703edb1 100644
--- a/gdb/gdbtk/library/memwin.itb
+++ b/gdb/gdbtk/library/memwin.itb
@@ -50,7 +50,6 @@ body MemWin::constructor {args} {
gdbtk_idle
add_hook gdb_update_hook "$this update"
- add_hook gdb_busy_hook [list $this busy]
add_hook gdb_idle_hook [list $this idle]
}
@@ -62,7 +61,6 @@ body MemWin::destructor {} {
$prefs_win cancel
}
remove_hook gdb_update_hook "$this update"
- remove_hook gdb_busy_hook [list $this busy]
remove_hook gdb_idle_hook [list $this idle]
}
@@ -404,9 +402,10 @@ body MemWin::idle {} {
# ------------------------------------------------------------------
-# METHOD: busy - disable menus 'cause we're busy updating things
+# METHOD: busy - BusyEvent handler
+# Disable menus 'cause we're busy updating things.
# ------------------------------------------------------------------
-body MemWin::busy {} {
+body MemWin::busy {event} {
# Fencepost
set Running 1
diff --git a/gdb/gdbtk/library/memwin.ith b/gdb/gdbtk/library/memwin.ith
index cae6ab5c419..6ab585f8d8f 100644
--- a/gdb/gdbtk/library/memwin.ith
+++ b/gdb/gdbtk/library/memwin.ith
@@ -62,7 +62,6 @@ class MemWin {
method toggle_enabled {}
method update {}
method idle {}
- method busy {}
method newsize {height}
method update_address_cb {}
method update_address { {ae ""} }
@@ -75,5 +74,10 @@ class MemWin {
method goto {addr}
method memMoveCell {w x y}
method error_dialog {msg {modality task} {type ok}}
+
+ #
+ # GDB Events
+ #
+ method busy {event}
}
}
diff --git a/gdb/gdbtk/library/plugins/rhabout/rhabout.itcl b/gdb/gdbtk/library/plugins/rhabout/rhabout.itcl
index 0f56c5d8e09..1518bacd4df 100644
--- a/gdb/gdbtk/library/plugins/rhabout/rhabout.itcl
+++ b/gdb/gdbtk/library/plugins/rhabout/rhabout.itcl
@@ -58,13 +58,13 @@ class RHAbout {
window_name "About Red Hat Insight Plug-In"
}
- # You can overload the base class running method, but make sure
+ # You can overload the base class busy method, but make sure
# to call it as well or the menu and button status will not be updated
# (unless this is what you want)
- private method running {} {
+ public method busy {event} {
debug
# Call the baseclass version
- PluginWindow::running
+ PluginWindow::busy $event
# Display something in the status area
$_status configure -text "Running..."
diff --git a/gdb/gdbtk/library/pluginwin.itcl b/gdb/gdbtk/library/pluginwin.itcl
index fded5a9739e..30a5559a85a 100644
--- a/gdb/gdbtk/library/pluginwin.itcl
+++ b/gdb/gdbtk/library/pluginwin.itcl
@@ -29,7 +29,7 @@
# ----------------------------------------------------------------------
class PluginWindow {
- inherit ManagedWin
+ inherit ManagedWin GDBEventHandler
# ------------------------------------------------------------------
# CONSTRUCTOR - create widget
@@ -53,7 +53,6 @@ class PluginWindow {
eval itk_initialize $args
add_hook gdb_idle_hook [code $this stopped]
- add_hook gdb_busy_hook [code $this running]
add_hook gdb_no_inferior_hook [code $this no_inferior]
}
@@ -62,7 +61,6 @@ class PluginWindow {
# ------------------------------------------------------------------
destructor {
remove_hook gdb_idle_hook [code $this stopped]
- remove_hook gdb_busy_hook [code $this running]
remove_hook gdb_no_inferior_hook [code $this no_inferior]
#destroy $this
@@ -91,11 +89,11 @@ class PluginWindow {
}
# ------------------------------------------------------------------
- # METHOD: running
+ # METHOD: busy - BusyEvent handler
# Invoked when gdb is going to run the inferior
# ------------------------------------------------------------------
- protected method running {} {
- debug "PluginWindow::running"
+ public method busy {event} {
+ debug "PluginWindow::busy"
enable_ui 0
}
diff --git a/gdb/gdbtk/library/process.itb b/gdb/gdbtk/library/process.itb
index 07638d5ab4f..e1f1de759dd 100644
--- a/gdb/gdbtk/library/process.itb
+++ b/gdb/gdbtk/library/process.itb
@@ -28,7 +28,6 @@ body ProcessWin::constructor {args} {
# Add hooks for this object
add_hook gdb_update_hook [code $this update]
- add_hook gdb_busy_hook [code $this busy]
add_hook gdb_no_inferior_hook [code $this idle]
add_hook gdb_idle_hook [code $this idle]
}
@@ -130,7 +129,6 @@ body ProcessWin::change_context {y} {
body ProcessWin::destructor {} {
remove_hook gdb_update_hook [code $this update]
remove_hook gdb_idle_hook [code $this idle]
- remove_hook gdb_busy_hook [code $this busy]
remove_hook gdb_no_inferior_hook [code $this no_inferior]
}
@@ -143,13 +141,13 @@ body ProcessWin::reconfig {} {
}
# ------------------------------------------------------------------
-# METHOD: busy - gdb_busy_hook
+# METHOD: busy - BusyEvent handler
#
# This method should accomplish blocking
# - clicks in the window
# - change mouse pointer
# ------------------------------------------------------------------
-body ProcessWin::busy {} {
+body ProcessWin::busy {event} {
set Running 1
cursor watch
}
diff --git a/gdb/gdbtk/library/process.ith b/gdb/gdbtk/library/process.ith
index d9b8fece4ee..0fbadc1b864 100644
--- a/gdb/gdbtk/library/process.ith
+++ b/gdb/gdbtk/library/process.ith
@@ -28,7 +28,6 @@ class ProcessWin {
method cursor {glyph}
method change_frame {y}
method update {}
- method busy {}
method idle {}
}
@@ -36,5 +35,10 @@ class ProcessWin {
method reconfig {}
method constructor {args}
method destructor {}
+
+ #
+ # Event
+ #
+ method busy {event}
}
} \ No newline at end of file
diff --git a/gdb/gdbtk/library/regwin.itb b/gdb/gdbtk/library/regwin.itb
index 1bd56a55ac8..9136472dd7e 100644
--- a/gdb/gdbtk/library/regwin.itb
+++ b/gdb/gdbtk/library/regwin.itb
@@ -33,7 +33,6 @@ body RegWin::constructor {args} {
gdbtk_idle
add_hook gdb_update_hook "$this update"
- add_hook gdb_busy_hook [list $this busy]
add_hook gdb_idle_hook [list $this idle]
}
@@ -44,7 +43,6 @@ body RegWin::destructor {} {
debug
save_reg_display_vars
remove_hook gdb_update_hook "$this update"
- remove_hook gdb_busy_hook [list $this busy]
remove_hook gdb_idle_hook [list $this idle]
}
@@ -677,9 +675,9 @@ body RegWin::reconfig {} {
}
# ------------------------------------------------------------------
-# PRIVATE METHOD: busy - gdb_busy_hook
+# PUBLIC METHOD: busy - BusyEvent handler
# ------------------------------------------------------------------
-body RegWin::busy {} {
+body RegWin::busy {event} {
# Cancel edits
unedit
diff --git a/gdb/gdbtk/library/regwin.ith b/gdb/gdbtk/library/regwin.ith
index c48532c5ca9..53d34032307 100644
--- a/gdb/gdbtk/library/regwin.ith
+++ b/gdb/gdbtk/library/regwin.ith
@@ -62,12 +62,12 @@ class RegWin {
method update {}
method idle {}
method reconfig {}
- method busy {}
#
# Gdb Events
#
method set_variable {event}
+ method busy {event}
}
diff --git a/gdb/gdbtk/library/srcbar.itcl b/gdb/gdbtk/library/srcbar.itcl
index 337ef142318..99627fed958 100644
--- a/gdb/gdbtk/library/srcbar.itcl
+++ b/gdb/gdbtk/library/srcbar.itcl
@@ -66,7 +66,6 @@ class SrcBar {
eval itk_initialize $args
add_hook gdb_idle_hook "$this enable_ui 1"
- add_hook gdb_busy_hook "$this enable_ui 0"
add_hook gdb_no_inferior_hook "$this enable_ui 2"
add_hook gdb_trace_find_hook "$this handle_trace_find_hook"
}
@@ -79,7 +78,6 @@ class SrcBar {
unset GDBSrcBar_state($this)
remove_hook gdb_idle_hook "$this enable_ui 1"
- remove_hook gdb_busy_hook "$this enable_ui 0"
remove_hook gdb_no_inferior_hook "$this enable_ui 2"
remove_hook gdb_trace_find_hook "$this handle_trace_find_hook"
@@ -1070,6 +1068,13 @@ Do you want to continue?" \
}
}
+ # ------------------------------------------------------------------
+ # METHOD: busy - BusyEvent handler
+ # ------------------------------------------------------------------
+ method busy {event} {
+ enable_ui 0
+ }
+
####################################################################
#
# PRIVATE DATA
diff --git a/gdb/gdbtk/library/srcwin.itb b/gdb/gdbtk/library/srcwin.itb
index 711c5a34855..89bb301d587 100644
--- a/gdb/gdbtk/library/srcwin.itb
+++ b/gdb/gdbtk/library/srcwin.itb
@@ -42,7 +42,6 @@ body SrcWin::constructor {args} {
set update_hook_init 1
add_hook gdb_update_hook "SrcWin::choose_and_update"
}
- add_hook gdb_busy_hook "$this busy"
add_hook gdb_idle_hook "$this idle"
add_hook gdb_no_inferior_hook "$this no_inferior"
add_hook download_progress_hook "$this download_progress"
@@ -60,7 +59,6 @@ body SrcWin::constructor {args} {
# ------------------------------------------------------------------
body SrcWin::destructor {} {
debug
- remove_hook gdb_busy_hook "$this busy"
remove_hook gdb_no_inferior_hook "$this no_inferior"
remove_hook gdb_idle_hook "$this idle"
remove_hook download_progress_hook "$this download_progress"
@@ -324,10 +322,8 @@ body SrcWin::_name {w {val ""}} {
body SrcWin::toggle_updates {value} {
if {$value} {
add_hook gdb_update_hook "$this update"
- add_hook gdb_busy_hook "$this busy"
} else {
remove_hook gdb_update_hook "$this update"
- remove_hook gdb_busy_hook "$this busy"
}
# save state in do_updates so it will be preserved
# in window reconfigs
@@ -547,19 +543,21 @@ body SrcWin::_update_title {name} {
# ------------------------------------------------------------------
# PUBLIC METHOD: busy - disable things when gdb is busy
# ------------------------------------------------------------------
-body SrcWin::busy {} {
+body SrcWin::busy {event} {
global gdb_loaded gdb_target_name
# debug "gdb_loaded=$gdb_loaded, gdb_target_name=$gdb_target_name"
- enable_ui 0
- if {$Running} {
- $_toolbar configure -runstop running
- if {$gdb_loaded || \
- ([TargetSelection::native_debugging] && $gdb_target_name != "remote")} {
- set_status "Program is running."
- }
- } else {
- $_toolbar configure -runstop busy
+ if {$do_updates} {
+ enable_ui 0
+ if {$Running} {
+ $_toolbar configure -runstop running
+ if {$gdb_loaded || \
+ ([TargetSelection::native_debugging] && $gdb_target_name != "remote")} {
+ set_status "Program is running."
+ }
+ } else {
+ $_toolbar configure -runstop busy
+ }
}
}
diff --git a/gdb/gdbtk/library/srcwin.ith b/gdb/gdbtk/library/srcwin.ith
index 5ad1da70a51..97db3ec051e 100644
--- a/gdb/gdbtk/library/srcwin.ith
+++ b/gdb/gdbtk/library/srcwin.ith
@@ -27,7 +27,6 @@ class SrcWin {
inherit TopLevelWin GDBWin
public {
- method busy {}
method constructor {args}
method destructor {}
method download_progress { section num tot {msg ""} }
@@ -57,6 +56,11 @@ class SrcWin {
proc choose_and_update {}
proc choose_and_display {tag linespec}
proc point_to_main {}
+
+ #
+ # GDB Events
+ #
+ method busy {event}
}
private {
diff --git a/gdb/gdbtk/library/stackwin.itb b/gdb/gdbtk/library/stackwin.itb
index 58675df3836..cdc4573b59f 100644
--- a/gdb/gdbtk/library/stackwin.itb
+++ b/gdb/gdbtk/library/stackwin.itb
@@ -21,7 +21,6 @@ body StackWin::constructor {args} {
gdbtk_idle
add_hook gdb_update_hook [code $this update]
- add_hook gdb_busy_hook [code $this busy]
add_hook gdb_no_inferior_hook [code $this no_inferior]
add_hook gdb_idle_hook [code $this idle]
}
@@ -32,7 +31,6 @@ body StackWin::constructor {args} {
body StackWin::destructor {} {
remove_hook gdb_update_hook [code $this update]
remove_hook gdb_idle_hook [code $this idle]
- remove_hook gdb_busy_hook [code $this busy]
remove_hook gdb_no_inferior_hook [code $this no_inferior]
}
@@ -146,13 +144,11 @@ body StackWin::reconfig {} {
}
# ------------------------------------------------------------------
-# METHOD: busy - gdb_busy_hook
-#
-# This body StackWin::should accomplish blocking
-# - clicks in the window
-# - change mouse pointer
+# PUBLIC METHOD: busy - BusyEvent handler
+# This method should cause blocking of clicks in
+# the window and change mouse pointer.
# ------------------------------------------------------------------
-body StackWin::busy {} {
+body StackWin::busy {event} {
set Running 1
cursor watch
}
diff --git a/gdb/gdbtk/library/stackwin.ith b/gdb/gdbtk/library/stackwin.ith
index af7132e9e1e..a5367bde50b 100644
--- a/gdb/gdbtk/library/stackwin.ith
+++ b/gdb/gdbtk/library/stackwin.ith
@@ -27,7 +27,6 @@ class StackWin {
method cursor {glyph}
method change_frame {y}
method update {}
- method busy {}
method no_inferior {}
method idle {}
}
@@ -36,6 +35,11 @@ class StackWin {
method reconfig {}
method constructor {args}
method destructor {}
+
+ #
+ # GDB Events
+ #
+ method busy {event}
}
}
diff --git a/gdb/gdbtk/library/tclIndex b/gdb/gdbtk/library/tclIndex
index c8c4cdd55ef..8423b000d84 100644
--- a/gdb/gdbtk/library/tclIndex
+++ b/gdb/gdbtk/library/tclIndex
@@ -51,6 +51,7 @@ set auto_index(gdbtk_locate_main) [list source [file join $dir interface.tcl]]
set auto_index(set_exe_name) [list source [file join $dir interface.tcl]]
set auto_index(set_exe) [list source [file join $dir interface.tcl]]
set auto_index(_open_file) [list source [file join $dir interface.tcl]]
+set auto_index(_close_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]]
@@ -142,6 +143,7 @@ set auto_index(GDBEvent) [list source [file join $dir gdbevent.ith]]
set auto_index(BreakpointEvent) [list source [file join $dir gdbevent.ith]]
set auto_index(TracepointEvent) [list source [file join $dir gdbevent.ith]]
set auto_index(SetVariableEvent) [list source [file join $dir gdbevent.ith]]
+set auto_index(BusyEvent) [list source [file join $dir gdbevent.ith]]
set auto_index(GDBWin) [list source [file join $dir gdbwin.ith]]
set auto_index(GlobalPref) [list source [file join $dir globalpref.ith]]
set auto_index(HtmlViewer) [list source [file join $dir helpviewer.ith]]
@@ -396,6 +398,7 @@ set auto_index(::MemWin::goto) [list source [file join $dir memwin.itb]]
set auto_index(::MemWin::init_addr_exp) [list source [file join $dir memwin.itb]]
set auto_index(::MemWin::cursor) [list source [file join $dir memwin.itb]]
set auto_index(::MemWin::memMoveCell) [list source [file join $dir memwin.itb]]
+set auto_index(::MemWin::error_dialog) [list source [file join $dir memwin.itb]]
set auto_index(::ProcessWin::constructor) [list source [file join $dir process.itb]]
set auto_index(::ProcessWin::build_win) [list source [file join $dir process.itb]]
set auto_index(::ProcessWin::update) [list source [file join $dir process.itb]]
diff --git a/gdb/gdbtk/library/variables.tcl b/gdb/gdbtk/library/variables.tcl
index fd66491ba45..cfefbaa4cc9 100644
--- a/gdb/gdbtk/library/variables.tcl
+++ b/gdb/gdbtk/library/variables.tcl
@@ -35,7 +35,6 @@ class VariableWin {
gdbtk_idle
add_hook gdb_update_hook "$this update"
- add_hook gdb_busy_hook "$this disable_ui"
add_hook gdb_no_inferior_hook "$this no_inferior"
add_hook gdb_idle_hook [list $this idle]
add_hook gdb_clear_file_hook [code $this clear_file]
@@ -166,7 +165,6 @@ class VariableWin {
# Remove this window and all hooks
remove_hook gdb_update_hook "$this update"
- remove_hook gdb_busy_hook "$this disable_ui"
remove_hook gdb_no_inferior_hook "$this no_inferior"
remove_hook gdb_idle_hook [list $this idle]
remove_hook gdb_clear_file_hook [code $this clear_file]
@@ -917,10 +915,10 @@ class VariableWin {
}
# ------------------------------------------------------------------
- # METHOD: disable_ui
+ # PUBLIC METHOD: busy - BusyEvent handler
# Disable all ui elements that could affect gdb's state
# ------------------------------------------------------------------
- method disable_ui {} {
+ method busy {event} {
# Set fencepost
set Running 1