OSDN Git Service

Other half of SetVariableEvent:
authorkseitz <kseitz>
Fri, 20 Apr 2001 18:47:32 +0000 (18:47 +0000)
committerkseitz <kseitz>
Fri, 20 Apr 2001 18:47:32 +0000 (18:47 +0000)
* library/srctextwin.ith (handle_set_hook): Rename to set_variable.
* library/srctextwin.itb (set_variable): Handle SetVariableEvent.
(constructor): Remove gdb_set_hook.
(destructor): Ditto.
* library/srcbar.itcl: Inherit from GDBEventHandler.
(set_hook): Rename to set_variable and handle SetVariableEvent.
(constructor): Remove gdb_set_hook.
(destructor): Ditto.
* library/regwin.ith (handle_set_hook): Renamed to set_variable.
* library/regwin.itb (set_variable): Handle SetVariableEvent.
(constructor): Remove gdb_set_hook.
(destructor): Ditto.
* library/kod.ith (set_os): Renamed to "set_variable".
* library/kod.itb (set_variable): Handle SetVariableEvent.
(constructor): Remove gdb_set_hook.
(destructor): Ditto.
* library/tclIndex: Regenerated.

gdb/gdbtk/ChangeLog
gdb/gdbtk/library/kod.itb
gdb/gdbtk/library/kod.ith
gdb/gdbtk/library/regwin.itb
gdb/gdbtk/library/regwin.ith
gdb/gdbtk/library/srcbar.itcl
gdb/gdbtk/library/srctextwin.itb
gdb/gdbtk/library/srctextwin.ith
gdb/gdbtk/library/tclIndex

index 23c8f11..6dc0122 100644 (file)
@@ -1,5 +1,25 @@
 2001-04-20  Keith Seitz  <keiths@cygnus.com>
 
+       * library/srctextwin.ith (handle_set_hook): Rename to set_variable.
+       * library/srctextwin.itb (set_variable): Handle SetVariableEvent.
+       (constructor): Remove gdb_set_hook.
+       (destructor): Ditto.
+       * library/srcbar.itcl: Inherit from GDBEventHandler.
+       (set_hook): Rename to set_variable and handle SetVariableEvent.
+       (constructor): Remove gdb_set_hook.
+       (destructor): Ditto.
+       * library/regwin.ith (handle_set_hook): Renamed to set_variable.
+       * library/regwin.itb (set_variable): Handle SetVariableEvent.
+       (constructor): Remove gdb_set_hook.
+       (destructor): Ditto.
+       * library/kod.ith (set_os): Renamed to "set_variable".
+       * library/kod.itb (set_variable): Handle SetVariableEvent.
+       (constructor): Remove gdb_set_hook.
+       (destructor): Ditto.
+       * library/tclIndex: Regenerated.
+
+2001-04-20  Keith Seitz  <keiths@cygnus.com>
+
        * library/interface.tcl (gdbtk_tcl_set_variable): New proc.
        * library/gdbevent.ith (SetVariableEvent): New event.
        * library/gdbevent.itb (SetVariableEvent::get): Override
index f586bcf..22a7af4 100644 (file)
@@ -1,5 +1,5 @@
 # Kernel Object Display Window for Insight.
-# Copyright (C) 1998, 1999, 2001 Red Hat
+# Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License (GPL) as published by
@@ -36,7 +36,6 @@ body KodWin::constructor {args} {
   add_hook gdb_update_hook [code $this update]
   add_hook gdb_busy_hook [code $this busy]
   add_hook gdb_idle_hook [code $this idle]
-  add_hook gdb_set_hook [code $this set_os]
 }
 
 # ------------------------------------------------------------------
@@ -402,14 +401,16 @@ 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]
-  remove_hook gdb_set_hook [code $this set_os]
 }
 
 # ------------------------------------------------------------------
-#  METHOD:  set - called when user runs `set os' command
+#  PUBLIC METHOD:  set_variable - called when user runs `set os'
+#                   command
 # ------------------------------------------------------------------
-body KodWin::set_os {var value} {
-  if {$var == "os" && $value != ""} {
+body KodWin::set_variable {event} {
+
+  set value [$event get value]
+  if {[$event get variable] == "os" && $value != ""} {
     set LevelCmd(0) "info $value "
     set level 0
     update
index d661670..c2a5e55 100644 (file)
@@ -1,5 +1,5 @@
-# Kernel Object Display Window definition for GDBtk.
-# Copyright (C) 1999 Cygnus Solutions
+# Kernel Object Display Window definition for Insight.
+# Copyright (C) 1999, 2001 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License (GPL) as published by
@@ -48,12 +48,16 @@ class KodWin {
     method cursor {glyph}
     method _disable_buttons {}
     method _restore_buttons {}
-    method set_os {var value}
   }
 
   public {
     method constructor {args}
     method destructor {}
     method reconfig {}
+
+    #
+    # Gdb Events
+    #
+    method set_variable {event}
   }
 }
index 6ff1275..1bd56a5 100644 (file)
@@ -1,5 +1,5 @@
 # Register display window for Insight.
-# Copyright 1998, 1999, 2001 Red Hat
+# Copyright 1998, 1999, 2001 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License (GPL) as published by
@@ -35,9 +35,6 @@ body RegWin::constructor {args} {
   add_hook gdb_update_hook "$this update"
   add_hook gdb_busy_hook [list $this busy]
   add_hook gdb_idle_hook [list $this idle]
-  if {[get_disassembly_flavor] != ""} {
-    add_hook gdb_set_hook [code $this handle_set_hook]
-  }
 }
 
 # ------------------------------------------------------------------
@@ -49,9 +46,6 @@ body RegWin::destructor {} {
   remove_hook gdb_update_hook "$this update"
   remove_hook gdb_busy_hook [list $this busy]
   remove_hook gdb_idle_hook [list $this idle]
-  if {[get_disassembly_flavor] != ""} {
-    remove_hook gdb_set_hook [code $this handle_set_hook]
-  }
 }
   
 
@@ -258,8 +252,8 @@ body RegWin::init_reg_display_vars {args} {
   set reg_names_dirty 0
 }
 
-body RegWin::handle_set_hook {var value} {
-  switch $var {
+body RegWin::set_variable {event} {
+  switch [$event get variable] {
     disassembly-flavor {
         disassembly_changed
     } 
index f2fadad..c48532c 100644 (file)
@@ -1,5 +1,5 @@
-# Register display window class definition for GDBtk.
-# Copyright 1998, 1999 Cygnus Solutions
+# Register display window class definition for Insight.
+# Copyright 1998, 1999, 2001 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License (GPL) as published by
@@ -36,7 +36,6 @@ class RegWin {
     common NormalForeground {}
     
     method init_reg_display_vars {args}
-    method handle_set_hook {var val}
     method disassembly_changed {}
     method dimensions {}
     method fixLength {s size where}
@@ -64,6 +63,11 @@ class RegWin {
     method idle {}
     method reconfig {}
     method busy {}
+
+    #
+    # Gdb Events
+    #
+    method set_variable {event}
   }
 
 
index 89fa82e..880a31b 100644 (file)
@@ -29,7 +29,7 @@
 # ----------------------------------------------------------------------
 
 class SrcBar {
-  inherit itk::Widget
+  inherit itk::Widget GDBEventHandler
 
   # ------------------------------------------------------------------
   #  CONSTRUCTOR - create widget
@@ -68,7 +68,6 @@ class SrcBar {
     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_set_hook "$this set_hook"
     add_hook gdb_trace_find_hook "$this handle_trace_find_hook"
   }
 
@@ -82,7 +81,6 @@ class SrcBar {
     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_set_hook "$this set_hook"
     remove_hook gdb_trace_find_hook "$this handle_trace_find_hook"
 
     #destroy $this
@@ -804,12 +802,14 @@ class SrcBar {
   }
 
   # ------------------------------------------------------------------
-  #  METHOD:  set_hook - run when user enters a `set' command.
+  #  METHOD:  set_variable - run when user enters a `set' command.
   #
   #  FIXME: Should not be accessing the base class internal data
   #         As the spec says, one must clear the menu and recreate it.
   # ------------------------------------------------------------------  
-  method set_hook {varname value} {
+  public method set_variable {event} {
+    set varname [$event get variable]
+    set value   [$event get value]
     debug "Got $varname = $value"
 
     if {$varname == "os"} {
index 35e12ba..8f04181 100644 (file)
@@ -65,10 +65,6 @@ body SrcTextWin::constructor {args} {
     add_hook gdb_trace_find_hook "$this trace_find_hook"
   }
   
-  if {[get_disassembly_flavor] != ""} {
-    add_hook gdb_set_hook [code $this handle_set_hook]
-  }
-
   if {$UseVariableBalloons} {
     add_hook gdb_idle_hook "$this updateBalloon"
   }
@@ -87,9 +83,6 @@ body SrcTextWin::destructor {} {
   if {$UseVariableBalloons} {
     remove_hook gdb_idle_hook "$this updateBalloon"
   }
-  if {[get_disassembly_flavor] != ""} {
-    remove_hook gdb_set_hook [code $this handle_set_hook]
-  }
 }
 
 # ------------------------------------------------------------------
@@ -714,10 +707,12 @@ body SrcTextWin::addPopup {menu label command {abg {}} {browse 1} {run 1}} {
 }
 
 # ------------------------------------------------------------------
-#  METHOD:  handle_set_hook - Handle changes in the gdb variables
+#  PUBLIC METHOD:  set_variable - Handle changes in the gdb variables
 #           changed through the "set" gdb command.
 # ------------------------------------------------------------------
-body SrcTextWin::handle_set_hook {var val} {
+body SrcTextWin::set_variable {event} {
+  set var [$event get variable]
+  set val [$event get value]
   debug "Set hook got called with $var $val"
   switch $var {
     disassembly-flavor {
index 5e5c0e0..d2ff09b 100644 (file)
@@ -93,11 +93,9 @@ class SrcTextWin {
     # GDB Events
     method breakpoint {event}
     method tracepoint {event}
+    method set_variable {event}
   }
 
-  protected {
-    method handle_set_hook {var val}
-  }
   private {
     variable top       ;# toplevel window
     variable twin      ;# top text window of pane
index 78adec0..c8c4cdd 100644 (file)
@@ -8,8 +8,6 @@
 
 set auto_index(About) [list source [file join $dir about.tcl]]
 set auto_index(ActionDlg) [list source [file join $dir actiondlg.tcl]]
-set auto_index(gdbtk_tcl_breakpoint) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_tracepoint) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_tcl_set_variable) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_tcl_preloop) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_busy) [list source [file join $dir interface.tcl]]
@@ -31,6 +29,8 @@ set auto_index(gdbtk_tcl_fputs_target) [list source [file join $dir interface.tc
 set auto_index(gdbtk_tcl_flush) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_tcl_start_variable_annotation) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_tcl_end_variable_annotation) [list source [file join $dir interface.tcl]]
+set auto_index(gdbtk_tcl_breakpoint) [list source [file join $dir interface.tcl]]
+set auto_index(gdbtk_tcl_tracepoint) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_tcl_trace_find_hook) [list source [file join $dir interface.tcl]]
 set auto_index(gdb_run_readline_command) [list source [file join $dir interface.tcl]]
 set auto_index(gdbtk_tcl_readline_begin) [list source [file join $dir interface.tcl]]
@@ -331,7 +331,7 @@ set auto_index(::KodWin::clear) [list source [file join $dir kod.itb]]
 set auto_index(::KodWin::top) [list source [file join $dir kod.itb]]
 set auto_index(::KodWin::up) [list source [file join $dir kod.itb]]
 set auto_index(::KodWin::destructor) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::set_os) [list source [file join $dir kod.itb]]
+set auto_index(::KodWin::set_variable) [list source [file join $dir kod.itb]]
 set auto_index(::KodWin::reconfig) [list source [file join $dir kod.itb]]
 set auto_index(::KodWin::busy) [list source [file join $dir kod.itb]]
 set auto_index(::KodWin::idle) [list source [file join $dir kod.itb]]
@@ -409,7 +409,7 @@ set auto_index(::RegWin::constructor) [list source [file join $dir regwin.itb]]
 set auto_index(::RegWin::destructor) [list source [file join $dir regwin.itb]]
 set auto_index(::RegWin::build_win) [list source [file join $dir regwin.itb]]
 set auto_index(::RegWin::init_reg_display_vars) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::handle_set_hook) [list source [file join $dir regwin.itb]]
+set auto_index(::RegWin::set_variable) [list source [file join $dir regwin.itb]]
 set auto_index(::RegWin::disassembly_changed) [list source [file join $dir regwin.itb]]
 set auto_index(::RegWin::save_reg_display_vars) [list source [file join $dir regwin.itb]]
 set auto_index(::RegWin::reg_select_up) [list source [file join $dir regwin.itb]]
@@ -450,7 +450,7 @@ set auto_index(::SrcTextWin::setTabs) [list source [file join $dir srctextwin.it
 set auto_index(::SrcTextWin::enable_disable_src_tags) [list source [file join $dir srctextwin.itb]]
 set auto_index(::SrcTextWin::config_win) [list source [file join $dir srctextwin.itb]]
 set auto_index(::SrcTextWin::addPopup) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::handle_set_hook) [list source [file join $dir srctextwin.itb]]
+set auto_index(::SrcTextWin::set_variable) [list source [file join $dir srctextwin.itb]]
 set auto_index(::SrcTextWin::disassembly_changed) [list source [file join $dir srctextwin.itb]]
 set auto_index(::SrcTextWin::reconfig) [list source [file join $dir srctextwin.itb]]
 set auto_index(::SrcTextWin::updateBalloon) [list source [file join $dir srctextwin.itb]]