* 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/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
# 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
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]
}
# ------------------------------------------------------------------
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
-# 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
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}
}
}
# 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
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]
- }
}
# ------------------------------------------------------------------
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]
- }
}
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
}
-# 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
common NormalForeground {}
method init_reg_display_vars {args}
- method handle_set_hook {var val}
method disassembly_changed {}
method dimensions {}
method fixLength {s size where}
method idle {}
method reconfig {}
method busy {}
+
+ #
+ # Gdb Events
+ #
+ method set_variable {event}
}
# ----------------------------------------------------------------------
class SrcBar {
- inherit itk::Widget
+ inherit itk::Widget GDBEventHandler
# ------------------------------------------------------------------
# CONSTRUCTOR - create widget
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"
}
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
}
# ------------------------------------------------------------------
- # 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"} {
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"
}
if {$UseVariableBalloons} {
remove_hook gdb_idle_hook "$this updateBalloon"
}
- if {[get_disassembly_flavor] != ""} {
- remove_hook gdb_set_hook [code $this handle_set_hook]
- }
}
# ------------------------------------------------------------------
}
# ------------------------------------------------------------------
-# 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 {
# 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
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]]
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]]
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]]
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]]
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]]