OSDN Git Service

* library/interface.tcl (gdb_update_hook): Mark as deprecated.
authorkseitz <kseitz>
Mon, 4 Jun 2001 15:49:53 +0000 (15:49 +0000)
committerkseitz <kseitz>
Mon, 4 Jun 2001 15:49:53 +0000 (15:49 +0000)
(gdbtk_update): Dispatch and UpdateEvent, too.
* library/ehandler.ith (update): New event handler.
* library/gdbevent.ith (UpdateEvent): New event.
* library/gdbevent.itb (UpdateEvent::constructor): New method.
(UpdateEvent::get): New method.
* library/kod.ith (udpate): Match event handler definition.
* library/kod.itb (update): Ditto.
(build_win): Pass dummy argument to update method.
(top): Ditto.
(up): Ditto.
(set_variable): Ditto.
* library/memwin.ith (update): Match event handler definition.
* library/memwin.itb (update): Ditto.
(constructor): Remove gdb_update_hook.
(destructor): Ditto.
* library/process.ith (update): Match event handler definition.
* library/process.itb (update): Ditto.
(constructor): Remove gdb_update_hook.
(destructor): Ditto.
(build_win): Pass dummy argument to update method.
* library/regwin.ith (update): Match event handler definition.
* library/regwin.itb (update): Ditto.
(constructor): Remove gdb_update_hook.
(destructor): Ditto.
(build_win): Pass dummy argument to update method.
(but3): Ditto.
(unedit): Ditto.
* library/stackwin.ith (update): Match event handler definition.
* library/stackwin.itb (update): Ditto.
(constructor): Remove gdb_update_hook.
(destructor): Ditto.
(build_win): Pass dummy argument to update method.
* library/tdump.tcl (update): Match event handler definition.
(constructor): Remove gdb_update_hook.
(destructor): Ditto.
(build_win): Pass dummy argument to update method.
* library/variables.tcl (update): Match event handler definition.
(build_win): Pass dummy argument to update method.
* library/locals.tcl (update): Match event handler definition.
(constructor): Pass dummy argument to update method.
* library/watch.tcl (update): Match event handler definition.
Pass dummy argument to VariableWin::update.
(add): Pass dummy argument to update method.
* library/srcwin.ith (update): New method.
(update_hook_init): Remove.
* library/srcwin.itb (update): New method.
(constructor): Remove gdb_update_hook.
(destructor): Ditto.
* tclIndex: Regenerate.

22 files changed:
gdb/gdbtk/ChangeLog
gdb/gdbtk/library/ehandler.ith
gdb/gdbtk/library/gdbevent.itb
gdb/gdbtk/library/gdbevent.ith
gdb/gdbtk/library/interface.tcl
gdb/gdbtk/library/kod.itb
gdb/gdbtk/library/kod.ith
gdb/gdbtk/library/locals.tcl
gdb/gdbtk/library/memwin.itb
gdb/gdbtk/library/memwin.ith
gdb/gdbtk/library/process.itb
gdb/gdbtk/library/process.ith
gdb/gdbtk/library/regwin.itb
gdb/gdbtk/library/regwin.ith
gdb/gdbtk/library/srcwin.itb
gdb/gdbtk/library/srcwin.ith
gdb/gdbtk/library/stackwin.itb
gdb/gdbtk/library/stackwin.ith
gdb/gdbtk/library/tclIndex
gdb/gdbtk/library/tdump.tcl
gdb/gdbtk/library/variables.tcl
gdb/gdbtk/library/watch.tcl

index 70090cb..5032e84 100644 (file)
@@ -1,3 +1,56 @@
+2001-06-04  Keith Seitz  <keiths@redhat.com>
+
+       * library/interface.tcl (gdb_update_hook): Mark as deprecated.
+       (gdbtk_update): Dispatch and UpdateEvent, too.
+       * library/ehandler.ith (update): New event handler.
+       * library/gdbevent.ith (UpdateEvent): New event.
+       * library/gdbevent.itb (UpdateEvent::constructor): New method.
+       (UpdateEvent::get): New method.
+       * library/kod.ith (udpate): Match event handler definition.
+       * library/kod.itb (update): Ditto.
+       (build_win): Pass dummy argument to update method.
+       (top): Ditto.
+       (up): Ditto.
+       (set_variable): Ditto.
+       * library/memwin.ith (update): Match event handler definition.
+       * library/memwin.itb (update): Ditto.
+       (constructor): Remove gdb_update_hook.
+       (destructor): Ditto.
+       * library/process.ith (update): Match event handler definition.
+       * library/process.itb (update): Ditto.
+       (constructor): Remove gdb_update_hook.
+       (destructor): Ditto.
+       (build_win): Pass dummy argument to update method.
+       * library/regwin.ith (update): Match event handler definition.
+       * library/regwin.itb (update): Ditto.
+       (constructor): Remove gdb_update_hook.
+       (destructor): Ditto.
+       (build_win): Pass dummy argument to update method.
+       (but3): Ditto.
+       (unedit): Ditto.
+       * library/stackwin.ith (update): Match event handler definition.
+       * library/stackwin.itb (update): Ditto.
+       (constructor): Remove gdb_update_hook.
+       (destructor): Ditto.
+       (build_win): Pass dummy argument to update method.
+       * library/tdump.tcl (update): Match event handler definition.
+       (constructor): Remove gdb_update_hook.
+       (destructor): Ditto.
+       (build_win): Pass dummy argument to update method.
+       * library/variables.tcl (update): Match event handler definition.
+       (build_win): Pass dummy argument to update method.
+       * library/locals.tcl (update): Match event handler definition.
+       (constructor): Pass dummy argument to update method.
+       * library/watch.tcl (update): Match event handler definition.
+       Pass dummy argument to VariableWin::update.
+       (add): Pass dummy argument to update method.
+       * library/srcwin.ith (update): New method.
+       (update_hook_init): Remove.
+       * library/srcwin.itb (update): New method.
+       (constructor): Remove gdb_update_hook.
+       (destructor): Ditto.
+       * tclIndex: Regenerate.
+
 2001-06-01  Keith Seitz  <keiths@redhat.com>
 
        * library/console.itb (constructor): Pass dummy argument
index 3c3517d..0c3f21e 100644 (file)
@@ -38,5 +38,8 @@ class GDBEventHandler {
 
     # Idle event
     method idle {event} {}
+
+    # Update event
+    method update {event} {}
   }
 }
index b9bd738..eab64f0 100644 (file)
@@ -170,3 +170,33 @@ body SetVariableEvent::get {what} {
     default { error "unknown event data \"$what\": should be: variable|value" }
   }
 }
+
+# ------------------------------------------------------------
+#  CONSTRUCTOR: Create an UpdateEvent
+# ------------------------------------------------------------
+body UpdateEvent::constructor {args} {
+  if {[catch {gdb_loc} loc]} {
+    dbug E "could not get current location: $loc"
+  } else {
+    lassign $loc _compile_filename _function _full_filename \
+      _line _frame_pc _pc _shlib
+  }
+}
+
+# ------------------------------------------------------------
+#  PUBLIC METHOD:  get - Retrieve data about the event
+# ------------------------------------------------------------
+body UpdateEvent::get {what} {
+
+  switch $what {
+    compile_filename { return $_compile_filename }
+    full_filename    { return $_full_filename }
+    function         { return $_function }
+    line             { return $_line }
+    frame_pc         { return $_frame_pc }
+    pc               { return $_pc }
+    shlib            { return $_shlib }
+
+    default { error "unknown event data \"$what\": should be: variable|value" }
+  }
+}
index 5d769bd..dd45f97 100644 (file)
@@ -171,3 +171,37 @@ class IdleEvent {
 
   public method handler {} { return "idle" }
 }
+
+# UPDATE EVENT
+#
+# This event is created/dispatched whenever the target's state
+# has changed. When an UpdateEvent is received, widgets should
+# update their contents to reflect the inferior's new state.
+#
+# Right now, this just holds the output of gdb_loc...
+#
+# compile_filename - Filename stored in the symtab
+# full_filename    - Full filename of file, if found in source search dir
+# function         - Function name
+# line             - Line number
+# frame_pc         - Frame's PC
+# pc               - Real stop PC
+# shlib            - Shared library stopped in
+#
+# FIXME: Should probably put frame_pc and pc into different
+# types of update events...
+class UpdateEvent {
+  inherit GDBEvent
+
+  constructor {args} {}
+  public method get {what}
+  public method handler {} { return "update" }
+
+  private variable _compile_filename {}
+  private variable _function         {}
+  private variable _full_filename    {}
+  private variable _line             {}
+  private variable _frame_pc         {}
+  private variable _pc               {}
+  private variable _shlib            {}
+}
index d9d7fb2..6b87e7f 100644 (file)
@@ -67,10 +67,11 @@ proc gdbtk_tcl_set_variable {var val} {
 #   time delays when enabling the UI.
 define_hook gdb_idle_hook
 
+# *** DEPRECATED: Use GDBEventHandler::update instead.
 # GDB_UPDATE_HOOK
 #   This hook is used to register a callback to update the widget
 #   when debugger state has changed.
-define_hook gdb_update_hook
+#define_hook gdb_update_hook
 
 # GDB_NO_INFERIOR_HOOK
 #   This hook is used to register a callback which should be invoked
@@ -148,10 +149,10 @@ proc gdbtk_busy {} {
 #          that could change target state.
 # ------------------------------------------------------------------
 proc gdbtk_update {} {
-  set err [catch {run_hooks gdb_update_hook} txt]
-  if {$err} { 
-    dbug E "$txt" 
-  }
+
+  set e [UpdateEvent \#auto]
+  GDBEventHandler::dispatch $e
+  delete object $e
   
   # Force the screen to update
   update
index a804c8f..f9121d4 100644 (file)
@@ -31,9 +31,6 @@ body KodWin::constructor {args} {
   gdbtk_busy
   build_win
   gdbtk_idle
-
-  # Add hooks for this object
-  add_hook gdb_update_hook [code $this update]
 }
 
 # ------------------------------------------------------------------
@@ -146,13 +143,13 @@ body KodWin::build_win {} {
 
   #    window_name "Kernel Objects"
 
-  update
+  update dummy
 }
 
 # ------------------------------------------------------------------
 #  METHOD:  update - update widget when something changes
 # ------------------------------------------------------------------
-body KodWin::update {} {
+body KodWin::update {event} {
 
   debug "updating kod window"
 
@@ -182,7 +179,7 @@ body KodWin::display {} {
     set LevelCmd($level) $LevelCmd([expr $level-1])
     append LevelCmd($level) $object
     debug "kod command for level $level is now: $LevelCmd($level)"
-    update
+    update dummy
     # Run idle hooks and cause all other widgets to update
     gdbtk_idle
   }
@@ -368,7 +365,7 @@ body KodWin::top {} {
   debug "going to top from level $level"
   if {$level > 0} {
     set level 0
-    update
+    update dummy
   }
 }
 
@@ -380,7 +377,7 @@ body KodWin::up {} {
   if {$level > 0} {
     incr level -1
     debug "...to level $level"
-    update
+    update dummy
   }
 }
 
@@ -395,8 +392,6 @@ body KodWin::destructor {} {
   catch {unset pane1_vals}
   catch {unset pane2_vals}
   catch {unset kodActivePane}
-
-  remove_hook gdb_update_hook [code $this update]
 }
 
 # ------------------------------------------------------------------
@@ -409,7 +404,7 @@ body KodWin::set_variable {event} {
   if {[$event get variable] == "os" && $value != ""} {
     set LevelCmd(0) "info $value "
     set level 0
-    update
+    update dummy
   }
 }
 
index 6ed76d4..8827deb 100644 (file)
@@ -36,7 +36,6 @@ class KodWin {
     variable BState
     variable Running 0
     method build_win {}
-    method update {}
     method display {}
     method display_list {}
     method display_object {{cmd ""} {obj ""}}
@@ -59,5 +58,6 @@ class KodWin {
     method set_variable {event}
     method busy {event}
     method idle {event}
+    method update {event}
   }
 }
index 53a9118..64daaf8 100644 (file)
@@ -19,7 +19,7 @@ class LocalsWin {
     #  CONSTRUCTOR - create new locals window
     # ------------------------------------------------------------------
     constructor {args} {
-       update
+       update dummy
     }
 
     # ------------------------------------------------------------------
@@ -65,7 +65,7 @@ class LocalsWin {
        return [$_frame variables]
     }
 
-    method update {} {
+    method update {event} {
        global Update Display
 
        debug "START LOCALS UPDATE CALLBACK"
@@ -115,7 +115,7 @@ class LocalsWin {
        }
 
        # Update variables in window
-       VariableWin::update
+       VariableWin::update dummy
 
        debug "END LOCALS UPDATE CALLBACK"
     }
index 8ceae68..7feaf08 100644 (file)
@@ -48,8 +48,6 @@ body MemWin::constructor {args} {
   init_addr_exp
   build_win
   gdbtk_idle
-
-  add_hook gdb_update_hook "$this update"
 }
 
 # ------------------------------------------------------------------
@@ -59,7 +57,6 @@ body MemWin::destructor {} {
   if {[winfo exists $prefs_win]} {
     $prefs_win cancel
   }
-  remove_hook gdb_update_hook "$this update"
 }
 
 
@@ -368,7 +365,7 @@ body MemWin::toggle_enabled {} {
 # ------------------------------------------------------------------
 #  METHOD:  update - update widget after every PC change
 # ------------------------------------------------------------------
-body MemWin::update {} {
+body MemWin::update {event} {
   global _mem
   if {$_mem($this,enabled)} {
     update_address
index c0ff22b..0d9f8f8 100644 (file)
@@ -60,7 +60,6 @@ class MemWin {
     method changed_cell {from to}
     method edit {cell}
     method toggle_enabled {}
-    method update {}
     method newsize {height}
     method update_address_cb {}
     method update_address { {ae ""} }
@@ -79,5 +78,6 @@ class MemWin {
     #
     method busy {event}
     method idle {event}
+    method update {event}
   }
 }
index 5fd382a..2d21320 100644 (file)
@@ -27,7 +27,6 @@ body ProcessWin::constructor {args} {
   gdbtk_idle
 
   # Add hooks for this object
-  add_hook gdb_update_hook [code $this update]
   add_hook gdb_no_inferior_hook [code $this idle]
 }
 
@@ -48,7 +47,7 @@ body ProcessWin::build_win {} {
     -selectforeground black \
     -font src-font          \
     -exportselection false
-  update
+  update dummy
   balloon register $lb "Click on a line to change context"
 
   # bind mouse button 1 to change the current context
@@ -62,7 +61,7 @@ body ProcessWin::build_win {} {
 # ------------------------------------------------------------------
 #  METHOD:  update - update widget when something changes
 # ------------------------------------------------------------------
-body ProcessWin::update {} {
+body ProcessWin::update {event} {
   if {!$protect_me} {
 
     $lb delete 0 end
@@ -126,7 +125,6 @@ body ProcessWin::change_context {y} {
 #  DESTRUCTOR - destroy window containing widget
 # ------------------------------------------------------------------
 body ProcessWin::destructor {} {
-  remove_hook gdb_update_hook [code $this update]
   remove_hook gdb_no_inferior_hook [code $this no_inferior]
 }
 
index fb3e239..eaa6dea 100644 (file)
@@ -27,7 +27,6 @@ class ProcessWin {
     method change_context {y}
     method cursor {glyph}
     method change_frame {y}
-    method update {}
   }
 
   public {
@@ -36,9 +35,10 @@ class ProcessWin {
     method destructor {}
 
     #
-    # Event
+    # GDB Events
     #
     method busy {event}    
     method idle {event}
+    method update {event}
   }
 }
\ No newline at end of file
index a144fff..12f3632 100644 (file)
@@ -32,7 +32,6 @@ body RegWin::constructor {args} {
   eval itk_initialize $args    
   
   gdbtk_idle
-  add_hook gdb_update_hook "$this update"
 }
 
 # ------------------------------------------------------------------
@@ -41,7 +40,6 @@ body RegWin::constructor {args} {
 body RegWin::destructor {} {
   debug
   save_reg_display_vars
-  remove_hook gdb_update_hook "$this update"
 }
   
 
@@ -164,19 +162,19 @@ body RegWin::build_win {} {
     $m add cascade -menu $itk_interior.m.reg.format -label "Format" -underline 0
     set f [menu $itk_interior.m.reg.format]
     $f add radio -label "Hex" -value x -underline 0 -state disabled \
-      -command "$this update"
+      -command "$this update dummy"
     $f add radio -label "Decimal" -value d -underline 0 -state disabled \
-      -command "$this update"
+      -command "$this update dummy"
     $f add radio -label "Natural" -value {} -underline 0 -state disabled \
-      -command "$this update"
+      -command "$this update dummy"
     $f add radio -label "Binary" -value t -underline 0 -state disabled \
-      -command "$this update"
+      -command "$this update dummy"
     $f add radio -label "Octal" -value o -underline 0 -state disabled \
-      -command "$this update"
+      -command "$this update dummy"
     $f add radio -label "Raw" -value r -underline 0 -state disabled \
-      -command "$this update"
+      -command "$this update dummy"
     $f add radio -label "Floating Point" -value f -underline 0 -state disabled \
-      -command "$this update"
+      -command "$this update dummy"
     $m add command -label "Remove from Display" -underline 0 -state disabled
     $m add separator
     $m add command -label "Add to Watch" -underline 7 -state disabled
@@ -450,19 +448,19 @@ body RegWin::but3 {rn X Y} {
     $Menu add command -label $reg_display($rn,name) -state disabled
     $Menu add separator
     if {!$reg_display($rn,typed)} {
-      $Menu add radio -label "Hex" -command "$this update" \
+      $Menu add radio -label "Hex" -command "$this update dummy" \
         -value x -variable reg_display($rn,format)
-      $Menu add radio -label "Decimal" -command "$this update" \
+      $Menu add radio -label "Decimal" -command "$this update dummy" \
         -value d -variable reg_display($rn,format)
-      $Menu add radio -label "Natural" -command "$this update" \
+      $Menu add radio -label "Natural" -command "$this update dummy" \
         -value {} -variable reg_display($rn,format)
-      $Menu add radio -label "Binary" -command "$this update" \
+      $Menu add radio -label "Binary" -command "$this update dummy" \
         -value t -variable reg_display($rn,format) -underline 0
-      $Menu add radio -label "Octal" -command "$this update" \
+      $Menu add radio -label "Octal" -command "$this update dummy" \
         -value o -variable reg_display($rn,format)
-      $Menu add radio -label "Raw" -command "$this update" \
+      $Menu add radio -label "Raw" -command "$this update dummy" \
         -value r -variable reg_display($rn,format)
-      $Menu add radio -label "Floating Point" -command "$this update" \
+      $Menu add radio -label "Floating Point" -command "$this update dummy" \
         -value f -variable reg_display($rn,format)
       $Menu add separator
     }
@@ -580,14 +578,14 @@ body RegWin::unedit {} {
     grid $ScrolledWin.$Editing.val -column 1 -row 0
     focus -force $ScrolledWin.$Editing
     set Editing -1
-    update
+    update dummy
   }
 }
 
 # ------------------------------------------------------------------
 #  PRIVATE METHOD:  update - update widget when PC changes
 # ------------------------------------------------------------------
-body RegWin::update {} {
+body RegWin::update {event} {
   global reg_display
   debug "START REGISTER UPDATE CALLBACK"
   if {$reg_display_list == ""
index 88bb69f..6e06ab2 100644 (file)
@@ -59,7 +59,6 @@ class RegWin {
     method edit {r} 
     method acceptEdit {r} 
     method unedit {} 
-    method update {}
     method reconfig {}
 
     #
@@ -68,6 +67,7 @@ class RegWin {
     method set_variable {event}
     method busy {event}
     method idle {event}
+    method update {event}
   }
 
 
index cc6e213..7a2bb3d 100644 (file)
@@ -38,10 +38,6 @@ body SrcWin::constructor {args} {
   wm protocol $top WM_DELETE_WINDOW "[code $this _exit]"
 
   # add hooks
-  if {! $update_hook_init} then {
-    set update_hook_init 1
-    add_hook gdb_update_hook "SrcWin::choose_and_update"
-  }
   add_hook gdb_no_inferior_hook "$this no_inferior"
   add_hook download_progress_hook "$this download_progress"
   add_hook state_hook [code $this _set_state]
@@ -318,11 +314,6 @@ body SrcWin::_name {w {val ""}} {
 #  PRIVATE PUBLIC METHOD:  toggle_updates - update toggle callback
 # ------------------------------------------------------------------
 body SrcWin::toggle_updates {value} {
-  if {$value} {
-    add_hook gdb_update_hook "$this update"
-  } else {
-    remove_hook gdb_update_hook "$this update"
-  }
   # save state in do_updates so it will be preserved
   # in window reconfigs
   set do_updates $value
@@ -560,6 +551,22 @@ body SrcWin::busy {event} {
 }
 
 # ------------------------------------------------------------------
+#   PUBLIC METHOD:  update - The inferior's state has changed.
+# ------------------------------------------------------------------
+body SrcWin::update {event} {
+
+  # FIXME: This is kinda lame. We need to run this only once
+  # as it is now written, so only the first window in the list
+  # will actually call choose_and_update.
+  # This is still better than before, since it will not
+  # matter if this window is destroyed: as long as _a_
+  # SrcWin exists, this will get called.
+  if {[lindex $window_list 0] == $this} {
+    choose_and_update
+  }
+}
+
+# ------------------------------------------------------------------
 #  PRIVATE METHOD:  _set_name - set the name in the name combobox and in the title
 # ------------------------------------------------------------------
 body SrcWin::_set_name { val {found 1} } {
index 9ad3f19..5cf256c 100644 (file)
@@ -61,6 +61,7 @@ class SrcWin {
     #
     method busy {event}
     method idle {event}
+    method update {event}
   }
 
   private {
@@ -96,7 +97,6 @@ class SrcWin {
     # source windows.
     common window_list ""
     common pc_window ""
-    common update_hook_init 0
 
     # fenceposts
     variable Running 0
index 6b9c3cd..7093b39 100644 (file)
@@ -20,7 +20,6 @@ body StackWin::constructor {args} {
   build_win
   gdbtk_idle
   
-  add_hook gdb_update_hook [code $this update]
   add_hook gdb_no_inferior_hook [code $this no_inferior]
 }
 
@@ -28,7 +27,6 @@ body StackWin::constructor {args} {
 #  DESTRUCTOR - destroy window containing widget
 # ------------------------------------------------------------------
 body StackWin::destructor {} {
-  remove_hook gdb_update_hook [code $this update]
   remove_hook gdb_no_inferior_hook [code $this no_inferior]
 }
 
@@ -48,7 +46,7 @@ body StackWin::build_win {} {
     -selectforeground black \
     -font src-font          \
     -exportselection false
-  update
+  update dummy
   $lb configure -width $maxwidth
 
   # bind mouse button 1 to change the stack frame
@@ -64,7 +62,7 @@ body StackWin::build_win {} {
 # ------------------------------------------------------------------
 #  METHOD:  update - update widget when PC changes
 # ------------------------------------------------------------------
-body StackWin::update {} {
+body StackWin::update {event} {
   global gdb_selected_frame_level
 
   if {!$protect_me} {
index 3b42ad6..3772918 100644 (file)
@@ -26,7 +26,6 @@ class StackWin {
     method build_win {}
     method cursor {glyph}
     method change_frame {y}
-    method update {}
     method no_inferior {}
   }
 
@@ -40,6 +39,7 @@ class StackWin {
     #
     method busy {event}
     method idle {event}
+    method update {event}
   }
 
 }
index a916c04..b79ddf9 100644 (file)
@@ -145,6 +145,7 @@ 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(IdleEvent) [list source [file join $dir gdbevent.ith]]
+set auto_index(UpdateEvent) [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]]
@@ -296,6 +297,8 @@ set auto_index(::TracepointEvent::_init) [list source [file join $dir gdbevent.i
 set auto_index(::TracepointEvent::number) [list source [file join $dir gdbevent.itb]]
 set auto_index(::TracepointEvent::get) [list source [file join $dir gdbevent.itb]]
 set auto_index(::SetVariableEvent::get) [list source [file join $dir gdbevent.itb]]
+set auto_index(::UpdateEvent::constructor) [list source [file join $dir gdbevent.itb]]
+set auto_index(::UpdateEvent::get) [list source [file join $dir gdbevent.itb]]
 set auto_index(::GlobalPref::_init) [list source [file join $dir globalpref.itb]]
 set auto_index(::GlobalPref::constructor) [list source [file join $dir globalpref.itb]]
 set auto_index(::GlobalPref::destructor) [list source [file join $dir globalpref.itb]]
@@ -531,6 +534,7 @@ set auto_index(::SrcWin::idle) [list source [file join $dir srcwin.itb]]
 set auto_index(::SrcWin::mode) [list source [file join $dir srcwin.itb]]
 set auto_index(::SrcWin::_update_title) [list source [file join $dir srcwin.itb]]
 set auto_index(::SrcWin::busy) [list source [file join $dir srcwin.itb]]
+set auto_index(::SrcWin::update) [list source [file join $dir srcwin.itb]]
 set auto_index(::SrcWin::_set_name) [list source [file join $dir srcwin.itb]]
 set auto_index(::SrcWin::set_status) [list source [file join $dir srcwin.itb]]
 set auto_index(::SrcWin::set_execution_status) [list source [file join $dir srcwin.itb]]
index 94c1310..8ad80a1 100644 (file)
@@ -48,7 +48,6 @@ itcl_class TdumpWin {
     wm withdraw $top
 
     build_win
-    add_hook gdb_update_hook "$this update"
     after idle [list wm deiconify $top]
 
   }
@@ -66,14 +65,14 @@ itcl_class TdumpWin {
     $twin configure -insertwidth 0 
 
     pack append  [namespace tail $this] [namespace tail $this].stext {left expand fill}
-    update
+    update dummy
   }
 
 
   # ------------------------------------------------------------------
   #  METHOD:  update - update widget when PC changes
   # ------------------------------------------------------------------
-  method update {} {
+  method update {event} {
     #debug "tdump: update"
     gdbtk_busy
     set tframe_num [gdb_get_trace_frame_num]
@@ -99,7 +98,6 @@ itcl_class TdumpWin {
   #  DESTRUCTOR - destroy window containing widget
   # ------------------------------------------------------------------
   destructor {
-    remove_hook gdb_update_hook "$this update"
     set top [winfo toplevel [namespace tail $this]]
     destroy $this
     destroy $top
index ea8e3b0..85cf4f3 100644 (file)
@@ -34,7 +34,6 @@ class VariableWin {
        build_win $itk_interior
        gdbtk_idle
 
-       add_hook gdb_update_hook "$this update"
        add_hook gdb_no_inferior_hook "$this no_inferior"
        add_hook gdb_clear_file_hook [code $this clear_file]
         # FIXME: This is too harsh.  We must add to varobj a method
@@ -109,7 +108,7 @@ class VariableWin {
 
 
        # Update the tree display
-       update
+       update dummy
        pack $Tree -expand yes -fill both
 
        # Create the popup menu for this widget
@@ -163,7 +162,6 @@ class VariableWin {
        destroy $DisabledTextStyle
 
        # Remove this window and all hooks
-       remove_hook gdb_update_hook "$this update"
        remove_hook gdb_no_inferior_hook "$this no_inferior"
        remove_hook gdb_clear_file_hook [code $this clear_file]
        remove_hook file_changed_hook [code $this clear_file]
@@ -816,7 +814,7 @@ class VariableWin {
     # METHOD:   update
     # OVERRIDE THIS METHOD and call it from there
     # ------------------------------------------------------------------
-    method update {} {
+    method update {event} {
        global Update
        debug
 
index 781bbc0..6734205 100644 (file)
@@ -197,11 +197,11 @@ class WatchWin {
     return $list
   }
 
-  method update {} {
+  method update {event} {
     global Update Display
     debug "START WATCH UPDATE CALLBACK"
     catch {populate {}} msg
-    catch {VariableWin::update} msg
+    catch {VariableWin::update dummy} msg
     debug "Did VariableWin::update with return \"$msg\""
 
     # Make sure all variables are marked as _not_ Openable?
@@ -255,7 +255,7 @@ class WatchWin {
          set var [gdb_variable create -expr $name]
          set ::Update($this,$var) 1
          lappend Watched $var
-         update
+         update dummy
          return 1
       }
     }