+2002-10-15 Martin M. Hunt <hunt@redhat.com>
+
+ * library/* : auto_mkindex cannot rebuild
+ tclIndex because it does not recognize the namespace
+ import in main.tcl. To get it to work again, rename the
+ following:
+ body -> itcl::body
+ configbody -> itcl::configbody
+ class -> itcl::class
+
2002-10-10 Martin M. Hunt <hunt@redhat.com>
* generic/gdbtk-cmds.c (gdb_update_mem): No results
TCL := $(wildcard *.tcl *.itcl *.ith *.itb)
-TCLSH = tclsh8.3
+TCLSH = tclsh
tclIndex: $(TCL) Makefile
echo "package require Itcl; auto_mkindex `pwd` $(TCL)" | $(TCLSH)
# Implements About window
# ----------------------------------------------------------------------
-class About {
+itcl::class About {
inherit ManagedWin ModalDialog
constructor {args} {
global gdb_ImageDir
# GNU General Public License for more details.
-class ActionDlg {
+itcl::class ActionDlg {
inherit ManagedWin
# ------------------------------------------------------------------
# Copyright (C) 1999 Cygnus Solutions
#
-body AttachDlg::constructor {args} {
+itcl::body AttachDlg::constructor {args} {
window_name "Attach To Process"
build_win
}
-body AttachDlg::build_win {} {
+itcl::body AttachDlg::build_win {} {
# CHOOSE_PID: the list box with list or processes. Also an entry
# for typing in the PID by hand.
# METHOD: doit - This accepts the attach command.
# ------------------------------------------------------------------
-body AttachDlg::doit {} {
+itcl::body AttachDlg::doit {} {
set AttachDlg::last_button 1
set AttachDlg::last_pid [$itk_component(pid_entry) get]
set AttachDlg::symbol_file [$itk_component(symbol_file) get]
# METHOD: cancel - unpost the dialog box without attaching.
# ------------------------------------------------------------------
-body AttachDlg::cancel {} {
+itcl::body AttachDlg::cancel {} {
set AttachDlg::last_button 0
set AttachDlg::last_pid {}
unpost
# METHOD: choose_symbol_file - Query for a new symbol file.
# ------------------------------------------------------------------
-body AttachDlg::choose_symbol_file {} {
+itcl::body AttachDlg::choose_symbol_file {} {
set file [tk_getOpenFile -parent . -title "Load New Executable"]
if {$file != ""} {
$itk_component(symbol_file) configure -state normal
# point we should steal some C code to do it by hand.
# ------------------------------------------------------------------
-body AttachDlg::list_pids {{pattern *}} {
+itcl::body AttachDlg::list_pids {{pattern *}} {
global tcl_platform
switch $tcl_platform(os) {
# and insert the associated PID into the entry form.
# ------------------------------------------------------------------
-body AttachDlg::select_pid {} {
+itcl::body AttachDlg::select_pid {} {
set hit [$itk_component(choose_pid) curselection]
if {$hit != ""} {
$itk_component(pid_entry) clear
# METHOD: clear_pid_selection - Clear the current PID selection.
# ------------------------------------------------------------------
-body AttachDlg::clear_pid_selection {} {
+itcl::body AttachDlg::clear_pid_selection {} {
$itk_component(choose_pid) selection clear 0 end
$itk_component(pid_entry) selection range 0 end
}
# METHOD: filter_pid_selection - Filters the pid box.
# ------------------------------------------------------------------
-body AttachDlg::filter_pid_selection {} {
+itcl::body AttachDlg::filter_pid_selection {} {
list_pids [$itk_component(pid_filter) get]
}
# ----------------------------------------------------------------------
# Copyright (C) 1999 Cygnus Solutions
#
-class AttachDlg {
+itcl::class AttachDlg {
inherit ModalDialog ManagedWin
public {
# ------------------------------------------------------------------
# Block
# ------------------------------------------------------------------
-body Block::constructor {start end args} {
+itcl::body Block::constructor {start end args} {
# Record runtime info about this block
set _start $start
}
# Destroy ourself.
-body Block::destructor {} {
+itcl::body Block::destructor {} {
# Each block is responsible for destroying its
# variables and removing them from the list of
# Return a list of variables defined in this block
# This list is determined when we are created.
-body Block::variables {} {
+itcl::body Block::variables {} {
return $_variables
}
# Find the new variables for this block.
-body Block::_findVariables {} {
+itcl::body Block::_findVariables {} {
# Find the new variables for this block.
set variables [gdb_block_variables $_start $_end]
return $vars
}
-body Block::update {} {
+itcl::body Block::update {} {
set changed {}
foreach var $_variables {
return $changed
}
-body Block::info {} {
+itcl::body Block::info {} {
return [list $_start $_end]
}
# ------------------------------------------------------------------
# Frame
# ------------------------------------------------------------------
-body Frame::constructor {addr} {
+itcl::body Frame::constructor {addr} {
set _addr $addr
}
-body Frame::destructor {} {
+itcl::body Frame::destructor {} {
# destroy our own blocks
foreach block $_blocks {
_removeBlock $block
}
}
-body Frame::_removeBlock {blockObj} {
+itcl::body Frame::_removeBlock {blockObj} {
set i [lsearch $_blocks $blockObj]
if {$i != -1} {
}
}
-body Frame::_addBlock {block} {
+itcl::body Frame::_addBlock {block} {
set start [lindex $block 0]
set end [lindex $block 1]
return $b
}
-body Frame::_createBlocks {blocks} {
+itcl::body Frame::_createBlocks {blocks} {
foreach block $blocks {
set b [_addBlock $block]
}
}
-body Frame::update {} {
+itcl::body Frame::update {} {
set vars {}
foreach block $_blocks {
return $vars
}
-body Frame::variables {} {
+itcl::body Frame::variables {} {
set vars {}
foreach block $_blocks {
return $vars
}
-body Frame::new {} {
+itcl::body Frame::new {} {
# find any new variables. So get a list of all blocks,
# eliminate duplicates, and get those variables.
return $new
}
-body Frame::deleteOld {} {
+itcl::body Frame::deleteOld {} {
foreach block [_oldBlocks] {
_removeBlock $block
}
}
-body Frame::_oldBlocks {} {
+itcl::body Frame::_oldBlocks {} {
set blocks [gdb_get_blocks]
set oldObjs $_blocks
return $oldObjs
}
-body Frame::old {} {
+itcl::body Frame::old {} {
# All the variables in the blocks in old are now gone...
# We don't remove blocks here, since the frontend viewer
return $vars
}
-body Frame::_findBlock {block} {
+itcl::body Frame::_findBlock {block} {
foreach b $_blocks {
set info [$b info]
return ""
}
-body Frame::_findBlockIndex {block} {
+itcl::body Frame::_findBlockIndex {block} {
set i 0
foreach b $_blocks {
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-class Block {
+itcl::class Block {
public {
method constructor {start end args}
}
}
-class Frame {
+itcl::class Frame {
public {
method constructor {addr}
# ------------------------------------------------------------------
# CONSTRUCTOR: create the main breakpoint window
# ------------------------------------------------------------------
-body BpWin::constructor {args} {
+itcl::body BpWin::constructor {args} {
window_name "Breakpoints" "BPs"
if {[pref getd gdb/bp/menu] != ""} {
# ------------------------------------------------------------------
# DESTRUCTOR: destroy the breakpoint window
# ------------------------------------------------------------------
-body BpWin::destructor {} {}
+itcl::body BpWin::destructor {} {}
# ------------------------------------------------------------------
# METHOD: build_win - build the main breakpoint window
# ------------------------------------------------------------------
-body BpWin::build_win {} {
+itcl::body BpWin::build_win {} {
global _bp_en _bp_disp tcl_platform
set bg1 $::Colors(bg)
# ------------------------------------------------------------------
# METHOD: bp_add - add a breakpoint entry
# ------------------------------------------------------------------
-body BpWin::bp_add {bp_event {tracepoint 0}} {
+itcl::body BpWin::bp_add {bp_event {tracepoint 0}} {
global _bp_en _bp_disp tcl_platform _files
set number [$bp_event get number]
# METHOD: bp_store - stores away the breakpoints in a file of gdb
# commands
# ------------------------------------------------------------------
-body BpWin::bp_store {} {
+itcl::body BpWin::bp_store {} {
set out_file [tk_getSaveFile]
if {$out_file == ""} {
return
# METHOD: bp_restore - restore the breakpoints from a file of gdb
# commands
# ------------------------------------------------------------------
-body BpWin::bp_restore {} {
+itcl::body BpWin::bp_restore {} {
set inH [tk_getOpenFile]
if {$inH == ""} {
return
# ------------------------------------------------------------------
# METHOD: bp_select - select a row in the grid
# ------------------------------------------------------------------
-body BpWin::bp_select { r } {
+itcl::body BpWin::bp_select { r } {
global _bp_en _bp_disp
set zz [list addr file func line]
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body BpWin::_select_and_popup {bp X Y} {
+itcl::body BpWin::_select_and_popup {bp X Y} {
if {$selected != $bp} {
bp_select $bp
}
# ------------------------------------------------------------------
# METHOD: bp_modify - modify a breakpoint entry
# ------------------------------------------------------------------
-body BpWin::bp_modify {bp_event {tracepoint 0}} {
+itcl::body BpWin::bp_modify {bp_event {tracepoint 0}} {
global _bp_en _bp_disp tcl_platform _files
set number [$bp_event get number]
# ------------------------------------------------------------------
# METHOD: bp_able - enable/disable a breakpoint
# ------------------------------------------------------------------
-body BpWin::bp_able { i } {
+itcl::body BpWin::bp_able { i } {
global _bp_en
bp_select $i
# ------------------------------------------------------------------
# METHOD: bp_remove - remove a breakpoint
# ------------------------------------------------------------------
-body BpWin::bp_remove { i } {
+itcl::body BpWin::bp_remove { i } {
bp_select $i
# ------------------------------------------------------------------
# METHOD: bp_type - change the breakpoint type (disposition)
# ------------------------------------------------------------------
-body BpWin::bp_type { i } {
+itcl::body BpWin::bp_type { i } {
if {$Index_to_bptype($i) != "breakpoint"} {
return
# ------------------------------------------------------------------
# METHOD: bp_delete - delete a breakpoint
# ------------------------------------------------------------------
-body BpWin::bp_delete {bp_event} {
+itcl::body BpWin::bp_delete {bp_event} {
set number [$bp_event get number]
for {set i 1} {$i < $next_row} {incr i} {
if { $number == $index_to_bpnum($i) } {
# PUBLIC METHOD: breakpoint - Update widget when a breakpoint
# event is received from the backend.
# ------------------------------------------------------------------
-body BpWin::breakpoint {bp_event} {
+itcl::body BpWin::breakpoint {bp_event} {
set action [$bp_event get action]
#debug "bp update $action [$bp_event get number] [$bp_event get type]"
# METHOD: tracepoint - Update widget when a tracepoint event
# is received from the backend.
# ------------------------------------------------------------------
-body BpWin::tracepoint {tp_event} {
+itcl::body BpWin::tracepoint {tp_event} {
set action [$tp_event get action]
#debug "tp update $action [$tp_event get number]"
# ------------------------------------------------------------------
# METHOD: bp_all - perform a command on all breakpoints
# ------------------------------------------------------------------
-body BpWin::bp_all { command } {
+itcl::body BpWin::bp_all { command } {
if {!$tracepoints} {
# Do all breakpoints
# METHOD: get_actions - pops up the add trace dialog on a selected
# tracepoint
# ------------------------------------------------------------------
-body BpWin::get_actions {bpnum} {
+itcl::body BpWin::get_actions {bpnum} {
set bpnum $index_to_bpnum($bpnum)
set bpinfo [gdb_get_tracepoint_info $bpnum]
lassign $bpinfo file func line pc enabled pass_count \
# ------------------------------------------------------------------
# METHOD: toggle_threads - callback when show_threads is toggled
# ------------------------------------------------------------------
-body BpWin::toggle_threads {} {
+itcl::body BpWin::toggle_threads {} {
set show_threads [pref get gdb/bp/show_threads]
reconfig
}
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body BpWin::reconfig {} {
+itcl::body BpWin::reconfig {} {
if {[winfo exists $itk_interior.f]} { destroy $itk_interior.f }
if {[winfo exists $itk_interior.m]} { destroy $itk_interior.m }
if {[winfo exists $itk_interior.sbox]} { destroy $itk_interior.sbox }
# ------------------------------------------------------------------
# METHOD: goto_bp - show bp in source window
# ------------------------------------------------------------------
-body BpWin::goto_bp {r} {
+itcl::body BpWin::goto_bp {r} {
set bpnum $index_to_bpnum($r)
if {$tracepoints} {
set bpinfo [gdb_get_tracepoint_info $bpnum]
# GNU General Public License for more details.
-class BpWin {
+itcl::class BpWin {
inherit EmbeddedWin GDBWin
public {
option add *BrowserWin.textBackground white
-body BrowserWin::constructor {args} {
+itcl::body BrowserWin::constructor {args} {
#eval itk_initialize $args
window_name "Function Browser"
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
-body BrowserWin::destructor {} {
+itcl::body BrowserWin::destructor {} {
if {$resize_after != ""} {
after cancel $resize_after
# ------------------------------------------------------------------
# METHOD: _build_win - build the main browser window
# ------------------------------------------------------------------
-body BrowserWin::_build_win {} {
+itcl::body BrowserWin::_build_win {} {
global PREFS_state gdb_ImageDir
# Three frames: regexp, listboxes, and drop-down pane
# box. The actual filtering is done in an after to avoid
# flashing too much if the user is typing quickly.
# ------------------------------------------------------------------
-body BrowserWin::_filter_trace_proc {v1 v2 mode} {
+itcl::body BrowserWin::_filter_trace_proc {v1 v2 mode} {
if {$filter_trace_after != ""} {
after cancel $filter_trace_after
}
# METHOD: _filter_trace_after
# This is a wrapper around search, needed to pass to trace
# ------------------------------------------------------------------
-body BrowserWin::_filter_trace_after {} {
+itcl::body BrowserWin::_filter_trace_after {} {
set filter_trace_after ""
search
}
# Search for text or jump to a specific line
# in source window, going in the specified DIRECTION.
# ------------------------------------------------------------------
-body BrowserWin::_search_src {direction} {
+itcl::body BrowserWin::_search_src {direction} {
set exp [$itk_component(view_search) get]
$itk_component(view_src) search $exp $direction
}
# Search for functions matching regexp/pattern
# in specified files
# ------------------------------------------------------------------
-body BrowserWin::search {} {
+itcl::body BrowserWin::search {} {
set files [$itk_component(file_box) getcurselection]
# METHOD: _toggle_more
# Toggle display of source listing
# ------------------------------------------------------------------
-body BrowserWin::_toggle_more {{in_constructor 0}} {
+itcl::body BrowserWin::_toggle_more {{in_constructor 0}} {
debug "Running toggle_more with MoreVisible: $MoreVisible"
# Temporarily disable the resize bindings before opening the window.
# METHOD: _bind_toplevel
# Setup the bindings for the toplevel.
# ------------------------------------------------------------------
-body BrowserWin::_bind_toplevel {install} {
+itcl::body BrowserWin::_bind_toplevel {install} {
set bindings [bindtags $_top]
if {$install} {
# METHOD: _do_resize
# Does the actual work of the resize.
# ------------------------------------------------------------------
-body BrowserWin::_do_resize {} {
+itcl::body BrowserWin::_do_resize {} {
update idletasks
debug "Running _do_resize"
# METHOD: _resize
# Resize "itk_component(view_hidden)" after all configure events
# ------------------------------------------------------------------
-body BrowserWin::_resize {} {
+itcl::body BrowserWin::_resize {} {
pack propagate $_top 0
# This fills the func combo, and the more window if it
# is currently open with the hit in the File combobox.
# ------------------------------------------------------------------
-body BrowserWin::_process_file_selection {y} {
+itcl::body BrowserWin::_process_file_selection {y} {
set curIndex [$itk_component(file_box) nearest $y]
set curSelection [$itk_component(file_box) curselection]
# This points the more window to the hit in the Func combobox
# if it is currently open.
# ------------------------------------------------------------------
-body BrowserWin::_process_func_selection {y} {
+itcl::body BrowserWin::_process_func_selection {y} {
set curIndex [$itk_component(func_box) nearest $y]
set curSelection [$itk_component(func_box) curselection]
# METHOD: do_all_bp
# Toggle a bp at every selected function in FuncLB
# ------------------------------------------------------------------
-body BrowserWin::do_all_bp {onp} {
+itcl::body BrowserWin::do_all_bp {onp} {
set funcs [$itk_component(func_box) getcurselection]
_freeze_me
# Toggle bp at function specified by the given Y
# coordinate in the listbox
# ------------------------------------------------------------------
-body BrowserWin::_toggle_bp {y} {
+itcl::body BrowserWin::_toggle_bp {y} {
set f [$itk_component(func_box) get [$itk_component(func_box) nearest $y]]
if {$f != ""} {
# METHOD: _select
# (Un/Highlight all files in the files list
# ------------------------------------------------------------------
-body BrowserWin::_select {highlight} {
+itcl::body BrowserWin::_select {highlight} {
if {$highlight} {
$itk_component(file_box) selection set 0 end
} else {
# METHOD: _set_filter_mode
# React to changes in the filter mode
# ------------------------------------------------------------------
-body BrowserWin::_set_filter_mode {w mode} {
+itcl::body BrowserWin::_set_filter_mode {w mode} {
if {[string compare $mode $cur_filter_mode] != 0} {
set cur_filter_mode $mode
pref set gdb/search/filter_mode $mode
# METHOD: _file_hide_h
# Run when the "Hide .h files" preference is chosen.
# ------------------------------------------------------------------
-body BrowserWin::_file_hide_h {} {
+itcl::body BrowserWin::_file_hide_h {} {
_fill_file_box
search
# Helper function to fill the srctextwin
# when needed.
# ------------------------------------------------------------------
-body BrowserWin::_fill_source {f {funcp 1} {filename ""}} {
+itcl::body BrowserWin::_fill_source {f {funcp 1} {filename ""}} {
if {!$MoreVisible } {
return
# Function called by srctextwin when the display
# mode changes
# ------------------------------------------------------------------
-body BrowserWin::mode {w {mode ""} {go 1}} {
+itcl::body BrowserWin::mode {w {mode ""} {go 1}} {
if {$mode != ""} {
$itk_component(view_src) mode_set $mode $go
$itk_component(view_mode) entryset $mode
# Callback for the function combo box which
# sets the srctextwin looking at the given function (VAL)
# ------------------------------------------------------------------
-body BrowserWin::_goto_func {w {val ""}} {
+itcl::body BrowserWin::_goto_func {w {val ""}} {
if {$val != ""} {
set mang 0
if {[info exists _mangled_func($val)]} {
# METHOD: _fill_file_box
# This private method fills the file listbox
# ------------------------------------------------------------------
-body BrowserWin::_fill_file_box {} {
+itcl::body BrowserWin::_fill_file_box {} {
# It would be cool if gdb_listfiles took a regexp to match,
# but it doesn't...
# This private method fills the functions combo box
# with all the functions in NAME.
# ------------------------------------------------------------------
-body BrowserWin::_fill_funcs_combo {name} {
+itcl::body BrowserWin::_fill_funcs_combo {name} {
$itk_component(view_func) list delete 0 end
if {$name != ""} {
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-class BrowserWin {
+itcl::class BrowserWin {
inherit EmbeddedWin
public {
# GNU General Public License for more details.
-body Console::constructor {args} {
+itcl::body Console::constructor {args} {
global gdbtk_state
window_name "Console Window"
set gdbtk_state(console) $this
}
-body Console::destructor {} {
+itcl::body Console::destructor {} {
global gdbtk_state
set gdbtk_state(console) ""
remove_hook gdb_no_inferior_hook [list $this idle dummy]
}
-body Console::_build_win {} {
+itcl::body Console::_build_win {} {
iwidgets::scrolledtext $itk_interior.stext \
-vscrollmode dynamic -textbackground white
}
-body Console::idle {event} {
+itcl::body Console::idle {event} {
set _running 0
$_top configure -cursor {}
}
# ------------------------------------------------------------------
# METHOD: busy - busy event handler
# ------------------------------------------------------------------
-body Console::busy {event} {
+itcl::body Console::busy {event} {
set _running 1
$_top configure -cursor watch
}
# ------------------------------------------------------------------
# METHOD: insert - insert new text in the text widget
# ------------------------------------------------------------------
-body Console::insert {line {tag ""}} {
+itcl::body Console::insert {line {tag ""}} {
if {$_needNL} {
$_twin insert {insert linestart} "\n"
}
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body Console::_operate_and_get_next {} {
+itcl::body Console::_operate_and_get_next {} {
if {$_histElement >= 0} {
# _pendingHistElement will be used after the new history element
# is pushed. So we must increment it.
#-------------------------------------------------------------------
# METHOD: _previous - recall the previous command
# ------------------------------------------------------------------
-body Console::_previous {} {
+itcl::body Console::_previous {} {
if {$_histElement == -1} {
# Save partial command.
set _partialCommand [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
#-------------------------------------------------------------------
# METHOD: _search_history - search history for match
# ------------------------------------------------------------------
-body Console::_search_history {} {
+itcl::body Console::_search_history {} {
set str [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
if {$_histElement == -1} {
#-------------------------------------------------------------------
# METHOD: _rsearch_history - search history in reverse for match
# ------------------------------------------------------------------
-body Console::_rsearch_history {} {
+itcl::body Console::_rsearch_history {} {
if {$_histElement != -1} {
set str $_partialCommand
set num [expr $_histElement - 1]
#-------------------------------------------------------------------
# METHOD: _next - recall the next command (scroll forward)
# ------------------------------------------------------------------
-body Console::_next {} {
+itcl::body Console::_next {} {
if {$_histElement == -1} {
# FIXME flash window.
return
#-------------------------------------------------------------------
# METHOD: _last - get the last history element
# ------------------------------------------------------------------
-body Console::_last {} {
+itcl::body Console::_last {} {
set _histElement 0
_next
}
#-------------------------------------------------------------------
# METHOD: _first - get the first (earliest) history element
# ------------------------------------------------------------------
-body Console::_first {} {
+itcl::body Console::_first {} {
set _histElement [expr {[llength $_history] - 1}]
_previous
}
#-------------------------------------------------------------------
# METHOD: _setprompt - put a prompt at the beginning of a line
# ------------------------------------------------------------------
-body Console::_setprompt {{prompt {}}} {
+itcl::body Console::_setprompt {{prompt {}}} {
if {$_invoking} {
set prompt ""
} elseif {"$prompt" != ""} {
#-------------------------------------------------------------------
# METHOD: activate - run this after a command is run
# ------------------------------------------------------------------
-body Console::activate {{prompt {}}} {
+itcl::body Console::activate {{prompt {}}} {
if {$_invoking > 0} {
incr _invoking -1
_setprompt $prompt
#-------------------------------------------------------------------
# METHOD: invoke - invoke a command
# ------------------------------------------------------------------
-body Console::invoke {} {
+itcl::body Console::invoke {} {
global gdbtk_state
set text [$_twin get {cmdmark + 1 char} end ]
#-------------------------------------------------------------------
# PRIVATE METHOD: _delete - Handle a Delete of some sort.
# ------------------------------------------------------------------
-body Console::_delete {{right 0}} {
+itcl::body Console::_delete {{right 0}} {
# If we are deleting to the right, and we have this turned off,
# delete to the right.
#-------------------------------------------------------------------
# PRIVATE METHOD: _insertion - Set or get saved insertion point
# ------------------------------------------------------------------
-body Console::_insertion {args} {
+itcl::body Console::_insertion {args} {
if {! [llength $args]} {
return $_saved_insertion
} else {
# ------------------------------------------------------------------
# METHOD: _paste - paste the selection into the console window
# ------------------------------------------------------------------
-body Console::_paste {{check_primary 1}} {
+itcl::body Console::_paste {{check_primary 1}} {
set sel {}
if {!$check_primary || [catch {selection get} sel] || $sel == ""} {
# METHOD: _find_lcp - Return the longest common prefix in SLIST.
# Can be empty string.
# ------------------------------------------------------------------
-body Console::_find_lcp {slist} {
+itcl::body Console::_find_lcp {slist} {
# Handle trivial cases where list is empty or length 1
if {[llength $slist] <= 1} {return [lindex $slist 0]}
# METHOD: _find_completion - Look through COMPLETIONS to generate
# the suffix needed to do command
# ------------------------------------------------------------------
-body Console::_find_completion {cmd completions} {
+itcl::body Console::_find_completion {cmd completions} {
# Get longest common prefix
set lcp [_find_lcp $completions]
set cmd_len [string length $cmd]
# ------------------------------------------------------------------
# METHOD: _complete - Command line completion
# ------------------------------------------------------------------
-body Console::_complete {} {
+itcl::body Console::_complete {} {
set command_line [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
set choices [gdb_cmd "complete $command_line" 1]
# METHOD: _reset_tab - Helper method for tab completion. Used
# to reset the tab when a key is pressed.
# ------------------------------------------------------------------
-body Console::_reset_tab {} {
+itcl::body Console::_reset_tab {} {
bind $_twin <KeyPress> {}
set _saw_tab 0
}
# ------------------------------------------------------------------
# METHOD: _set_wrap - Set wrap mode
# ------------------------------------------------------------------
-body Console::_set_wrap {wrap} {
+itcl::body Console::_set_wrap {wrap} {
if { $wrap } {
set hsm none
set wv char
# ------------------------------------------------------------------
# METHOD: _update_option - Update in response to preference change
# ------------------------------------------------------------------
-body Console::_update_option {name value} {
+itcl::body Console::_update_option {name value} {
switch -- $name {
gdb/console/wrap {
_set_wrap $value
# NOTES: This will only run if env(GDBTK_TEST_RUNNING)==1.
# FOR TESTING ONLY
# ------------------------------------------------------------------
-body Console::test {args} {
+itcl::body Console::test {args} {
global env
if {[info exists env(GDBTK_TEST_RUNNING)] && $env(GDBTK_TEST_RUNNING) == 1} {
# blocks.
# ----------------------------------------------------------------------
-class Console {
+itcl::class Console {
inherit EmbeddedWin GDBEventHandler
public {
# ------------------------------------------------------------------
# Stack
# ------------------------------------------------------------------
-body Stack::constructor {} {
+itcl::body Stack::constructor {} {
set _stack {}
}
-body Stack::push {args} {
+itcl::body Stack::push {args} {
set _stack [concat $_stack $args]
}
-body Stack::destructor {} {
+itcl::body Stack::destructor {} {
}
-body Stack::pop {} {
+itcl::body Stack::pop {} {
set thing [lindex $_stack end]
set _stack [lreplace $_stack end end]
return $thing
# ------------------------------------------------------------------
# Queue
# ------------------------------------------------------------------
-body Queue::constructor {} {
+itcl::body Queue::constructor {} {
}
-body Queue::destructor {} {
+itcl::body Queue::destructor {} {
}
-body Queue::pop {} {
+itcl::body Queue::pop {} {
set thing [lindex $_stack 0]
set _stack [lreplace $_stack 0 0]
return $thing
# GNU General Public License for more details.
# Generic Stack
-class Stack {
+itcl::class Stack {
public {
method constructor {}
}
# Generic Queue
-class Queue {
+itcl::class Queue {
inherit Stack
public {
#
# ARGS: None are used yet.
# -----------------------------------------------------------------------------
-body DebugWin::constructor {args} {
+itcl::body DebugWin::constructor {args} {
debug $args
window_name "Insight Debug" "Debug"
#
# ARGS: None
# -----------------------------------------------------------------------------
-body DebugWin::destructor {} {
+itcl::body DebugWin::destructor {} {
# notify debug code that window is going away
::debug::debugwin ""
}
# file, if it exists. Notifies the debug functions in ::debug
# to send output here.
# -----------------------------------------------------------------------------
-body DebugWin::build_win {} {
+itcl::body DebugWin::build_win {} {
global gdb_ImageDir GDBTK_LIBRARY
set top [winfo toplevel $itk_interior]
# func - function name of caller
# msg - message to display
# -----------------------------------------------------------------------------
-body DebugWin::puts {level cls func msg} {
+itcl::body DebugWin::puts {level cls func msg} {
# filter. check if we should display this message
# for now we always let high-level messages through
if {$level == "I"} {
# func - function name
# ar - function arguments
# -----------------------------------------------------------------------------
-body DebugWin::put_trace {enter level func ar} {
+itcl::body DebugWin::put_trace {enter level func ar} {
set x [expr {$level * 2 - 2}]
if {$enter} {
$_t insert end "[string range $_bigstr 0 $x]$func " trace "$ar\n" args
# DESC: Reads the contents of the debug log file, if it exists, into
# the DebugWin.
# -----------------------------------------------------------------------------
-body DebugWin::loadlog {} {
+itcl::body DebugWin::loadlog {} {
$_t delete 0.0 end
# Now load in log file, if possible.
# this is rather rude, using the logfile variable in the debug namespace
#
# DESC: Re-sources all the .itb files.
# -----------------------------------------------------------------------------
-body DebugWin::_source_all {} {
+itcl::body DebugWin::_source_all {} {
foreach f [glob [file join $::GDBTK_LIBRARY *.itb]] {
source $f
}
#
# DESC: Clears out the content of the debug window.
# -----------------------------------------------------------------------------
-body DebugWin::_clear {} {
+itcl::body DebugWin::_clear {} {
$_t delete 1.0 end
}
#
# DESC: Changes the background of the current contents of the window.
# -----------------------------------------------------------------------------
-body DebugWin::_mark_old {} {
+itcl::body DebugWin::_mark_old {} {
$_t tag add marked 1.0 "end - 1c"
}
#
# DESC: Changes the background of the current contents of the window.
# -----------------------------------------------------------------------------
-body DebugWin::_save_contents {} {
+itcl::body DebugWin::_save_contents {} {
set file [tk_getSaveFile -title "Choose debug window dump file" \
-parent [winfo toplevel $itk_interior]]
if {$file == ""} {
#
# DESC: Creates the Debug Window Options Dialog.
# -----------------------------------------------------------------------------
-body DebugWinDOpts::constructor {args} {
+itcl::body DebugWinDOpts::constructor {args} {
window_name "Debug Window Options"
build_win
eval itk_initialize $args
#
# DESC: Destroys the Debug Window Options Dialog.
# -----------------------------------------------------------------------------
-body DebugWinDOpts::destructor {} {
+itcl::body DebugWinDOpts::destructor {} {
}
# user to select which information is displayed in the debug
# window and (eventually) how it looks.
# -----------------------------------------------------------------------------
-body DebugWinDOpts::build_win {} {
+itcl::body DebugWinDOpts::build_win {} {
wm title [winfo toplevel $itk_interior] "Debug Display Options"
# initialize here so we can resource this file and update the list
set _classes {DebugWin RegWin SrcBar SrcWin ToolBar WatchWin EmbeddedWin \
# DESC: Callback for selecting ALL classes. If the user selects ALL,
# deselect all the individual class checkbuttons.
# -----------------------------------------------------------------------------
-body DebugWinDOpts::_all {} {
+itcl::body DebugWinDOpts::_all {} {
switch $::gdbtk_de(filter_var) {
ALL {
set ::gdbtk_de(ALL) 1
# log file through the new filter into the debug window. The
# button is disabled if there is no log file.
# -----------------------------------------------------------------------------
-body DebugWinDOpts::_apply { done } {
+itcl::body DebugWinDOpts::_apply { done } {
set dw [ManagedWin::find DebugWin]
debug $dw
if {$dw != ""} {
# This window is for developers.
#
# -----------------------------------------------------------------------------
-class DebugWin {
+itcl::class DebugWin {
inherit ManagedWin
private {
# This window is for developers.
#
# -----------------------------------------------------------------------------
-class DebugWinDOpts {
+itcl::class DebugWinDOpts {
inherit ManagedWin
public {
#
# ----------------------------------------------------------------------
-body Download::constructor {args} {
+itcl::body Download::constructor {args} {
global gdb_pretty_name
debug $args
eval itk_initialize $args
# ------------------------------------------------------------------
# METHOD: update_download - update the download meters
# ------------------------------------------------------------------
-body Download::update_download { sec num tot } {
+itcl::body Download::update_download { sec num tot } {
# Loop through all the sections, marking each as either done or
# updating its meter. This will mark all previous sections prior to
# ------------------------------------------------------------------
# METHOD: done - notification that the download is really complete
# ------------------------------------------------------------------
-body Download::done { {msg ""} } {
+itcl::body Download::done { {msg ""} } {
bell
if {$msg == ""} {
# ------------------------------------------------------------------
# METHOD: cancel - cancel the download
# ------------------------------------------------------------------
-body Download::cancel {} {
+itcl::body Download::cancel {} {
debug "canceling the download"
set ::download_cancel_ok 1
}
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
-body Download::destructor {} {
+itcl::body Download::destructor {} {
remove_hook download_progress_hook "$this update_download"
}
-body Download::do_download_hooks {} {
+itcl::body Download::do_download_hooks {} {
set ::download_timer(ok) 1
}
-body Download::download_hash { section num } {
+itcl::body Download::download_hash { section num } {
global download_timer
debug "sec=$section num=$num tot=$total_bytes ok=$::download_cancel_ok"
::update
}
# Download the executable. Return zero for success, and non-zero for error.
-body Download::download_it { } {
+itcl::body Download::download_it { } {
global gdb_exe_name gdb_downloading gdb_loaded
global gdb_target_name gdb_pretty_name
global gdb_running
# GNU General Public License for more details.
-class Download {
+itcl::class Download {
inherit ManagedWin
protected {
# method to call is stored in the event's
# "handler" method.
# ------------------------------------------------------------
-body GDBEventHandler::dispatch {event} {
+itcl::body GDBEventHandler::dispatch {event} {
set handler [$event handler]
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-class GDBEventHandler {
+itcl::class GDBEventHandler {
constructor {args} {}
destructor {}
# GNU General Public License for more details.
-class EmbeddedWin {
+itcl::class EmbeddedWin {
inherit ManagedWin
constructor {args} {
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
-body BreakpointEvent::get {what} {
+itcl::body BreakpointEvent::get {what} {
switch $what {
action { return $action }
# ------------------------------------------------------------
# PRIVATE METHOD: _init - Initialize all private data
# ------------------------------------------------------------
-body BreakpointEvent::_init {} {
+itcl::body BreakpointEvent::_init {} {
if {[catch {gdb_get_breakpoint_info $number} bpinfo]} {
set _file {}
set _function {}
# When the breakpoint number for the event changes,
# update the private data in the event.
-configbody BreakpointEvent::number {
+itcl::configbody BreakpointEvent::number {
_init
}
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
-body TracepointEvent::get {what} {
+itcl::body TracepointEvent::get {what} {
switch $what {
action { return $action }
# ------------------------------------------------------------
# PRIVATE METHOD: _init - Initialize all private data
# ------------------------------------------------------------
-body TracepointEvent::_init {} {
+itcl::body TracepointEvent::_init {} {
if {[catch {gdb_get_tracepoint_info $number} tpinfo]} {
set _file {}
set _function {}
# When the tracepoint number for the event changes,
# update the private data in the event.
-configbody TracepointEvent::number {
+itcl::configbody TracepointEvent::number {
_init
}
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
-body TracepointEvent::get {what} {
+itcl::body TracepointEvent::get {what} {
switch $what {
action { return $action }
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
-body SetVariableEvent::get {what} {
+itcl::body SetVariableEvent::get {what} {
switch $what {
variable { return $variable }
# ------------------------------------------------------------
# CONSTRUCTOR: Create an UpdateEvent
# ------------------------------------------------------------
-body UpdateEvent::constructor {args} {
+itcl::body UpdateEvent::constructor {args} {
if {[catch {gdb_loc} loc]} {
dbug E "could not get current location: $loc"
} else {
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
-body UpdateEvent::get {what} {
+itcl::body UpdateEvent::get {what} {
switch $what {
compile_filename { return $_compile_filename }
# will call the (empty) constructor in here instead of the one
# defined in the implementation file. Sigh.
-class GDBEvent {
+itcl::class GDBEvent {
public method get {what} { return "" }
public method handler {} { return "unknown" }
}
# hit_count .... number of times BP has been hit
# user_specification
# .. text the user initially used to set this breakpoint
-class BreakpointEvent {
+itcl::class BreakpointEvent {
inherit GDBEvent
public variable action {}
# thread ....... thread in which BP is set (or -1 for all threads)
# hit_count .... number of times BP has been hit
# actions ...... a list of actions to be performed when the tracepoint is hit
-class TracepointEvent {
+itcl::class TracepointEvent {
inherit GDBEvent
public variable action {}
#
# variable ..... the variable that was changed
# value ........ the variable's new value
-class SetVariableEvent {
+itcl::class SetVariableEvent {
inherit GDBEvent
public variable variable
# This could happen when the inferior is executing or when the GUI
# is, for example, fetching memory from the target.
-class BusyEvent {
+itcl::class BusyEvent {
inherit GDBEvent
public method handler {} { return "busy" }
# "busy". Receipt of this event means that the GUI should be put into
# a state to accept input by the user.
-class IdleEvent {
+itcl::class IdleEvent {
inherit GDBEvent
public method handler {} { return "idle" }
#
# FIXME: Should probably put frame_pc and pc into different
# types of update events...
-class UpdateEvent {
+itcl::class UpdateEvent {
inherit GDBEvent
constructor {args} {}
#
# This event is posted whenever the target architecture changes
-class ArchChangedEvent {
+itcl::class ArchChangedEvent {
inherit GDBEvent
public method handler {} { return "arch_changed" }
#
# ----------------------------------------------------------------------
-class GDBMenuBar {
+itcl::class GDBMenuBar {
inherit itk::Widget
# ------------------------------------------------------------------
#
# ----------------------------------------------------------------------
-class GDBToolBar {
+itcl::class GDBToolBar {
inherit itk::Widget
# ------------------------------------------------------------------
# GNU General Public License for more details.
-class GDBWin {
+itcl::class GDBWin {
inherit GDBEventHandler
constructor {args} {
# ------------------------------------------------------------------
# METHOD: _init - set up the tracing labels info
# ------------------------------------------------------------------
-body GlobalPref::_init {} {
+itcl::body GlobalPref::_init {} {
if {$inited} {
return
}
# ------------------------------------------------------------------
# METHOD: init_var - initialize preference variables
# ------------------------------------------------------------------
-body GlobalPref::_init_var {} {
+itcl::body GlobalPref::_init_var {} {
set vlist {gdb/ImageDir gdb/console/wrap gdb/mode
gdb/help/browser gdb/use_icons}
# ------------------------------------------------------------------
# METHOD: constructor - create the Global Preferences object
# ------------------------------------------------------------------
-body GlobalPref::constructor {args} {
+itcl::body GlobalPref::constructor {args} {
window_name "Global Preferences"
_init
_init_var
# ------------------------------------------------------------------
# METHOD: destructor - destroy the Global Preferences object
# ------------------------------------------------------------------
-body GlobalPref::destructor {} {
+itcl::body GlobalPref::destructor {} {
foreach thunk $_fonts {
font delete test-$thunk-font
}
# ------------------------------------------------------------------
# METHOD: _build_win - build the dialog
# ------------------------------------------------------------------
-body GlobalPref::_build_win {} {
+itcl::body GlobalPref::_build_win {} {
global tcl_platform GDBTK_LIBRARY
debug
frame $itk_interior.f
# ------------------------------------------------------------------
# PRIVATE METHOD: _make_font_item
# ------------------------------------------------------------------
-body GlobalPref::_make_font_item {f name label font_list} {
+itcl::body GlobalPref::_make_font_item {f name label font_list} {
# create ComboBox with font name
lappend _fonts $name
# ------------------------------------------------------------------
# PRIVATE METHOD: _resize_font_item_height
# ------------------------------------------------------------------
-body GlobalPref::_resize_font_item_height {} {
+itcl::body GlobalPref::_resize_font_item_height {} {
foreach font $_fonts {
set master [$itk_interior.f.d get_frame]
set row [gridCGet $master.${font}l -row]
# ------------------------------------------------------------------
# PRIVATE METHOD: _change_icons
# ------------------------------------------------------------------
-body GlobalPref::_change_icons {w args} {
+itcl::body GlobalPref::_change_icons {w args} {
debug
set index [$w list curselection]
if {$index != ""} {
# NOTES: The combobox has a really non-standard callback
# mechanism: it always adds two args to the callback.
# ------------------------------------------------------------------
-body GlobalPref::_change_font {font stupid implementation} {
+itcl::body GlobalPref::_change_font {font stupid implementation} {
font configure test-$font-font -family $implementation
}
#
# NOTES: See comments for purpose of "direction". Sigh.
# ------------------------------------------------------------------
-body GlobalPref::_change_size {direction font} {
+itcl::body GlobalPref::_change_size {direction font} {
# Almost as stupid as the comobox, the iwidgets::spinint class
# will not treat its -increment and -decrement commands
}
-body GlobalPref::_toggle_tracing {win} {
+itcl::body GlobalPref::_toggle_tracing {win} {
debug
$win configure -text $tracing_labels($_new(gdb/mode))
}
# ------------------------------------------------------------------
# METHOD: _ok - called to accept settings and close dialog
# ------------------------------------------------------------------
-body GlobalPref::_ok {} {
+itcl::body GlobalPref::_ok {} {
_apply 1
}
# ------------------------------------------------------------------
# METHOD: _apply - apply current settings to the screen
# ------------------------------------------------------------------
-body GlobalPref::_apply {{deleteMe 0}} {
+itcl::body GlobalPref::_apply {{deleteMe 0}} {
debug
set changed_something 0
# METHOD: _cancel - forget current settings -- reset to original
# state and close preferences
# ------------------------------------------------------------------
-body GlobalPref::_cancel {} {
+itcl::body GlobalPref::_cancel {} {
debug
set changed_something 0
# The cancel method is actually called when
# the window is closed. Name needs fixed.
# ------------------------------------------------------------------
-body GlobalPref::cancel {} {
+itcl::body GlobalPref::cancel {} {
# when the window is closed, we want the preferences selected to
# be applied.
_apply 1
# GNU General Public License for more details.
-class GlobalPref {
+itcl::class GlobalPref {
inherit ManagedWin ModalDialog
private {
# DESC:
# Creates the Help Viewer window.
# -----------------------------------------------------------------------------
-body HtmlViewer::constructor {args} {
+itcl::body HtmlViewer::constructor {args} {
window_name "Help"
eval itk_initialize $args
_buildwin
# Finally it loads help/index.html. This last step should change if
# this widget is ever used for anything but help.
# -----------------------------------------------------------------------------
-body HtmlViewer::_buildwin {} {
+itcl::body HtmlViewer::_buildwin {} {
global GDBTK_LIBRARY gdb_ImageDir
set _links [PageStack \#auto]
# SYNOPSIS: push val
# DESC: Pushes a value onto the stack.
# -----------------------------------------------------------------------------
-body PageStack::push {val} {
+itcl::body PageStack::push {val} {
incr _ptr
incr _max
if {$_ptr < $_max} {
# DESC: Moves the stack pointer back by one.
# RETURNS: Returns the value on the stack, or 0 on error.
# -----------------------------------------------------------------------------
-body PageStack::back {} {
+itcl::body PageStack::back {} {
if {$_ptr > 0} {
incr _ptr -1
return $_stack($_ptr)
# DESC: Moves the stack pointer forward by one.
# RETURNS: Returns the value on the stack, or 0 on error.
# -----------------------------------------------------------------------------
-body PageStack::next {} {
+itcl::body PageStack::next {} {
if {$_ptr < $_max} {
incr _ptr
return $_stack($_ptr)
# DESC: Indicates if the stack pointer is not at the top.
# RETURNS: Returns 1 if PageStack::next will suceed, 0 otherwise.
# -----------------------------------------------------------------------------
-body PageStack::more {} {
+itcl::body PageStack::more {} {
if {$_ptr < $_max} {
return 1
}
# DESC: Indicates if the stack pointer is not at the bottom of stack.
# RETURNS: Returns 1 if PageStack::back will suceed, 0 otherwise.
# -----------------------------------------------------------------------------
-body PageStack::less {} {
+itcl::body PageStack::less {} {
if {$_ptr > 0} {
return 1
}
# SYNOPSIS: current
# RETURNS: Returns the current value on the stack.
# -----------------------------------------------------------------------------
-body PageStack::current {} {
+itcl::body PageStack::current {} {
if {$_ptr > 0} {
return $_stack($_ptr)
}
# "fore", and "home"
#
# ------------------------------------------------------------------------------
-body HtmlViewer::_enable { on args } {
+itcl::body HtmlViewer::_enable { on args } {
if {$on} {
set state normal
} else {
# SYNOPSIS: back
# DESC: Moves to the previous page
# ------------------------------------------------------------------------------
-body HtmlViewer::back {} {
+itcl::body HtmlViewer::back {} {
set res [$_links back]
if {$res != 0} {
load $res
# SYNOPSIS: forward
# DESC: Moves to the next page
# ------------------------------------------------------------------------------
-body HtmlViewer::forward {} {
+itcl::body HtmlViewer::forward {} {
set res [$_links next]
if {$res != 0} {
load $res
# ARDS: page - link to the page to load
# DESC: Saves the page on the stack and calls the "load" method
# ------------------------------------------------------------------------------
-body HtmlViewer::link {page} {
+itcl::body HtmlViewer::link {page} {
if {$page != [$_links current]} {
$_links push $page
load $page
# the html widget, then resets cursor and enables the menus
# and buttons
# ------------------------------------------------------------------------------
-body HtmlViewer::load {link} {
+itcl::body HtmlViewer::load {link} {
_enable 0 back fore home
$itk_interior configure -cursor watch
$_html import -link $link
# DESC: If the prefs are set to use a browser, attempts
# to do so. Otherwise, uses builtin HtmlViewer class.
# ------------------------------------------------------------------------------
-body HtmlViewer::open_help {hfile} {
+itcl::body HtmlViewer::open_help {hfile} {
set link file://[file join $::GDBTK_LIBRARY help $hfile]
if {![pref get gdb/help/browser] || ![::open_url $link]} {
ManagedWin::open HtmlViewer -file $hfile
# Currently used as a help window.
#
# -----------------------------------------------------------------------------
-class HtmlViewer {
+itcl::class HtmlViewer {
inherit EmbeddedWin
public {
# Currently used by the HtmlViewer class.
#
# -----------------------------------------------------------------------------
-class PageStack {
+itcl::class PageStack {
private {
variable _ptr -1
variable _max -1
# ------------------------------------------------------------------
# CONSTRUCTOR - create new process window
# ------------------------------------------------------------------
-body KodWin::constructor {args} {
+itcl::body KodWin::constructor {args} {
#
# Create a window with the same name as this object
#
# ------------------------------------------------------------------
# METHOD: build_win - build the main KOD window
# ------------------------------------------------------------------
-body KodWin::build_win {} {
+itcl::body KodWin::build_win {} {
# FIXME: rename this variable.
global kodActivePane
# ------------------------------------------------------------------
# METHOD: update - update widget when something changes
# ------------------------------------------------------------------
-body KodWin::update {event} {
+itcl::body KodWin::update {event} {
debug "updating kod window"
# We get here from a press on the Display button or
# from a <Double-1> on a line of the list of objects
# ------------------------------------------------------------------
-body KodWin::display {} {
+itcl::body KodWin::display {} {
upvar \#0 $this table_vals
if {!$Running && [$lf.s cget -rows] > 1} {
gdbtk_busy
# ------------------------------------------------------------------
# METHOD: display_list - display list of objects
# ------------------------------------------------------------------
-body KodWin::display_list {} {
+itcl::body KodWin::display_list {} {
upvar \#0 $this table_vals
debug "displaying list of objects"
# When called from update we have to reissue the gdb
# command to get fresh data
# ------------------------------------------------------------------
-body KodWin::display_object {{cmd ""} {obj ""}} {
+itcl::body KodWin::display_object {{cmd ""} {obj ""}} {
debug "Displaying object details..."
upvar $obj objects
global kodActivePane
# ------------------------------------------------------------------
# METHOD: clear - clear detail panes and reset pane selection
# ------------------------------------------------------------------
-body KodWin::clear {} {
+itcl::body KodWin::clear {} {
debug "going to clear detail panes and pane selection"
$t1 configure -state normal
$t2 configure -state normal
# ------------------------------------------------------------------
# METHOD: top - go to the list of types of objects (top level)
# ------------------------------------------------------------------
-body KodWin::top {} {
+itcl::body KodWin::top {} {
debug "going to top from level $level"
if {$level > 0} {
set level 0
# ------------------------------------------------------------------
# METHOD: up - go to the list of objects which led to the current one
# ------------------------------------------------------------------
-body KodWin::up {} {
+itcl::body KodWin::up {} {
debug "going up from level $level..."
if {$level > 0} {
incr level -1
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
-body KodWin::destructor {} {
+itcl::body KodWin::destructor {} {
upvar \#0 $this table_vals $this-pane1 pane1_vals $this-pane2 pane2_vals
global kodActivePane
# PUBLIC METHOD: set_variable - called when user runs `set os'
# command
# ------------------------------------------------------------------
-body KodWin::set_variable {event} {
+itcl::body KodWin::set_variable {event} {
set value [$event get value]
if {[$event get variable] == "os" && $value != ""} {
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body KodWin::reconfig {} {
+itcl::body KodWin::reconfig {} {
destroy $itk_interior.bf
destroy $titl
build_win
# - clicks in the window
# - change mouse pointer
# ------------------------------------------------------------------
-body KodWin::busy {event} {
+itcl::body KodWin::busy {event} {
set Running 1
_disable_buttons
cursor watch
# METHOD: idle - idle event handler. Run when the target is not
# running
# ------------------------------------------------------------------
-body KodWin::idle {event} {
+itcl::body KodWin::idle {event} {
set Running 0
_restore_buttons
cursor {}
# This is a convenience method which simply sets the mouse
# pointer to the given glyph.
# ------------------------------------------------------------------
-body KodWin::cursor {glyph} {
+itcl::body KodWin::cursor {glyph} {
$_top configure -cursor $glyph
}
# PRIVATE METHOD: _disable_buttons - disable all buttons
# Used when we are busy and can't take another event
# ------------------------------------------------------------------
-body KodWin::_disable_buttons {} {
+itcl::body KodWin::_disable_buttons {} {
$BTop configure -state disabled
$BUp configure -state disabled
$BDisplay configure -state disabled
# previous states.
# Used when we are busy and can't take another event
# ------------------------------------------------------------------
-body KodWin::_restore_buttons {} {
+itcl::body KodWin::_restore_buttons {} {
$BTop configure -state $BState(BTop)
$BUp configure -state $BState(BUp)
$BDisplay configure -state $BState(BDisplay)
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-class KodWin {
+itcl::class KodWin {
inherit EmbeddedWin GDBWin
private {
# GNU General Public License for more details.
-class LocalsWin {
+itcl::class LocalsWin {
inherit VariableWin
# ------------------------------------------------------------------
# ------------------------------------------------------------
# PUBLIC METHOD: constructor
# ------------------------------------------------------------
-body ManagedWin::constructor {args} {
+itcl::body ManagedWin::constructor {args} {
#debug "$this args=$args"
set _top [winfo toplevel $itk_interior]
}
# ------------------------------------------------------------
# PUBLIC METHOD: destructor
# ------------------------------------------------------------
-body ManagedWin::destructor {} {
+itcl::body ManagedWin::destructor {} {
# If no toplevels remain, quit. However, check the quit_if_last
# flag since we might be doing something like displaying a
# splash screen at startup...
# PUBLIC METHOD: window_name - Set the name of the window
# (and optionally its icon's name).
# ------------------------------------------------------------
-body ManagedWin::window_name {wname {iname ""}} {
+itcl::body ManagedWin::window_name {wname {iname ""}} {
wm title $_top $wname
if {$iname != ""} {
wm iconname $_top $iname
# method. It returns a command that can be used to recreate
# this particular window.
# ------------------------------------------------------------
-body ManagedWin::pickle {} {
+itcl::body ManagedWin::pickle {} {
return [list ManagedWin::open [namespace tail [info class]]]
}
# ------------------------------------------------------------
# PUBLIC METHOD: reveal
# ------------------------------------------------------------
-body ManagedWin::reveal {} {
+itcl::body ManagedWin::reveal {} {
# Do this update to flush all changes before deiconifying the window.
update idletasks
# ------------------------------------------------------------
# PUBLIC PROC: restart
# ------------------------------------------------------------
-body ManagedWin::restart {} {
+itcl::body ManagedWin::restart {} {
# This is needed in case we've called "gdbtk_busy" before the restart.
# This will configure the stop/run button as necessary
after idle gdbtk_idle
# the preferences file, so they can be restored at startup.
# FIXME: Currently assumes only ONE window per type...
# ------------------------------------------------------------------
-body ManagedWin::shutdown {} {
+itcl::body ManagedWin::shutdown {} {
set activeWins {}
foreach win [itcl_info objects -isa ManagedWin] {
if {![$win isa ModalDialog] && ![$win _ignore_on_save]} {
# opened at shutdown.
# FIXME: Currently assumes only ONE window per type...
# ------------------------------------------------------------------
-body ManagedWin::startup {} {
+itcl::body ManagedWin::startup {} {
debug "Got active list [pref get gdb/window/active]"
foreach cmd [pref get gdb/window/active] {
# ------------------------------------------------------------
# PUBLIC PROC: open_dlg
# ------------------------------------------------------------
-body ManagedWin::open_dlg {class args} {
+itcl::body ManagedWin::open_dlg {class args} {
set newwin [eval _open $class $args]
if {$newwin != ""} {
# ------------------------------------------------------------
# PUBLIC PROC: open
# ------------------------------------------------------------
-body ManagedWin::open {class args} {
+itcl::body ManagedWin::open {class args} {
set newwin [eval _open $class $args]
if {$newwin != ""} {
# ------------------------------------------------------------
# PRIVATE PROC: _open
# ------------------------------------------------------------
-body ManagedWin::_open { class args } {
+itcl::body ManagedWin::_open { class args } {
debug "$class $args"
parse_args force
# ------------------------------------------------------------
# PRIVATE PROC: _create
# ------------------------------------------------------------
-body ManagedWin::_create { class args } {
+itcl::body ManagedWin::_create { class args } {
set win [string tolower $class]
debug "win=$win args=$args"
# ------------------------------------------------------------
# PUBLIC PROC: find
# ------------------------------------------------------------
-body ManagedWin::find { win } {
+itcl::body ManagedWin::find { win } {
debug "$win"
set res ""
foreach obj [itcl_info objects -isa ManagedWin] {
# ------------------------------------------------------------
# PUBLIC PROC: init
# ------------------------------------------------------------
-body ManagedWin::init {} {
+itcl::body ManagedWin::init {} {
wm withdraw .
set _screenheight [winfo screenheight .]
set _screenwidth [winfo screenwidth .]
# ------------------------------------------------------------
# PUBLIC METHOD: destroy_toplevel
# ------------------------------------------------------------
-body ManagedWin::destroy_toplevel {} {
+itcl::body ManagedWin::destroy_toplevel {} {
after idle "update idletasks;destroy $_top"
}
# ------------------------------------------------------------
# PROTECTED METHOD: _freeze_me
# ------------------------------------------------------------
-body ManagedWin::_freeze_me {} {
+itcl::body ManagedWin::_freeze_me {} {
$_top configure -cursor watch
::update idletasks
}
# ------------------------------------------------------------
# PROTECTED METHOD: _thaw_me
# ------------------------------------------------------------
-body ManagedWin::_thaw_me {} {
+itcl::body ManagedWin::_thaw_me {} {
$_top configure -cursor {}
::update idletasks
# PRIVATE PROC: _make_icon_window - create a small window with an
# icon in it for use by certain Unix window managers.
# ------------------------------------------------------------------
-body ManagedWin::_make_icon_window {name {file "gdbtk_icon"}} {
+itcl::body ManagedWin::_make_icon_window {name {file "gdbtk_icon"}} {
if {![winfo exists $name]} {
toplevel $name
label $name.im -image \
# GNU General Public License for more details.
-class ManagedWin {
+itcl::class ManagedWin {
inherit itk::Widget
public {
# ------------------------------------------------------------------
# METHOD: constructor - build the dialog
# ------------------------------------------------------------------
-body MemPref::constructor {args} {
+itcl::body MemPref::constructor {args} {
window_name "Memory Preferences"
# ------------------------------------------------------------------
# METHOD: destructor - destroy the dialog
# ------------------------------------------------------------------
-body MemPref::destructor {} {
+itcl::body MemPref::destructor {} {
trace vdelete [scope gnumbytes] w [code $this check_numbytes]
}
# ------------------------------------------------------------------
# METHOD: build_win - build the dialog
# ------------------------------------------------------------------
-body MemPref::build_win {} {
+itcl::body MemPref::build_win {} {
frame $itk_interior.f
set f [frame $itk_interior.f.a]
# ------------------------------------------------------------------
# METHOD: busy - make the widget unusable
# ------------------------------------------------------------------
-body MemPref::busy {} {
+itcl::body MemPref::busy {} {
set top [winfo toplevel $itk_interior]
$top configure -cursor watch
# ------------------------------------------------------------------
# METHOD: idle - make the widget useable
# ------------------------------------------------------------------
-body MemPref::idle {} {
+itcl::body MemPref::idle {} {
set top [winfo toplevel $itk_interior]
$top configure -cursor {}
# ------------------------------------------------------------------
# METHOD: ok - apply and quit
# ------------------------------------------------------------------
-body MemPref::ok {} {
+itcl::body MemPref::ok {} {
apply
unpost
}
# ------------------------------------------------------------------
# METHOD: cancel - just close the dialog w/o saving changes
# ------------------------------------------------------------------
-body MemPref::cancel {} {
+itcl::body MemPref::cancel {} {
unpost
}
# ------------------------------------------------------------------
# METHOD: check_numbytes - a trace to make sure gnumbytes is an int > 0
# ------------------------------------------------------------------
-body MemPref::check_numbytes {var index mode} {
+itcl::body MemPref::check_numbytes {var index mode} {
upvar \#0 $var true
if {($true != "") && ([catch {expr {(int($true) != double($true)) || $true <= 0}} val]
|| $val)} {
# ------------------------------------------------------------------
# METHOD: set_bytes_per_row - combobox callback to set the bytes per row
# ------------------------------------------------------------------
-body MemPref::set_bytes_per_row {w value} {
+itcl::body MemPref::set_bytes_per_row {w value} {
set gbpr $value
}
# METHOD: toggle_size_control - toggle the state of the entry box as the
# control method changes
# ------------------------------------------------------------------
-body MemPref::toggle_size_control {} {
+itcl::body MemPref::toggle_size_control {} {
if {$gvar} {
$Widgets(e-numbytes) configure -state normal \
# ------------------------------------------------------------------
# METHOD: apply - apply changes to the parent window
# ------------------------------------------------------------------
-body MemPref::apply {} {
+itcl::body MemPref::apply {} {
busy
gdbtk_busy
# ------------------------------------------------------------------
# METHOD: enable_format - turn on the format radio buttons
# ------------------------------------------------------------------
-body MemPref::enable_format {} {
+itcl::body MemPref::enable_format {} {
if {!$format_disabled} {
return
}
# ------------------------------------------------------------------
# METHOD: disable_format - turn off the format radio buttons
# ------------------------------------------------------------------
-body MemPref::disable_format {} {
+itcl::body MemPref::disable_format {} {
if {$format_disabled} {
return
}
# ------------------------------------------------------------------
# METHOD: pick - pick colors
# ------------------------------------------------------------------
-body MemPref::pick {lab} {
+itcl::body MemPref::pick {lab} {
set new_color [tk_chooseColor -initialcolor $color -title "Choose color"]
if {$new_color != $color && $new_color != ""} {
set color $new_color
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body MemPref::reconfig {} {
+itcl::body MemPref::reconfig {} {
# for now, just delete and recreate
destroy $itk_interior.f
build_win
# GNU General Public License for more details.
-class MemPref {
+itcl::class MemPref {
inherit ModalDialog ManagedWin
public {
# ------------------------------------------------------------------
# METHOD: constructor - build the dialog
# ------------------------------------------------------------------
-body MemWin::constructor {args} {
+itcl::body MemWin::constructor {args} {
global _mem
debug $args
eval itk_initialize $args
# ------------------------------------------------------------------
# METHOD: destructor - destroy the dialog
# ------------------------------------------------------------------
-body MemWin::destructor {} {
+itcl::body MemWin::destructor {} {
if {[winfo exists $prefs_win]} {
$prefs_win cancel
}
# ------------------------------------------------------------------
# METHOD: build_win - build the main memory window
# ------------------------------------------------------------------
-body MemWin::build_win {} {
+itcl::body MemWin::build_win {} {
global tcl_platform gdb_ImageDir _mem ${this}_memval
set maxlen 0
# ------------------------------------------------------------------
# METHOD: paste - paste callback. Update cell contents after paste
# ------------------------------------------------------------------
-body MemWin::paste {x y} {
+itcl::body MemWin::paste {x y} {
edit [$itk_component(table) index @$x,$y]
}
# ------------------------------------------------------------------
# METHOD: validate - because the control widget wants this
# ------------------------------------------------------------------
-body MemWin::validate {val} {
+itcl::body MemWin::validate {val} {
return $val
}
# ------------------------------------------------------------------
# METHOD: create_prefs - create memory preferences dialog
# ------------------------------------------------------------------
-body MemWin::create_prefs {} {
+itcl::body MemWin::create_prefs {} {
if {$Running} { return }
# make sure row height is set
# ------------------------------------------------------------------
# METHOD: changed_cell - called when moving from one cell to another
# ------------------------------------------------------------------
-body MemWin::changed_cell {from to} {
+itcl::body MemWin::changed_cell {from to} {
#debug "moved from $from to $to"
#debug "value = [$itk_component(table) get $from]"
if {$saved_value != ""} {
# ------------------------------------------------------------------
# METHOD: edit - edit a cell
# ------------------------------------------------------------------
-body MemWin::edit { cell } {
+itcl::body MemWin::edit { cell } {
global _mem ${this}_memval
#debug "edit $cell"
# ------------------------------------------------------------------
# METHOD: toggle_enabled - called when enable is toggled
# ------------------------------------------------------------------
-body MemWin::toggle_enabled {} {
+itcl::body MemWin::toggle_enabled {} {
global _mem
if {$Running} { return }
# ------------------------------------------------------------------
# METHOD: update - update widget after every PC change
# ------------------------------------------------------------------
-body MemWin::update {event} {
+itcl::body MemWin::update {event} {
global _mem
if {$_mem($this,enabled)} {
_update_address 0
# ------------------------------------------------------------------
# METHOD: idle - memory window is idle, so enable menus
# ------------------------------------------------------------------
-body MemWin::idle {event} {
+itcl::body MemWin::idle {event} {
# Fencepost
set Running 0
# METHOD: busy - BusyEvent handler
# Disable menus 'cause we're busy updating things.
# ------------------------------------------------------------------
-body MemWin::busy {event} {
+itcl::body MemWin::busy {event} {
# Fencepost
set Running 1
# METHOD: newsize - calculate how many rows to display when the
# window is resized.
# ------------------------------------------------------------------
-body MemWin::newsize {height} {
+itcl::body MemWin::newsize {height} {
if {$dont_size || $Running} {
return
}
}
-body MemWin::_update_address {make_busy} {
+itcl::body MemWin::_update_address {make_busy} {
if {$make_busy} {
gdbtk_busy
}
# ------------------------------------------------------------------
# METHOD: update_address_cb - address entry widget callback
# ------------------------------------------------------------------
-body MemWin::update_address_cb {} {
+itcl::body MemWin::update_address_cb {} {
set new_entry 1
_update_address 1
}
# ------------------------------------------------------------------
# METHOD: update_address - update address and data displayed
# ------------------------------------------------------------------
-body MemWin::update_address {addr_exp} {
+itcl::body MemWin::update_address {addr_exp} {
set bad_expr 0
set saved_addr $current_addr
# ------------------------------------------------------------------
# METHOD: BadExpr - handle a bad expression
# ------------------------------------------------------------------
-body MemWin::BadExpr {errTxt} {
+itcl::body MemWin::BadExpr {errTxt} {
if {$new_entry} {
tk_messageBox -type ok -icon error -message $errTxt
set new_entry 0
# METHOD: incr_addr - callback from control widget to increment
# the current address.
# ------------------------------------------------------------------
-body MemWin::incr_addr {num} {
+itcl::body MemWin::incr_addr {num} {
if {$current_addr == ""} {
return
}
# METHOD: update_addr - read in data starting at $current_addr
# This is just a helper function for update_address.
# ------------------------------------------------------------------
-body MemWin::update_addr {} {
+itcl::body MemWin::update_addr {} {
global _mem ${this}_memval
set row 0
# ------------------------------------------------------------------
# METHOD: hidemb - hide the menubar. NOT CURRENTLY USED
# ------------------------------------------------------------------
-body MemWin::hidemb {} {
+itcl::body MemWin::hidemb {} {
set mbar 0
reconfig
}
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body MemWin::reconfig {} {
+itcl::body MemWin::reconfig {} {
debug
set addr_exp [string trimright [string trimleft $addr_exp]]
set wh [winfo height $top]
# ------------------------------------------------------------------
# METHOD: do_popup - Display popup menu
# ------------------------------------------------------------------
-body MemWin::do_popup {X Y} {
+itcl::body MemWin::do_popup {X Y} {
if {$Running} { return }
$itk_component(table).menu delete 0 end
$itk_component(table).menu add check -label "Auto Update" -variable _mem($this,enabled) \
# ------------------------------------------------------------------
# METHOD: goto - change the address of the current memory window
# ------------------------------------------------------------------
-body MemWin::goto { addr } {
+itcl::body MemWin::goto { addr } {
set current_addr $addr
$itk_interior.f.cntl delete 0 end
$itk_interior.f.cntl insert end $addr
# On startup, if the public variable "addr_exp" was not set,
# then set it to the start of ".data" if found, otherwise "$pc"
# ------------------------------------------------------------------
-body MemWin::init_addr_exp {} {
+itcl::body MemWin::init_addr_exp {} {
if {$addr_exp == ""} {
set err [catch {gdb_cmd "info file"} result]
if {!$err} {
# ------------------------------------------------------------------
# METHOD: cursor - set the cursor
# ------------------------------------------------------------------
-body MemWin::cursor {glyph} {
+itcl::body MemWin::cursor {glyph} {
# Set cursor for all labels
# for {set i 0} {$i < $bytes_per_row} {incr i $size} {
# $itk_component(table).h.$i configure -cursor $glyph
# x - +1 to move down one cell, -1 to move up one cell.
# y - +1 to move right one cell, -1 to move left one cell.
-body MemWin::memMoveCell {w x y} {
+itcl::body MemWin::memMoveCell {w x y} {
if {[catch {$w index active row} r]} return
set c [$w index active col]
if {$ascii && ($c == $Numcols)} {
# type - The dialog type (tk_messageBox).
# Default: ok
# ------------------------------------------------------------
-body MemWin::error_dialog {msg {modality task} {type ok}} {
+itcl::body MemWin::error_dialog {msg {modality task} {type ok}} {
set parent [winfo toplevel [namespace tail $this]]
tk_messageBox -icon error -title Error -type $type \
-message $msg -parent $parent
# GNU General Public License for more details.
-class MemWin {
+itcl::class MemWin {
inherit EmbeddedWin GDBWin
private {
#
# ----------------------------------------------------------------------
-class ModalDialog {
+itcl::class ModalDialog {
# This is the variable we vwait on when the dialog is posted.
# It is set to 1 in the unpost method, and to -1 in the destructor.
#
# ----------------------------------------------------------------------
-class PluginWindow {
+itcl::class PluginWindow {
inherit ManagedWin GDBEventHandler
# ------------------------------------------------------------------
#
# ----------------------------------------------------------------------
-body ProcessWin::constructor {args} {
+itcl::body ProcessWin::constructor {args} {
window_name "Processes"
gdbtk_busy
# ------------------------------------------------------------------
# METHOD: build_win - build the main process window
# ------------------------------------------------------------------
-body ProcessWin::build_win {} {
+itcl::body ProcessWin::build_win {} {
global tcl_platform
if {$tcl_platform(platform) == "windows"} {
# ------------------------------------------------------------------
# METHOD: update - update widget when something changes
# ------------------------------------------------------------------
-body ProcessWin::update {event} {
+itcl::body ProcessWin::update {event} {
if {!$protect_me} {
$itk_component(slbox) delete 0 end
# METHOD: change_context - change the current context (active thread)
# This method is currently ONLY called from the mouse binding
# ------------------------------------------------------------------
-body ProcessWin::change_context {} {
+itcl::body ProcessWin::change_context {} {
if {!$Running && [$itk_component(slbox) size] != 0} {
gdbtk_busy
set sel [$itk_component(slbox) curselection]
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
-body ProcessWin::destructor {} {
+itcl::body ProcessWin::destructor {} {
remove_hook gdb_no_inferior_hook [code $this no_inferior]
}
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body ProcessWin::reconfig {} {
+itcl::body ProcessWin::reconfig {} {
destroy $itk_interior.s
if {[winfo exists $itk_interior.sbox]} { destroy $itk_interior.sbox }
if {[winfo exists $itk_interior.slbox]} { destroy $itk_interior.slbox }
# - clicks in the window
# - change mouse pointer
# ------------------------------------------------------------------
-body ProcessWin::busy {event} {
+itcl::body ProcessWin::busy {event} {
set Running 1
cursor watch
}
# ------------------------------------------------------------------
# METHOD: idle - handle IdleEvent
# ------------------------------------------------------------------
-body ProcessWin::idle {event} {
+itcl::body ProcessWin::idle {event} {
set Running 0
cursor {}
}
# This is a convenience method which simply sets the mouse
# pointer to the given glyph.
# ------------------------------------------------------------------
-body ProcessWin::cursor {glyph} {
+itcl::body ProcessWin::cursor {glyph} {
$_top configure -cursor $glyph
}
# GNU General Public License for more details.
-class ProcessWin {
+itcl::class ProcessWin {
inherit EmbeddedWin GDBWin
private {
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::constructor {args} {
+itcl::body RegWin::constructor {args} {
eval itk_initialize $args
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::destructor {} {
+itcl::body RegWin::destructor {} {
debug
}
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::_load_prefs {} {
+itcl::body RegWin::_load_prefs {} {
debug
# Find out largest register name length.
# each RegWin. To change the layout of the table
# in the window, use RegWin::_layout_table.
# ------------------------------------------------------------------
-body RegWin::_build_win {} {
+itcl::body RegWin::_build_win {} {
# Create scrollbars and table
itk_component add vscroll {
# NOTES: Uses preferences to determine if/how a register
# is displayed
# ------------------------------------------------------------------
-body RegWin::_layout_table {} {
+itcl::body RegWin::_layout_table {} {
debug
if {[info exists _cell]} {
# NOTES: See _size_column for the reasoning for the "down"
# option.
# ------------------------------------------------------------------
-body RegWin::_size_cell_column {cell down} {
+itcl::body RegWin::_size_cell_column {cell down} {
set col [string trim [lindex [split $cell ,] 1] ()]
_size_column $col $down
# should not downsize. This helps mitigate the
# annoyance.
# ------------------------------------------------------------------
-body RegWin::_size_column {col down} {
+itcl::body RegWin::_size_column {col down} {
set max 0
foreach cell [array names _data *,$col] {
#
# NOTES: Callback from pref system
# ------------------------------------------------------------------
-body RegWin::_prefs_changed {pref value} {
+itcl::body RegWin::_prefs_changed {pref value} {
debug "$pref $value"
# do nothing for now. With proper iwidgets this would not
# be required anyway.
# NOTES: Event handler for <Enter> and <KP_Enter>
# in table
# ------------------------------------------------------------------
-body RegWin::_accept_edit {} {
+itcl::body RegWin::_accept_edit {} {
debug
set cell [$itk_component(table) tag cell edit]
if {[llength $cell] == 1 && [info exists _register($cell)]} {
#
# NOTES: Only works with one WatchWin...
# ------------------------------------------------------------------
-body RegWin::_add_to_watch {rn} {
+itcl::body RegWin::_add_to_watch {rn} {
[ManagedWin::open WatchWin] add "\$[gdb_reginfo name $rn]"
}
#
# NOTES: Only works with one WatchWin...
# ------------------------------------------------------------------
-body RegWin::_open_memory {rn} {
+itcl::body RegWin::_open_memory {rn} {
ManagedWin::open MemWin -force -addr_exp $_data($_cell($rn))
}
# Y - y-root coordinate
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::_but3 {x y X Y} {
+itcl::body RegWin::_but3 {x y X Y} {
# Only post the menu when we're not executing the inferior,
# the inferior is in a runnable state, and we're not in a disabled
# ARGUMENTS: rn - the register number to remove
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::_delete_from_display {rn} {
+itcl::body RegWin::_delete_from_display {rn} {
# Mark the cell as hidden
set index [lsearch $_reg_display_list $rn]
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::_display_all {} {
+itcl::body RegWin::_display_all {} {
$itk_component(reg_menu) entryconfigure $_menuitems(display_all_registers) \
-state disabled
# NOTES: Event handler for <1> in table.
#
# ------------------------------------------------------------------
-body RegWin::_edit {x y} {
+itcl::body RegWin::_edit {x y} {
_select_cell [$itk_component(table) index @$x,$y]
}
# we're not editing, or it will move the icursor
# if we are editing.
# ------------------------------------------------------------------
-body RegWin::_move {direction} {
+itcl::body RegWin::_move {direction} {
debug $direction
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::_post_menu {} {
+itcl::body RegWin::_post_menu {} {
global gdb_running
# Configure the menu for the active cell
# NOTES: Adjusts the cell index so that it always
# selects the value cell for a register
# ------------------------------------------------------------------
-body RegWin::_select_cell {cell} {
+itcl::body RegWin::_select_cell {cell} {
# Abort an edit
_unedit
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::_unedit {} {
+itcl::body RegWin::_unedit {} {
# clear the tag
set cell [$itk_component(table) tag cell edit]
#
# NOTES:
# ------------------------------------------------------------------
-body RegWin::_get_value {rn} {
+itcl::body RegWin::_get_value {rn} {
if {[catch {gdb_reginfo value $rn} value]} {
dbug W "\"gdb_reginfo value $rn\" returned $value"
set value ""
#
# NOTES:
# ------------------------------------------------------------------
-body RegWin::_change_format {rn {newtype {}}} {
+itcl::body RegWin::_change_format {rn {newtype {}}} {
set name [gdb_reginfo name $rn]
# rn - the register number to update
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::_update_register {rn} {
+itcl::body RegWin::_update_register {rn} {
set _data($_cell($rn)) [_get_value $rn]
}
# ARGUMENTS: event - the ArchChangedEvent (not used)
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::arch_changed {event} {
+itcl::body RegWin::arch_changed {event} {
# When the arch changes, gdb will callback into gdbtk-register.c
# to swap out the old register set, so we need only redraw the
# ARGUMENTS: event - the BusyEvent (not used)
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::busy {event} {
+itcl::body RegWin::busy {event} {
# Abort any edit. Need to check if the table is constructed,
# since we call gdbtk_busy when we're created...
# ARGUMENTS: event - the IdleEvent (not used)
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::idle {event} {
+itcl::body RegWin::idle {event} {
# Clear fencepost
set _running 0
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::set_variable {event} {
+itcl::body RegWin::set_variable {event} {
switch [$event get variable] {
disassembly-flavor {
_layout_table
# ARGUMENTS: event - the UpdateEvent (not used)
# RETURNS: Nothing
# ------------------------------------------------------------------
-body RegWin::update {event} {
+itcl::body RegWin::update {event} {
dbug I "START REGISTER UPDATE CALLBACK"
# GNU General Public License for more details.
-class RegWin {
+itcl::class RegWin {
inherit EmbeddedWin GDBWin
private {
#
# ----------------------------------------------------------------------
-class SrcBar {
+itcl::class SrcBar {
inherit itk::Widget GDBEventHandler
# ------------------------------------------------------------------
# ------------------------------------------------------------------
# CONSTRUCTOR - create new source preferences window
# ------------------------------------------------------------------
-body SrcPref::constructor {args} {
+itcl::body SrcPref::constructor {args} {
window_name "Source Preferences"
_init_var
_build_win
# ------------------------------------------------------------------
# METHOD: init_var - initialize preference variables
# ------------------------------------------------------------------
-body SrcPref::_init_var {} {
+itcl::body SrcPref::_init_var {} {
set vlist {gdb/src/PC_TAG gdb/src/STACK_TAG gdb/src/BROWSE_TAG
gdb/src/run_attach gdb/src/run_load gdb/src/run_run
gdb/src/run_cont gdb/src/bp_fg gdb/src/temp_bp_fg
# ------------------------------------------------------------------
# METHOD: build_win - build the dialog
# ------------------------------------------------------------------
-body SrcPref::_build_win {} {
+itcl::body SrcPref::_build_win {} {
frame $itk_interior.f
frame $itk_interior.f.a
frame $itk_interior.f.b
# ------------------------------------------------------------------
# METHOD: apply - apply changes
# ------------------------------------------------------------------
-body SrcPref::_apply {} {
+itcl::body SrcPref::_apply {} {
foreach var [array names _new] {
if {$_new($var) != [pref get $var]} {
#debug "$var = $_new($var)"
ManagedWin::restart
}
-body SrcPref::cancel {} {
+itcl::body SrcPref::cancel {} {
_save
}
# ------------------------------------------------------------------
# METHOD: _cancel
# ------------------------------------------------------------------
-body SrcPref::_cancel {} {
+itcl::body SrcPref::_cancel {} {
set any_changed 0
foreach elem [array names _saved] {
# ------------------------------------------------------------------
# METHOD: save - apply changes and quit
# ------------------------------------------------------------------
-body SrcPref::_save {} {
+itcl::body SrcPref::_save {} {
_apply
unpost
}
# METHOD: _set_flavor - sets the disassembly flavor. The set disassembly-flavor
# gdb command is already known to exist, so I don't have to check...
# ------------------------------------------------------------------
-body SrcPref::_set_flavor {w new_mode} {
+itcl::body SrcPref::_set_flavor {w new_mode} {
$w entryset $new_mode
set _new_disassembly_flavor $new_mode
}
# ------------------------------------------------------------------
# METHOD: pick - pick colors
# ------------------------------------------------------------------
-body SrcPref::_pick {color win tag} {
+itcl::body SrcPref::_pick {color win tag} {
set new_color [tk_chooseColor -initialcolor $color -title "Choose color"]
if {$new_color != $color && $new_color != {}} {
set _new(gdb/src/$tag) $new_color
# GNU General Public License for more details.
-class SrcPref {
+itcl::class SrcPref {
inherit ManagedWin ModalDialog
private {
# ------------------------------------------------------------------
# CONSTRUCTOR - create new source text window
# ------------------------------------------------------------------
-body SrcTextWin::constructor {args} {
+itcl::body SrcTextWin::constructor {args} {
eval itk_initialize $args
set top [winfo toplevel $itk_interior]
if {$parent == {}} {
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
-body SrcTextWin::destructor {} {
+itcl::body SrcTextWin::destructor {} {
if {$Tracing} {
remove_hook control_mode_hook "$this set_control_mode"
}
# need to do here is to remove the trace tags, if we are exiting
# trace mode
# ------------------------------------------------------------------
-body SrcTextWin::trace_find_hook {mode from_tty} {
+itcl::body SrcTextWin::trace_find_hook {mode from_tty} {
if {[string compare $mode -1] == 0} {
if {$Browsing} {
$twin tag remove STACK_TAG 1.0 end
# browsing -> mode = 1
# controlling -> mode = 0
# ------------------------------------------------------------------
-body SrcTextWin::set_control_mode {mode} {
+itcl::body SrcTextWin::set_control_mode {mode} {
# debug "Setting control mode of $twin to $mode"
if {$mode} {
set Browsing 1
# browse_disabled - a similar list for menus that should be disabled
# when you are browsing a trace expt.
#
-body SrcTextWin::build_popups {} {
+itcl::body SrcTextWin::build_popups {} {
set popups(bp) $itk_interior.bp_menu
set popups(tp) $itk_interior.tp_menu
# ------------------------------------------------------------------
# METHOD: build_win - build the main source paned window
# ------------------------------------------------------------------
-body SrcTextWin::build_win {} {
+itcl::body SrcTextWin::build_win {} {
cyg::panedwindow $itk_interior.p
set _tpane pane$filenum
# METHOD: SetRunningState - set state based on if GDB is running or not.
# This disables the popup menus when GDB is not running yet.
# ------------------------------------------------------------------
-body SrcTextWin::SetRunningState {state} {
+itcl::body SrcTextWin::SetRunningState {state} {
# debug "$state"
foreach elem $popups(run_disabled) {
$popups([lindex $elem 0]) entryconfigure [lindex $elem 1] -state $state
# ------------------------------------------------------------------
# METHOD: enable - enable or disable bindings and change cursor
# ------------------------------------------------------------------
-body SrcTextWin::enable {on} {
+itcl::body SrcTextWin::enable {on} {
if {$on} {
set Running 0
set glyph ""
# ------------------------------------------------------------------
# PROC: makeBreakDot - make the break dot for the screen
# ------------------------------------------------------------------
-body SrcTextWin::makeBreakDot {size colorList {image {}}} {
+itcl::body SrcTextWin::makeBreakDot {size colorList {image {}}} {
if {$size > 32} {
set size 32
} elseif {$size < 1} {
# ------------------------------------------------------------------
# METHOD: setTabs - set the tabs for the assembly/src windows
# ------------------------------------------------------------------
-body SrcTextWin::setTabs {win {asm S}} {
+itcl::body SrcTextWin::setTabs {win {asm S}} {
set fsize [font measure [pref get gdb/src/font] "W"]
set tsize [pref get gdb/src/tab_size]
set rest ""
$win configure -tabs $tablist
}
-body SrcTextWin::enable_disable_src_tags {win how} {
+itcl::body SrcTextWin::enable_disable_src_tags {win how} {
switch $how {
normal {
# ------------------------------------------------------------------
# METHOD: config_win - configure the source or assembly text window
# ------------------------------------------------------------------
-body SrcTextWin::config_win {win {asm S}} {
+itcl::body SrcTextWin::config_win {win {asm S}} {
# debug "$win $asm Tracing=$Tracing Browsing=$Browsing"
$win config -borderwidth 2 -insertwidth 0 -wrap none
# ------------------------------------------------------------------
# METHOD: addPopup - adds a popup to one of the source popup menus
# ------------------------------------------------------------------
-body SrcTextWin::addPopup {menu label command {abg {}} {browse 1} {run 1}} {
+itcl::body SrcTextWin::addPopup {menu label command {abg {}} {browse 1} {run 1}} {
if {$abg == ""} {
$popups($menu) add command -label $label -command $command
# PUBLIC METHOD: set_variable - Handle changes in the gdb variables
# changed through the "set" gdb command.
# ------------------------------------------------------------------
-body SrcTextWin::set_variable {event} {
+itcl::body SrcTextWin::set_variable {event} {
set var [$event get variable]
set val [$event get value]
debug "Set hook got called with $var $val"
# mark all the cached assembly windows dirty, and force the
# visible window to be redisplayed.
# ------------------------------------------------------------------
-body SrcTextWin::disassembly_changed {} {
+itcl::body SrcTextWin::disassembly_changed {} {
foreach name [array names Stwc *:pane] {
debug "Looking at $name"
set vals [split $name ,]
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body SrcTextWin::reconfig {} {
+itcl::body SrcTextWin::reconfig {} {
# debug
# Make sure we redo the break images when we reconfigure
# ------------------------------------------------------------------
# METHOD: updateBalloon - we have gone idle, update the balloon
# ------------------------------------------------------------------
-body SrcTextWin::updateBalloon {} {
+itcl::body SrcTextWin::updateBalloon {} {
set err [catch {$_balloon_var update} changed]
catch {$_balloon_var name} var
}
}
-body SrcTextWin::balloon_value {variable} {
+itcl::body SrcTextWin::balloon_value {variable} {
catch {$variable value} value
set value [string trim $value \ \r\t\n]
# ------------------------------------------------------------------
# METHOD: ClearTags - clear all tags
# ------------------------------------------------------------------
-body SrcTextWin::ClearTags {} {
+itcl::body SrcTextWin::ClearTags {} {
foreach tag {PC_TAG BROWSE_TAG STACK_TAG} {
catch {
$twin tag remove $tag $current(line).2 $current(line).end
# METHOD: _mtime_changed - check if the modtime for a file
# has changed.
# ------------------------------------------------------------------
-body SrcTextWin::_mtime_changed {filename} {
+itcl::body SrcTextWin::_mtime_changed {filename} {
global tcl_platform
if [catch {gdb_find_file $filename} f] {
# ------------------------------------------------------------------
# METHOD: FillSource - fill a window with source
# ------------------------------------------------------------------
-body SrcTextWin::FillSource {w tagname filename funcname line addr pc_addr lib} {
+itcl::body SrcTextWin::FillSource {w tagname filename funcname line addr pc_addr lib} {
global gdb_running
upvar ${w}win win
# ------------------------------------------------------------------
# METHOD: FillAssembly - fill a window with disassembled code
# ------------------------------------------------------------------
-body SrcTextWin::FillAssembly {w tagname filename funcname line addr pc_addr lib} {
+itcl::body SrcTextWin::FillAssembly {w tagname filename funcname line addr pc_addr lib} {
global gdb_running
upvar ${w}win win
upvar _${w}pane pane
# ------------------------------------------------------------------
# METHOD: FillMixed - fill a window with mixed source and assembly
# ------------------------------------------------------------------
-body SrcTextWin::FillMixed {w tagname filename funcname line addr pc_addr lib} {
+itcl::body SrcTextWin::FillMixed {w tagname filename funcname line addr pc_addr lib} {
global gdb_running
upvar ${w}win win
upvar _${w}pane pane
# METHOD: _highlightAsmLine - highlight the current execution line
# in one of the assembly modes
# ------------------------------------------------------------------
-body SrcTextWin::_highlightAsmLine {win addr pc_addr \
+itcl::body SrcTextWin::_highlightAsmLine {win addr pc_addr \
tagname filename funcname} {
global gdb_running
# ------------------------------------------------------------------
# METHOD: set_tag - update tag to STACK without making other changes
# ------------------------------------------------------------------
-body SrcTextWin::set_tag_to_stack {} {
+itcl::body SrcTextWin::set_tag_to_stack {} {
foreach window [list $twin $bwin] {
if {$window == ""} then {
continue
# ------------------------------------------------------------------
# METHOD: location - display a location in a file
# ------------------------------------------------------------------
-body SrcTextWin::location {tagname filename funcname line addr pc_addr lib} {
+itcl::body SrcTextWin::location {tagname filename funcname line addr pc_addr lib} {
# debug "$tagname $filename $line $addr $pc_addr, mode=$current(mode) oldmode=$oldmode cf=$current(filename) lib=$lib"
ClearTags
# ------------------------------------------------------------------
# METHOD: LoadFile - loads in a new source file
# ------------------------------------------------------------------
-body SrcTextWin::LoadFile {w name lib mtime_changed} {
+itcl::body SrcTextWin::LoadFile {w name lib mtime_changed} {
debug "$name $current(filename) $current(mode)"
upvar ${w}win win
upvar _${w}pane pane
# METHOD: display_line - make sure a line is displayed and near the center
# ------------------------------------------------------------------
-body SrcTextWin::display_line { win line } {
+itcl::body SrcTextWin::display_line { win line } {
::update idletasks
# keep line near center of display
set pixHeight [winfo height $win]
# uses current(filename) in SOURCE mode
# ------------------------------------------------------------------
-body SrcTextWin::display_breaks {} {
+itcl::body SrcTextWin::display_breaks {} {
# debug
# clear any previous breakpoints
# METHOD: insertBreakTag - insert the right amount of tag chars
# into the text window WIN, at line linenum.
# ------------------------------------------------------------------
-body SrcTextWin::insertBreakTag {win linenum tag} {
+itcl::body SrcTextWin::insertBreakTag {win linenum tag} {
# debug "$win $linenum $tag"
# Get the tags at the current line.
# from the given line. If this is the last break tag on the
# line reinstall the break_rgn_tag
# ------------------------------------------------------------------
-body SrcTextWin::removeBreakTag {win linenum tag } {
+itcl::body SrcTextWin::removeBreakTag {win linenum tag } {
# debug "$win $linenum $tag"
set tag_list [$win tag names $linenum.0]
# PUBLIC METHOD: breakpoint - Handle a breakpoint create, delete,
# or modify event from the backend.
# ------------------------------------------------------------------
-body SrcTextWin::breakpoint {bp_event} {
+itcl::body SrcTextWin::breakpoint {bp_event} {
bp [$bp_event get action] [$bp_event get number] [$bp_event get address] \
[$bp_event get line] [$bp_event get file] [$bp_event get disposition] \
# PUBLIC METHOD: tracepoint - Handle a tracepoint create, delete,
# modify event from the backend.
# ------------------------------------------------------------------
-body SrcTextWin::tracepoint {tp_event} {
+itcl::body SrcTextWin::tracepoint {tp_event} {
bp [$tp_event get action] [$tp_event get number] [$tp_event get address] \
[$tp_event get line] [$tp_event get file] tracepoint \
# mixed window at that address. If $line and $file are valid,
# a breakpoint will be set in the source window if appropriate.
# ------------------------------------------------------------------
-body SrcTextWin::bp {action bpnum addr {linenum {}} {file {}} {type 0} {enabled 0} {thread -1}} {
+itcl::body SrcTextWin::bp {action bpnum addr {linenum {}} {file {}} {type 0} {enabled 0} {thread -1}} {
# debug "$action addr=$addr line=$linenum file=$file type=$type current(filename)=$current(filename)"
switch $current(mode) {
# ------------------------------------------------------------------
# METHOD: do_bp - bp helper function
# ------------------------------------------------------------------
-body SrcTextWin::do_bp { win action linenum type bpnum enabled thread asm} {
+itcl::body SrcTextWin::do_bp { win action linenum type bpnum enabled thread asm} {
# debug "$action line=$linenum type=$type bpnum=$bpnum enabled=$enabled thread=$thread"
if {$dont_change_appearance} {
# ------------------------------------------------------------------
# METHOD: hasBP - see if a line number has a breakpoint set
# ------------------------------------------------------------------
-body SrcTextWin::hasBP {win line} {
+itcl::body SrcTextWin::hasBP {win line} {
if {$win == ""} {
set win $popups(saved_win)
}
# ------------------------------------------------------------------
# METHOD: hasTP - see if a line number has a tracepoint set
# ------------------------------------------------------------------
-body SrcTextWin::hasTP {win line} {
+itcl::body SrcTextWin::hasTP {win line} {
if {$win == ""} {
set win $popups(saved_win)
}
# Return:
# The gdb_loc result for the location found
# ------------------------------------------------------------------
-body SrcTextWin::report_source_location {} {
+itcl::body SrcTextWin::report_source_location {} {
if {$current(filename) == ""} {
error "No source file in window"
# set_cmd - for convenience, this is the command needed to set a
# breakpoint at this address.
# ------------------------------------------------------------------
-body SrcTextWin::lookup_line {win y} {
+itcl::body SrcTextWin::lookup_line {win y} {
#debug "$win $y"
if {$y == -1} {
set y $popups(saved_y)
#
# The threads parameter is not currently used.
# ------------------------------------------------------------------
-body SrcTextWin::continue_to_here {{win {}} {y -1} {threads -1}} {
+itcl::body SrcTextWin::continue_to_here {{win {}} {y -1} {threads -1}} {
# Look up the line... This foreach is an lassign...
foreach {name line addr type set_cmd} [lookup_line $win $y] {
#
# The threads parameter is not currently used.
# ------------------------------------------------------------------
-body SrcTextWin::jump_to_here {{win {}} {y -1} {threads -1}} {
+itcl::body SrcTextWin::jump_to_here {{win {}} {y -1} {threads -1}} {
# Look up the line... This foreach is an lassign...
foreach {name line addr type set_cmd} [lookup_line $win $y] {
#
# When "threads" is set it means to set a bp on each thread in the list.
# ------------------------------------------------------------------
-body SrcTextWin::set_bp_at_line {{type N} {win {}} {y -1} {threads "-1"}} {
+itcl::body SrcTextWin::set_bp_at_line {{type N} {win {}} {y -1} {threads "-1"}} {
# debug "$win $y $type $current(filename) Tracing=$Tracing"
if {$Running} {return}
# ------------------------------------------------------------------
# METHOD: enable_disable_at_line - Enable or disable breakpoint
# ------------------------------------------------------------------
-body SrcTextWin::enable_disable_at_line {action} {
+itcl::body SrcTextWin::enable_disable_at_line {action} {
if {$Running} {
return
}
#
# when "threads" is set it means to set a bp on each thread in the list.
# ------------------------------------------------------------------
-body SrcTextWin::remove_bp_at_line {{win {}} {y -1}} {
+itcl::body SrcTextWin::remove_bp_at_line {{win {}} {y -1}} {
if {$Running} {return}
#
# when "threads" is set it means to set a bp on each thread in the list.
# ------------------------------------------------------------------
-body SrcTextWin::set_tp_at_line {{win {}} {y -1}} {
+itcl::body SrcTextWin::set_tp_at_line {{win {}} {y -1}} {
# debug "$win $y $current(filename) Tracing=$Tracing"
if {$Running} {return}
# given by win & y...
#
# ------------------------------------------------------------------
-body SrcTextWin::next_hit_at_line {{win {}} {y -1}} {
+itcl::body SrcTextWin::next_hit_at_line {{win {}} {y -1}} {
# debug "$win $y $current(filename) Tracing=$Tracing"
if {!$Browsing} {return}
#
# when "threads" is set it means to set a bp on each thread in the list.
# ------------------------------------------------------------------
-body SrcTextWin::remove_tp_at_line {{win {}} {y -1}} {
+itcl::body SrcTextWin::remove_tp_at_line {{win {}} {y -1}} {
if {$Running} {return}
# METHOD: do_tag_popup - The tag bind function for breakpoint popups
# ------------------------------------------------------------------
-body SrcTextWin::do_tag_popup {name X Y y} {
+itcl::body SrcTextWin::do_tag_popup {name X Y y} {
# debug "$name $X $Y $y"
# METHOD: do_source_popup - tag bind function for source popups
# ------------------------------------------------------------------
-body SrcTextWin::do_source_popup { X Y x y } {
+itcl::body SrcTextWin::do_source_popup { X Y x y } {
if {$Running || [winfo ismapped $popups(source)]} {
return
}
# ------------------------------------------------------------------
# METHOD: addToWatch - add a variable to the watch window
# ------------------------------------------------------------------
-body SrcTextWin::addToWatch {var} {
+itcl::body SrcTextWin::addToWatch {var} {
[ManagedWin::open WatchWin] add $var
}
# ------------------------------------------------------------------
# METHOD: do_key -- wrapper for all key bindings
# ------------------------------------------------------------------
-body SrcTextWin::do_key {key} {
+itcl::body SrcTextWin::do_key {key} {
if {!$Running} {
switch $key {
print { print }
# ------------------------------------------------------------------
# METHOD: mode_get - get the source mode
# ------------------------------------------------------------------
-body SrcTextWin::mode_get {} {
+itcl::body SrcTextWin::mode_get {} {
return $current(mode)
}
# ------------------------------------------------------------------
# METHOD: mode_set - change the source mode
# ------------------------------------------------------------------
-body SrcTextWin::mode_set {new_mode {go 1}} {
+itcl::body SrcTextWin::mode_set {new_mode {go 1}} {
debug "$new_mode"
if {$new_mode != $current(mode)} {
# METHOD: cancelMotion - cancel any pending motion callbacks for
# the source window's variable balloons
# ------------------------------------------------------------------
-body SrcTextWin::cancelMotion {} {
+itcl::body SrcTextWin::cancelMotion {} {
catch {after cancel $timeoutID}
}
# METHOD: motion - callback for mouse motion within the source
# window's text widget
# ------------------------------------------------------------------
-body SrcTextWin::motion {type win x y} {
+itcl::body SrcTextWin::motion {type win x y} {
global gdb_running
cancelMotion
# ------------------------------------------------------------------
# METHOD: showBPBalloon - show BP information in a balloon
# ------------------------------------------------------------------
-body SrcTextWin::showBPBalloon {win x y} {
+itcl::body SrcTextWin::showBPBalloon {win x y} {
if {$Running} { return }
$win tag remove _show_variable 1.0 end
set line [lindex [split [$win index @0,$y] .] 0]
# METHOD: showBalloon - (possibly) show a variable's value in
# a balloon-help widget
# ------------------------------------------------------------------
-body SrcTextWin::showBalloon {win x y} {
+itcl::body SrcTextWin::showBalloon {win x y} {
if {$Running} { return }
$twin tag remove _show_variable 1.0 end
# METHOD: getVariable - get the name of the 'variable' under the
# mouse pointer in the text widget
# ------------------------------------------------------------------
-body SrcTextWin::getVariable {x y {line {}}} {
+itcl::body SrcTextWin::getVariable {x y {line {}}} {
#debug "$x $y $line"
set hit_point [$twin index @$x,$y]
# ------------------------------------------------------------------
# METHOD: trace_help - update statusbar with ballon help message
# ------------------------------------------------------------------
-body SrcTextWin::trace_help {args} {
+itcl::body SrcTextWin::trace_help {args} {
upvar #0 ${this}_balloon a
if {$a == ""} {
$parent set_status
}
}
-body SrcTextWin::line_is_executable {win line} {
+itcl::body SrcTextWin::line_is_executable {win line} {
# there should be an image or a "-" on the line
set res [catch {$win image cget $line.0 -image}]
if {!$res || [$win get $line.0] == "-"} {
# METHOD: tracepoint_range - create tracepoints at every line in
# a range of lines on the screen
# ------------------------------------------------------------------
-body SrcTextWin::tracepoint_range {win low high} {
+itcl::body SrcTextWin::tracepoint_range {win low high} {
# debug "$win $low $high"
switch $current(mode) {
# METHOD: search - search for text or jump to a specific line
# in source window, going in the specified DIRECTION.
# ------------------------------------------------------------------
-body SrcTextWin::search {exp direction} {
+itcl::body SrcTextWin::search {exp direction} {
if {$exp != ""} {
set result {}
if {[regexp {^@([0-9]+)} $exp dummy index]} {
# filled in later due to errors, call UnLoadFromCache.
# -----------------------------------------------------------------------------
-body SrcTextWin::LoadFromCache {w name asm lib} {
+itcl::body SrcTextWin::LoadFromCache {w name asm lib} {
debug "LoadFromCache $w $name $asm"
global tcl_platform
upvar ${w}win win
# there is a problem with filling the widget.
# ------------------------------------------------------------------
-body SrcTextWin::UnLoadFromCache {w oldpane name asm lib} {
+itcl::body SrcTextWin::UnLoadFromCache {w oldpane name asm lib} {
# debug "$w $oldpane $name"
upvar ${w}win win
upvar _${w}pane pane
# ------------------------------------------------------------------
# METHOD: print - print the contents of the text widget
# ------------------------------------------------------------------
-body SrcTextWin::print {top} {
+itcl::body SrcTextWin::print {top} {
# FIXME
send_printer -ascii [$twin get 1.0 end] -parent $top
}
# ------------------------------------------------------------------
# METHOD: ask_thread_bp - prompt for thread(s) for BP
# ------------------------------------------------------------------
-body SrcTextWin::ask_thread_bp {} {
+itcl::body SrcTextWin::ask_thread_bp {} {
# debug
if {[catch {gdb_cmd "info thread"} threads]} {
# failed. Just leave
# ------------------------------------------------------------------
# METHOD: do_thread_bp - callback from thread selection
# ------------------------------------------------------------------
-body SrcTextWin::do_thread_bp {listbox} {
+itcl::body SrcTextWin::do_thread_bp {listbox} {
# debug "$listbox [$listbox curselection]"
set x ""
foreach i [$listbox curselection] {
# public method for testing use only!
-body SrcTextWin::test_get {var} {
+itcl::body SrcTextWin::test_get {var} {
if {[array exists $var]} {
return [array get $var]
} else {
# ------------------------------------------------------------------
# METHOD: get_file - Return name of current file.
# ------------------------------------------------------------------
-body SrcTextWin::get_file {} {
+itcl::body SrcTextWin::get_file {} {
return $current(filename)
}
# Delete the variable balloon if it exists.
# Clear the screen.
# ------------------------------------------------------------------
-body SrcTextWin::clear_file {} {
+itcl::body SrcTextWin::clear_file {} {
debug "In clear_file"
# delete all caches
}
-body SrcTextWin::_initialize_srctextwin {} {
+itcl::body SrcTextWin::_initialize_srctextwin {} {
set pc(filename) ""
set pc(func) ""
set pc(line) 0
# ------------------------------------------------------------------
# METHOD: _clear_cache - Clear the cache
# ------------------------------------------------------------------
-body SrcTextWin::_clear_cache {} {
+itcl::body SrcTextWin::_clear_cache {} {
# display empty scratch frame
set pane $Stwc(gdbtk_scratch_widget:pane)
# GNU General Public License for more details.
-class SrcTextWin {
+itcl::class SrcTextWin {
inherit itk::Widget GDBWin
public {
# ------------------------------------------------------------------
# CONSTRUCTOR - create new source window
# ------------------------------------------------------------------
-body SrcWin::constructor {args} {
+itcl::body SrcWin::constructor {args} {
debug "$args"
eval itk_initialize $args
set top [winfo toplevel $itk_interior]
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
-body SrcWin::destructor {} {
+itcl::body SrcWin::destructor {} {
debug
remove_hook gdb_no_inferior_hook "$this no_inferior"
remove_hook download_progress_hook "$this download_progress"
# ------------------------------------------------------------------
# PRIVATE METHOD: _build_win - build the main source window
# ------------------------------------------------------------------
-body SrcWin::_build_win {} {
+itcl::body SrcWin::_build_win {} {
global gdb_downloading gdb_running gdb_loaded
# build source toolbar
# ------------------------------------------------------------------
# PUBLIC METHOD: _set_state - do things when program state changes
# ------------------------------------------------------------------
-body SrcWin::_set_state {varname} {
+itcl::body SrcWin::_set_state {varname} {
global gdb_running gdb_downloading gdb_loaded gdb_program_has_run
debug "$varname l=$gdb_loaded d=$gdb_downloading r=$gdb_running"
# ------------------------------------------------------------------
# PUBLIC METHOD: download_progress - update the progress meter when downloading
# ------------------------------------------------------------------
-body SrcWin::download_progress { section num tot {msg ""} } {
+itcl::body SrcWin::download_progress { section num tot {msg ""} } {
global download_start_time download_cancel_ok gdb_loaded
#debug "$section $num $tot $msg"
# ------------------------------------------------------------------
# PUBLIC METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body SrcWin::reconfig {} {
+itcl::body SrcWin::reconfig {} {
debug
$_toolbar reconfig
$twin reconfig
# It is the only way that files can be inserted into the file list
# once the debugger is started.
# ------------------------------------------------------------------
-body SrcWin::_name {w {val ""}} {
+itcl::body SrcWin::_name {w {val ""}} {
global _files
debug "$w $val"
if {$val != ""} {
# ------------------------------------------------------------------
# PRIVATE PUBLIC METHOD: toggle_updates - update toggle callback
# ------------------------------------------------------------------
-body SrcWin::toggle_updates {value} {
+itcl::body SrcWin::toggle_updates {value} {
# save state in do_updates so it will be preserved
# in window reconfigs
set do_updates $value
# ------------------------------------------------------------------
# PRIVATE PUBLIC METHOD: goto_func - function combobox callback
# ------------------------------------------------------------------
-body SrcWin::goto_func {w {val ""}} {
+itcl::body SrcWin::goto_func {w {val ""}} {
if {$val != ""} {
set mang 0
if {[info exists _mangled_func($val)]} {
# This method needs to be public, since other parts of
# the gui can cause new symbols to be read.
# ------------------------------------------------------------------
-body SrcWin::fillNameCB {} {
+itcl::body SrcWin::fillNameCB {} {
global _files
set allfiles [gdb_listfiles]
foreach f $allfiles {
# This method needs to be public, since other parts of
# the gui can cause new symbols to be read.
# ------------------------------------------------------------------
-body SrcWin::fillFuncCB {name} {
+itcl::body SrcWin::fillFuncCB {name} {
$_statbar.func list delete 0 end
if {$name != ""} {
set maxlen 10
#
# linespec will be "{} {} {} 0 0x0 0x0" when GDB has not started debugging.
# ------------------------------------------------------------------
-body SrcWin::location {tag linespec} {
+itcl::body SrcWin::location {tag linespec} {
global gdb_running gdb_exe_name _files tcl_platform
# We need to keep track of changes to the line, filename, function name
# ------------------------------------------------------------------
# PUBLIC METHOD: stack - handle stack commands
# ------------------------------------------------------------------
-body SrcWin::stack {cmd} {
+itcl::body SrcWin::stack {cmd} {
if {$cmd == "bottom"} {
set cmd "frame 0"
}
# ------------------------------------------------------------------
# METHOD: _update - update widget when PC changes
# ------------------------------------------------------------------
-body SrcWin::_update {loc} {
+itcl::body SrcWin::_update {loc} {
debug "loc=$loc"
# See if name combobox needs filled.
if {$need_files} {
# PUBLIC METHOD: idle - callback for gdbtk_idle
# Called when the target is idle, so enable all buttons.
# ------------------------------------------------------------------
-body SrcWin::idle {event} {
+itcl::body SrcWin::idle {event} {
$_toolbar configure -runstop normal
enable_ui 1
}
# ------------------------------------------------------------------
# PUBLIC METHOD: mode - set mode to SOURCE, ASSEMBLY, MIXED, SRC+ASM
# ------------------------------------------------------------------
-body SrcWin::mode {w new_mode {go 1}} {
+itcl::body SrcWin::mode {w new_mode {go 1}} {
gdbtk_busy
$_statbar.mode entryset $new_mode
catch {$twin mode_set $new_mode $go} errorVal
# ------------------------------------------------------------------
# PRIVATE METHOD: _update_title - update title bar
# ------------------------------------------------------------------
-body SrcWin::_update_title {name} {
+itcl::body SrcWin::_update_title {name} {
set fn [lindex [::file split $name] end]
if {$fn == ""} {
set prefix ""
# ------------------------------------------------------------------
# PUBLIC METHOD: busy - disable things when gdb is busy
# ------------------------------------------------------------------
-body SrcWin::busy {event} {
+itcl::body SrcWin::busy {event} {
global gdb_loaded gdb_target_name
# debug "gdb_loaded=$gdb_loaded, gdb_target_name=$gdb_target_name"
# ------------------------------------------------------------------
# PUBLIC METHOD: update - The inferior's state has changed.
# ------------------------------------------------------------------
-body SrcWin::update {event} {
+itcl::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
# ------------------------------------------------------------------
# PRIVATE METHOD: _set_name - set the name in the name combobox and in the title
# ------------------------------------------------------------------
-body SrcWin::_set_name { val {found 1} } {
+itcl::body SrcWin::_set_name { val {found 1} } {
global _files
_update_title $val
if {![info exists _files(short,$val)]} {
# If "tmp" is set, the status change will not be saved.
# ------------------------------------------------------------------
-body SrcWin::set_status { {msg ""} {tmp 0} } {
+itcl::body SrcWin::set_status { {msg ""} {tmp 0} } {
set msg [lindex [split $msg \n] 0]
if {$tmp} {
$_status configure -text $msg
# PUBLIC METHOD: set_execution_status - write the current execution state
# to the status line
# ------------------------------------------------------------------
-body SrcWin::set_execution_status { {line ""} {pc ""}} {
+itcl::body SrcWin::set_execution_status { {line ""} {pc ""}} {
global gdb_running gdb_loaded gdb_program_has_run gdb_target_changed
#debug "line=$line pc=$pc [gdb_target_has_execution] running=$gdb_running loaded=$gdb_loaded"
set message ""
# ------------------------------------------------------------------
# PUBLIC METHOD: edit - invoke external editor
# ------------------------------------------------------------------
-body SrcWin::edit {} {
+itcl::body SrcWin::edit {} {
global external_editor_command
# If external editor is enabled, pass the file to the specified command
# ------------------------------------------------------------------
# PUBLIC METHOD: print - print the contents of the text widget
# ------------------------------------------------------------------
-body SrcWin::print {} {
+itcl::body SrcWin::print {} {
# Call the SrcTextWin's print public method
$twin print $top
}
# PUBLIC METHOD: enable_ui
# Enable all UI elements for user interaction.
# ------------------------------------------------------------------
-body SrcWin::enable_ui { on } {
+itcl::body SrcWin::enable_ui { on } {
#debug "$on"
if {$on} {
set Running 0
#
# Change mouse pointer to normal
# ------------------------------------------------------------------
-body SrcWin::no_inferior {} {
+itcl::body SrcWin::no_inferior {} {
#debug
set_execution_status
enable_ui 1
# ------------------------------------------------------------------
# PUBLIC METHOD: reset - reset the source window
# ------------------------------------------------------------------
-body SrcWin::reset {} {
+itcl::body SrcWin::reset {} {
set current(filename) ""
set need_files 1
set do_updates 1
# PUBLIC METHOD: search - search for a STRING or jump to a specific line
# in source window, going in the specified DIRECTION.
# ------------------------------------------------------------------
-body SrcWin::search {direction string} {
+itcl::body SrcWin::search {direction string} {
set_status
set_status [$twin search $string $direction] 1
}
# Proc that may be called to point some source window to
# main (or an entry point?). (see gdbtk_tcl_exec_file_changed)
# ------------------------------------------------------------------
-body SrcWin::point_to_main {} {
+itcl::body SrcWin::point_to_main {} {
# We need to force this to some default location. Assume main and
# if that fails, let the source window guess (via gdb_loc using stop_pc).
set src [lindex [ManagedWin::find SrcWin] 0]
}
}
-body SrcWin::_exit {} {
+itcl::body SrcWin::_exit {} {
debug
if {[llength [ManagedWin::find SrcWin]] == 1} {
if {![gdbtk_quit_check]} {
}
# public method for testing use only!
-body SrcWin::test_get {var {private_func 0}} {
+itcl::body SrcWin::test_get {var {private_func 0}} {
debug $var
if {$private_func} {
return [code $this $var]
# running - Stop button appears, allowing user to stop executing target
# downloading - Stop button appears, allowing user to interrupt downloading
# normal - Run button appears, allowing user to run/re-run exe
-body SrcWin::toolbar {state} {
+itcl::body SrcWin::toolbar {state} {
$_toolbar configure -runstop $state
}
#
# FIXME: This should really be in an object which describes gdb's state.
# Unfortunately, this doesn't exist, so it's here for now.
-body SrcWin::inferior {action} {
+itcl::body SrcWin::inferior {action} {
switch $action {
step { gdbtk_step }
# - clear status (done by no_inferior)
# - allow SrcTextWin to clear_file
# ------------------------------------------------------------------
-body SrcWin::clear_file {} {
+itcl::body SrcWin::clear_file {} {
# Reset to Source mode
if {[$twin mode_get] != "SOURCE"} {
# METHOD: get_file
# Return name of displayed file, or empty string if no file.
# ------------------------------------------------------------------
-body SrcWin::get_file {} {
+itcl::body SrcWin::get_file {} {
if {$twin == ""} {
return ""
} else {
# METHOD: is_fixed
# Return boolean indicating whether this window is fixed.
# ------------------------------------------------------------------
-body SrcWin::is_fixed {} {
+itcl::body SrcWin::is_fixed {} {
return 0
}
# METHOD: get_top
# Return toplevel
# ------------------------------------------------------------------
-body SrcWin::get_top {} {
+itcl::body SrcWin::get_top {} {
return $top
}
# METHOD: _set_tag_to_stack
# Set tag to `stack' and update the underlying window.
# ------------------------------------------------------------------
-body SrcWin::_set_tag_to_stack {} {
+itcl::body SrcWin::_set_tag_to_stack {} {
set tag STACK_TAG
if {$twin != ""} then {
$twin set_tag_to_stack
# METHOD: _choose_window
# Choose the right source window.
# ------------------------------------------------------------------
-body SrcWin::_choose_window {file} {
+itcl::body SrcWin::_choose_window {file} {
# Find the next available source window. The rules are:
# 1. LRU overall
# 2. Skip iconified windows
# METHOD: choose_and_update
# Choose the right source window and then cause it to be updated
# ------------------------------------------------------------------
-body SrcWin::choose_and_update {} {
+itcl::body SrcWin::choose_and_update {} {
if {$pc_window == ""} then {
set pc_window [lindex $window_list 0]
}
# METHOD: choose_and_display
# Choose the right source window for a given file
# ------------------------------------------------------------------
-body SrcWin::choose_and_display {tag linespec} {
+itcl::body SrcWin::choose_and_display {tag linespec} {
set file [lindex $linespec 2]
set window [_choose_window $file]
$window location $tag $linespec
# should be returned and SrcWin should figure out what to do.
# ----------------------------------------------------------------------
-class SrcWin {
+itcl::class SrcWin {
inherit TopLevelWin GDBWin
public {
# ------------------------------------------------------------------
# CONSTRUCTOR - create new stack window
# ------------------------------------------------------------------
-body StackWin::constructor {args} {
+itcl::body StackWin::constructor {args} {
gdbtk_busy
build_win
gdbtk_idle
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
-body StackWin::destructor {} {
+itcl::body StackWin::destructor {} {
remove_hook gdb_no_inferior_hook [code $this no_inferior]
}
# ------------------------------------------------------------------
# METHOD: build_win - build the main register window
# ------------------------------------------------------------------
-body StackWin::build_win {} {
+itcl::body StackWin::build_win {} {
global tcl_platform
itk_component add slb {
# ------------------------------------------------------------------
# METHOD: update - update widget when PC changes
# ------------------------------------------------------------------
-body StackWin::update {event} {
+itcl::body StackWin::update {event} {
global gdb_selected_frame_level
if {!$protect_me} {
}
}
-body StackWin::idle {event} {
+itcl::body StackWin::idle {event} {
set Running 0
cursor {}
}
# ------------------------------------------------------------------
# METHOD: change_frame - change the current frame
-# This body StackWin::is currently ONLY called from the mouse binding
+# This method is currently ONLY called from the mouse binding
# ------------------------------------------------------------------
-body StackWin::change_frame {} {
+itcl::body StackWin::change_frame {} {
if {!$Running && [$itk_component(slb) size] != 0} {
gdbtk_busy
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body StackWin::reconfig {} {
+itcl::body StackWin::reconfig {} {
destroy $itk_interior.s
if {[winfo exists $itk_interior.sbox]} { destroy $itk_interior.sbox }
build_win
# This method should cause blocking of clicks in
# the window and change mouse pointer.
# ------------------------------------------------------------------
-body StackWin::busy {event} {
+itcl::body StackWin::busy {event} {
set Running 1
cursor watch
}
# ------------------------------------------------------------------
# METHOD: no_inferior - gdb_no_inferior_hook
# ------------------------------------------------------------------
-body StackWin::no_inferior {} {
+itcl::body StackWin::no_inferior {} {
set Running 0
cursor {}
}
# ------------------------------------------------------------------
# METHOD: cursor - set the window cursor
-# This is a convenience body StackWin::which simply sets the mouse
+# This is a convenience method which simply sets the mouse
# pointer to the given glyph.
# ------------------------------------------------------------------
-body StackWin::cursor {glyph} {
+itcl::body StackWin::cursor {glyph} {
set top [winfo toplevel $itk_interior]
$top configure -cursor $glyph
}
# Implements stack window for gdb
# ----------------------------------------------------------------------
-class StackWin {
+itcl::class StackWin {
inherit EmbeddedWin GDBWin
private {
# ------------------------------------------------------------------
# CONSTRUCTOR - create new target selection window
# ------------------------------------------------------------------
-body TargetSelection::constructor {args} {
+itcl::body TargetSelection::constructor {args} {
eval itk_initialize $args
set top [winfo toplevel $itk_interior]
_init
build_win
}
-body TargetSelection::getname {target name} {
+itcl::body TargetSelection::getname {target name} {
# Init target database if we haven't already done so
init_target_db
}
}
-body TargetSelection::init_target_db {} {
+itcl::body TargetSelection::init_target_db {} {
# check to see if we already initialized this database
if {$db_inited} {
return
set gdb_target(gdbservertcp,after_attaching) {}
}
-body TargetSelection::default_port {} {
+itcl::body TargetSelection::default_port {} {
global tcl_platform
switch -regexp $tcl_platform(os) {
Windows { set port com1 }
}
-body TargetSelection::_init_prefs {} {
+itcl::body TargetSelection::_init_prefs {} {
if {$prefs_inited} {
return
pref define gdb/load/default-after_attaching {}
}
-body TargetSelection::_init_target {} {
+itcl::body TargetSelection::_init_target {} {
global gdb_target_name
set target_list [get_target_list]
set target $gdb_target_name
}
}
-body TargetSelection::_init {} {
+itcl::body TargetSelection::_init {} {
if {!$trace_inited} {
# Trace all gdb_loaded changes based on target
# ------------------------------------------------------------------
# METHOD: build_win - build the dialog
# ------------------------------------------------------------------
-body TargetSelection::build_win {} {
+itcl::body TargetSelection::build_win {} {
global tcl_platform PREFS_state gdb_ImageDir gdb_target_name
set f [frame $itk_interior.f]
# ------------------------------------------------------------------
# METHOD: set_saved - set saved values
# ------------------------------------------------------------------
-body TargetSelection::set_saved {} {
+itcl::body TargetSelection::set_saved {} {
set saved_baud [pref get gdb/load/$target-baud]
set saved_port [pref get gdb/load/$target-port]
set saved_main [pref get gdb/load/main]
# ------------------------------------------------------------------
# METHOD: write_saved - write saved values to preferences
# ------------------------------------------------------------------
-body TargetSelection::write_saved {} {
+itcl::body TargetSelection::write_saved {} {
pref setd gdb/load/$target-baud $saved_baud
pref setd gdb/load/$target-port $saved_port
pref setd gdb/load/main $saved_main
# ------------------------------------------------------------------
# METHOD: fill_rates - fill baud rate combobox
# ------------------------------------------------------------------
-body TargetSelection::fill_rates {} {
+itcl::body TargetSelection::fill_rates {} {
$fr.cb list delete 0 end
if {$gdb_target($target,baud-rates) != ""} {
# ------------------------------------------------------------------
# METHOD: fill_targets - fill target combobox
# ------------------------------------------------------------------
-body TargetSelection::fill_targets {} {
+itcl::body TargetSelection::fill_targets {} {
#[$fr.tar subwidget listbox] delete 0 end
$fr.tar list delete 0 end
# METHOD: config_dialog - Convenience method to map/unmap/rename
# components onto the screen based on target T.
# ------------------------------------------------------------------
-body TargetSelection::config_dialog {t} {
+itcl::body TargetSelection::config_dialog {t} {
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
# Map the correct entries and comboboxes onto the screen
# ------------------------------------------------------------------
# METHOD: change_target - callback for target combobox
# ------------------------------------------------------------------
-body TargetSelection::change_target {w {name ""}} {
+itcl::body TargetSelection::change_target {w {name ""}} {
if {$name == ""} {return}
set target [get_target $name]
# PRIVATE METHOD: change_baud - called when the baud rate is changed.
# If GDB is running, set baud rate in GDB and read it back.
# ------------------------------------------------------------------
-body TargetSelection::change_baud {w {baud ""}} {
+itcl::body TargetSelection::change_baud {w {baud ""}} {
if {$baud != ""} {
if {([string compare $baud "TCP"] != 0)
&& ([string compare $baud "ETH"] != 0)} {
# ------------------------------------------------------------------
# METHOD: port_list - return a list of valid ports for Windows
# ------------------------------------------------------------------
-body TargetSelection::port_list {} {
+itcl::body TargetSelection::port_list {} {
set plist ""
# Scan com1 - com8 trying to open each one.
# If permission is denied that means it is in use,
# METHOD: get_target_list - return a list of targets supported
# by this GDB. Parses the output of "help target"
# ------------------------------------------------------------------
-body TargetSelection::get_target_list {} {
+itcl::body TargetSelection::get_target_list {} {
set native [native_debugging]
set names ""
set res [gdb_cmd "help target"]
# ------------------------------------------------------------------
# METHOD: save - save values
# ------------------------------------------------------------------
-body TargetSelection::save {} {
+itcl::body TargetSelection::save {} {
global gdb_target_name
set err [catch {
set_saved
# ------------------------------------------------------------------
# METHOD: cancel - restore previous values
# ------------------------------------------------------------------
-body TargetSelection::cancel {} {
+itcl::body TargetSelection::cancel {} {
global gdb_target_name
catch {gdb_cmd "set remotebaud $saved_baud"}
# ------------------------------------------------------------------
# METHOD: set_check_button - enable/disable compare-section command
# ------------------------------------------------------------------
-body TargetSelection::set_check_button {name} {
+itcl::body TargetSelection::set_check_button {name} {
if {[winfo exists $itk_interior.f.fr.check]} {
if { $name == "exec" } {
$itk_interior.f.fr.check configure -state disabled
# ------------------------------------------------------------------
# METHOD: help - launches context sensitive help.
# ------------------------------------------------------------------
-body TargetSelection::help {} {
+itcl::body TargetSelection::help {} {
}
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
-body TargetSelection::reconfig {} {
+itcl::body TargetSelection::reconfig {} {
# for now, just delete and recreate
destroy $itk_interior.f
build_win
# METHOD: get_target - get the internal name of a target from the
# pretty-name
# ------------------------------------------------------------------
-body TargetSelection::get_target {name} {
+itcl::body TargetSelection::get_target {name} {
set t {}
set list [array get gdb_target *,pretty-name]
set i [lsearch -exact $list $name]
# METHOD: toggle_more_options -- toggle displaying the More/Fewer
# Options pane
# ------------------------------------------------------------------
-body TargetSelection::toggle_more_options {} {
+itcl::body TargetSelection::toggle_more_options {} {
if {[$MoreLabel cget -text] == "More Options"} {
$MoreLabel configure -text "Fewer Options"
$MoreButton configure -image _LESS_
# METHOD: set_run - set the run button. Make sure not both run and
# continue are selected.
# ------------------------------------------------------------------
-body TargetSelection::set_run {check_which} {
+itcl::body TargetSelection::set_run {check_which} {
global PREFS_state
set var [pref varname gdb/src/run_$check_which]
global $var
# and possible more) whenever the value of gdb_loaded
# is changed based on the current target.
# ------------------------------------------------------------------
-body TargetSelection::target_trace {variable index op} {
+itcl::body TargetSelection::target_trace {variable index op} {
global gdb_target_name gdb_loaded
switch $gdb_target_name {
}
# Returns 1 if TARGET is a _runnable_ target for this gdb.
-body TargetSelection::valid_target {target} {
+itcl::body TargetSelection::valid_target {target} {
# always allow gdbserver
if {$target == "gdbserver"} {return 1}
}
# Returns 1 if this is not a cross debugger.
-body TargetSelection::native_debugging {} {
+itcl::body TargetSelection::native_debugging {} {
global GDBStartup
set r [string compare $GDBStartup(host_name) $GDBStartup(target_name)]
# GNU General Public License for more details.
-class TargetSelection {
+itcl::class TargetSelection {
inherit ModalDialog ManagedWin
private {
#
# ----------------------------------------------------------------------
-class TdumpWin {
+itcl::class TdumpWin {
inherit ManagedWin GDBWin
# ------------------------------------------------------------------
# and button sets. It does not actually add any buttons or
# menus on its own, however.
-class oldGDBToolBar {
+itcl::class oldGDBToolBar {
inherit itk::Widget
# ------------------------------------------------------------------
# GNU General Public License for more details.
-class TopLevelWin {
+itcl::class TopLevelWin {
inherit ManagedWin
private variable frame ""
# either one if a tracepoint was set/edited successfully or zero if
# the user bails out (cancel or destroy buttons).
-class TraceDlg {
+itcl::class TraceDlg {
inherit ManagedWin
# ------------------------------------------------------------------
# 'getVariablesBlankPath' and a few other things...
# ----------------------------------------------------------------------
-class VariableWin {
+itcl::class VariableWin {
inherit EmbeddedWin GDBWin
protected variable Sizebox 1
# OVERRIDE THIS METHOD and call it from there
# ------------------------------------------------------------------
method update {event} {
- global Update
- debug
+ global Update
+ debug
- # First, reset color on label to normal
- foreach w $ChangeList {
- catch {
- $Hlist entryconfigure $w -style $NormalTextStyle
- }
+ # First, reset color on label to normal
+ foreach w $ChangeList {
+ catch {
+ $Hlist entryconfigure $w -style $NormalTextStyle
}
-
+ }
+
# Tell toplevel variables to update themselves. This will
# give us a list of all the variables in the table that
# have changed values.
# -----------------------------------------------------------------------------
#
-class WarningDlg {
+itcl::class WarningDlg {
inherit ManagedWin ModalDialog
public {
# DESC:
# Creates the warning dialog.
# -----------------------------------------------------------------------------
-body WarningDlg::constructor {args} {
+itcl::body WarningDlg::constructor {args} {
debug $args
window_name "Warning"
eval itk_initialize $args
# class from variables.tcl.
# ----------------------------------------------------------------------
-class WatchWin {
+itcl::class WatchWin {
inherit VariableWin
# ------------------------------------------------------------------