1
0
Fork 0

arduino-0018-windows

This commit is contained in:
orange 2010-03-30 21:53:44 +02:00
parent 157fd6f1a1
commit f39fc49523
5182 changed files with 950586 additions and 0 deletions

View file

@ -0,0 +1,43 @@
# About window for GDBtk.
# Copyright (C) 1997, 1998, 1999, 2000, 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Implements About window
# ----------------------------------------------------------------------
itcl::class About {
inherit ManagedWin ModalDialog
constructor {args} {
global gdb_ImageDir
set f [frame $itk_interior.f]
label $f.image1 -bg #ee0000 -image \
[image create photo -file [file join $gdb_ImageDir insight.gif]]
message $f.m -bg #ee0000 -fg white -text [gdb_cmd {show version}] \
-aspect 500 -relief flat
pack $f.image1 $f.m $itk_interior.f -fill both -expand yes
pack $itk_interior
bind $f.image1 <1> [code $this unpost]
bind $f.m <1> [code $this unpost]
window_name "About Red Hat Insight"
}
# Don't quit if this is the last window. The only way that this can
# happen is if we are the splash screen.
method quit_if_last {} {
return 0
}
}

View file

@ -0,0 +1,810 @@
# Tracepoint actions dialog for Insight.
# Copyright (C) 1997, 1998, 1999, 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class ActionDlg {
inherit ManagedWin
# ------------------------------------------------------------------
# CONSTRUCTOR
# ------------------------------------------------------------------
constructor {args} {
global _TStepCount _TOtherVariable
eval itk_initialize $args
set Registers [gdb_reginfo name]
if {$Line != ""} {
set Locals [gdb_get_locals "$File:$Line"]
set Args [gdb_get_args "$File:$Line"]
} else {
set Locals [gdb_get_locals "*$Address"]
set Args [gdb_get_args "*$Address"]
}
set Variables [concat $Locals $Args]
foreach a $Registers {
lappend Variables "\$$a"
}
if {[llength $Args] > 0} {
lappend Variables "All Arguments"
}
if {[llength $Locals] > 0} {
lappend Variables "All Locals"
}
lappend Variables "All Registers"
lappend Variables "Collect Stack"
build_win
# Set a default return status, in case we are destroyed
set _TOtherVariable {}
# Fill the listboxes with any default data
if {"$Data" != {}} {
change 1 $Data
}
}
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
destructor {
# Remove this window and all hooks
# grab release $this
# Note that this is okay: the callback (TraceDlg::done, usually) will
# ignore stray "cancel" callbacks
eval $Callback cancel
}
# ------------------------------------------------------------------
# METHOD: build_win - build the Trace dialog box (cache this?)
# ------------------------------------------------------------------
method build_win {} {
global _TStepCount _TOtherVariable
set f $itk_interior
# The two frames of this dialog
set bbox [frame $f.bbox]; # for holding OK,CANCEL buttons
set data [frame $f.data]; # for everything else
# Setup the button box
button $bbox.ok -text OK -command "$this ok"
button $bbox.cancel -text CANCEL -command "$this cancel"
pack $bbox.ok $bbox.cancel -side left -padx 10 -expand yes
# The "Data Collection" Frame
set top [frame $data.top]
set bot [frame $data.bot]
set boxes [frame $top.boxes]
set cFrame [frame $boxes.cFrame]
set vFrame [frame $boxes.vFrame]
set bFrame [frame $boxes.bframe]
set oFrame [frame $top.uFrame]
pack $cFrame $bFrame $vFrame -side left -expand yes -padx 5
# While stepping
if {$WhileStepping} {
set step_frame [frame $top.stepf]
label $step_frame.whilelbl -text {While Stepping, Steps:}
set WhileSteppingEntry [entry $step_frame.steps \
-textvariable _TStepCount \
-width 5]
pack $step_frame.whilelbl $WhileSteppingEntry -side left
}
# The Collect listbox
label $cFrame.lbl -text {Collect:}
set CollectLB [iwidgets::scrolledlistbox $cFrame.lb -hscrollmode dynamic \
-vscrollmode dynamic \
-selectioncommand [code $this toggle_button_state 0] \
-dblclickcommand [code $this change 0] \
-selectmode extended \
-exportselection false]
[$CollectLB component listbox] configure -background gray92
pack $cFrame.lbl $cFrame.lb -side top -expand yes -pady 2
# The Variables listbox
label $vFrame.lbl -text {Variables:}
set VariablesLB [iwidgets::scrolledlistbox $vFrame.lb -hscrollmode dynamic \
-vscrollmode dynamic \
-selectioncommand [code $this toggle_button_state 1] \
-dblclickcommand [code $this change 1] \
-selectmode extended \
-exportselection false]
[$VariablesLB component listbox] configure -background gray92
pack $vFrame.lbl $vFrame.lb -side top -expand yes -pady 2
# The button frame
set AddButton [button $bFrame.add -text {<<< Collect} \
-command "$this change 1" -state disabled]
set RemoveButton [button $bFrame.del -text {Ignore >>>} \
-command "$this change 0" -state disabled]
pack $bFrame.add $bFrame.del -side top -expand yes -pady 5
# The other frame (type-in)
label $oFrame.lbl -text {Other:}
set OtherEntry [entry $oFrame.ent -textvariable _TOtherVariable]
pack $oFrame.lbl $OtherEntry -side left
bind $OtherEntry <Return> "$this change_other"
# Pack these frames
if {$WhileStepping} {
pack $step_frame -side top
}
pack $boxes $oFrame -side top -padx 5 -pady 5
pack $top $bot -side top
# Fill the list boxes
fill_listboxes
# Pack the main frames
# after idle
pack $f.data $bbox -side top -padx 4 -pady 2 \
-expand yes -fill x
# !!???
if {$WhileStepping} {
$WhileSteppingEntry delete 0 end
$WhileSteppingEntry insert 0 $Steps
}
}
method toggle_button_state {add} {
# This is invoked whenever a <1> event is generated in
# the listbox...
if {$add} {
set a [$VariablesLB getcurselection]
if {"$a" != ""} {
$AddButton configure -state normal
$RemoveButton configure -state disabled
}
} else {
set a [$CollectLB getcurselection]
if {"$a" != ""} {
$AddButton configure -state disabled
$RemoveButton configure -state normal
}
}
}
# ------------------------------------------------------------------
# METHOD: fill_listboxes - fills the two listboxes
# ------------------------------------------------------------------
method fill_listboxes {{last {}}} {
# Fill the Collect listbox with the variables being collected
if {[info exists Collect]} {
fill_collect $last
}
fill_variables $last
}
# ------------------------------------------------------------------
# METHOD: change - change a selected variable
# ------------------------------------------------------------------
method change {add {select {}}} {
if {"$select" == {}} {
set selections [get_selections $add]
set lb [lindex $selections 0]
set last [lindex $selections 1]
set selection [lindex $selections 2]
set noname 1
} else {
# This usually (only) occurs when we open this dialog for editing
# some existing action.
set lb {}
set last {}
set noname 0
set selection $select
}
$RemoveButton configure -state disabled
$AddButton configure -state disabled
# Remove all the selections from one list
# and add them to the other list
if {$add} {
set list1 $Variables
set list2 $Collect
} else {
set list1 $Collect
set list2 $Variables
}
foreach a $selection {
if {$noname} {
set name [$lb get $a]
} else {
set name $a
}
if {"$name" == "All Locals" || "$name" == {$loc}} {
set name "All Locals"
set lists [all_locals $add]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
} elseif {"$name" == "All Registers" || "$name" == {$reg}} {
set name "All Registers"
set lists [all_regs $add]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
} elseif {"$name" == "All Arguments" || "$name" == {$arg}} {
set name "All Arguments"
set lists [all_args $add]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
} else {
set i [lsearch -exact $list1 $name]
set list1 [lreplace $list1 $i $i]
# Check if this is something we want to keep on a list
if {[lsearch $Args $name] != -1 || [lsearch $Registers [string trim $name \$]] != -1 || [lsearch $Locals $name] != -1 || $add} {
lappend list2 $name
}
}
if {$add} {
set Collect $list2
set Variables $list1
} else {
set Collect $list1
set Variables $list2
}
}
# Update boxes (!! SLOW !!)
fill_collect $last
fill_variables $last
}
# ------------------------------------------------------------------
# METHOD: fill_collect - fill the collect box
# ------------------------------------------------------------------
method fill_collect {{last {}}} {
$CollectLB delete 0 end
set Collect [sort $Collect]
foreach a $Collect {
$CollectLB insert end $a
}
if {"$last" != ""} {
$CollectLB see $last
}
}
# ------------------------------------------------------------------
# METHOD: fill_variables - fill the variables box
# ------------------------------------------------------------------
method fill_variables {{last {}}} {
$VariablesLB delete 0 end
set Variables [sort $Variables]
foreach a $Variables {
$VariablesLB insert end $a
}
if {"$last" != ""} {
$VariablesLB see $last
}
}
# ------------------------------------------------------------------
# METHOD: sort - sort a list of variables, placing regs and
# special identifiers (like "All Locals") at end
# ------------------------------------------------------------------
method sort {list} {
set special_names {
"All Arguments" args \
"All Locals" locs \
"All Registers" regs \
"Collect Stack" stack
}
foreach {name var} $special_names {
set i [lsearch $list $name]
if {$i != -1} {
set $var 1
set list [lreplace $list $i $i]
} else {
set $var 0
}
}
# Extract all the locals, regs, args, globals
set types_list {Args Locals Registers }
foreach type $types_list {
set used_$type {}
foreach a [set $type] {
set i [lsearch $list $a]
if {$i != -1} {
lappend used_$type $a
set list [lreplace $list $i $i]
}
}
set used_$type [lsort [set used_$type]]
}
set globals [lsort $list]
# Sort the remaining list in order: args, locals, globals, regs
set list [concat $used_Args $used_Locals $globals $used_Registers]
set list2 {}
foreach {name var} $special_names {
if {[set $var]} {
lappend list2 $name
}
}
set list [concat $list2 $list]
return $list
}
# ------------------------------------------------------------------
# METHOD: all_args - add/remove all args
# ------------------------------------------------------------------
method all_args {add} {
if {$add} {
set list1 $Variables
set list2 $Collect
} else {
set list1 $Collect
set list2 $Variables
}
# foreach var $Args {
# set i [lsearch $list1 $var]
# if {$i != -1} {
# set list1 [lreplace $list1 $i $i]
# lappend list2 $var
# }
# }
lappend list2 "All Arguments"
set i [lsearch $list1 "All Arguments"]
if {$i != -1} {
set list1 [lreplace $list1 $i $i]
}
return [list $list1 $list2]
}
# ------------------------------------------------------------------
# METHOD: all_locals - add/remove all locals
# ------------------------------------------------------------------
method all_locals {add} {
if {$add} {
set list1 $Variables
set list2 $Collect
} else {
set list1 $Collect
set list2 $Variables
}
# foreach var $Locals {
# set i [lsearch $list1 $var]
# if {$i != -1} {
# set list1 [lreplace $list1 $i $i]
# lappend list2 $var
# }
# }
lappend list2 "All Locals"
set i [lsearch $list1 "All Locals"]
if {$i != -1} {
set list1 [lreplace $list1 $i $i]
}
return [list $list1 $list2]
}
# ------------------------------------------------------------------
# METHOD: all_regs - add/remove all registers
# ------------------------------------------------------------------
method all_regs {add} {
if {$add} {
set list1 $Variables
set list2 $Collect
} else {
set list1 $Collect
set list2 $Variables
}
# foreach var $Registers {
# set i [lsearch $list1 "\$$var"]
# if {$i != -1} {
# set list1 [lreplace $list1 $i $i]
# lappend list2 "\$$var"
# }
# }
lappend list2 "All Registers"
set i [lsearch $list1 "All Registers"]
if {$i != -1} {
set list1 [lreplace $list1 $i $i]
}
return [list $list1 $list2]
}
# ------------------------------------------------------------------
# METHOD: change_other - add/remove a user defined type
# ------------------------------------------------------------------
method change_other {} {
set other [$OtherEntry get]
if {"$other" != ""} {
set added 0
# Check if this is a local/register/arg
set i [lsearch $Locals "$other"]
if {$i != -1} {
set i [lsearch $Collect "$other"]
set added 1
if {$i != -1} {
# It's a local on the collection list
debug "local on collection list"
set add 0
set list1 [lreplace $Collect $i $i]
set list2 [concat $Variables "$other"]
} else {
# It's a local on the variables list
debug "local on variable list"
set add 1
set i [lsearch $Variables "$other"]
set list1 [lreplace $Variables $i $i]
set list2 [concat $Collect "$other"]
}
}
set i [lsearch $Registers [string trim "$other" \$]]
if {$i != -1} {
set i [lsearch $Collect "$other"]
set added 1
if {$i != -1} {
# It's a register on the collection list
debug "register on collection list"
set add 0
set list1 [lreplace $Collect $i $i]
set list2 [concat $Variables "$other"]
} else {
# It's a register on the variables list
debug "register on variable list"
set add 1
set i [lsearch $Variables "$other"]
set list1 [lreplace $Variables $i $i]
set list2 [concat $Collect "$other"]
}
}
set i [lsearch $Args $other]
if {$i != -1} {
set i [lsearch $Collect "$other"]
set added 1
if {$i != -1} {
# It's an arg on the collection list
debug "arg on collection list"
set add 0
set list1 [lreplace $Collect $i $i]
set list2 [concat $Variables "$other"]
} else {
# It's an arg on the variables list
debug "arg on variable list"
set add 1
set i [lsearch $Variables "$other"]
set list1 [lreplace $Variables $i $i]
set list2 [concat $Collect "$other"]
}
}
# Check for special tags
if {!$added} {
if {"[string tolower $other]" == "all locals"} {
set i [lsearch $Variables "All Locals"]
if {$i != -1} {
# It's "All Locals" on the variables list
set add 1
set lists [all_locals 1]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
} else {
# It's "All Locals" on the Collect list
set add 0
set lists [all_locals 0]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
}
} elseif {"[string tolower $other]" == "all registers"} {
set i [lsearch $Variables "All Registers"]
if {$i != -1} {
# It's "All Registers" on the Variables list
set add 1
set lists [all_regs 1]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
} else {
set add 0
set lists [all_regs 0]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
}
} elseif {"[string tolower $other]" == "all arguments"} {
set i [lsearch $Variables "All Arguments"]
if {$i != -1} {
# It's "All Arguments" on the Variables list
set add 1
set lists [all_args 1]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
} else {
set add 0
set lists [all_args 0]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
}
} elseif {"[string tolower $other]" == "collect stack"} {
set i [lsearch $Variables "Collect Stack"]
if {$i != -1} {
# It's "All Arguments" on the Variables list
set add 1
set lists [all_args 1]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
} else {
set add 0
set lists [all_args 0]
set list1 [lindex $lists 0]
set list2 [lindex $lists 1]
}
} else {
# Check if this entry is on the Collect list
set i [lsearch $Collect $other]
if {$i != -1} {
# It's on the list -- remove it
set add 0
set list1 [lreplace $Collect $i $i]
set list2 $Variables
} else {
# It's not on the list -- add it
set other [string trim $other \ \r\t\n]
# accept everything, send to gdb to validate
set ok 1
# memranges will be rejected right here
if {[string range $other 0 1] == "\$("} {
tk_messageBox -type ok -icon error \
-message "Expression syntax not supported"
set ok 0
}
# do all syntax checking later
if {$ok} {
#debug "Keeping \"$other\""
# We MUST string out all spaces...
if {[regsub -all { } $other {} expression]} {
set other $expression
}
set add 1
set list1 $Variables
set list2 [concat $Collect "$other"]
} else {
#debug "Discarding \"$other\""
}
}
}
}
# Clear the entry
$OtherEntry delete 0 end
if {$add} {
set Variables $list1
set Collect $list2
} else {
set Variables $list2
set Collect $list1
}
fill_listboxes
}
}
# ------------------------------------------------------------------
# METHOD: get_selections - get all the selected variables
# pass 0 to get the selections from the collect box
# Returns a list of: listbox in which the selections were
# obtained, last element selected on the list, and all the
# selected elements
# ------------------------------------------------------------------
method get_selections {vars} {
if {$vars} {
set widget $VariablesLB
} else {
set widget $CollectLB
}
set elements [$widget curselection]
set list {}
set i 0
foreach i $elements {
lappend list [$widget get $i]
}
return [list $widget $i $elements]
}
# ------------------------------------------------------------------
# METHOD: cancel - cancel the dialog and do not set the trace
# ------------------------------------------------------------------
method cancel {} {
::delete object $this
}
method remove_special {list items} {
foreach item $items {
set i [lsearch $list $item]
if {$i != -1} {
set list [lreplace $list $i $i]
} else {
set i [lsearch $list \$$item]
if {$i != -1} {
set list [lreplace $list $i $i]
}
}
}
return $list
}
# ------------------------------------------------------------------
# METHOD: ok - validate the tracepoint and install it
# ------------------------------------------------------------------
method ok {} {
global _TStepCount
# Add anything in the OtherEntry
change_other
# Check that we are collecting data
if {[llength $Collect] == 0} {
# No data!
set msg "No data specified for the given action."
set answer [tk_messageBox -type ok -title "Tracepoint Error" \
-icon error \
-message $msg]
case $answer {
cancel {
cancel
}
ok {
return
}
}
}
set i [lsearch $Collect "All Locals"]
if {$i != -1} {
set data [lreplace $Collect $i $i]
set data [concat $data {$loc}]
# Remove all the locals from the list
set data [remove_special $data $Locals]
} else {
set data $Collect
}
set i [lsearch $data "All Registers"]
if {$i != -1} {
set data [lreplace $data $i $i]
set data [concat $data {$reg}]
# Remove all the locals from the list
set data [remove_special $data $Registers]
}
set i [lsearch $data "All Arguments"]
if {$i != -1} {
set data [lreplace $data $i $i]
set data [concat $data {$arg}]
# Remove all the locals from the list
set data [remove_special $data $Args]
}
set i [lsearch $data "Collect Stack"]
if {$i != -1} {
set data [lreplace $data $i $i]
set data [concat $data [collect_stack]]
}
# Remove repeats
set d {}
foreach i $data {
if {![info exists check($i)]} {
set check($i) 1
lappend d $i
}
}
if {$WhileStepping} {
set steps $_TStepCount
} else {
set steps 0
}
if {"$Data" != {}} {
set command "modify"
} else {
set command "add"
}
debug "DATA = $data"
eval $Callback $command $steps [list $data]
::delete object $this
}
method collect_stack {} {
return $StackCollect
}
method cmd {line} {
$line
}
# PUBLIC DATA
public variable File
public variable Line {}
public variable WhileStepping 0
public variable Number
public variable Callback
public variable Data {}
public variable Steps {}
public variable Address {}
# PROTECTED DATA
protected variable WhileSteppingEntry
protected variable CollectLB
protected variable VariablesLB
protected variable Variables {}
protected variable Collect {}
protected variable Locals
protected variable Args
protected variable Registers
protected variable Others {}
protected variable AddButton
protected variable RemoveButton
protected variable OtherEntry
protected variable StackCollect {*(char*)$sp@64}
}

View file

@ -0,0 +1,232 @@
# Attach Dialog for Insight.
# Copyright (C) 1999, 2002, 2003, 2008 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::body AttachDlg::constructor {args} {
eval itk_initialize $args
window_name "Attach To Process"
build_win
}
itcl::body AttachDlg::build_win {} {
# Frame
itk_component add pid {
iwidgets::labeledframe $itk_interior.f -labeltext "Choose Process" \
-relief groove -borderwidth 2 -ipadx 6 -ipady 4
}
# Listbox of processes
itk_component add choose_pid {
iwidgets::scrolledlistbox [$itk_component(pid) childsite].pid \
-visibleitems 30x15 -hscrollmode dynamic -vscrollmode dynamic\
-exportselection 0 -selectioncommand [code $this select_pid] \
-foreground $::Colors(textfg) -textbackground $::Colors(textbg) \
-dblclickcommand [code $this doit]
}
# Filter entryfield
itk_component add pid_filter {
iwidgets::entryfield [$itk_component(pid) childsite].filt \
-labeltext "Filter:" \
-foreground $::Colors(textfg) -textbackground $::Colors(textbg) \
-focuscommand [code $this clear_pid_selection] \
-command [code $this filter_pid_selection]
}
$itk_component(pid_filter) insert 0 *
# seperator
itk_component add pid_sep {
frame [$itk_component(pid) childsite].sep \
-height 2 -borderwidth 1 -relief sunken
}
# PID_ENTRY: this is the PID entry box. You can enter the pid
# by hand here, or click on the listbox to have it entered for you.
itk_component add pid_entry {
iwidgets::entryfield [$itk_component(pid) childsite].lab \
-labeltext "PID:" -validate numeric \
-foreground $::Colors(textfg) -textbackground $::Colors(textbg) \
-focuscommand [code $this clear_pid_selection]
}
pack $itk_component(choose_pid) -fill x -side top -pady 4
pack $itk_component(pid_filter) -fill x -side top -pady 4
pack $itk_component(pid_sep) -fill x -side top -pady 8
pack $itk_component(pid_entry) -fill x -side bottom -pady 4
itk_component add symbol_label {
iwidgets::labeledframe $itk_interior.sym -labeltext "Choose Exec file" \
-labelpos nw -relief groove -borderwidth 2 \
-ipadx 8 -ipady 6
}
itk_component add symbol_file {
iwidgets::entryfield [$itk_interior.sym childsite].f -labeltext "File:" \
-foreground $::Colors(textfg) -textbackground $::Colors(textbg)
}
pack $itk_component(symbol_file) -pady 4 -padx 4 -fill x
# can't use the -state in the entryfield, 'cause that affects the
# label as well...
#$itk_component(symbol_file) component entry configure -state disabled
$itk_component(symbol_file) configure -state normal
$itk_component(symbol_file) insert 0 $::gdb_exe_name
#$itk_component(symbol_file) configure -state disabled
itk_component add symbol_browse {
button [$itk_component(symbol_file) childsite].br -text "Choose..." \
-command [code $this choose_symbol_file]
}
pack $itk_component(symbol_browse) -pady 4 -padx 4 -ipadx 4
itk_component add button_box {
frame $itk_interior.b
}
itk_component add cancel {
button $itk_component(button_box).cancel -text "Cancel" \
-command [code $this cancel]
}
itk_component add ok {
button $itk_component(button_box).ok -text "OK" -command [code $this doit]
}
# if {$::gdb_exe_name == ""} {
# $itk_component(ok) configure -state disabled
# }
::standard_button_box $itk_component(button_box)
pack $itk_component(button_box) -side bottom -fill x -pady 4 -padx 4
pack $itk_component(symbol_label) -side bottom -fill x -pady 4 -padx 4
pack $itk_component(pid) -fill both -expand 1 -pady 4 -padx 4
after idle [list update idletasks; $this list_pids]
}
# ------------------------------------------------------------------
# METHOD: doit - This accepts the attach command.
# ------------------------------------------------------------------
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]
unpost
}
# ------------------------------------------------------------------
# METHOD: cancel - unpost the dialog box without attaching.
# ------------------------------------------------------------------
itcl::body AttachDlg::cancel {} {
set AttachDlg::last_button 0
set AttachDlg::last_pid {}
unpost
}
# ------------------------------------------------------------------
# METHOD: choose_symbol_file - Query for a new 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
$itk_component(symbol_file) clear
$itk_component(symbol_file) insert 0 $file
# $itk_component(symbol_file) configure -state disabled
$itk_component(ok) configure -state active
}
}
# ------------------------------------------------------------------
# METHOD: list_pids - List the available processes. Right now,
# this just spawns ps, which means we have to deal with
# all the different ps flags & output formats. At some
# point we should steal some C code to do it by hand.
# ------------------------------------------------------------------
itcl::body AttachDlg::list_pids {{pattern *}} {
global gdbtk_platform
switch $gdbtk_platform(os) {
Linux {
set ps_cmd "ps axw"
}
default {
set ps_cmd "ps w"
}
}
if {[catch {::open "|$ps_cmd" r} psH]} {
set errTxt "Could not exec ps: $psH
You will have to enter the PID by hand."
ManagedWin::open WarningDlg -message [list $errTxt]
return
}
gets $psH header
set nfields [llength $header]
set nfields_m_1 [expr {$nfields - 1}]
set regexp {^ *([^ ]*) +}
for {set i 1} {$i < $nfields_m_1} {incr i} {
append regexp {[^ ]* +}
}
append regexp {(.*)$}
$itk_component(choose_pid) clear
set pid_list {}
while {[gets $psH line] >= 0} {
regexp $regexp $line dummy PID COMMAND
if {[string match $pattern $COMMAND]} {
lappend pid_list [list $PID $COMMAND]
$itk_component(choose_pid) insert end $COMMAND
}
}
close $psH
$itk_component(choose_pid) selection set 0
select_pid
}
# ------------------------------------------------------------------
# METHOD: select_pid - Grab the selected element from the PID listbox
# and insert the associated PID into the entry form.
# ------------------------------------------------------------------
itcl::body AttachDlg::select_pid {} {
set hit [$itk_component(choose_pid) curselection]
if {$hit != ""} {
$itk_component(pid_entry) clear
$itk_component(pid_entry) insert 0 [lindex [lindex $pid_list $hit] 0]
}
}
# ------------------------------------------------------------------
# METHOD: clear_pid_selection - Clear the current 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.
# ------------------------------------------------------------------
itcl::body AttachDlg::filter_pid_selection {} {
list_pids [$itk_component(pid_filter) get]
}

View file

@ -0,0 +1,35 @@
#
# attachdlg.ith - itcl declarations for class AttachDlg
# ----------------------------------------------------------------------
# Implements Attach to process window
#
# ----------------------------------------------------------------------
# Copyright (C) 1999 Cygnus Solutions
#
itcl::class AttachDlg {
inherit ModalDialog ManagedWin
public {
method constructor {args}
proc last_button {} {return $last_button}
proc pid {} {return $last_pid}
proc symbol_file {} {return $symbol_file}
}
protected {
method build_win {args}
method cancel {}
method choose_symbol_file {}
method doit {}
method list_pids {{pattern *}}
method select_pid {}
method clear_pid_selection {}
method filter_pid_selection {}
variable pid_list
common last_button 0
common last_pid {}
common symbol_file
}
}

View file

@ -0,0 +1,227 @@
# Block and frame class implementations for GDBtk.
# Copyright (C) 1997, 1998, 1999 Cygnus Solutions
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ------------------------------------------------------------------
# Block
# ------------------------------------------------------------------
itcl::body Block::constructor {start end args} {
# Record runtime info about this block
set _start $start
set _end $end
set _variables [_findVariables]
eval configure $args
}
# Destroy ourself.
itcl::body Block::destructor {} {
# Each block is responsible for destroying its
# variables and removing them from the list of
# of all variables for this frame
foreach var $_variables {
$var delete
}
}
# Return a list of variables defined in this block
# This list is determined when we are created.
itcl::body Block::variables {} {
return $_variables
}
# Find the new variables for this block.
itcl::body Block::_findVariables {} {
# Find the new variables for this block.
set variables [gdb_block_variables $_start $_end]
# Create variables.
set vars {}
foreach variable $variables {
# Be paranoid: catch errors constructing variable.
set err [catch {gdb_variable create -expr $variable} obj]
if {!$err} {
lappend vars $obj
}
}
return $vars
}
itcl::body Block::update {} {
set changed {}
foreach var $_variables {
set changed [concat $changed [$var update]]
}
return $changed
}
itcl::body Block::info {} {
return [list $_start $_end]
}
# ------------------------------------------------------------------
# Frame
# ------------------------------------------------------------------
itcl::body Frame::constructor {addr} {
set _addr $addr
# Create all blocks in the selected frame
set _blocks {}
_createBlocks [gdb_get_blocks]
}
itcl::body Frame::destructor {} {
# destroy our own blocks
foreach block $_blocks {
_removeBlock $block
}
}
itcl::body Frame::_removeBlock {blockObj} {
set i [lsearch $_blocks $blockObj]
if {$i != -1} {
set _blocks [lreplace $_blocks $i $i]
delete object $blockObj
}
}
itcl::body Frame::_addBlock {block} {
set start [lindex $block 0]
set end [lindex $block 1]
set b [Block \#auto $start $end]
lappend _blocks $b
return $b
}
itcl::body Frame::_createBlocks {blocks} {
foreach block $blocks {
set b [_addBlock $block]
}
}
itcl::body Frame::update {} {
set vars {}
foreach block $_blocks {
set vars [concat $vars [$block update]]
}
return $vars
}
itcl::body Frame::variables {} {
set vars {}
foreach block $_blocks {
set vars [concat $vars [$block variables]]
}
return $vars
}
itcl::body Frame::new {} {
# find any new variables. So get a list of all blocks,
# eliminate duplicates, and get those variables.
set blocks [gdb_get_blocks]
set new {}
foreach block $blocks {
set b [_findBlock $block]
if {$b == ""} {
# Found a new block. Create it get its variables
set b [_addBlock $block]
set new [concat $new [$b variables]]
}
}
return $new
}
itcl::body Frame::deleteOld {} {
foreach block [_oldBlocks] {
_removeBlock $block
}
}
itcl::body Frame::_oldBlocks {} {
set blocks [gdb_get_blocks]
set oldObjs $_blocks
foreach block $blocks {
set obj [_findBlock $block]
if {$obj != ""} {
# Found it.. Remove it from old
set i [lsearch $oldObjs $obj]
set oldObjs [lreplace $oldObjs $i $i]
}
}
return $oldObjs
}
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
# might want to keep these variables around for a little while
# longer.
set vars {}
set old [_oldBlocks]
foreach block $old {
set vars [concat $vars [$block variables]]
}
return $vars
}
itcl::body Frame::_findBlock {block} {
foreach b $_blocks {
set info [$b info]
if {$info == $block} {
return $b
}
}
return ""
}
itcl::body Frame::_findBlockIndex {block} {
set i 0
foreach b $_blocks {
set info [$b info]
if {$info == $block} {
return $i
}
incr i
}
return -1
}

View file

@ -0,0 +1,63 @@
# Class definitions for blocks and frames for GDBtk.
# Copyright (C) 1997, 1998, 1999 Cygnus Solutions
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class Block {
public {
method constructor {start end args}
method destructor {}
method variables {}
method update {}
method info {}
}
private {
# Start and end address for this block
variable _start
variable _end
# List of variables (new) variables defined in this block
variable _variables
method _findVariables {}
}
}
itcl::class Frame {
public {
method constructor {addr}
method destructor {}
method variables {}
method update {}
method new {}
method old {}
method deleteOld {}
method address {} { return $_addr }
}
private {
method _createBlocks {blocks}
method _addBlock {block}
method _findBlock {block}
method _findBlockIndex {block}
method _removeBlock {blockObj}
method _oldBlocks {}
# Our address
variable _addr
# A list of all blocks
variable _blocks
}
}

View file

@ -0,0 +1,728 @@
# Breakpoint window for Insight.
# Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2008 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ------------------------------------------------------------------
# CONSTRUCTOR: create the main breakpoint window
# ------------------------------------------------------------------
itcl::body BpWin::constructor {args} {
window_name "Breakpoints" "BPs"
if {[pref getd gdb/bp/menu] != ""} {
set mbar 0
}
set show_threads [pref get gdb/bp/show_threads]
debug "Ready to build"
build_win
eval itk_initialize $args
# The scrolledframe uses a canvas, which doesn't properly
# calculate an initial size, so we must set a default
# window size here. ManagedWin could override this still
# if there is a user preference for the geometry.
wm geometry $_top 350x165
debug "done building"
}
# ------------------------------------------------------------------
# DESTRUCTOR: destroy the breakpoint window
# ------------------------------------------------------------------
itcl::body BpWin::destructor {} {}
# ------------------------------------------------------------------
# METHOD: build_win - build the main breakpoint window
# ------------------------------------------------------------------
itcl::body BpWin::build_win {} {
global _bp_en _bp_disp
set bg1 $::Colors(bg)
set hsmode dynamic
set vsmode dynamic
# FIXME: The iwidgets scrolled frame is pretty useless.
# When we get BLT, use its hiertable to do this.
itk_component add sframe {
iwidgets::scrolledframe $itk_interior.sf \
-hscrollmode $hsmode -vscrollmode $vsmode
}
set twin [$itk_component(sframe) childsite]
# write header
if {$tracepoints} {
label $twin.num0 -text "Num" -relief raised -bd 2 -anchor center \
-font global/fixed
}
label $twin.thread0 -text "Thread" -relief raised -bd 2 -anchor center \
-font global/fixed
label $twin.addr0 -text "Address" -relief raised -bd 2 -anchor center \
-font global/fixed
label $twin.file0 -text "File" -relief raised -bd 2 -anchor center \
-font global/fixed
label $twin.line0 -text "Line" -relief raised -bd 2 -anchor center \
-font global/fixed
label $twin.func0 -text "Function" -relief raised -bd 2 -anchor center \
-font global/fixed
if {$tracepoints} {
label $twin.pass0 -text "PassCount" -relief raised -borderwidth 2 \
-anchor center -font global/fixed
grid x $twin.num0 $twin.addr0 $twin.file0 $twin.line0 $twin.func0 $twin.pass0 \
-sticky new
} else {
if {$show_threads} {
grid x $twin.thread0 $twin.addr0 $twin.file0 $twin.line0 $twin.func0 -sticky new
# Let the File and Function columns expand; no others.
grid columnconfigure $twin 3 -weight 1
grid columnconfigure $twin 5 -weight 1
} else {
grid x $twin.addr0 $twin.file0 $twin.line0 $twin.func0 -sticky new
# Let the File and Function columns expand; no others.
grid columnconfigure $twin 2 -weight 1
grid columnconfigure $twin 4 -weight 1
}
}
# The last row must always suck up all the leftover vertical
# space.
set next_row 1
grid rowconfigure $twin $next_row -weight 1
if { $mbar } {
menu $itk_interior.m -tearoff 0
[winfo toplevel $itk_interior] configure -menu $itk_interior.m
if { $tracepoints == 0 } {
$itk_interior.m add cascade -menu $itk_interior.m.bp -label "Breakpoint" -underline 0
} else {
$itk_interior.m add cascade -menu $itk_interior.m.bp -label "Tracepoint" -underline 0
}
set m [menu $itk_interior.m.bp]
if { $tracepoints == 0 } {
$m add radio -label "Normal" -variable _bp_disp($selected) \
-value donttouch -underline 0 -state disabled
$m add radio -label "Temporary" -variable _bp_disp($selected) \
-value delete -underline 0 -state disabled
} else {
$m add command -label "Actions" -underline 0 -state disabled
}
$m add separator
$m add radio -label "Enabled" -variable _bp_en($selected) -value 1 \
-underline 0 -state disabled
$m add radio -label "Disabled" -variable _bp_en($selected) -value 0 \
-underline 0 -state disabled
$m add separator
$m add command -label "Remove" -underline 0 -state disabled
$itk_interior.m add cascade -menu $itk_interior.m.all -label "Global" \
-underline 0
set m [menu $itk_interior.m.all]
$m add check -label " Show Threads" \
-variable [pref varname gdb/bp/show_threads] \
-underline 1 -command "$this toggle_threads"
$m add separator
$m add command -label "Disable All" -underline 0 \
-command "$this bp_all disable"
$m add command -label "Enable All" -underline 0 \
-command "$this bp_all enable"
$m add separator
$m add command -label "Remove All" -underline 0 \
-command "$this bp_all delete"
$m add separator
$m add command -label "Store Breakpoints..." -underline 0 \
-command [code $this bp_store]
$m add command -label "Restore Breakpoints..." -underline 3 \
-command [code $this bp_restore]
}
set Menu [menu $itk_interior.pop -tearoff 0]
if { $tracepoints == 0 } {
$Menu add radio -label "Normal" -variable _bp_disp($selected) \
-value donttouch -underline 0
$Menu add radio -label "Temporary" -variable _bp_disp($selected) \
-value delete -underline 0
} else {
$Menu add command -label "Actions" -underline 0
}
$Menu add separator
$Menu add radio -label "Enabled" -variable _bp_en($selected) -value 1 -underline 0
$Menu add radio -label "Disabled" -variable _bp_en($selected) -value 0 -underline 0
$Menu add separator
$Menu add command -label "Remove" -underline 0
$Menu add cascade -menu $Menu.all -label "Global" -underline 0
set m [menu $Menu.all]
$m add check -label " Show Threads" -variable [pref varname gdb/bp/show_threads] \
-underline 1 -command "$this toggle_threads"
$m add separator
$m add command -label "Disable All" -underline 0 -command "$this bp_all disable"
$m add command -label "Enable All" -underline 0 -command "$this bp_all enable"
$m add separator
$m add command -label "Remove All" -underline 0 -command "$this bp_all delete"
if { $tracepoints == 0 } {
# insert all breakpoints
foreach i [gdb_get_breakpoint_list] {
set e [BreakpointEvent \#auto -action create -number $i]
bp_add $e
delete object $e
}
} else {
# insert all tracepoints
foreach i [gdb_get_tracepoint_list] {
set e [TracepointEvent \#auto -action create -number $i]
bp_add $e 1
delete object $e
}
}
pack $itk_component(sframe) -side left -expand true -fill both
}
# ------------------------------------------------------------------
# METHOD: bp_add - add a breakpoint entry
# ------------------------------------------------------------------
itcl::body BpWin::bp_add {bp_event {tracepoint 0}} {
global _bp_en _bp_disp gdbtk_platform _files
set number [$bp_event get number]
set thread [$bp_event get thread]
set disposition [$bp_event get disposition]
set file [$bp_event get file]
if {$tracepoint} {
set diposition tracepoint
set bptype tracepoint
} else {
set bptype breakpoint
}
debug "bp_add bpnum=$number thread=$thread show=$show_threads"
set i $next_row
set _bp_en($i) [$bp_event get enabled]
set _bp_disp($i) $disposition
set temp($i) ""
switch $disposition {
donttouch { set color [pref get gdb/src/bp_fg] }
delete {
set color [pref get gdb/src/temp_bp_fg]
set temp($i) delete
}
tracepoint {
set color [pref get gdb/src/trace_fg]
}
default { set color yellow }
}
if {$thread != "-1"} {set color [pref get gdb/src/thread_fg]}
if {$gdbtk_platform(platform) == "windows"} {
checkbutton $twin.en$i -relief flat -variable _bp_en($i) \
-activebackground $bg1 -command "$this bp_able $i" -fg $color
} else {
checkbutton $twin.en$i -relief flat -variable _bp_en($i) \
-command "$this bp_able $i" -activebackground $bg1 \
-selectcolor $color -highlightbackground $bg1
}
if {$tracepoints} {
label $twin.num$i -text "$number " -relief flat -anchor w -font global/fixed
}
label $twin.addr$i -text "[gdb_CA_to_TAS [$bp_event get address]] " -relief flat -anchor w -font global/fixed -bg $bg1
if {[info exists _files(short,$file)]} {
set file $_files(short,$file)
} else {
# FIXME. Really need to do better than this.
set file [::file tail $file]
}
if {$show_threads} {
if {$thread == "-1"} {set thread "ALL"}
label $twin.thread$i -text "$thread " -relief flat -anchor w -font global/fixed
}
label $twin.file$i -text "$file " -relief flat -anchor w -font global/fixed
label $twin.line$i -text "[$bp_event get line] " -relief flat -anchor w -font global/fixed
label $twin.func$i -text "[$bp_event get function] " -relief flat -anchor w -font global/fixed
if {$tracepoints} {
label $twin.pass$i -text "[$bp_event get pass_count] " -relief flat -anchor w -font global/fixed
}
if {$mbar} {
set zz [list addr file func line]
if {$tracepoints} {lappend zz num pass}
if {$show_threads} {lappend zz thread}
foreach thing $zz {
bind $twin.${thing}${i} <1> "$this bp_select $i"
bind $twin.${thing}${i} <Double-1> "$this goto_bp $i"
bind $twin.${thing}${i} <3> [code $this _select_and_popup $i %X %Y]
}
}
if {$tracepoints} {
grid $twin.en$i $twin.num$i $twin.addr$i $twin.file$i $twin.line$i \
$twin.func$i $twin.pass$i -sticky new -ipadx 4 -ipady 2
} else {
if {$show_threads} {
grid $twin.en$i $twin.thread$i $twin.addr$i $twin.file$i $twin.line$i \
$twin.func$i -sticky new -ipadx 4 -ipady 2
} else {
grid $twin.en$i $twin.addr$i $twin.file$i $twin.line$i \
$twin.func$i -sticky new -ipadx 4 -ipady 2
}
}
# This used to be the last row. Fix it vertically again.
grid rowconfigure $twin $i -weight 0
set index_to_bpnum($i) $number
set Index_to_bptype($i) $bptype
incr i
set next_row $i
grid rowconfigure $twin $i -weight 1
}
# ------------------------------------------------------------------
# METHOD: bp_store - stores away the breakpoints in a file of gdb
# commands
# ------------------------------------------------------------------
itcl::body BpWin::bp_store {} {
set out_file [tk_getSaveFile]
if {$out_file == ""} {
return
}
if {[catch {::open $out_file w} outH]} {
tk_messageBox -message "Could not open $out_file: $outH"
return
}
foreach breakpoint [gdb_get_breakpoint_list] {
# This is an lassign
foreach {file function line_no address type \
enable_p disp ignore cmds cond thread hit_count user_spec} \
[gdb_get_breakpoint_info $breakpoint] {
break
}
if {$user_spec != ""} {
set bp_specifier $user_spec
} elseif {$file != ""} {
set filename [file tail $file]
set bp_specifier $filename:$line_no
} else {
set bp_specifier *$address
}
# FIXME: doesn't handle watchpoints.
if {[string compare $disp "delete"] == 0} {
puts $outH "tbreak $bp_specifier"
} else {
puts $outH "break $bp_specifier"
}
if {!$enable_p} {
puts $outH "disable \$bpnum"
}
if {$ignore > 0} {
puts $outH "ignore \$bpnum $ignore"
}
}
close $outH
}
# ------------------------------------------------------------------
# METHOD: bp_restore - restore the breakpoints from a file of gdb
# commands
# ------------------------------------------------------------------
itcl::body BpWin::bp_restore {} {
set inH [tk_getOpenFile]
if {$inH == ""} {
return
}
bp_all delete
if {[catch {gdb_cmd "source $inH"} err]} {
tk_messageBox -message "Error sourcing in BP file $inH: \"$err\""
}
}
# ------------------------------------------------------------------
# METHOD: bp_select - select a row in the grid
# ------------------------------------------------------------------
itcl::body BpWin::bp_select { r } {
global _bp_en _bp_disp
set zz [list addr file func line]
if {$tracepoints} {lappend zz num pass}
if {$show_threads} {lappend zz thread}
if {$selected} {
set i $selected
foreach thing $zz {
$twin.${thing}${i} configure -fg $::Colors(fg) -bg $bg1
}
}
# if we click on the same line, unselect it and return
if {$selected == $r} {
set selected 0
if {$tracepoints == 0} {
$itk_interior.m.bp entryconfigure "Normal" -state disabled
$itk_interior.m.bp entryconfigure "Temporary" -state disabled
} else {
$itk_interior.m.bp entryconfigure "Actions" -state disabled
}
$itk_interior.m.bp entryconfigure "Enabled" -state disabled
$itk_interior.m.bp entryconfigure "Disabled" -state disabled
$itk_interior.m.bp entryconfigure "Remove" -state disabled
return
}
foreach thing $zz {
$twin.${thing}${r} configure -fg $::Colors(sfg) -bg $::Colors(sbg)
}
if {$tracepoints == 0} {
$itk_interior.m.bp entryconfigure "Normal" -variable _bp_disp($r) \
-command "$this bp_type $r" -state normal
$itk_interior.m.bp entryconfigure "Temporary" -variable _bp_disp($r) \
-command "$this bp_type $r" -state normal
$Menu entryconfigure "Normal" -variable _bp_disp($r) \
-command "$this bp_type $r" -state normal
$Menu entryconfigure "Temporary" -variable _bp_disp($r) \
-command "$this bp_type $r" -state normal
} else {
$itk_interior.m.bp entryconfigure "Actions" -command "$this get_actions $r" -state normal
$Menu entryconfigure "Actions" -command "$this get_actions $r" -state normal
}
$itk_interior.m.bp entryconfigure "Enabled" -variable _bp_en($r) \
-command "$this bp_able $r" -state normal
$itk_interior.m.bp entryconfigure "Disabled" -variable _bp_en($r) \
-command "$this bp_able $r" -state normal
$itk_interior.m.bp entryconfigure "Remove" -command "$this bp_remove $r" -state normal
$Menu entryconfigure "Enabled" -variable _bp_en($r) \
-command "$this bp_able $r" -state normal
$Menu entryconfigure "Disabled" -variable _bp_en($r) \
-command "$this bp_able $r" -state normal
$Menu entryconfigure "Remove" -command "$this bp_remove $r" -state normal
set selected $r
}
# ------------------------------------------------------------------
# NAME: private method BpWin::_select_and_popup
# DESCRIPTION: Select the given breakpoint and popup the options
# menu at the given location.
#
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
itcl::body BpWin::_select_and_popup {bp X Y} {
if {$selected != $bp} {
bp_select $bp
}
tk_popup $Menu $X $Y
}
# ------------------------------------------------------------------
# METHOD: bp_modify - modify a breakpoint entry
# ------------------------------------------------------------------
itcl::body BpWin::bp_modify {bp_event {tracepoint 0}} {
global _bp_en _bp_disp gdbtk_platform _files
set number [$bp_event get number]
set thread [$bp_event get thread]
set disposition [$bp_event get disposition]
set file [$bp_event get file]
if {$tracepoint} {
set disposition tracepoint
set bptype tracepoint
} else {
set bptype breakpoint
}
set found 0
for {set i 1} {$i < $next_row} {incr i} {
if { $number == $index_to_bpnum($i)
&& "$Index_to_bptype($i)" == "$bptype"} {
incr found
break
}
}
if {!$found} {
debug "ERROR: breakpoint number $number not found!"
return
}
if {$_bp_en($i) != [$bp_event get enabled]} {
set _bp_en($i) [$bp_event get enabled]
}
if {$_bp_disp($i) != $disposition} {
set _bp_disp($i) $disposition
}
switch $disposition {
donttouch { set color [pref get gdb/src/bp_fg] }
delete {
set color [pref get gdb/src/temp_bp_fg]
}
tracepoint { set color [pref get gdb/src/trace_fg] }
default { set color yellow}
}
if {$thread != "-1"} {set color [pref get gdb/src/thread_fg]}
if {$gdbtk_platform(platform) == "windows"} then {
$twin.en$i configure -fg $color
} else {
$twin.en$i configure -selectcolor $color
}
if {$tracepoints} {
$twin.num$i configure -text "$number "
}
$twin.addr$i configure -text "[gdb_CA_to_TAS [$bp_event get address]] "
if {[info exists _files(short,$file)]} {
set file $_files(short,$file)
} else {
# FIXME. Really need to do better than this.
set file [::file tail $file]
}
if {$show_threads} {
if {$thread == "-1"} {set thread "ALL"}
$twin.thread$i configure -text "$thread "
}
$twin.file$i configure -text "$file "
$twin.line$i configure -text "[$bp_event get line] "
$twin.func$i configure -text "[$bp_event get function] "
if {$tracepoints} {
$twin.pass$i configure -text "[$bp_event get pass_count] "
}
}
# ------------------------------------------------------------------
# METHOD: bp_able - enable/disable a breakpoint
# ------------------------------------------------------------------
itcl::body BpWin::bp_able { i } {
global _bp_en
bp_select $i
switch $Index_to_bptype($i) {
breakpoint {set type {}}
tracepoint {set type "tracepoint"}
}
if {$_bp_en($i) == "1"} {
set command "enable $type $temp($i) "
} else {
set command "disable $type "
}
append command "$index_to_bpnum($i)"
gdb_cmd "$command"
}
# ------------------------------------------------------------------
# METHOD: bp_remove - remove a breakpoint
# ------------------------------------------------------------------
itcl::body BpWin::bp_remove { i } {
bp_select $i
switch $Index_to_bptype($i) {
breakpoint { set type {} }
tracepoint { set type "tracepoint" }
}
gdb_cmd "delete $type $index_to_bpnum($i)"
}
# ------------------------------------------------------------------
# METHOD: bp_type - change the breakpoint type (disposition)
# ------------------------------------------------------------------
itcl::body BpWin::bp_type { i } {
if {$Index_to_bptype($i) != "breakpoint"} {
return
}
set bpnum $index_to_bpnum($i)
#debug "bp_type $i $bpnum"
set bpinfo [gdb_get_breakpoint_info $bpnum]
lassign $bpinfo file func line pc type enabled disposition \
ignore_count commands cond thread hit_count user_spec
bp_select $i
switch $disposition {
delete {
gdb_cmd "delete $bpnum"
gdb_cmd "break *$pc"
}
donttouch {
gdb_cmd "delete $bpnum"
gdb_cmd "tbreak *$pc"
}
default { debug "Unknown breakpoint disposition: $disposition" }
}
}
# ------------------------------------------------------------------
# METHOD: bp_delete - delete a breakpoint
# ------------------------------------------------------------------
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) } {
if {$tracepoints} {
grid forget $twin.en$i $twin.num$i $twin.addr$i $twin.file$i \
$twin.line$i $twin.func$i $twin.pass$i
destroy $twin.en$i $twin.num$i $twin.addr$i $twin.file$i \
$twin.line$i $twin.func$i $twin.pass$i
} else {
if {$show_threads} {
grid forget $twin.thread$i
destroy $twin.thread$i
}
grid forget $twin.en$i $twin.addr$i $twin.file$i $twin.line$i $twin.func$i
destroy $twin.en$i $twin.addr$i $twin.file$i $twin.line$i $twin.func$i
}
if {$selected == $i} {
set selected 0
}
return
}
}
}
# ------------------------------------------------------------------
# PUBLIC METHOD: breakpoint - Update widget when a breakpoint
# event is received from the backend.
# ------------------------------------------------------------------
itcl::body BpWin::breakpoint {bp_event} {
set action [$bp_event get action]
#debug "bp update $action [$bp_event get number] [$bp_event get type]"
switch $action {
modify { bp_modify $bp_event 0 }
create { bp_add $bp_event 0 }
delete { bp_delete $bp_event }
default { dbug E "Unknown breakpoint action: $action" }
}
}
# ------------------------------------------------------------------
# METHOD: tracepoint - Update widget when a tracepoint event
# is received from the backend.
# ------------------------------------------------------------------
itcl::body BpWin::tracepoint {tp_event} {
set action [$tp_event get action]
#debug "tp update $action [$tp_event get number]"
switch $action {
modify { bp_modify $tp_event 1 }
create { bp_add $tp_event 1 }
delete { bp_delete $tp_event }
default { dbug E "Unknown tracepoint action: $action" }
}
}
# ------------------------------------------------------------------
# METHOD: bp_all - perform a command on all breakpoints
# ------------------------------------------------------------------
itcl::body BpWin::bp_all { command } {
if {!$tracepoints} {
# Do all breakpoints
foreach bpnum [gdb_get_breakpoint_list] {
if { $command == "enable"} {
for {set i 1} {$i < $next_row} {incr i} {
if { $bpnum == $index_to_bpnum($i)
&& "$Index_to_bptype($i)" == "breakpoint"} {
gdb_cmd "enable $temp($i) $bpnum"
break
}
}
} else {
gdb_cmd "$command $bpnum"
}
}
} else {
# Do all tracepoints
foreach bpnum [gdb_get_tracepoint_list] {
if { $command == "enable"} {
for {set i 1} {$i < $next_row} {incr i} {
if { $bpnum == $index_to_bpnum($i)
&& "$Index_to_bptype($i)" == "tracepoint"} {
gdb_cmd "enable tracepoint $bpnum"
break
}
}
} else {
gdb_cmd "$command tracepoint $bpnum"
}
}
}
}
# ------------------------------------------------------------------
# METHOD: get_actions - pops up the add trace dialog on a selected
# tracepoint
# ------------------------------------------------------------------
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 \
step_count thread hit_count actions
set filename [::file tail $file]
ManagedWin::open TraceDlg -File $filename -Lines $line
}
# ------------------------------------------------------------------
# METHOD: toggle_threads - callback when show_threads is toggled
# ------------------------------------------------------------------
itcl::body BpWin::toggle_threads {} {
set show_threads [pref get gdb/bp/show_threads]
reconfig
}
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
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 }
if {[winfo exists $itk_interior.sf]} { destroy $itk_interior.sf }
if {[winfo exists $itk_interior.pop]} { destroy $itk_interior.pop }
build_win
}
# ------------------------------------------------------------------
# METHOD: goto_bp - show bp in source window
# ------------------------------------------------------------------
itcl::body BpWin::goto_bp {r} {
set bpnum $index_to_bpnum($r)
if {$tracepoints} {
set bpinfo [gdb_get_tracepoint_info $bpnum]
} else {
set bpinfo [gdb_get_breakpoint_info $bpnum]
}
set pc [lindex $bpinfo 3]
SrcWin::choose_and_display BROWSE_TAG [gdb_loc *$pc]
}

View file

@ -0,0 +1,59 @@
# Breakpoint window class definition for Insight
# Copyright (C) 1997, 1998, 1999, 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class BpWin {
inherit EmbeddedWin GDBWin
public {
variable tracepoints 0
method constructor {args}
method destructor {}
method bp_select {r}
method bp_able { i }
method bp_remove { i }
method bp_restore {}
method bp_store {}
method bp_type { i }
method bp_all { command }
method get_actions {bpnum}
method toggle_threads {}
method reconfig {}
method goto_bp {r}
# GDB Events
method breakpoint {event}
method tracepoint {event}
}
private {
variable twin
variable next_row 0
variable index_to_bpnum
variable Index_to_bptype
variable temp
variable mbar 1
variable selected 0
variable bg1
variable Menu
variable show_threads ;#cached copy of [pref get gdb/bp/show_threads]
method build_win {}
method bp_add {bp_event {tracepoint 0}}
method bp_modify {bp_event {tracepoint 0}}
method bp_delete {bp_event}
method _select_and_popup {bp X Y}
}
}

View file

@ -0,0 +1,731 @@
# Browswer window for Insight.
# Copyright (C) 1998, 1999, 2001, 2002, 2003 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Implements Browser window for Insight
#
# ----------------------------------------------------------------------
option add *BrowserWin.textBackground $::Colors(textbg)
# ------------------------------------------------------------------
# CONSTRUCTOR - create new browser window
# ------------------------------------------------------------------
itcl::body BrowserWin::constructor {args} {
debug
#eval itk_initialize $args
window_name "Function Browser"
set _layout [pref get gdb/browser/layout]
set Current(filename) {}
set Current(function) {}
_build_win
eval itk_initialize $args
add_hook file_changed_hook [code $this _fill_file_box]
}
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
itcl::body BrowserWin::destructor {} {
debug
if {$filter_trace_after != ""} {
after cancel $filter_trace_after
}
remove_hook file_changed_hook [code $this _fill_file_box]
trace vdelete [pref varname gdb/search/last_symbol] \
w [code $this _filter_trace_proc]
}
# ------------------------------------------------------------------
# METHOD: _build_win - build the main browser window
# ------------------------------------------------------------------
itcl::body BrowserWin::_build_win {} {
debug
# popup menu
itk_component add popup {
menu $itk_interior.pop -tearoff 0
} {}
set pop $itk_component(popup)
$pop add command -label "Toggle Layout" -command [code $this _switch_layout]
$pop add command -label "Help" -command "open_help browser.html"
$pop add separator
$pop add command -label "Close" -command "destroy [winfo toplevel $itk_interior]"
bind [winfo toplevel $itk_interior] <3> "tk_popup $itk_component(popup) %X %Y"
# Four Main Frames: filter, files, functions, and view (source)
# Their layout depends on _layout
if {$_layout == 1} {
set p [cyg::panedwindow $itk_interior.p -orient vertical -height 5i \
-width 5i]
$p add left
set p2 [cyg::panedwindow [$p childsite left].p]
$p2 add file
_build_file_frame [$p2 childsite file]
$p2 add filter
set f [frame [$p2 childsite filter].f]
_build_filter_frame $f
_build_function_frame $f
pack $f -fill both -expand yes
pack $p2 -fill both -expand yes
$p add view
_build_view_frame [$p childsite view]
} else {
set p [cyg::panedwindow $itk_interior.p -height 5i -width 5i]
$p add top
set f [frame [$p childsite top].f]
_build_filter_frame $f
set browser [cyg::panedwindow $f.p -orient vertical]
$browser add file
_build_file_frame [$browser childsite file]
$browser add function
_build_function_frame [$browser childsite function]
pack $browser -fill both -expand yes
pack $f -fill both -expand yes
$p add view
_build_view_frame [$p childsite view]
}
# Fill file box
_fill_file_box
pack $p -fill both -expand yes
}
# ------------------------------------------------------------------
# METHOD: _filter_trace_proc
# This is called when something is entered in the filter
# box. The actual filtering is done in an after to avoid
# flashing too much if the user is typing quickly.
# ------------------------------------------------------------------
itcl::body BrowserWin::_filter_trace_proc {v1 v2 mode} {
if {$filter_trace_after != ""} {
after cancel $filter_trace_after
}
set filter_trace_after [after 100 [code $this _filter_trace_after]]
}
# ------------------------------------------------------------------
# METHOD: _filter_trace_after
# This is a wrapper around search, needed to pass to trace
# ------------------------------------------------------------------
itcl::body BrowserWin::_filter_trace_after {} {
set filter_trace_after ""
search
}
# ------------------------------------------------------------------
# METHOD: _search_src
# Search for text or jump to a specific line
# in source window, going in the specified DIRECTION.
# ------------------------------------------------------------------
itcl::body BrowserWin::_search_src {direction} {
set exp [$itk_component(view_search) get]
$itk_component(view_src) search $exp $direction
}
# ------------------------------------------------------------------
# METHOD: search
# Search for functions matching regexp/pattern
# in specified files
# ------------------------------------------------------------------
itcl::body BrowserWin::search {} {
set files [$itk_component(file_box) getcurselection]
if {[llength $files] == 0} {
return
}
_freeze_me
set filt_pat [format $filter_regexp($cur_filter_mode) \
[pref get gdb/search/last_symbol]]
if {[llength $files] == [$itk_component(file_box) size]} {
set err [catch {gdb_search functions $filt_pat \
-filename 1} matches]
} else {
set err [catch {gdb_search functions $filt_pat \
-files $files -filename 1} matches]
}
if {$err} {
debug "ERROR searching for [pref get gdb/search/last_symbol]: $matches"
_thaw_me
return
}
$itk_component(func_box) delete 0 end
set i -1
catch {unset index_to_file}
foreach func [lsort -command "list_element_strcmp 0" $matches] {
$itk_component(func_box) insert end [lindex $func 0]
set index_to_file([incr i]) [lindex $func 1]
}
_thaw_me
}
# ------------------------------------------------------------------
# METHOD: _process_file_selection
# This fills the func combo, and the more window if it
# is currently open with the hit in the File combobox.
# ------------------------------------------------------------------
itcl::body BrowserWin::_process_file_selection {y} {
set curIndex [$itk_component(file_box) nearest $y]
set curSelection [$itk_component(file_box) curselection]
# We got a button-release - First make sure the click selected the item...
if {[lsearch $curIndex $curSelection] >= 0} {
_fill_source [$itk_component(file_box) get $curIndex] 0
} else {
# If the item was deselected, go back to the first one in the list...
# It would be better to keep a stack of the clicked items, and go to the
# last one on the stack. But in extended mode, this is tricky. FIXME
if {[llength $curSelection] > 0} {
_fill_source [$itk_component(file_box) get [lindex $curSelection 0]] 0
} else {
_fill_source ""
}
}
search
}
# ------------------------------------------------------------------
# METHOD: _process_func_selection
# This points the more window to the hit in the Func combobox
# if it is currently open.
# ------------------------------------------------------------------
itcl::body BrowserWin::_process_func_selection {y} {
set curIndex [$itk_component(func_box) nearest $y]
set curSelection [$itk_component(func_box) curselection]
# We got a button-release - First make sure the click selected the item...
if {[lsearch $curIndex $curSelection] >= 0} {
set funcName [$itk_component(func_box) get $curIndex]
set fileName $index_to_file($curIndex)
_fill_source $funcName 1 $fileName
}
}
# ------------------------------------------------------------------
# METHOD: do_all_bp
# Toggle a bp at every selected function in FuncLB
# ------------------------------------------------------------------
itcl::body BrowserWin::do_all_bp {onp} {
set funcs [$itk_component(func_box) getcurselection]
_freeze_me
foreach f $funcs {
if {[catch {gdb_loc $f} linespec]} {
dbug W "Could not gdb_loc \"$f\""
return
}
set bpnum [bp_exists $linespec]
if {$bpnum == -1 && $onp} {
# FIXME: gdb_set_bp is the preferred method, but it requires
# a file and line number. This doesn't work very well for
# templates...
gdb_cmd "break $f"
} elseif {!$onp} {
catch {gdb_cmd "delete $bpnum"}
}
}
_thaw_me
}
# ------------------------------------------------------------------
# METHOD: _toggle_bp
# Toggle bp at function specified by the given Y
# coordinate in the listbox
# ------------------------------------------------------------------
itcl::body BrowserWin::_toggle_bp {y} {
set f [$itk_component(func_box) get [$itk_component(func_box) nearest $y]]
if {$f != ""} {
if {[catch {gdb_loc $f} linespec]} {
return
}
set bpnum [bp_exists $linespec]
if {$bpnum == -1} {
# FIXME: gdb_set_bp is the preferred method, but it requires
# a file and line number. This doesn't work very well for
# templates...
gdb_cmd "break $f"
} else {
catch {gdb_cmd "delete $bpnum"}
}
}
}
# ------------------------------------------------------------------
# METHOD: _select
# Un/Highlight all files in the files list
# ------------------------------------------------------------------
itcl::body BrowserWin::_select {highlight} {
if {$highlight} {
$itk_component(file_box) selection set 0 end
} else {
$itk_component(file_box) selection clear 0 end
}
search
}
# ------------------------------------------------------------------
# METHOD: _set_filter_mode
# React to changes in the filter 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
search
}
}
# ------------------------------------------------------------------
# METHOD: _file_hide_h
# Run when the "Hide .h files" preference is chosen.
# ------------------------------------------------------------------
itcl::body BrowserWin::_file_hide_h {} {
_fill_file_box
search
}
# ------------------------------------------------------------------
# METHOD: _fill_source
# Helper function to fill the srctextwin
# when needed.
# ------------------------------------------------------------------
itcl::body BrowserWin::_fill_source {f {funcp 1} {filename ""}} {
if {($funcp && [string compare $f $Current(function)]) \
|| [string compare $f $Current(filename)]} {
if {!$funcp} {
if {$filename == ""} {
set f $f:1
} else {
set f $f:$filename
}
}
if {[catch {gdb_loc $f} linespec]} {
return
}
lassign $linespec foo funcname name line addr pc_addr lib
set file_changed [string compare $Current(filename) $name]
if {$file_changed} {
# Set the file name label:
$itk_component(view_name) configure -text $name:
_freeze_me
}
# fill srctextwin
$itk_component(view_src) location BROWSE_TAG $name $funcname \
$line $addr $pc_addr lib
if {$file_changed} {
_thaw_me
}
set Current(function) $funcname
# fill func combo
if {$file_changed} {
set Current(filename) $name
_fill_funcs_combo $name
}
# Set current function in combo box
$itk_component(view_func) entryset $f
}
}
# ------------------------------------------------------------------
# METHOD: mode
# Function called by srctextwin when the display
# mode changes
# ------------------------------------------------------------------
itcl::body BrowserWin::mode {w {mode ""} {go 1}} {
if {$mode != ""} {
$itk_component(view_src) mode_set $mode $go
$itk_component(view_mode) entryset $mode
}
}
# ------------------------------------------------------------------
# METHOD: _goto_func
# Callback for the function combo box which
# sets the srctextwin looking at the given function (VAL)
# ------------------------------------------------------------------
itcl::body BrowserWin::_goto_func {w {val ""}} {
if {$val != ""} {
set mang 0
if {[info exists _mangled_func($val)]} {
set mang $_mangled_func($val)
}
if {$mang} {
set loc $val
} else {
set fn [lindex [::file split $Current(filename)] end]
set loc $fn:$val
}
debug "GOTO \"$loc\""
if {![catch {gdb_loc $loc} result]} {
lassign $result foo funcname name line addr pc_addr lib
$itk_component(view_src) location BROWSE_TAG $name $funcname \
$line $addr $pc_addr lib
} else {
dbug W "gdb_loc returned \"$result\""
}
}
}
# ------------------------------------------------------------------
# METHOD: _fill_file_box
# This private method fills the file listbox
# ------------------------------------------------------------------
itcl::body BrowserWin::_fill_file_box {} {
# It would be cool if gdb_listfiles took a regexp to match,
# but it doesn't...
$itk_component(file_box) clear
set allFiles [gdb_listfiles]
if {[pref get gdb/browser/hide_h]} {
foreach file $allFiles {
if {[string compare [file extension $file] ".h"]} {
$itk_component(file_box) insert end $file
}
}
} else {
foreach file $allFiles {
$itk_component(file_box) insert end $file
}
}
search
}
# ------------------------------------------------------------------
# METHOD: _fill_funcs_combo
# This private method fills the functions combo box
# with all the functions in NAME.
# ------------------------------------------------------------------
itcl::body BrowserWin::_fill_funcs_combo {name} {
$itk_component(view_func) list delete 0 end
if {$name != ""} {
set maxlen 10
if {[catch {gdb_listfuncs $name} listfuncs]} {
tk_messageBox -icon error -default ok \
-title "GDB" -type ok \
-message "This file can not be found or does not contain\ndebugging information."
return
}
foreach f [lsort $listfuncs] {
lassign $f func mang
if {$func == "global constructors keyed to main"} {continue}
set _mangled_func($func) $mang
$itk_component(view_func) list insert end $func
if {[string length $func] > $maxlen} {
set maxlen [string length $func]
}
}
# limit size to 40 chars because if we don't set a reasonable limit
# then the combobox can be wider than the screen
if {$maxlen > 40} {set maxlen 40}
$itk_component(view_func) configure -width [expr {$maxlen + 1}]
}
}
# ------------------------------------------------------------------
# METHOD: _build_filter_frame
# This private method builds the filter frame
# ------------------------------------------------------------------
itcl::body BrowserWin::_build_filter_frame {parent} {
itk_component add filter {
iwidgets::labeledframe $parent.filter -labeltext "Function Filter" \
-relief groove -borderwidth 2 -ipadx 6 -ipady 4
}
# Set up the contents of the Filter frame
if {$_layout == 2} {
itk_component add filt_label {
label [$itk_component(filter) childsite].lbl -text "Show if function " \
-font global/fixed
}
}
itk_component add filt_type {
combobox::combobox [$itk_component(filter) childsite].type -height 4 \
-width 15 -editable 0 \
-command [code $this _set_filter_mode] \
-font global/fixed
} {
rename -background -textbackground textBackground Background
}
# Fill the filter mode combo-box
foreach elem $filter_modes {
$itk_component(filt_type) list insert end $elem
}
set cur_filter_mode [pref get gdb/search/filter_mode]
if {[lsearch $filter_modes $cur_filter_mode] < 0} {
set cur_filter_mode [lindex $filter_modes 0]
}
$itk_component(filt_type) entryset $cur_filter_mode
itk_component add filt_entry {
entry [$itk_component(filter) childsite].ent -font global/fixed \
-textvariable [pref varname gdb/search/last_symbol]
} {}
bind_plain_key $itk_component(filt_entry) Return [list $this search]
# Watch keystrokes into the entry box and filter on them...
trace variable [pref varname gdb/search/last_symbol] w \
[code $this _filter_trace_proc]
if {$_layout == 2} {
pack $itk_component(filt_label) -side left
}
pack $itk_component(filt_type) -side left -padx 4 -fill y -pady 5
pack $itk_component(filt_entry) -side right -fill both -expand 1 \
-padx 6 -pady 5
pack $itk_component(filter) -fill x -anchor n -pady 3
}
# ------------------------------------------------------------------
# METHOD: _build_file_frame
# This private method builds the files frame
# ------------------------------------------------------------------
itcl::body BrowserWin::_build_file_frame {parent} {
# Labeled Frame
itk_component add file_frame {
iwidgets::labeledframe $parent.file -labeltext "Files" \
-relief groove -borderwidth 2 -ipadx 6 -ipady 4
}
# Listbox with files
itk_component add file_box {
iwidgets::scrolledlistbox [$itk_component(file_frame) childsite].listbox \
-selectmode extended -exportselection false \
-hscrollmode dynamic -vscrollmode dynamic -foreground $::Colors(textfg) \
-textbackground $::Colors(textbg)
} {}
bind [$itk_component(file_box) component listbox] <ButtonRelease-1> \
[code $this _process_file_selection %y]
itk_component add file_sep {
frame [$itk_component(file_frame) childsite].sep -relief raised -height 2 \
-borderwidth 1
}
itk_component add file_hide {
checkbutton [$itk_component(file_frame) childsite].hide \
-text "Hide .h files" \
-variable [pref varname gdb/browser/hide_h] \
-command [code $this _file_hide_h]
}
itk_component add file_all {
button [$itk_component(file_frame) childsite].sel \
-text "Select All" \
-command [code $this _select 1]
}
# pack all the pieces
grid $itk_component(file_box) -column 0 -row 0 -columnspan 2 \
-sticky news
grid $itk_component(file_sep) -column 0 -row 1 -columnspan 2 \
-sticky ew -pady 8
grid $itk_component(file_hide) -column 0 -row 2 -padx 5 -sticky w
grid $itk_component(file_all) -column 1 -row 2 -padx 5 -sticky e
grid columnconfigure [$itk_component(file_frame) childsite] 0 -weight 1
grid rowconfigure [$itk_component(file_frame) childsite] 0 -weight 1
# finally pack the main frame
pack $itk_component(file_frame) -side left -fill both -expand yes
}
# ------------------------------------------------------------------
# METHOD: _build_function_frame
# This private method builds the functions frame
# ------------------------------------------------------------------
itcl::body BrowserWin::_build_function_frame {parent} {
# Labeled Frame
itk_component add func_frame {
iwidgets::labeledframe $parent.file -labeltext "Function" \
-relief groove -borderwidth 2 -ipadx 6 -ipady 4
}
# Functions Listbox
itk_component add func_box {
iwidgets::scrolledlistbox [$itk_component(func_frame) childsite].listbox \
-selectmode extended -hscrollmode dynamic -vscrollmode dynamic \
-exportselection false -foreground $::Colors(textfg) \
-textbackground $::Colors(textbg)
} {}
bind [$itk_component(func_box) component listbox] <ButtonRelease-1> \
[code $this _process_func_selection %y]
bind $itk_component(func_box) <3> [code $this _toggle_bp %y]
itk_component add func_sep {
frame [$itk_component(func_frame) childsite].sep -relief raised \
-height 2 -borderwidth 1
}
itk_component add func_add_bp {
button [$itk_component(func_frame) childsite].abp -text "Set BP" \
-command [code $this do_all_bp 1]
}
itk_component add func_remove_bp {
button [$itk_component(func_frame) childsite].rbp -text "Delete BP" \
-command [code $this do_all_bp 0]
}
# pack all the pieces
grid $itk_component(func_box) -column 0 -row 0 -columnspan 2 -sticky news
grid $itk_component(func_sep) -row 1 -column 0 -columnspan 2 \
-sticky ew -pady 8
grid $itk_component(func_remove_bp) -row 2 -column 0 -padx 5 -sticky w
grid $itk_component(func_add_bp) -row 2 -column 1 -padx 5 -sticky e
grid columnconfigure [$itk_component(func_frame) childsite] 0 -weight 1
grid rowconfigure [$itk_component(func_frame) childsite] 0 -weight 1
# finally pack the main frame
pack $itk_component(func_frame) -fill both -expand yes
}
# ------------------------------------------------------------------
# METHOD: _build_view_frame
# This private method builds the view frame
# ------------------------------------------------------------------
itcl::body BrowserWin::_build_view_frame {parent} {
itk_component add view {
frame $parent.view
}
itk_component add view_src {
SrcTextWin $itk_component(view).src -Tracing 0 \
-parent $this -ignore_var_balloons 0
} {
rename -background -textbackground textBackground Background
}
itk_component add view_bottom {
frame $itk_component(view).bottom
}
itk_component add view_name {
label $itk_component(view).name -font global/fixed
}
itk_component add view_func {
combobox::combobox $itk_component(view_bottom).combo -maxheight 15\
-font global/fixed -command [code $this _goto_func]
} {
rename -background -textbackground textBackground Background
}
itk_component add view_mode {
combobox::combobox $itk_component(view_bottom).mode -width 9 \
-font global/fixed -command [code $this mode]
} {
rename -background -textbackground textBackground Background
}
itk_component add view_search {
entry $itk_component(view_bottom).search -borderwidth 2 \
-font global/fixed -width 10 -background $::Colors(textbg)
} {}
# Pack all the components of view into the frame:
pack $itk_component(view_func) -side left -anchor w
pack $itk_component(view_mode) -side left -padx 5
pack $itk_component(view_search) -side right -padx 5 -expand 1 -anchor e
pack $itk_component(view_name) -side top -fill x -padx 5 -pady 3
pack $itk_component(view_bottom) -side bottom -fill x -pady 3 -padx 5
pack $itk_component(view_src) -fill both -expand 1 -padx 5 -pady 3
# Fill combo boxes
$itk_component(view_mode) list insert end SOURCE
$itk_component(view_mode) list insert end ASSEMBLY
$itk_component(view_mode) list insert end MIXED
# don't allow SRC+ASM mode... $itk_component(view_mode) insert end SRC+ASM
$itk_component(view_mode) entryset [$itk_component(view_src) mode_get]
# Key bindings
bind_plain_key $itk_component(view_search) Return \
[code $this _search_src forwards]
bind_plain_key $itk_component(view_search) Shift-Return \
[code $this _search_src backwards]
pack $itk_component(view) -fill both -expand yes
}
# ------------------------------------------------------------------
# METHOD: _switch_layout
# Switch between different layouts
#
# ------------------------------------------------------------------
itcl::body BrowserWin::_switch_layout {} {
# only 2 right now, so toggle
if {$_layout == 1} {
set _layout 2
} else {
set _layout 1
}
pref set gdb/browser/layout $_layout
destroy $itk_interior.p
destroy $itk_component(popup)
set Current(filename) {}
set Current(function) {}
if {$filter_trace_after != ""} {
after cancel $filter_trace_after
}
trace vdelete [pref varname gdb/search/last_symbol] \
w [code $this _filter_trace_proc]
_build_win
}

View file

@ -0,0 +1,77 @@
# Browser window class definition for Insight.
# Copyright (C) 1998, 1999, 2003 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class BrowserWin {
inherit EmbeddedWin
public {
method constructor {args}
method destructor {}
method mode {w {mode ""} {go 1}}
method search {}
method test_get {var}
method do_all_bp {onp}
}
private {
method _build_win {}
method _file_hide_h {}
method _fill_file_box {}
method _fill_funcs_combo {name}
method _fill_source {f {funcp 1} {filename ""}}
method _filter_trace_proc {v1 v2 mode}
method _filter_trace_after {}
method _goto_func {w {val ""}}
method _process_file_selection {y}
method _process_func_selection {y}
method _search_src {direction}
method _select {highlight}
method _set_filter_mode {w mode}
method _toggle_bp {y}
method _build_filter_frame {parent}
method _build_file_frame {parent}
method _build_function_frame {parent}
method _build_view_frame {parent}
method _switch_layout
variable cur_filter_mode
variable Current;
variable labelUpdateCode ""
variable index_to_file
variable _mangled_func
variable filter_trace_after ""
variable _layout
common componentToRow
array set componentToRow {
filter 0
browser 1
view 2
view_hidden 3
}
common filter_modes [list "starts with" \
"contains" \
"ends with" \
"matches regexp"]
common filter_regexp
array set filter_regexp {
"starts with" ^%s
"contains" %s
"ends with" %s$
"matches regexp" %s
}
}
}

View file

@ -0,0 +1,747 @@
# Console window for Insight
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::body Console::constructor {args} {
global gdbtk_state
window_name "Console Window"
debug "$args"
_build_win
eval itk_initialize $args
add_hook gdb_no_inferior_hook [list $this idle dummy]
# There are a bunch of console prefs that have no UI
# for the user to modify them. In the event that the user
# really wants to change them, they will have to be modified
# in prefs.tcl or by editing .gdbtkinit. When these prefs
# gain a prefs UI, the user may change them dynamically
# and the console window will need notification that they
# have changed. Add them to the following list and
# Console::_update_option.
foreach option {gdb/console/wrap} {
pref add_hook $option [code $this _update_option]
}
set gdbtk_state(console) $this
}
itcl::body Console::destructor {} {
global gdbtk_state
set gdbtk_state(console) ""
remove_hook gdb_no_inferior_hook [list $this idle dummy]
}
itcl::body Console::_build_win {} {
iwidgets::scrolledtext $itk_interior.stext \
-vscrollmode dynamic -textbackground white
set _twin [$itk_interior.stext component text]
_set_wrap [pref get gdb/console/wrap]
$_twin tag configure prompt_tag -foreground [pref get gdb/console/prompt_fg]
$_twin tag configure err_tag -foreground [pref get gdb/console/error_fg]
$_twin tag configure log_tag -foreground [pref get gdb/console/log_fg]
$_twin tag configure target_tag -foreground [pref get gdb/console/target_fg]
$_twin configure -font [pref get gdb/console/font] \
-bg $::Colors(textbg) -fg $::Colors(textfg)
#
# bind editing keys for console window
#
bind $_twin <Return> "$this invoke; break"
bind_plain_key $_twin Control-m "$this invoke; break"
bind_plain_key $_twin Control-j "$this invoke; break"
# History control.
bind_plain_key $_twin Control-p "[code $this _previous]; break"
bind $_twin <Up> "[code $this _previous]; break"
bind_plain_key $_twin Control-n "[code $this _next]; break"
bind $_twin <Down> "[code $this _next]; break"
bind $_twin <Meta-less> "[code $this _first]; break"
bind $_twin <Home> "[code $this _first]; break"
bind $_twin <Meta-greater> "[code $this _last]; break"
bind $_twin <End> "[code $this _last]; break"
bind_plain_key $_twin Control-o "[code $this _operate_and_get_next]; break"
# Tab completion
bind_plain_key $_twin KeyPress-Tab "[code $this _complete]; break"
# Don't let left arrow or ^B go over the prompt
bind_plain_key $_twin Control-b {
if {[%W compare insert <= {cmdmark + 1 char}]} {
break
}
}
bind $_twin <Left> [bind $_twin <Control-b>]
# Don't let Control-h, Delete, or Backspace back up over the prompt.
bind_plain_key $_twin Control-h "[code $this _delete]; break"
bind $_twin <BackSpace> "[code $this _delete]; break"
bind $_twin <Delete> "[code $this _delete 1]; break"
# Control-a moves to start of line.
bind_plain_key $_twin Control-a {
%W mark set insert {cmdmark + 1 char}
%W see {insert linestart}
break
}
# Control-u deletes to start of line.
bind_plain_key $_twin Control-u {
%W delete {cmdmark + 1 char} insert
%W see {insert linestart}
}
# Control-w deletes previous word.
bind_plain_key $_twin Control-w {
if {[%W compare {insert -1c wordstart} > cmdmark]} {
%W delete {insert -1c wordstart} insert
%W see insert
}
}
bind $_twin <Control-Up> "[code $this _search_history]; break"
bind $_twin <Shift-Up> "[code $this _search_history]; break"
bind $_twin <Control-Down> "[code $this _rsearch_history]; break"
bind $_twin <Shift-Down> "[code $this _rsearch_history]; break"
# Don't allow key motion to move insertion point outside the command
# area. This is done by fixing up the insertion point after any key
# movement. We only need to do this after events we do not
# explicitly override. Note that since the edit line is always the
# last line, we can't possibly go past it, so we don't bother
# checking that. Note also that we check for a binding which is
# simply `;'; this lets us handle keys already bound via
# bind_plain_key.
foreach event [bind Text] {
if {[string match *Key* $event]
&& ([bind $_twin $event] == ""
|| [bind $_twin $event] == ";")} {
bind $_twin $event [bind Text $event]
bind $_twin $event {+
if {[%W compare insert <= {cmdmark + 1 char}]} {
%W mark set insert {cmdmark + 1 char}
}
break
}
}
}
# Don't allow mouse to put cursor outside command line. For some
# events we do this by noticing when the cursor is outside the
# range, and then saving the insertion point. For others we notice
# the saved insertion point.
set pretag pre-$_twin
bind $_twin <1> [format {
if {[%%W compare [tk::TextClosestGap %%W %%x %%y] <= cmdmark]} {
%s _insertion [%%W index insert]
} else {
%s _insertion {}
}
} $this $this]
bind $_twin <B1-Motion> [format {
if {[%s _insertion] != ""} {
%%W mark set insert [%s _insertion]
}
} $this $this $this]
# FIXME: has inside information.
bind $_twin <ButtonRelease-1> [format {
tk::CancelRepeat
if {[%s _insertion] != ""} {
%%W mark set insert [%s _insertion]
}
%s _insertion {}
break
} $this $this $this]
# Don't allow inserting text outside the command line. FIXME:
# requires inside information.
# Also make it a little easier to paste by making the button
# drags a little "fuzzy".
bind $_twin <B2-Motion> {
if {!$tk_strictMotif} {
if {($tk::Priv(x) - 2 < %x < $tk::Priv(x) + 2) \
|| ($tk::Priv(y) - 2 < %y < $tk::Priv(y) + 2)} {
set tk::Priv(mouseMoved) 1
}
if {$tk::Priv(mouseMoved)} {
%W scan dragto %x %y
}
}
break
}
bind $_twin <ButtonRelease-2> [format {
if {!$tk::Priv(mouseMoved) || $tk_strictMotif} {
%s
break
}
} [code $this _paste 1]]
bind $_twin <<Paste>> "[code $this _paste 0]; break"
bind $_twin <<PasteSelection>> "[code $this _paste 0]; break"
bind_plain_key $_twin Control-c "event generate $_twin <<Copy>>"
bind_plain_key $_twin Control-v "[code $this _paste 1]; break"
_setprompt
pack $itk_interior.stext -expand yes -fill both
focus $_twin
}
itcl::body Console::idle {event} {
set _running 0
$_top configure -cursor {}
}
# ------------------------------------------------------------------
# METHOD: busy - busy event handler
# ------------------------------------------------------------------
itcl::body Console::busy {event} {
set _running 1
$_top configure -cursor watch
}
# ------------------------------------------------------------------
# METHOD: insert - insert new text in the text widget
# ------------------------------------------------------------------
itcl::body Console::insert {line {tag ""}} {
if {$_needNL} {
$_twin insert {insert linestart} "\n"
}
# Remove all \r characters from line.
set line [join [split $line \r] {}]
$_twin insert {insert -1 line lineend} $line $tag
set nlines [lindex [split [$_twin index end] .] 0]
if {$nlines > $throttle} {
set delta [expr {$nlines - $throttle}]
$_twin delete 1.0 ${delta}.0
}
$_twin see insert
set _needNL 0
::update idletasks
}
# ------------------------------------------------------------------
# NAME: ConsoleWin::_operate_and_get_next
# DESCRIPTION: Invokes the current command and, if this
# command came from the history, arrange for
# the next history command to be inserted once this
# command is finished.
#
# ARGUMENTS: None
# RETURNS: Nothing
# ------------------------------------------------------------------
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.
set _pendingHistElement [expr {$_histElement + 1}]
}
invoke
}
#-------------------------------------------------------------------
# METHOD: _previous - recall the previous command
# ------------------------------------------------------------------
itcl::body Console::_previous {} {
if {$_histElement == -1} {
# Save partial command.
set _partialCommand [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
}
incr _histElement
set text [lindex $_history $_histElement]
if {$text == ""} {
# No dice.
incr _histElement -1
# FIXME flash window.
} else {
$_twin delete {cmdmark + 1 char} {cmdmark lineend}
$_twin insert {cmdmark + 1 char} $text
}
}
#-------------------------------------------------------------------
# METHOD: _search_history - search history for match
# ------------------------------------------------------------------
itcl::body Console::_search_history {} {
set str [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
if {$_histElement == -1} {
# Save partial command.
set _partialCommand $str
set ix [lsearch $_history ${str}*]
} else {
set str $_partialCommand
set num [expr $_histElement + 1]
set ix [lsearch [lrange $_history $num end] ${str}*]
incr ix $num
}
set text [lindex $_history $ix]
if {$text != ""} {
set _histElement $ix
$_twin delete {cmdmark + 1 char} {cmdmark lineend}
$_twin insert {cmdmark + 1 char} $text
}
}
#-------------------------------------------------------------------
# METHOD: _rsearch_history - search history in reverse for match
# ------------------------------------------------------------------
itcl::body Console::_rsearch_history {} {
if {$_histElement != -1} {
set str $_partialCommand
set num [expr $_histElement - 1]
set ix $num
while {$ix >= 0} {
if {[string match ${str}* [lindex $_history $ix]]} {
break
}
incr ix -1
}
set text ""
if {$ix >= 0} {
set text [lindex $_history $ix]
set _histElement $ix
} else {
set text $_partialCommand
set _histElement -1
}
$_twin delete {cmdmark + 1 char} {cmdmark lineend}
$_twin insert {cmdmark + 1 char} $text
}
}
#-------------------------------------------------------------------
# METHOD: _next - recall the next command (scroll forward)
# ------------------------------------------------------------------
itcl::body Console::_next {} {
if {$_histElement == -1} {
# FIXME flash window.
return
}
incr _histElement -1
if {$_histElement == -1} {
set text $_partialCommand
} else {
set text [lindex $_history $_histElement]
}
$_twin delete {cmdmark + 1 char} {cmdmark lineend}
$_twin insert {cmdmark + 1 char} $text
}
#-------------------------------------------------------------------
# METHOD: _last - get the last history element
# ------------------------------------------------------------------
itcl::body Console::_last {} {
set _histElement 0
_next
}
#-------------------------------------------------------------------
# METHOD: _first - get the first (earliest) history element
# ------------------------------------------------------------------
itcl::body Console::_first {} {
set _histElement [expr {[llength $_history] - 1}]
_previous
}
#-------------------------------------------------------------------
# METHOD: _setprompt - put a prompt at the beginning of a line
# ------------------------------------------------------------------
itcl::body Console::_setprompt {{prompt {}}} {
if {$prompt == ""} {
#set prompt [pref get gdb/console/prompt]
set prompt [gdb_prompt]
} elseif {$prompt == "none"} {
set prompt ""
}
$_twin delete {insert linestart} {insert lineend}
$_twin insert {insert linestart} $prompt prompt_tag
$_twin mark set cmdmark "insert -1 char"
$_twin see insert
if {$_pendingHistElement >= 0} {
set _histElement $_pendingHistElement
set _pendingHistElement -1
_next
}
}
#-------------------------------------------------------------------
# METHOD: gets - get a line of input from the console
# ------------------------------------------------------------------
itcl::body Console::gets {} {
set _input_mode 1
# _setprompt "(input) "
_setprompt none
$_twin delete insert end
$_twin mark set cmdmark {insert -1 char}
bind_plain_key $_twin Control-d "$this invoke 1; break"
bind_plain_key $_twin Control-c "[code $this _cancel]; break"
vwait [scope _input_result]
set _input_mode 0
bind_plain_key $_twin Control-c "event generate $_twin <<Copy>>"
activate
if {$_input_error} {
set _input_error 0
return -code error ""
}
return $_input_result
}
#-------------------------------------------------------------------
# METHOD: cancel - cancel input when ^C is hit
# ------------------------------------------------------------------
itcl::body Console::_cancel {} {
if {$_input_mode} {
set _needNL 1
$_twin mark set insert {insert lineend}
$_twin insert {insert lineend} "^C\n"
incr _invoking
set _input_error 1
set _input_result ""
}
}
#-------------------------------------------------------------------
# METHOD: activate - run this after a command is run
# ------------------------------------------------------------------
itcl::body Console::activate {{prompt {}}} {
if {$_invoking > 0} {
incr _invoking -1
_setprompt $prompt
}
}
#-------------------------------------------------------------------
# METHOD: invoke - invoke a command
# ------------------------------------------------------------------
itcl::body Console::invoke {{controld 0}} {
global gdbtk_state
set text [$_twin get {cmdmark + 1 char} end ]
if { "[string range $text 0 1]" == "tk" } {
if {! [info complete $text] } {
$_twin insert {insert lineend} " \\\n"
$_twin see insert
return
}
}
incr _invoking
set text [string trimright $text \n]
if {$text == ""} {
set text [lindex $_history 0]
$_twin insert {insert lineend} $text
}
$_twin mark set insert {insert lineend}
$_twin insert {insert lineend} "\n"
set ok 0
if {$_running} {
if {[string index $text 0] == "!"} {
set text [string range $text 1 end]
set ok 1
}
}
if {$_input_mode} {
if {!$controld} {append text \n}
set _input_result $text
set _needNL 1
return
}
# Only push new nonempty history items.
if {$text != "" && [lindex $_history 0] != $text} {
lvarpush _history $text
}
set index [$_twin index insert]
# Clear current history element, and current partial element.
set _histElement -1
set _partialCommand ""
# Need a newline before next insert.
set _needNL 1
# run command
if {$gdbtk_state(readline)} {
set gdbtk_state(readline_response) $text
return
}
if {!$_running || $ok} {
set result [catch {gdb_immediate "$text" 1} message]
} else {
set result 1
set message "The debugger is busy."
}
# gdb_immediate may take a while to finish. Exit if
# our window has gone away.
if {![winfo exists $_twin]} { return }
if {$result} {
global errorInfo
dbug W "Error: $errorInfo\n"
$_twin insert end "Error: $message\n" err_tag
} elseif {$message != ""} {
$_twin insert $index "$message\n"
}
# Make the prompt visible again.
activate
# Make sure the insertion point is visible.
$_twin see insert
}
#-------------------------------------------------------------------
# PRIVATE METHOD: _delete - Handle a Delete of some sort.
# ------------------------------------------------------------------
itcl::body Console::_delete {{right 0}} {
# If we are deleting to the right, and we have this turned off,
# delete to the right.
if {$right && ![pref get gdb/console/deleteLeft]} {
set right 0
}
if {!$right} {
set insert_valid [$_twin compare insert > {cmdmark + 1 char}]
set delete_loc "insert-1c"
} else {
set insert_valid [$_twin compare insert > cmdmark]
set delete_loc "insert"
}
# If there is a selection on the command line, delete it,
# If there is a selection above the command line, do a
# regular delete, but don't delete the prompt.
# If there is no selection, do the delete.
if {![catch {$_twin index sel.first}]} {
if {[$_twin compare sel.first <= cmdmark]} {
if {$insert_valid} {
$_twin delete $delete_loc
}
} else {
$_twin delete sel.first sel.last
}
} elseif {$insert_valid} {
$_twin delete $delete_loc
}
}
#-------------------------------------------------------------------
# PRIVATE METHOD: _insertion - Set or get saved insertion point
# ------------------------------------------------------------------
itcl::body Console::_insertion {args} {
if {! [llength $args]} {
return $_saved_insertion
} else {
set _saved_insertion [lindex $args 0]
}
}
# ------------------------------------------------------------------
# METHOD: _paste - paste the selection into the console window
# ------------------------------------------------------------------
itcl::body Console::_paste {{check_primary 1}} {
set sel {}
if {!$check_primary || [catch {selection get} sel] || $sel == ""} {
if {[catch {selection get -selection CLIPBOARD} sel] || $sel == ""} {
return
}
}
#if there is a selection, insert over it:
if {![catch {$_twin index sel.first}]
&& [$_twin compare sel.first > {cmdmark + 1 char}]} {
set point [$_twin index sel.first]
$_twin delete sel.first sel.last
$_twin insert $point $sel
} else {
$_twin insert insert $sel
}
}
# ------------------------------------------------------------------
# METHOD: _find_lcp - Return the longest common prefix in SLIST.
# Can be empty string.
# ------------------------------------------------------------------
itcl::body Console::_find_lcp {slist} {
# Handle trivial cases where list is empty or length 1
if {[llength $slist] <= 1} {return [lindex $slist 0]}
set prefix [lindex $slist 0]
set prefixlast [expr [string length $prefix] - 1]
foreach str [lrange $slist 1 end] {
set test_str [string range $str 0 $prefixlast]
while {[string compare $test_str $prefix] != 0} {
incr prefixlast -1
set prefix [string range $prefix 0 $prefixlast]
set test_str [string range $str 0 $prefixlast]
}
if {$prefixlast < 0} break
}
return $prefix
}
# ------------------------------------------------------------------
# METHOD: _find_completion - Look through COMPLETIONS to generate
# the suffix needed to do command
# ------------------------------------------------------------------
itcl::body Console::_find_completion {cmd completions} {
# Get longest common prefix
set lcp [_find_lcp $completions]
set cmd_len [string length $cmd]
# Return suffix beyond end of cmd
return [string range $lcp $cmd_len end]
}
# ------------------------------------------------------------------
# METHOD: _complete - Command line completion
# ------------------------------------------------------------------
itcl::body Console::_complete {} {
set command_line [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
set choices [gdb_cmd "complete $command_line" 1]
set choices [string trimright $choices \n]
set choices [split $choices \n]
# Just do completion if this is the first tab
if {!$_saw_tab} {
set _saw_tab 1
set completion [_find_completion $command_line $choices]
# Here is where the completion is actually done. If there
# is one match, complete the command and print a space.
# If two or more matches, complete the command and beep.
# If no match, just beep.
switch [llength $choices] {
0 {}
1 {
$_twin insert end "$completion "
set _saw_tab 0
return
}
default {
$_twin insert end $completion
}
}
bell
$_twin see end
bind $_twin <KeyPress> [code $this _reset_tab]
} else {
# User hit another consecutive tab. List the choices.
# Note that at this point, choices may contain commands
# with spaces. We have to lop off everything before (and
# including) the last space so that the completion list
# only shows the possibilities for the last token.
set choices [lsort $choices]
if {[regexp ".* " $command_line prefix]} {
regsub -all $prefix $choices {} choices
}
if {[llength choices] != 0} {
insert "\nCompletions:\n[join $choices \ ]\n"
$_twin see end
bind $_twin <KeyPress> [code $this _reset_tab]
}
}
}
# ------------------------------------------------------------------
# METHOD: _reset_tab - Helper method for tab completion. Used
# to reset the tab when a key is pressed.
# ------------------------------------------------------------------
itcl::body Console::_reset_tab {} {
bind $_twin <KeyPress> {}
set _saw_tab 0
}
# ------------------------------------------------------------------
# METHOD: _set_wrap - Set wrap mode
# ------------------------------------------------------------------
itcl::body Console::_set_wrap {wrap} {
if { $wrap } {
set hsm none
set wv char
} else {
set hsm dynamic
set wv none
}
$itk_interior.stext configure -hscrollmode $hsm
$_twin configure -wrap $wv
}
# ------------------------------------------------------------------
# METHOD: _update_option - Update in response to preference change
# ------------------------------------------------------------------
itcl::body Console::_update_option {name value} {
switch -- $name {
gdb/console/wrap {
_set_wrap $value
}
gdb/console/prompt_fg {
$_twin tag configure prompt_tag -foreground $value
}
gdb/console/error_fg {
$_twin tag configure err_tag -foreground $value
}
}
}
# ------------------------------------------------------------------
# NAME: public method Console::test
# DESCRIPTION: Executes the given command
#
# ARGUMENTS: Command to run
# RETURNS: Return value of command
#
# NOTES: This will only run if env(GDBTK_TEST_RUNNING)==1.
# FOR TESTING ONLY
# ------------------------------------------------------------------
itcl::body Console::test {args} {
global env
if {[info exists env(GDBTK_TEST_RUNNING)] && $env(GDBTK_TEST_RUNNING) == 1} {
return [eval $args]
}
}

View file

@ -0,0 +1,77 @@
# Console window class definition for GDBtk.
# Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Implements a console display widget using primitive widgets as the building
# blocks.
# ----------------------------------------------------------------------
itcl::class Console {
inherit EmbeddedWin GDBEventHandler
public {
#Approximate maximum number of lines allowed in widget
variable throttle 2000
method constructor {args}
method destructor {}
method insert {line {tag ""}}
method invoke {{controld 0}}
method _insertion {args}
method activate {{prompt {}}}
method test {args}
method gets {}
#
# GDB Events
#
method busy {event}
method idle {event}
}
private {
variable _twin
variable _invoking 0
variable _needNL 1
variable _history {}
variable _histElement -1
variable _partialCommand ""
variable _saved_insertion ""
variable _running 0
variable _saw_tab 0
variable _pendingHistElement -1
variable _input_mode 0
variable _input_result ""
variable _input_error 0
method _build_win {}
method _cancel {}
method _complete {}
method _delete {{left 0}}
method _find_completion {cmd completions}
method _find_lcp {slist}
method _first {}
method _last {}
method _next {}
method _operate_and_get_next {}
method _paste {{check_primary 1}}
method _previous {}
method _reset_tab {}
method _search_history {}
method _rsearch_history {}
method _setprompt {{prompt {}}}
method _set_wrap {wrap}
method _update_option {name value}
}
}

View file

@ -0,0 +1,152 @@
# Color Scheme preferences dialog for Insight.
# Copyright (C) 2004 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ------------------------------------------------------------------
# CONSTRUCTOR - create new source preferences window
# ------------------------------------------------------------------
itcl::body CSPref::constructor {args} {
window_name "Color Scheme Preferences"
_init_var
_build_win
}
# ------------------------------------------------------------------
# METHOD: init_var - initialize preference variables
# ------------------------------------------------------------------
itcl::body CSPref::_init_var {} {
for {set i 0} {$i < 16} {incr i} {
lappend vlist gdb/bg/$i
}
foreach var $vlist {
set _saved($var) [pref get $var]
set _new($var) $_saved($var)
}
}
# ------------------------------------------------------------------
# METHOD: build_win - build the dialog
# ------------------------------------------------------------------
itcl::body CSPref::_build_win {} {
frame $itk_interior.f
frame $itk_interior.f.a
frame $itk_interior.f.b
set f $itk_interior.f.a
# Description frame
set d [labelframe $f.desc -text "Description"]
label $d.txt -justify left -wraplength 6i -background $::Colors(textbg) \
-text "There are many situations where multiple instances\
of Insight may be running. Some examples are when debugging itself, when debugging\
client and server programs, or multiprocessor systems. In these situations, it is easy\
to get confused by the many different windows. Insight provides a simple way to have\
all the windows belonging to a particular Insight instance use the same background color.\
\n\nClick on a color below to edit it. This is a text background color. Other colors are\
computed based on it."
pack $d.txt -side top
pack $f.desc -expand yes -fill both
set w [labelframe $f.colors -text "Text Backgrounds"]
for {set i 0} {$i < 16} {incr i} {
set color $_new(gdb/bg/$i)
button $w.$i -text [format "%X" $i] -activebackground $color -bg $color \
-command [code $this _pick $color $w.$i $i]
}
grid $w.0 $w.1 $w.2 $w.3 $w.4 $w.5 $w.6 $w.7 -padx 10 -pady 10 -sticky we
grid $w.8 $w.9 $w.10 $w.11 $w.12 $w.13 $w.14 $w.15 -padx 10 -pady 10 -sticky we
pack $w -fill both -expand yes
pack $f.colors -fill both -expand yes
button $itk_interior.f.b.ok -text OK -width 7 -underline 0 -command [code $this _save]
button $itk_interior.f.b.apply -text Apply -width 7 -underline 0 -command [code $this _apply]
button $itk_interior.f.b.quit -text Cancel -width 7 -underline 0 -command [code $this _cancel]
standard_button_box $itk_interior.f.b
pack $itk_interior.f.a $itk_interior.f.b $itk_interior.f -expand yes -fill both -padx 5 -pady 5
}
# ------------------------------------------------------------------
# METHOD: apply - apply changes
# ------------------------------------------------------------------
itcl::body CSPref::_apply {} {
foreach var [array names _new] {
if {$_new($var) != [pref get $var]} {
pref set $var $_new($var)
}
}
set_bg_colors
}
# ------------------------------------------------------------------
# METHOD: _cancel
# ------------------------------------------------------------------
itcl::body CSPref::_cancel {} {
set bg_changed 0
if {[string compare [pref get gdb/bg/$::gdb_bg_num] $_saved(gdb/bg/$::gdb_bg_num)] != 0} {
set bg_changed 1
}
foreach elem [array names _saved] {
set cur_val [pref get $elem]
if {[string compare $cur_val $_saved($elem)] != 0} {
pref set $elem $_saved($elem)
}
}
if {$bg_changed} {
set_bg_colors
} else {
ManagedWin::restart
}
unpost
}
# ------------------------------------------------------------------
# METHOD: save - apply changes and quit
# ------------------------------------------------------------------
itcl::body CSPref::_save {} {
_apply
unpost
}
# ------------------------------------------------------------------
# METHOD: reconfig - called when windows are reconfigured
# ------------------------------------------------------------------
itcl::body CSPref::reconfig {} {
# Unfortunately, r_setcolors recolors buttons if we do an Apply,
# so fix them up here.
for {set i 0} {$i < 10} {incr i} {
set color $_new(gdb/bg/$i)
$w.$i configure -activebackground $color -bg $color
}
}
# ------------------------------------------------------------------
# METHOD: pick - pick colors
# ------------------------------------------------------------------
itcl::body CSPref::_pick {color win num} {
#debug "$color $win $num"
set new_color [tk_chooseColor -initialcolor $color -title "Choose color"]
if {$new_color != $color && $new_color != {}} {
$win configure -activebackground $new_color -bg $new_color \
-command [code $this _pick $new_color $w.${num}b $num]
set _new(gdb/bg/$num) $new_color
pref set gdb/bg/$num $new_color
}
}

View file

@ -0,0 +1,36 @@
# Color Scheme preferences dialog class definition for GDBtk.
# Copyright (C) 2004, Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class CSPref {
inherit ManagedWin ModalDialog
private {
variable _saved ;# These are the saved values...
variable _new ;# These are the changed values
variable w
method _apply {}
method _build_win {}
method _cancel {}
method _init_var {}
method _pick {color win num}
method _save {}
method _setcolors {}
}
public {
method constructor {args}
method reconfig {}
}
}

View file

@ -0,0 +1,483 @@
# Debug window for GDBtk.
# Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# -----------------------------------------------------------------------------
# NAME: DebugWin::constructor
#
# SYNOPSIS: constructor::args
#
# DESC: Creates the debug window
#
# ARGS: None are used yet.
# -----------------------------------------------------------------------------
itcl::body DebugWin::constructor {args} {
debug $args
window_name "Insight Debug" "Debug"
build_win
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::destructor
#
# SYNOPSIS: Not called by hand
#
# DESC: Destroys the debug window
#
# ARGS: None
# -----------------------------------------------------------------------------
itcl::body DebugWin::destructor {} {
# notify debug code that window is going away
::debug::debugwin ""
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::reconfig
#
# SYNOPSIS: Reconfigure callback
#
# DESC: Fixes up window colors
#
# ARGS: None
# -----------------------------------------------------------------------------
itcl::body DebugWin::reconfig {} {
# This keeps the Debug window using its unique black background.
# Otherwise, a reconfigure event will color it to match the other windows
$itk_interior.s configure -textbackground black
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::build_win
#
# SYNOPSIS: build_win
#
# DESC: Creates the Debug Window. Reads the contents of the debug log
# file, if it exists. Notifies the debug functions in ::debug
# to send output here.
# -----------------------------------------------------------------------------
itcl::body DebugWin::build_win {} {
global gdb_ImageDir GDBTK_LIBRARY
set top [winfo toplevel $itk_interior]
# initialize the gdbtk_de array
if {![info exists ::gdbtk_de]} {
set ::gdbtk_de(ALL) 1
set ::gdbtk_de(ERRORS_ONLY) 0
set ::gdbtk_de(others) 0
set ::gdbtk_de(filter_var) ALL
}
# create menubar
set menu [menu $itk_interior.m -tearoff 0]
$menu add cascade -menu $menu.file -label "File" -underline 0
set m [menu $menu.file]
$m add command -label "Clear" -underline 1 \
-command [code $this _clear]
$m add command -label "Mark Old" -underline 1 \
-command [code $this _mark_old]
$m add separator
$m add command -label "Save" -underline 0 \
-command [code $this _save_contents]
$m add separator
$m add command -label "Close" -underline 0 \
-command "::debug::debugwin {};delete object $this"
$menu add cascade -menu $menu.trace -label "Trace"
set m [menu $menu.trace]
$m add radiobutton -label Start -variable ::debug::tracing -value 1
$m add radiobutton -label Stop -variable ::debug::tracing -value 0
$menu add cascade -menu $menu.rs -label "ReSource"
set m [menu $menu.rs]
foreach f [lsort [glob [file join $GDBTK_LIBRARY *.itb]]] {
$m add command -label "Source [file tail $f]"\
-command [list source $f]
}
$m add separator
$m add command -label "Source ALL" -command [code $this _source_all]
$menu add cascade -menu $menu.opt -label "Options"
set m [menu $menu.opt]
$m add command -label "Display" -underline 0 \
-command [list ManagedWin::open DebugWinDOpts -over $this]
if {!$::debug::initialized} {
$menu entryconfigure 1 -state disabled
$menu add cascade -label " Tracing Not Initialized" -foreground red \
-activeforeground red
}
$menu add cascade -menu $menu.help -label "Help" -underline 0
set m [menu $menu.help]
$m add command -label "Debugging Functions" -underline 0 \
-command {open_help debug.html}
$top configure -menu $menu
iwidgets::scrolledtext $itk_interior.s -hscrollmode static \
-vscrollmode static -wrap none -textbackground black -foreground white
set _t [$itk_interior.s component text]
pack $itk_interior.s -expand 1 -fill both
# define tags
foreach color $_colors {
$_t tag configure [lindex $color 0] -foreground [lindex $color 1]
}
$_t tag configure trace -foreground gray
$_t tag configure args -foreground blue
$_t tag configure marked -background grey20
loadlog
# now notify the debug functions to use this window
::debug::debugwin $this
# override the window delete procedure so the messages are
# turned off first.
wm protocol $top WM_DELETE_WINDOW "::debug::debugwin {};destroy $top"
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::puts
#
# SYNOPSIS: puts {level cls func msg}
#
# DESC: Writes debugging information into the DebugWin. A filter
# will be applied to determine if the message should be
# displayed or not.
#
# ARGS: level - priority level. See debug::dbug for details.
# cls - class name of caller, for example "SrcWin"
# func - function name of caller
# msg - message to display
# -----------------------------------------------------------------------------
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"} {
# errors and warnings only
if {$::gdbtk_de(ERRORS_ONLY)} { return }
# ALL classes except those set
if {$::gdbtk_de(ALL)} {
if {[info exists ::gdbtk_de($cls)]} {
if {$::gdbtk_de($cls)} {
return
}
} elseif {$::gdbtk_de(others)} {
return
}
}
# ONLY the classes set
if {!$::gdbtk_de(ALL)} {
if {[info exists ::gdbtk_de($cls)]} {
if {!$::gdbtk_de($cls)} {
return
}
} elseif {!$::gdbtk_de(others)} {
return
}
}
}
if {$func != ""} {
append cls ::$func
}
$_t insert end "($cls) " {} "$msg\n" $level
$_t see insert
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::put_trace
#
# SYNOPSIS: put_trace {enter level func ar}
#
# DESC: Writes trace information into the DebugWin. A filter
# will be applied to determine if the message should be
# displayed or not.
#
# ARGS: enter - 1 if this is a function entry, 0 otherwise.
# level - stack level
# func - function name
# ar - function arguments
# -----------------------------------------------------------------------------
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
} else {
$_t insert end "[string range $_bigstr 0 $x]<- $func " trace "$ar\n" args
}
$_t see insert
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::loadlog
#
# SYNOPSIS: loadlog
#
# DESC: Reads the contents of the debug log file, if it exists, into
# the DebugWin.
# -----------------------------------------------------------------------------
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
if {$::debug::logfile != "" && $::debug::logfile != "stdout"} {
flush $::debug::logfile
seek $::debug::logfile 0 start
while {[gets $::debug::logfile line] >= 0} {
while {[catch {set f [lindex $line 0]} f]} {
# If the lindex failed its because the remainder of the
# list is on the next line. Get it.
if {[gets $::debug::logfile line2] < 0} {
break
}
append line \n $line2
}
if {$f == "T"} {
put_trace [lindex $line 1] [lindex $line 2] [lindex $line 3] \
[lindex $line 4]
} else {
puts $f [lindex $line 1] [lindex $line 2] [lindex $line 3]
}
}
}
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::_source_all
#
# SYNOPSIS: _source_all
#
# DESC: Re-sources all the .itb files.
# -----------------------------------------------------------------------------
itcl::body DebugWin::_source_all {} {
foreach f [glob [file join $::GDBTK_LIBRARY *.itb]] {
source $f
}
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::_clear
#
# SYNOPSIS: _clear
#
# DESC: Clears out the content of the debug window.
# -----------------------------------------------------------------------------
itcl::body DebugWin::_clear {} {
$_t delete 1.0 end
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::_mark_old
#
# SYNOPSIS: _mark_old
#
# DESC: Changes the background of the current contents of the window.
# -----------------------------------------------------------------------------
itcl::body DebugWin::_mark_old {} {
$_t tag add marked 1.0 "end - 1c"
}
# -----------------------------------------------------------------------------
# NAME: DebugWin::_save_contents
#
# SYNOPSIS: _save_contents
#
# DESC: Changes the background of the current contents of the window.
# -----------------------------------------------------------------------------
itcl::body DebugWin::_save_contents {} {
set file [tk_getSaveFile -title "Choose debug window dump file" \
-parent [winfo toplevel $itk_interior]]
if {$file == ""} {
return
}
if {[catch {::open $file w} fileH]} {
tk_messageBox -type ok -icon error -message \
"Can't open file: \"$file\". \n\nThe error was:\n\n\"$fileH\""
return
}
::puts $fileH [$_t get 1.0 end]
}
###############################################################################
# -----------------------------------------------------------------------------
# NAME: DebugWinDOpts::constructor
#
# SYNOPSIS: constructor
#
# DESC: Creates the Debug Window Options Dialog.
# -----------------------------------------------------------------------------
itcl::body DebugWinDOpts::constructor {args} {
window_name "Debug Window Options"
build_win
eval itk_initialize $args
}
###############################################################################
# -----------------------------------------------------------------------------
# NAME: DebugWinDOpts::destructor
#
# SYNOPSIS: Not called by hand
#
# DESC: Destroys the Debug Window Options Dialog.
# -----------------------------------------------------------------------------
itcl::body DebugWinDOpts::destructor {} {
}
# -----------------------------------------------------------------------------
# NAME: DebugWinDOpts::build_win
#
# SYNOPSIS: build_win
#
# DESC: Creates the Debug Window Options Dialog. This dialog allows the
# user to select which information is displayed in the debug
# window and (eventually) how it looks.
# -----------------------------------------------------------------------------
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 \
ManagedWin GDBWin StackWin SrcTextWin global \
BpWin TargetSelection ModalDialog ProcessWin \
GDBEventHandler MemWin VarTree}
set _classes [concat [lsort $_classes] others]
set f [frame $itk_interior.f]
set btns [frame $itk_interior.buttons]
iwidgets::Labeledframe $f.display -labelpos nw -labeltext {Classes}
set fr [$f.display childsite]
radiobutton $fr.0 -text "Messages from ALL classes EXCEPT those selected below" \
-variable ::gdbtk_de(filter_var) -value ALL -command [code $this _all]
radiobutton $fr.1 -text "Messages from ONLY those classes selected below" \
-variable ::gdbtk_de(filter_var) -value ONLY -command [code $this _all]
radiobutton $fr.2 -text "Only WARNINGS and ERRORS" \
-variable ::gdbtk_de(filter_var) -value ERRORS -command [code $this _all]
grid $fr.0 -sticky w -padx 5 -pady 5
grid $fr.1 -sticky w -padx 5 -pady 5
grid $fr.2 -sticky w -padx 5 -pady 5
iwidgets::Labeledframe $f.classes
set fr [$f.classes childsite]
set i 0
foreach cls $_classes {
if {![info exists ::gdbtk_de($cls)]} {
set ::gdbtk_de($cls) 0
}
checkbutton $fr.$i -text $cls -variable ::gdbtk_de($cls)
incr i
}
set k [expr 3*(int($i/3))]
set more [expr $i - $k]
set j 0
while {$j < $k} {
grid $fr.$j $fr.[expr $j+1] $fr.[expr $j+2] -sticky w -padx 5 -pady 5
incr j 3
}
switch $more {
1 { grid $fr.$j x x -sticky w -padx 5 -pady 5}
2 { grid $fr.$j $fr.[expr $j+1] x -sticky w -padx 5 -pady 5}
}
pack $f.display -side top -expand 1 -fill both
pack $f.classes -side top -expand 1 -fill both
button $btns.ok -text [gettext OK] -width 7 -command [code $this _apply 1] \
-default active
button $btns.apply -text "Apply to All" -width 7 \
-command [code $this _apply 0]
if {$::debug::logfile == "" || $::debug::logfile == "stdout"} {
$btns.apply configure -state disabled
}
button $btns.help -text [gettext Help] -width 10 -command [code $this help] \
-state disabled
standard_button_box $btns
bind $btns.ok <Return> "$btns.ok flash; $btns.ok invoke"
bind $btns.apply <Return> "$btns.apply flash; $btns.apply invoke"
bind $btns.help <Return> "$btns.help flash; $btns.help invoke"
pack $btns $f -side bottom -expand 1 -fill both -anchor e
focus $btns.ok
}
# -----------------------------------------------------------------------------
# NAME: DebugWinDOpts::_all
#
# SYNOPSIS: _all
#
# DESC: Callback for selecting ALL classes. If the user selects ALL,
# deselect all the individual class checkbuttons.
# -----------------------------------------------------------------------------
itcl::body DebugWinDOpts::_all {} {
switch $::gdbtk_de(filter_var) {
ALL {
set ::gdbtk_de(ALL) 1
set ::gdbtk_de(ERRORS_ONLY) 0
#enable class buttons
set num 0
foreach class $_classes {
[$itk_interior.f.classes childsite].$num configure -state normal
incr num
}
}
ONLY {
set ::gdbtk_de(ALL) 0
set ::gdbtk_de(ERRORS_ONLY) 0
#enable class buttons
set num 0
foreach class $_classes {
[$itk_interior.f.classes childsite].$num configure -state normal
incr num
}
}
ERRORS {
set ::gdbtk_de(ALL) 0
set ::gdbtk_de(ERRORS_ONLY) 1
# disable class buttons
set num 0
foreach class $_classes {
[$itk_interior.f.classes childsite].$num configure -state disabled
incr num
}
}
}
}
# -----------------------------------------------------------------------------
# NAME: DebugWinDOpts::_apply
#
# SYNOPSIS: _apply
#
# DESC: Callback for the "Apply" button. Loads the contents of the
# log file through the new filter into the debug window. The
# button is disabled if there is no log file.
# -----------------------------------------------------------------------------
itcl::body DebugWinDOpts::_apply { done } {
set dw [ManagedWin::find DebugWin]
debug $dw
if {$dw != ""} {
$dw loadlog
}
if {$done} {
delete object $this
}
}

View file

@ -0,0 +1,93 @@
# Debug window class definition for GDBtk.
# Copyright (C) 1998, 1999 Cygnus Solutions
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# -----------------------------------------------------------------------------
# NAME:
# class DebugWin
#
# DESC:
# This class implements a debug output window to display internal
# debugging information. It can handle debugging messages, tracing,
# and eventually profiling.
#
# NOTES:
# This window is for developers.
#
# -----------------------------------------------------------------------------
itcl::class DebugWin {
inherit ManagedWin
private {
variable _t
variable _colors {
{I green}
{W yellow}
{E orange}
{X red}
}
variable _bigstr " "
method build_win {}
method _source_all {}
method _clear {}
method _mark_old {}
method _save_contents {}
method reconfig {}
}
protected {
method _ignore_on_save {} { return 1 }
}
public {
method constructor {args}
method destructor {}
method puts {level cls func msg}
method put_trace {enter level func ar}
method loadlog {}
}
}
# -----------------------------------------------------------------------------
# NAME:
# class DebugWinDOpts
#
# DESC:
# This class implements a debug options dialog for the DebugWin.
# Currently this consists os a selection dialog to choose which
# messages to print. Eventually it could also include a filter
# for different priorities and color selections.
#
# NOTES:
# This window is for developers.
#
# -----------------------------------------------------------------------------
itcl::class DebugWinDOpts {
inherit ManagedWin
public {
method constructor {args} {}
method destructor {}
}
protected {
method _ignore_on_save { return 1 }
}
private {
variable _classes
method build_win {}
method _all {}
method _apply {done}
}
}

View file

@ -0,0 +1,303 @@
# Download class implementation for Insight.
# Copyright (C) 1999, 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Download window and associated procs
#
# ----------------------------------------------------------------------
itcl::body Download::constructor {args} {
global gdb_pretty_name
debug $args
eval itk_initialize $args
window_name "Download Status" "Download"
add_hook download_progress_hook "$this update_download"
label $itk_interior.dload -text "Downloading $filename to $gdb_pretty_name"
label $itk_interior.stat
set f [frame $itk_interior.f]
set i 0
while {$i <$num_sections} {
iwidgets::feedback $f.meter$i -steps $num_steps
grid forget [$f.meter$i component percentage]
label $f.sec$i -text [lindex $section(names) $i] -anchor w
label $f.num$i -text $bytes($i) -anchor e
grid $f.sec$i $f.meter$i $f.num$i -padx 4 -pady 4 -sticky news
incr i
}
grid columnconfigure $f 1 -weight 1
button $itk_interior.cancel -text Cancel -command "$this cancel" \
-state active -width 10
pack $itk_interior.dload -padx 5 -pady 5 -side top -fill x -expand yes
pack $itk_interior.stat -padx 5 -pady 5 -expand yes
pack $itk_interior.f -padx 5 -pady 5 -fill x -expand yes
pack $itk_interior.cancel -padx 5 -pady 5 -side bottom
::update idletasks
}
# ------------------------------------------------------------------
# METHOD: update_download - update the download meters
# ------------------------------------------------------------------
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
# SEC as complete.
foreach s $section(names) {
set i $section($s)
if {$s == $sec} {
# Advance feedback meter. The iwidgets meter leaves a lot to
# be desired. No way to query the current setting. No way to
# set the state of the meter by percentage. It only understands
# steps, and we must be careful not to step the widget past the
# the configured number of steps, or else the meter will be
# set wrong. How lame.
set steps [expr {$num / $bytes($i) * $num_steps}]
if {[expr {$completed_steps($s) + $steps}] > $num_steps} {
set steps [expr {$num_steps - $completed_steps($s)}]
}
incr completed_steps($s) $steps
$itk_interior.f.meter$i step $steps
break
} else {
# Section already loaded. Make sure meter is at 100%.
if {$completed_steps($s) < $num_steps} {
set steps [expr {$num_steps - $completed_steps($s)}]
set completed_steps($s) $num_steps
$itk_interior.f.meter$i step $steps
}
}
}
::update
}
# ------------------------------------------------------------------
# METHOD: done - notification that the download is really complete
# ------------------------------------------------------------------
itcl::body Download::done { {msg ""} } {
bell
if {$msg == ""} {
# download finished
set secs [expr {[clock seconds] - $::download_start_time}]
if {$secs == 0} { incr secs }
$itk_interior.cancel config -state disabled
set bps [expr {8 * $total_bytes / $secs / 1000}]
$itk_interior.stat config -text "$total_bytes bytes in $secs seconds ($bps kbps)"
# set all indicators to FULL
foreach sec $section(names) {
set i $section($sec)
if {$completed_steps($sec) < $num_steps} {
set steps [expr {$num_steps - $completed_steps($sec)}]
set completed_steps($sec) $num_steps
$itk_interior.f.meter$i step $steps
}
}
} else {
# download failed
if {$msg != "CANCEL"} {
$itk_interior.stat config -text $msg
}
}
# enable OK button
$itk_interior.cancel config -state active -text OK -command "delete object $this"
::update
}
# ------------------------------------------------------------------
# METHOD: cancel - cancel the download
# ------------------------------------------------------------------
itcl::body Download::cancel {} {
debug "canceling the download"
set ::download_cancel_ok 1
}
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
itcl::body Download::destructor {} {
remove_hook download_progress_hook "$this update_download"
}
itcl::body Download::do_download_hooks {} {
set ::download_timer(ok) 1
}
itcl::body Download::download_hash { section num } {
global download_timer
debug "sec=$section num=$num tot=$total_bytes ok=$::download_cancel_ok"
::update
# Only run the timer at discrete times...
if {[info exists download_timer(timer)]} {
after cancel $download_timer(timer)
}
set download_timer(timer) [after 100 Download::do_download_hooks]
if {![info exists download_timer(ok)] || $download_timer(ok)} {
run_hooks download_progress_hook $section $num $total_bytes
::update
unset download_timer(timer)
set download_timer(ok) 0
}
return $::download_cancel_ok
}
# Download the executable. Return zero for success, and non-zero for error.
itcl::body Download::download_it { } {
global gdb_exe_name gdb_downloading gdb_loaded
global gdb_target_name gdb_pretty_name
global gdb_running gdbtk_platform
debug "exe=$gdb_exe_name downloading=$gdb_downloading"
debug " loaded=$gdb_loaded target=$gdb_target_name running=$gdb_running"
if {$gdb_downloading || $gdb_exe_name == ""} {
return 0
}
set gdb_downloading 1
set gdb_loaded 0
# Make sure the source window has had time to be created
::update
gdbtk_busy
# Only places that load files should do set_exe
#set_exe
switch [set_target] {
ERROR {
# target command failed
set gdb_downloading 0
gdbtk_idle
return 0
}
CANCELED {
# command cancelled by user
set gdb_downloading 0
if {$gdb_running} {
# Run the idle hooks (free the UI)
gdbtk_update
gdbtk_idle
} else {
gdbtk_idle
}
return 1
}
}
if {[string compare $gdbtk_platform(os) "cygwin"] == 0} {
set f [ide_cygwin_path to_win32 $gdb_exe_name]
} else {
set f $gdb_exe_name
}
if {! [file exists $f]} {
tk_messageBox -icon error -title GDB -type ok \
-message "Request to download non-existent executable $gdb_exe_name"
set gdb_downloading 0
gdbtk_idle
return 0
}
debug "downloading $gdb_exe_name"
set target $gdb_target_name
# get load info and total up number of bytes
if {[catch {gdb_load_info $gdb_exe_name} val]} {
set result "$gdb_exe_name: $val"
tk_dialog .load_warn "" "$result" error 0 Ok
return 0
}
set i 0
set total_bytes 0
set section(names) {}
foreach x $val {
set s [lindex $x 0]
lappend section(names) $s
set section($s) $i
set b [lindex $x 1]
set bytes($i) [expr {double($b)}]
incr total_bytes $b
set completed_steps($s) 0
incr i
}
set num_sections $i
set ::download_cancel_ok 0
set ::download_start_time [clock seconds]
if {[pref getd gdb/load/$target-verbose] == "1"} {
# open a detailed download dialog window
set download_dialog [ManagedWin::open Download -transient -filename $gdb_exe_name]
} else {
# raise source windows
foreach src [ManagedWin::find SrcWin] {
$src reveal
$src toolbar downloading
}
set download_dialog ""
}
set download_error ""
debug "starting load"
::update idletasks
if {[catch {gdb_cmd "load $gdb_exe_name"} errTxt]} {
debug "load returned $errTxt"
if {[regexp -nocase cancel $errTxt]} {
set download_error "CANCEL"
} else {
set download_error $errTxt
}
set ::download_cancel_ok 1
}
debug "Done loading"
set gdb_downloading 0
if {$::download_cancel_ok} {
set gdb_loaded 0
if {$download_dialog != ""} {
catch {$download_dialog done $download_error}
}
} else {
set gdb_loaded 1
if {$download_dialog != ""} {
catch {$download_dialog done}
}
}
foreach src [ManagedWin::find SrcWin] {
if {$download_error == "CANCEL"} {
$src download_progress CANCEL 1 1
} else {
$src download_progress DONE 0 $total_bytes $download_error
}
}
set ::download_cancel_ok 0
set download_dialog ""
gdbtk_idle
return 0
}

View file

@ -0,0 +1,45 @@
# Download class definition for Insight
# Copyright (C) 1999, 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class Download {
inherit ManagedWin
protected {
common total_bytes
common section
common bytes
common num_sections
common num_steps 100
# completed steps in feedback meter (iwidget::feedback is lame)
common completed_steps
method _ignore_on_save {} { return 1 }
proc dont_remember_size {} { return 1}
}
public {
variable filename
method constructor {args}
method destructor {}
method update_download { sec num tot }
method done { {msg ""} }
method cancel {}
proc download_it { }
proc do_download_hooks {}
proc download_hash { section num }
}
}

View file

@ -0,0 +1,47 @@
# Editor
# Copyright (C) 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Implements a set of editor commands
# ----------------------------------------------------------------------
namespace eval Editor {
namespace export edit
proc edit {loc_info} {
global external_editor_command
if {[info exists external_editor_command]} {
if {[catch {uplevel \#0 "$external_editor_command edit $loc_info"} \
err]} {
tk_dialog .warn-sn "Edit" $err error 0 Ok
}
return
}
lassign $loc_info baseName fnName fileName lineNum addr pc
set newCmd [pref get gdb/editor]
if {! [string compare $newCmd ""]} {
tk_dialog .warn "Edit" "No editor command specified" error 0 Ok
}
# Replace %s with file name and %d with line number.
regsub -all -- %s $newCmd $fileName newCmd
regsub -all -- %d $newCmd $lineNum newCmd
if {[catch "exec $newCmd &" err]} {
tk_dialog .warn "Edit" $err error 0 Ok
}
}
}

View file

@ -0,0 +1,31 @@
# GDBEventHandler class implementation for Insight.
# Copyright (C) 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ------------------------------------------------------------
# PUBLIC PROC: dispatch - Dispatch the given event to all
# event handlers. The name of the handler
# method to call is stored in the event's
# "handler" method.
# ------------------------------------------------------------
itcl::body GDBEventHandler::dispatch {event} {
set handler [$event handler]
# invoke event handlers
foreach w [itcl_info objects -isa GDBEventHandler] {
dbug I "posting event \"$handler\" to \"$w\""
if {[catch {$w $handler $event}]} {
dbug E "On $handler event, $w errored:\n$::errorInfo"
}
}
}

View file

@ -0,0 +1,48 @@
# GDBEventHandler class definition for Insight.
# Copyright (C) 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class GDBEventHandler {
constructor {args} {}
destructor {}
# Dispatching proc. ALL events should be funneled through this
# procedure.
public proc dispatch {event}
#
# Events
#
# See gdbevent.ith for descriptions of event
public {
# Breakpiont/tracepoint events
method breakpoint {event} {}
method tracepoint {event} {}
# Set variable
method set_variable {event} {}
# Busy event
method busy {event} {}
# Idle event
method idle {event} {}
# Update event
method update {event} {}
# Architecture changed event
method arch_changed {event} {}
}
}

View file

@ -0,0 +1,25 @@
# EmbeddedWin class definition for GDBtk.
# Copyright (C) 1998, 1999, 2001 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class EmbeddedWin {
inherit ManagedWin
constructor {args} {
debug "$args"
}
destructor {
debug
}
}

View file

@ -0,0 +1,205 @@
# GDB event class implementations for Insight.
# Copyright (C) 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
itcl::body BreakpointEvent::get {what} {
switch $what {
action { return $action }
number { return $number }
file { return $_file }
function { return $_function }
line { return $_line }
address { return $_address }
type { return $_type }
enabled { return $_enabled }
disposition { return $_disposition }
ignore_count { return $_ignore_count }
commands { return $_commands }
condition { return $_condition }
thread { return $_thread }
hit_count { return $_hit_count }
user_specification { return $_user_specification }
default { error "unknown event data \"$what\": should be: action|number|file|function|line|address|type|enabled|disposition|ignore_count|commands|condition|thread|hit_count|user_specification" }
}
}
# ------------------------------------------------------------
# PRIVATE METHOD: _init - Initialize all private data
# ------------------------------------------------------------
itcl::body BreakpointEvent::_init {} {
if {[catch {gdb_get_breakpoint_info $number} bpinfo]} {
set _file {}
set _function {}
set _line {}
set _address {}
set _type {}
set _enabled {}
set _disposition {}
set _ignore_count {}
set _commands {}
set _condition {}
set _thread {}
set _hit_count {}
set _user_specification {}
} else {
lassign $bpinfo \
_file \
_function \
_line \
_address \
_type \
_enabled \
_disposition \
_ignore_count \
_commands \
_condition \
_thread \
_hit_count \
_user_specification
}
}
# When the breakpoint number for the event changes,
# update the private data in the event.
itcl::configbody BreakpointEvent::number {
_init
}
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
itcl::body TracepointEvent::get {what} {
switch $what {
action { return $action }
number { return $number }
file { return $_file }
function { return $_function }
line { return $_line }
address { return $_address }
enabled { return $_enabled }
pass_count { return $_pass_count }
step_count { return $_step_count }
thread { return $_thread }
hit_count { return $_hit_count }
actions { return $_actions }
default { error "unknown event data \"$what\": should be: action|number|file|function|line|address|pass_count|step_count|thread|hit_count|actions" }
}
}
# ------------------------------------------------------------
# PRIVATE METHOD: _init - Initialize all private data
# ------------------------------------------------------------
itcl::body TracepointEvent::_init {} {
if {[catch {gdb_get_tracepoint_info $number} tpinfo]} {
set _file {}
set _function {}
set _line {}
set _address {}
set _enabled {}
set _pass_count {}
set _step_count {}
set _thread {}
set _hit_count {}
set _actions {}
} else {
lassign $tpinfo \
_file \
_function \
_line \
_address \
_enabled \
_pass_count \
_step_count \
_thread \
_hit_count \
_actions
}
}
# When the tracepoint number for the event changes,
# update the private data in the event.
itcl::configbody TracepointEvent::number {
_init
}
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
itcl::body TracepointEvent::get {what} {
switch $what {
action { return $action }
number { return $number }
file { return $_file }
function { return $_function }
line { return $_line }
address { return $_address }
enabled { return $_enabled }
pass_count { return $_pass_count }
step_count { return $_step_count }
thread { return $_thread }
hit_count { return $_hit_count }
actions { return $_actions }
default { error "unknown event data \"$what\": should be: action|number|file|function|line|address|pass_count|step_count|thread|hit_count|actions" }
}
}
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
itcl::body SetVariableEvent::get {what} {
switch $what {
variable { return $variable }
value { return $value }
default { error "unknown event data \"$what\": should be: variable|value" }
}
}
# ------------------------------------------------------------
# CONSTRUCTOR: Create an UpdateEvent
# ------------------------------------------------------------
itcl::body UpdateEvent::constructor {args} {
if {[catch {gdb_loc} loc]} {
dbug E "could not get current location: $loc"
} else {
lassign $loc _compile_filename _function _full_filename \
_line _frame_pc _pc _shlib
}
}
# ------------------------------------------------------------
# PUBLIC METHOD: get - Retrieve data about the event
# ------------------------------------------------------------
itcl::body UpdateEvent::get {what} {
switch $what {
compile_filename { return $_compile_filename }
full_filename { return $_full_filename }
function { return $_function }
line { return $_line }
frame_pc { return $_frame_pc }
pc { return $_pc }
shlib { return $_shlib }
default { error "unknown event data \"$what\": should be: variable|value" }
}
}

View file

@ -0,0 +1,220 @@
# GDBEvent class definitions for Insight.
# Copyright (C) 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# For reasons unknown to me, I cannot put any of the constructors
# in the implementation files. The very first instance of the class
# will call the (empty) constructor in here instead of the one
# defined in the implementation file. Sigh.
itcl::class GDBEvent {
public method get {what} { return "" }
public method handler {} { return "unknown" }
}
# BREAKPOINT EVENT
#
# This event is created/dispatched whenever a breakpoint is created,
# deleted, or modified.
#
# action ....... what type of BP event ("create", "delete", "modify")
# number ....... gdb's internal token for the BP
# file ......... filename in which event occurred
# function ..... function in which event occurred
# line ......... line number in file
# address ...... address of BP
# type ......... breakpoint type ("breakpoint", "hw breakpoint", "step resume", etc)
# enabled ...... BP enabled?
# disposition .. BP's disposition ("delete", "delstop", "disable", "donttouch")
# ignore_count . BP's ignore count
# commands ..... list of commands to run when BP hit
# condition .... BP condition
# thread ....... thread in which BP is set (or -1 for all threads)
# hit_count .... number of times BP has been hit
# user_specification
# .. text the user initially used to set this breakpoint
itcl::class BreakpointEvent {
inherit GDBEvent
public variable action {}
public variable number {}
#constructor {args} {}
constructor {args} {
eval configure $args
# If creating/modifying a breakpoint, then get
# all info about it and save it away.
_init
}
#destructor { dbug I "" }
public method get {what}
public method handler {} { return "breakpoint" }
private variable _file {}
private variable _function {}
private variable _line {}
private variable _address {}
private variable _type {}
private variable _enabled {}
private variable _disposition {}
private variable _ignore_count {}
private variable _commands {}
private variable _condition {}
private variable _thread {}
private variable _hit_count {}
private variable _user_specification {}
private method _init {}
}
# TRACEPOINT EVENT
#
# This event is created/dispatched whenever a tracepoint is created,
# deleted, or modified.
#
# action ....... what type of BP event ("create", "delete", "modify")
# number ....... gdb's internal token for the BP
# file ......... filename in which event occurred
# function ..... function in which event occurred
# line ......... line number in file
# address ...... address of BP
# enabled ...... BP enabled?
# pass_count ...
# step_count ...
# 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
itcl::class TracepointEvent {
inherit GDBEvent
public variable action {}
public variable number {}
# For reasons unknown to me, I cannot put this in the implementation
# file. The very first instance of the class will call this empty
# constructor instead of the one defined in the implementation file.
#constructor {args} {}
constructor {args} {
eval configure $args
# If creating/modifying a tracepoint, then get
# all info about it and save it away.
_init
}
#destructor { dbug I "" }
public method get {what}
public method handler {} { return "tracepoint" }
private variable _file {}
private variable _function {}
private variable _line {}
private variable _address {}
private variable _enabled {}
private variable _pass_count {}
private variable _step_count {}
private variable _thread {}
private variable _hit_count {}
private variable _actions {}
private method _init {}
}
# SET VARIABLE EVENT
#
# This event is created/dispatched whenever a "set" command successfully
# completes in gdb's command interpreter.
#
# variable ..... the variable that was changed
# value ........ the variable's new value
itcl::class SetVariableEvent {
inherit GDBEvent
public variable variable
public variable value
constructor {args} {
eval configure $args
}
#destructor { dbug I "" }
public method get {what}
public method handler {} { return "set_variable" }
}
# BUSY EVENT
#
# This event is created/dispatched whenever the GUI or GDB is "busy".
# This could happen when the inferior is executing or when the GUI
# is, for example, fetching memory from the target.
itcl::class BusyEvent {
inherit GDBEvent
public method handler {} { return "busy" }
}
# IDLE EVENT
#
# This event is created/dispatched whenever the GUI and GDB is not
# "busy". Receipt of this event means that the GUI should be put into
# a state to accept input by the user.
itcl::class IdleEvent {
inherit GDBEvent
public method handler {} { return "idle" }
}
# UPDATE EVENT
#
# This event is created/dispatched whenever the target's state
# has changed. When an UpdateEvent is received, widgets should
# update their contents to reflect the inferior's new state.
#
# Right now, this just holds the output of gdb_loc...
#
# compile_filename - Filename stored in the symtab
# full_filename - Full filename of file, if found in source search dir
# function - Function name
# line - Line number
# frame_pc - Frame's PC
# pc - Real stop PC
# shlib - Shared library stopped in
#
# FIXME: Should probably put frame_pc and pc into different
# types of update events...
itcl::class UpdateEvent {
inherit GDBEvent
constructor {args} {}
public method get {what}
public method handler {} { return "update" }
private variable _compile_filename {}
private variable _function {}
private variable _full_filename {}
private variable _line {}
private variable _frame_pc {}
private variable _pc {}
private variable _shlib {}
}
# ARCHITECTURE CHANGED EVENT
#
# This event is posted whenever the target architecture changes
itcl::class ArchChangedEvent {
inherit GDBEvent
public method handler {} { return "arch_changed" }
}

View file

@ -0,0 +1,332 @@
# GDBMenuBar
# Copyright (C) 2000, 2004 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Implements a GDB menubar.
#
# PUBLIC ATTRIBUTES:
#
#
# METHODS:
#
# configure ....... used to change public attributes
#
# PRIVATE METHODS
#
# X11 OPTION DATABASE ATTRIBUTES
#
#
# ----------------------------------------------------------------------
itcl::class GDBMenuBar {
inherit itk::Widget
# ------------------------------------------------------------------
# CONSTRUCTOR - create widget
# ------------------------------------------------------------------
constructor {args} {
set Menu [menu $itk_interior.m -tearoff 0]
eval itk_initialize $args
}
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
destructor {
#destroy $this
}
# ------------------------------------------------------------------
# METHOD: show - attach menu to the toplevel window
# ------------------------------------------------------------------
public method show {} {
[winfo toplevel $itk_interior] configure -menu $Menu
}
# ------------------------------------------------------------------
# METHOD: set_class_state - standard method to control state by class
# ------------------------------------------------------------------
public method set_class_state {enable_list} {
debug "Enable list is: $enable_list"
foreach {type state} $enable_list {
# debug $type
if {[info exists menu_classes($type)]} {
set class_list $menu_classes($type)
if {[llength $class_list]} {
# debug "$type $state \{$class_list\}"
foreach menu $class_list {
# debug "$type $menu $state"
menubar_change_menu_state $menu $state
}
}
}
}
}
####################################################################
# Methods that deal with menus.
#
# The next set of methods control the menubar associated with the
# toolbar. Currently, only sequential addition of submenu's and menu
# entries is allowed. Here's what you do. First, create a submenu
# with the "new_menu" command. This submenu is the targeted menu.
# Subsequent calls to add_menu_separator, and add_menu_command add
# separators and commands to the end of this submenu.
# If you need to edit a submenu, call clear_menu and then add all the
# items again.
#
# Each menu command also has a class list. Transitions between states
# of gdb will enable and disable different classes of menus.
#
# FIXME - support insert_command, and also cascade menus, whenever
# we need it...
####################################################################
# ------------------------------------------------------------------
# METHOD: add - Add something.
# It can be a menubutton for the main menu,
# a separator or a command.
#
# type - what we want to add
# args - arguments appropriate to what is being added
#
# RETURNS: the cascade menu widget path.
# ------------------------------------------------------------------
method add {type args} {
switch $type {
menubutton {
eval menubar_new_menu $args
}
command {
eval menubar_add_menu_command $args
}
separator {
menubar_add_menu_separator
}
cascade {
eval menubar_add_cascade $args
}
default {
error "Invalid item type: $type"
}
}
return $current_menu
}
# ------------------------------------------------------------------
# NAME: private method GDBMenuBar::menubar_add_cascade
# DESCRIPTION: Create a new cascading menu in the current menu
#
# ARGUMENTS: menu_name - the name of the menu to be created
# label - label to be displayed for the menu
# underline - which element to underline for shortcuts
# RETURNS: Nothing
# ------------------------------------------------------------------
private method menubar_add_cascade {menu_name class label underline} {
set m [menu $current_menu.$menu_name -tearoff false]
$current_menu add cascade -menu $m -label $label \
-underline $underline
incr item_number
switch $class {
None {}
default {
foreach elem $class {
lappend menu_classes($elem) [list $current_menu $item_number]
}
}
}
set current_menu $m
}
# ------------------------------------------------------------------
# PRIVATE METHOD: menubar_new_menu - Add a new menu to the main
# menu.
# Also target this menu for subsequent
# menubar_add_menu_command calls.
#
# name - the token for the new menu
# label - The label used for the label
# underline - the index of the underlined character for this menu item.
#
# ------------------------------------------------------------------
private method menubar_new_menu {name label underline args} {
set current_menu $Menu.$name
$Menu add cascade -menu $current_menu -label $label \
-underline $underline
eval menu $current_menu -tearoff 0 $args
# Save the index number of this menu. It is always the last one.
set menu_list($name) [$Menu index end]
set menu_list($name,label) $label
set item_number -1
}
# ------------------------------------------------------------------
# PRIVATE METHOD: menubar_add_menu_command - Adds a menu command item
# to the currently targeted submenu of the main menu.
#
# class - The class of the command, used for disabling entries.
# label - The text for the command.
# command - The command for the menu entry
# args - Passed to the menu entry creation command (eval'ed)
# ------------------------------------------------------------------
private method menubar_add_menu_command {class label command args} {
eval $current_menu add command -label \$label -command \$command \
$args
incr item_number
switch $class {
None {}
default {
foreach elem $class {
lappend menu_classes($elem) [list $current_menu $item_number]
}
}
}
}
# ------------------------------------------------------------------
# PRIVATE METHOD: menubar_add_menu_separator - Adds a menu separator
# to the currently targeted submenu of the main menu.
#
# ------------------------------------------------------------------
private method menubar_add_menu_separator {} {
incr item_number
$current_menu add separator
}
# ------------------------------------------------------------------
# METHOD: exists - Report whether a menu keyed by NAME exists.
#
# name - the token for the menu sought
#
# RETURNS: 1 if the menu exists, 0 otherwise.
# ------------------------------------------------------------------
method exists {name} {
return [info exists menu_list($name)]
}
# ------------------------------------------------------------------
# METHOD: clear - Deletes the items from one of the
# main menu cascade menus. Also makes this menu
# the target menu.
#
# name - the token for the new menu
#
# RETURNS: then item number of the menu, or "" if the menu is not found.
#
# FIXME: Does not remove the deleted menus from their class lists.
# ------------------------------------------------------------------
method clear {name} {
if {[info exists menu_list($name)]} {
set current_menu [$Menu entrycget $menu_list($name) -menu]
$current_menu delete 0 end
set item_number -1
return $current_menu
} else {
return ""
}
}
# ------------------------------------------------------------------
# METHOD: delete - Deletes one of the main menu
# cascade menus. Also makes the previous menu the
# target menu.
#
# name - the token for the new menu
#
# RETURNS: then item number of the menu, or "" if the menu is not found.
#
# FIXME: Does not remove the deleted menus from their class lists.
# ------------------------------------------------------------------
method delete {name} {
if {[info exists menu_list($name)]} {
$Menu delete $menu_list($name,label)
set current_menu {}
unset menu_list($name,label)
unset menu_list($name)
}
}
# ------------------------------------------------------------------
# PRIVATE METHOD: menubar_change_menu_state - Does the actual job of
# enabling menus...
#
# INPUT: Pass normal or disabled for the state.
# ------------------------------------------------------------------
private method menubar_change_menu_state {menu state} {
[lindex $menu 0] entryconfigure [lindex $menu 1] -state $state
}
# ------------------------------------------------------------------
# METHOD: menubar_set_current_menu - Change the current_menu pointer.
# Returns the current value so it can be restored.
# ------------------------------------------------------------------
method menubar_set_current_menu {menup} {
set saved_menu $current_menu
set current_menu $menup
return $saved_menu
}
# ------------------------------------------------------------------
# METHOD: menubar_get_current_menu - Get the current_menu pointer.
# Returns the current value so it can be restored.
# ------------------------------------------------------------------
method menubar_get_current_menu {} {
return $current_menu
}
####################################################################
#
# PRIVATE DATA
#
####################################################################
# This array holds the menu classes. The key is the class name,
# and the value is the list of menus belonging to this class.
private variable menu_classes
# This array holds the pathname that corresponds to a menu name
private variable menu_list
private variable item_number -1
private variable current_menu {}
####################################################################
#
# PROTECTED DATA
#
####################################################################
# The menu Tk widget
protected variable Menu
####################################################################
#
# PUBLIC DATA
#
####################################################################
# None
}

View file

@ -0,0 +1,396 @@
# GDBToolBar
# Copyright (C) 2000 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Implements a toolbar.
#
# PUBLIC ATTRIBUTES:
#
#
# METHODS:
#
# configure ....... used to change public attributes
#
# PRIVATE METHODS
#
# X11 OPTION DATABASE ATTRIBUTES
#
#
# ----------------------------------------------------------------------
itcl::class GDBToolBar {
inherit itk::Widget
# ------------------------------------------------------------------
# CONSTRUCTOR - create widget
# ------------------------------------------------------------------
constructor {args} {
# Make a subframe so that the menu can't accidentally conflict
# with a name created by some subclass.
set ButtonFrame [frame $itk_interior.t]
pack $ButtonFrame $itk_interior -fill both -expand true
eval itk_initialize $args
}
# ------------------------------------------------------------------
# DESTRUCTOR - destroy window containing widget
# ------------------------------------------------------------------
destructor {
#destroy $this
}
# ------------------------------------------------------------------
# METHOD: show - show the toolbar
# ------------------------------------------------------------------
public method show {} {
if {[llength $button_list]} {
eval standard_toolbar $ButtonFrame $button_list
}
}
# ------------------------------------------------------------------
# METHOD: set_class_state - standard method to control state by class
# ------------------------------------------------------------------
public method set_class_state {enable_list} {
debug "Enable list is: $enable_list"
foreach {type state} $enable_list {
# debug $type
if {[info exists button_classes($type)]} {
set class_list $button_classes($type)
if {[llength $class_list]} {
# debug "$type $state \{$class_list\}"
foreach button $class_list {
# debug "$type $button $state"
itemconfigure $button -state $state
}
}
}
}
}
####################################################################
# Methods that deal with buttons.
####################################################################
# ------------------------------------------------------------------
# METHOD: add - Add something.
# It can be a button a separator or a label.
#
# type - what we want to add
# args - arguments appropriate to what is being added
#
# ------------------------------------------------------------------
method add {type args} {
switch $type {
button {
eval toolbar_add_button $args
}
label {
eval toolbar_add_label $args
}
separator {
toolbar_add_button_separator
}
custom {
eval toolbar_add_custom $args
}
default {
error "Invalid item type: $type"
}
}
}
# ------------------------------------------------------------------
# PRIVATE METHOD: toolbar_add_button - Creates a button, and inserts
# it at the end of the button list. Call this when
# the toolbar is being set up, but has not yet been
# made.
# ------------------------------------------------------------------
private method toolbar_add_button {name class command balloon args} {
lappend button_list \
[eval _register_button 1 \$name \$class \$command \$balloon $args]
}
# ------------------------------------------------------------------
# PRIVATE METHOD: toolbar_add_label - Create a label to be inserted
# in the toolbar.
# ------------------------------------------------------------------
private method toolbar_add_label {name text balloon args} {
set lname $ButtonFrame.$name
set Buttons($name) $lname
set Buttons($lname,align) $button_align
eval label $lname -text \$text $args
balloon register $lname $balloon
lappend button_list $lname
}
# ------------------------------------------------------------------
# PRIVATE METHOD: toolbar_add_custom - Create a user defined widget
# to be inserted in the toolbar.
# ------------------------------------------------------------------
private method toolbar_add_custom {name createCmd balloon args} {
set wname $ButtonFrame.$name
set Buttons($name) $wname
set Buttons($wname,align) $button_align
eval $createCmd $wname $args
balloon register $wname $balloon
lappend button_list $wname
}
# ------------------------------------------------------------------
# PRIVATE METHOD: toolbar_add_button_separator -
# ------------------------------------------------------------------
private method toolbar_add_button_separator {} {
lappend button_list -
}
# ------------------------------------------------------------------
# PRIVATE METHOD: _register_button - Creates all the bookkeeping
# for a button, without actually inserting it in the toolbar.
# If the button will not be immediately inserted (INS == 0),
# sets its bindings and appearences to the same of a
# standard_toolbar button.
# ------------------------------------------------------------------
private method _register_button {ins name class command balloon args} {
set bname $ButtonFrame.$name
set Buttons($name) $bname
set Buttons($bname,align) $button_align
eval button $bname -command \$command $args
balloon register $bname $balloon
foreach elem $class {
switch $elem {
None {}
default {
lappend button_classes($elem) $name
}
}
}
# If the button is not going to be inserted now...
if {! $ins} {
# This is a bit of a hack, but I need to bind the standard_toolbar bindings
# and appearances to these externally, since I am not inserting them in
# the original toolbar...
# FIXME: Have to add a method to the libgui toolbar to do this.
# Make sure the button acts the way we want, not the default Tk way.
$bname configure -takefocus 0 -highlightthickness 0 \
-relief flat -borderwidth 1
set index [lsearch -exact [bindtags $bname] Button]
bindtags $bname [lreplace [bindtags $bname] $index $index ToolbarButton]
}
return $bname
}
# ------------------------------------------------------------------
# METHOD: create - Creates all the bookkeeping for a button,
# without actually inserting it in the toolbar.
# ------------------------------------------------------------------
method create {name class command balloon args} {
return [eval _register_button 0 \$name \$class \$command \$balloon $args]
}
# ------------------------------------------------------------------
# METHOD: itemconfigure -
# ------------------------------------------------------------------
method itemconfigure {button args} {
eval $Buttons($button) configure $args
}
# ------------------------------------------------------------------
# METHOD: itembind -
# ------------------------------------------------------------------
method itembind {button key cmd} {
eval [list bind $Buttons($button) $key $cmd]
}
# ------------------------------------------------------------------
# METHOD: itemballoon -
# ------------------------------------------------------------------
method itemballoon {button text} {
eval [list balloon register $Buttons($button) $text]
}
# ------------------------------------------------------------------
# PRIVATE METHOD: toolbar_insert_button - Inserts button "name" before
# button "before".
# The toolbar must be made, and the buttons must have been
# created before you run this.
# ------------------------------------------------------------------
private method toolbar_insert_button {name before} {
if {[string first "-" $name] == 0} {
set name [string range $name 1 end]
set add_sep 1
} else {
set add_sep 0
}
if {![info exists Buttons($name)] || ![info exists Buttons($before)]} {
error "toolbar_insert_buttons called with non-existant button"
}
set before_col [gridCGet $Buttons($before) -column]
set before_row [gridCGet $Buttons($before) -row]
set slaves [grid slaves $ButtonFrame]
set incr [expr 1 + $add_sep]
foreach slave $slaves {
set slave_col [gridCGet $slave -column]
if {$slave_col >= $before_col} {
grid configure $slave -column [expr $slave_col + $incr]
}
}
if {$add_sep} {
grid $Buttons(-$name) -column $before_col -row $before_row
}
# Now grid our button. Have to put in the pady since this button
# may not have been originally inserted by the libgui toolbar
# proc.
grid $Buttons($name) -column [expr $before_col + $add_sep] \
-row $before_row -pady 2
}
# ------------------------------------------------------------------
# PRIVATE METHOD: toolbar_remove_button -
# ------------------------------------------------------------------
private method toolbar_remove_button {name} {
if {[string first "-" $name] == 0} {
set name [string range $name 1 end]
set remove_sep 1
} else {
set remove_sep 0
}
if {![info exists Buttons($name)] } {
error "toolbar_remove_buttons called with non-existant button $name"
}
set name_col [gridCGet $Buttons($name) -column]
set name_row [gridCGet $Buttons($name) -row]
grid remove $Buttons($name)
if {$remove_sep} {
set Buttons(-$name) [grid slaves $ButtonFrame \
-column [expr $name_col - 1] \
-row $name_row]
grid remove $Buttons(-$name)
}
set slaves [grid slaves $ButtonFrame -row $name_row]
foreach slave $slaves {
set slave_col [gridCGet $slave -column]
if {($slave_col > $name_col)
&& ! ([info exists Buttons($slave,align)]
&& $Buttons($slave,align) == "right")} {
grid configure $slave -column [expr $slave_col - 1 - $remove_sep]
}
}
}
# ------------------------------------------------------------------
# METHOD: toolbar_button_right_justify -
# ------------------------------------------------------------------
method toolbar_button_right_justify {} {
lappend button_list --
set button_align "right"
}
# ------------------------------------------------------------------
# METHOD: toolbar_swap_button_lists -
# ------------------------------------------------------------------
method toolbar_swap_button_lists {in_list out_list} {
# Now swap out the buttons...
set first_out [lindex $out_list 0]
if {[info exists Buttons($first_out)] && [grid info $Buttons($first_out)] != ""} {
foreach button $in_list {
toolbar_insert_button $button $first_out
}
foreach button $out_list {
toolbar_remove_button $button
}
} elseif {[info exists Buttons($first_out)]} {
debug "Error in swap_button_list - $first_out not gridded..."
} else {
debug "Button $first_out is not in button list"
}
}
####################################################################
#
# PRIVATE DATA
#
####################################################################
# This is the list of buttons that are being built up
#
private variable button_list {}
# This is an array of buttons names -> Tk Window names
# and also of Tk Window names -> column position in grid
private variable Buttons
# This array holds the button classes. The key is the class name,
# and the value is the list of buttons belonging to this class.
private variable button_classes
# Tell if we are inserting buttons left or right justified
private variable button_align "left"
#The frame to contain the buttons:
private variable ButtonFrame
####################################################################
#
# PROTECTED DATA
#
####################################################################
# None.
####################################################################
#
# PUBLIC DATA
#
####################################################################
# None.
}

View file

@ -0,0 +1,25 @@
# GDBwin class definition for Insight.
# Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class GDBWin {
inherit GDBEventHandler
constructor {args} {
debug "$args"
}
destructor {
debug
}
}

View file

@ -0,0 +1,481 @@
# Global preference class implementation for Insight.
# Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004, 2008 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Implements Global preferences dialog
#
# ----------------------------------------------------------------------
# ------------------------------------------------------------------
# METHOD: _init - set up the tracing labels info
# ------------------------------------------------------------------
itcl::body GlobalPref::_init {} {
if {$inited} {
return
}
set inited 1
array set tracing_labels {
0 "Tracing features disabled"
1 "Tracing features enabled"
max_len 0
}
foreach elem [array names tracing_labels] {
set len [string length $tracing_labels($elem)]
set tracing_labels(max_len) \
[expr $len > $tracing_labels(max_len) ? $len : $tracing_labels(max_len) ]
}
}
# ------------------------------------------------------------------
# METHOD: init_var - initialize preference variables
# ------------------------------------------------------------------
itcl::body GlobalPref::_init_var {} {
set vlist {gdb/ImageDir gdb/console/wrap gdb/mode gdb/use_icons gdb/compat gdb/use_color_schemes}
foreach var $vlist {
set _saved($var) [pref get $var]
set _new($var) $_saved($var)
}
}
# ------------------------------------------------------------------
# METHOD: constructor - create the Global Preferences object
# ------------------------------------------------------------------
itcl::body GlobalPref::constructor {args} {
window_name "Global Preferences"
_init
_init_var
_build_win
eval itk_initialize $args
}
# ------------------------------------------------------------------
# METHOD: destructor - destroy the Global Preferences object
# ------------------------------------------------------------------
itcl::body GlobalPref::destructor {} {
foreach thunk $_fonts {
font delete test-$thunk-font
}
}
# ------------------------------------------------------------------
# METHOD: _build_win - build the dialog
# ------------------------------------------------------------------
itcl::body GlobalPref::_build_win {} {
global gdbtk_platform GDBTK_LIBRARY
debug
frame $itk_interior.f
frame $itk_interior.x
set frame $itk_interior.f
# Icons
frame $frame.icons
label $frame.icons.lab -text "Icons "
combobox::combobox $frame.icons.cb -editable 0 -maxheight 10\
-command [code $this _change_icons] -bg $::Colors(textbg)
# get list of icon directories
set curdir [pwd]
set _icondirlist ""
cd $GDBTK_LIBRARY
foreach foo [glob -- *] {
if {[file isdirectory $foo] && [file exists [file join $foo "icons.txt"]]} {
lappend _icondirlist $foo
}
}
set width 14
# load combobox
foreach dir $_icondirlist {
if {![string compare $dir $_saved(gdb/ImageDir)]} {
set cdir 1
} else {
set cdir 0
}
set foo [file join $dir "icons.txt"]
if {[catch {::open $foo r} fid]} {
# failed
dbug E "couldn't open $foo:$fid"
if {$cdir} {$frame.icons.cb entryset "unknown icons"}
$frame.icons.cb list insert end "unknown icons"
} else {
if {[gets $fid txt] >= 0} {
if {$cdir} {$frame.icons.cb entryset $txt}
if {[string length $txt] > $width} {set width [string length $txt]}
$frame.icons.cb list insert end $txt
} else {
if {$cdir} {$frame.icons.cb entryset "unknown icons"}
$frame.icons.cb list insert end "unknown icons"
}
close $fid
}
}
$frame.icons.cb configure -width $width
cd $curdir
# searching for fixed font families take a long time
# therefore, we cache the font names. The font cache
# can be saved in the init file. A way should be provided
# to rescan the font list, without deleting the entry from the
# init file.
set font_cache [pref get gdb/font_cache]
# get list of fonts, removing some that typically
# are not useful or cause tk problems
set fam [lremove [font families] "open look glyph"]
set fam [lremove $fam "open look cursor"]
set fam [lremove $fam "song ti"]
set fam [lremove $fam "clearlyu"]
set fam [lremove $fam "clearlyu alternate glyphs"]
set fam [lremove $fam "clearlyu arabic extra"]
set fam [lremove $fam "clearlyu ligature"]
set fam [lremove $fam "clearlyu pua"]
set fam [lremove $fam "fangsong ti"]
set fam [lremove $fam "newspaper"]
set fam [lremove $fam "palatino linotype"]
set fam [lsort $fam]
if {$font_cache == ""} {
if {$gdbtk_platform(platform) == "unix"} {
toplevel .c
wm title .c "Scanning for fonts"
message .c.m -width 3i -text "Scanning system for fonts\n\nPlease wait..." \
-relief flat -padx 30 -pady 30 \
-bg [pref get gdb/global_prefs/message_bg] \
-fg [pref get gdb/global_prefs/message_fg]
::update
pack .c.m
focus .c
::raise .c
::update
}
foreach fn $fam {
if {[font metrics [list $fn] -fixed] == 1} {
lappend font_cache $fn
}
}
pref set gdb/font_cache $font_cache
if {[winfo exists .c]} { destroy .c }
}
Labelledframe $frame.d -text "Fonts"
set f [$frame.d get_frame]
_make_font_item $f fixed "Fixed Font:" $font_cache
if {$gdbtk_platform(platform) != "windows"} {
# Cannot change the windows menu font ourselves
_make_font_item $f menu "Menu Font:" $fam
}
_make_font_item $f default "Default Font:" $fam
_make_font_item $f status "Status Bar Font:" $fam
iwidgets::Labeledframe $frame.misc -labelpos nw -labeltext "Misc"
set f [$frame.misc childsite]
# This is the tracing preference
set tracing_cb [pref get gdb/mode]
if { ![info exists tracing_labels($tracing_cb)]} {
dbug E "Got unknown mode value: $tracing_cb"
set tracing_labels($tracing_cb) "Unknown gdb mode..."
}
checkbutton $f.tracing -variable [scope _new(gdb/mode)] \
-text $tracing_labels($tracing_cb) \
-command [code $this _toggle_tracing $f.tracing] \
-width $tracing_labels(max_len) -anchor w
# use_icons
if {$gdbtk_platform(platform) == "unix"} {
checkbutton $f.use_icons \
-text "Use builtin image as icon." -variable [scope _new(gdb/use_icons)]
}
# console wrap
checkbutton $f.consolewrap -text "Wrap text in console window" \
-variable [scope _new(gdb/console/wrap)]
# colored backgrounds
checkbutton $f.use_cs -text "Enable Color Schemes" \
-variable [scope _new(gdb/use_color_schemes)]
grid $f.tracing -sticky w -padx 5 -pady 5
if {$gdbtk_platform(platform) == "unix"} {
grid $f.use_icons -sticky w -padx 5 -pady 5
}
grid $f.consolewrap -sticky w -padx 5 -pady 5
grid $f.use_cs -sticky w -padx 5 -pady 5
if {$gdbtk_platform(platform) == "unix"} {
# Compatibility frame
iwidgets::Labeledframe $frame.compat -labelpos nw -labeltext "OS Compatibility"
set fc [$frame.compat childsite]
radiobutton $fc.0 -text "GNOME" -value "GNOME" -variable [scope _new(gdb/compat)]
radiobutton $fc.1 -text "KDE" -value "KDE" -variable [scope _new(gdb/compat)]
radiobutton $fc.2 -text "default" -value "default" -variable [scope _new(gdb/compat)]
grid $fc.0 -sticky w -padx 5 -pady 5
grid $fc.1 -sticky w -padx 5 -pady 5
grid $fc.2 -sticky w -padx 5 -pady 5
grid [label $fc.warn -text "Restart required for all\nchanges to take effect"] -sticky w
}
# pack it all
pack $frame.icons.lab $frame.icons.cb -side left
grid $frame.icons x -sticky w -pady 10
grid $frame.d -columnspan 2 -sticky w
if {$gdbtk_platform(platform) == "unix"} {
grid $frame.compat $frame.misc -sticky we
} else {
grid $frame.misc x -sticky we
}
# make buttons
button $itk_interior.x.ok -text OK -underline 0 -width 7 -command [code $this _ok]
button $itk_interior.x.apply -text Apply -width 7 -underline 0 -command [code $this _apply]
button $itk_interior.x.cancel -text Cancel -width 7 -underline 0 -command [code $this _cancel]
pack $itk_interior.x.ok $itk_interior.x.apply $itk_interior.x.cancel -side left
standard_button_box $itk_interior.x
pack $itk_interior.x -fill x -padx 5 -pady 5 -side bottom
pack $itk_interior.f -fill both -expand yes -padx 5 -pady 5
bind $itk_interior.x.ok <Return> \
"$itk_interior.x.ok flash; $itk_interior.x.ok invoke"
focus $itk_interior.x.ok
# We don't want the window flashing around as we change the fonts...
::update idletasks
_resize_font_item_height
pack propagate $itk_interior.f 0
}
# ------------------------------------------------------------------
# PRIVATE METHOD: _make_font_item
# ------------------------------------------------------------------
itcl::body GlobalPref::_make_font_item {f name label font_list} {
# create ComboBox with font name
lappend _fonts $name
set _original($name,family) [font actual global/$name -family]
set _original($name,size) [font actual global/$name -size]
font create test-$name-font -family $_original($name,family) \
-size $_original($name,size)
label $f.${name}x -text $label
combobox::combobox $f.${name}n -editable 0 -value $_original($name,family) \
-command [code $this _change_font $name] -bg $::Colors(textbg)
foreach a $font_list {
$f.${name}n list insert end $a
}
itk_component add $name-size {
iwidgets::spinint $f.${name}s -labeltext "Size:" -range {6 18} -step 1 \
-fixed 2 -width 2 -textvariable [scope _size($name)] -wrap 0 \
-increment [code $this _change_size up $name] \
-decrement [code $this _change_size down $name] \
-textbackground $::Colors(textbg)
} {}
label $f.${name}l -text ABCDEFabcdef0123456789 -font test-$name-font
set _size($name) $_original($name,size)
grid $f.${name}x $f.${name}n $f.${name}s $f.${name}l -sticky we -padx 5 -pady 5
grid columnconfigure $f 3 -weight 1
}
# ------------------------------------------------------------------
# PRIVATE METHOD: _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]
grid rowconfigure $master $row -minsize [lindex [grid bbox $master 0 $row 3 $row ] 3]
}
}
# ------------------------------------------------------------------
# PRIVATE METHOD: _change_icons
# ------------------------------------------------------------------
itcl::body GlobalPref::_change_icons {w args} {
set index [$w curselection]
if {$index != ""} {
set _new(gdb/ImageDir) [lindex $_icondirlist $index]
}
}
# ------------------------------------------------------------------
# NAME: private method GlobalPref::_change_font
# DESCRIPTION: Change the given font's family
#
# ARGUMENTS:
# font - the font whose family is to be
# changed
# stupid - the comobox widget which changed
# implementation - the new value of the combobox
# RETURNS: Nothing
#
# NOTES: The combobox has a really non-standard callback
# mechanism: it always adds two args to the callback.
# ------------------------------------------------------------------
itcl::body GlobalPref::_change_font {font stupid implementation} {
font configure test-$font-font -family $implementation
}
# ------------------------------------------------------------------
# NAME: private method GlobalPref::_change_size
# DESCRIPTION: Change the given font's size
#
# ARGUMENTS:
# direction - the direction of the change (up/down)
# font - the font that is changing
# RETURNS: Nothing
#
# NOTES: See comments for purpose of "direction". Sigh.
# ------------------------------------------------------------------
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
# as command callbacks. Instead it OVERRIDES all behavior.
# Thus, we need to call the stupid spinint's callback.
$itk_component($font-size) $direction
font configure test-$font-font -size $_size($font)
}
itcl::body GlobalPref::_toggle_tracing {win} {
debug
$win configure -text $tracing_labels($_new(gdb/mode))
}
# ------------------------------------------------------------------
# METHOD: _ok - called to accept settings and close dialog
# ------------------------------------------------------------------
itcl::body GlobalPref::_ok {} {
_apply 1
}
# ------------------------------------------------------------------
# METHOD: _apply - apply current settings to the screen
# ------------------------------------------------------------------
itcl::body GlobalPref::_apply {{deleteMe 0}} {
debug
set changed_something 0
# If you are not destroying the window, then make sure to
# propagate the geometry info from the font frame, so that changing
# the fonts IN the window don't cause some of the buttons to
# get obscured...
if {!$deleteMe} {
pack propagate $itk_interior.f 1
}
foreach thunk $_fonts {
set font [font configure test-$thunk-font]
if {[pref get global/font/$thunk] != $font} {
pref set global/font/$thunk $font
}
}
foreach var [array names _new] {
if {$_new($var) != [pref get $var]} {
debug "$var = $_new($var)"
if {$var == "gdb/mode"} {
if {!$_new(gdb/mode)} { pref set gdb/B1_behavior 1 }
} elseif {$var == "gdb/ImageDir"} {
set ::gdb_ImageDir [file join $::GDBTK_LIBRARY $_new($var)]
}
pref set $var $_new($var)
set changed_something 1
}
}
if {$changed_something} {
if {$deleteMe} { unpost }
ManagedWin::restart
return
}
if {$deleteMe} {
unpost
} else {
after idle "
update idletasks
[code $this _resize_font_item_height]
pack propagate $itk_interior.f 0
"
}
}
# ------------------------------------------------------------------
# METHOD: _cancel - forget current settings -- reset to original
# state and close preferences
# ------------------------------------------------------------------
itcl::body GlobalPref::_cancel {} {
debug
set changed_something 0
# Reset fonts if different
foreach thunk $_fonts {
set family [font configure global/$thunk -family]
set size [font configure global/$thunk -size]
if {$_original($thunk,family) != $family || $_original($thunk,size) != $size} {
pref set global/font/$thunk \
[list -family $_original($thunk,family) -size $_original($thunk,size)]
set changed_something 1
}
}
foreach var [array names _saved] {
if {$_saved($var) != [pref get $var]} {
debug "$var = $_saved($var)"
if {$var == "gdb/mode"} {
if {!$_saved(gdb/mode)} { pref set gdb/B1_behavior 1 }
} elseif {$var == "gdb/ImageDir"} {
set ::gdb_ImageDir [file join $::GDBTK_LIBRARY $_saved($var)]
}
pref set $var $_saved($var)
set changed_something 1
}
}
if {$changed_something} {
ManagedWin::restart
}
unpost
}
# ------------------------------------------------------------------
# METHOD: cancel - override modal dialog cancel method.
# The cancel method is actually called when
# the window is closed. Name needs fixed.
# ------------------------------------------------------------------
itcl::body GlobalPref::cancel {} {
# when the window is closed, we want the preferences selected to
# be applied.
_apply 1
}

View file

@ -0,0 +1,47 @@
# Global preference class definition for GDBtk.
# Copyright (C) 1998, 1999 Cygnus Solutions
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
itcl::class GlobalPref {
inherit ManagedWin ModalDialog
private {
variable _new
variable _saved
variable _icondirlist ""
variable _original ;# Original font settings
variable _size ;# Array tracking spinint values
variable _fonts ;# List of all available fonts for editing
common tracing_labels
common inited 0
method _init {}
method _init_var {}
method _build_win {}
method _make_font_item {f name label font_list}
method _resize_font_item_height {}
method _change_icons {w args}
method _change_font {font stupid implementation}
method _change_size {direction font}
method _ok {}
method _apply {{deleteMe 0}}
method _cancel {}
method cancel {}
method _toggle_tracing {win}
}
public {
method constructor {args}
method destructor {}
}
}

View file

@ -0,0 +1,107 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i686) [Netscape]">
<TITLE>Breakpoint Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Breakpoint Window</H1>
The Breakpoint Window lists all the various breakpoints that exist in the
program. It facilitates modifying breakpoints (make them temporary or normal,
disabled or enabled) and removing breakpoints.
<UL>
<LI><A HREF="#menus_bp">Breakpoint Menu</A></LI>
<LI><A HREF="#menus_global">Global Menu</A></LI>
<LI><A HREF="#display">Breakpoint Display</A></LI>
</UL>
<HR SIZE=4 WIDTH="100%">
<H2>
<A NAME="menus_bp"></A>Breakpoint Menu</H2>
The Breakpoint Menu operates on the selected breakpoint only.&nbsp; If
no breakpoint is selected the menu items will be disabled. The type and
state of a breakpoint may be changed by selecting the desired type or state
from the menu.
<DL>
<DT>Normal</DT>
<DD>The selected breakpoint is a normal breakpoint</DD>
<DT>Temporary</DT>
<DD>Indicates that the breakpoint is temporary</DD>
<DT>Enabled</DT>
<DD>The breakpoint is active and will stop the debugger when it is hit.</DD>
<DT>Disabled</DT>
<DD>The breakpoint is being ignored. A disabled breakpoint will never get hit.</DD>
<DT>Remove</DT>
<DD>Deletes the breakpoint</DD>
</DL>
<HR SIZE=4 WIDTH="100%">
<H2>
<A NAME="menus_global"></A>Global Menu</H2>
Items on the Global Menu affect all defined breakpoints. Users may:
<DL>
<DT>Show Threads</DT>
<DD>Toggle on/off the thread column</DD>
<DT>Enable All</DT>
<DD>Enable all breakpoints</DD>
<DT>Disable All</DT>
<DD>Disable all breakpoints</DD>
<DT>Remove All</DT>
<DD>Delete all breakpoints</DD>
</DL>
<HR SIZE=4 WIDTH="100%">
<H2><A NAME="display"></A>Breakpoint Display</H2>
The Breakpoint Display is a table of breakpoints. The first column of the
table (unlabeled) shows a checkbutton, indicating whether the breakpoint
is enabled (checked) or disabled (unchecked). Disabled breakpoints are
ignored and will not cause the program to stop.
<P>To use the Breakpoint Menu or the Breakpoint Pop-up Menu, first use
the left mouse button to select a breakpoint from the list, then make the
menu selection.
<H4>Modifying Breakpoints</H4>
To&nbsp;<A NAME="display_state"></A>enable a breakpoint, simply click the
checkbutton in the first column of the desired breakpoint so that it is
selected (checked). To disable a breakpoint, "uncheck" the checkbutton.
<P>To change a breakpoint's&nbsp;<A NAME="display_temp"></A>type, select
the desired type from either the Breakpoint Menu or the Breakpoint Pop-up
Menu.
<P>To remove a&nbsp;<A NAME="display_remove"></A>breakpoint, use the left
mouse button to select the breakpoint to remove and use either the Breakpoint
Menu or the Breakpoint Pop-up Menu to select "remove". To re-install a
breakpoint, use the <A HREF="source.html#setting_a_breakpoint">Source Window
Display</A>.
<H4><A NAME="display_popup"></A>Breakpoint Pop-up Menu</H4>
The Breakpoint Pop-up Menu is accessed by using the mouse cursor to select
a breakpoint from the Breakpoint Display and then clicking the right button
on the mouse. The Pop-up allows expert users quicker access to the functions
of the Breakpoint Menu:
<DL>
<DT>Normal</DT>
<DD>The selected breakpoint is a normal breakpoint</DD>
<DT>Temporary</DT>
<DD>Indicates that the breakpoint is temporary</DD>
<DT>Enabled</DT>
<DD>The breakpoint is active and will stop the debugger when it is hit.</DD>
<DT>Disabled</DT>
<DD>The breakpoint is being ignored. A disabled breakpoint will never get hit.</DD>
<DT>Remove</DT>
<DD>Deletes the breakpoint</DD>
<DT>Global, Show Threads</DT>
<DD>Toggle on/off the thread column</DD>
<DT>Global, Enable All</DT>
<DD>Enable all breakpoints</DD>
<DT>Global, Disable All</DT>
<DD>Disable all breakpoints</DD>
<DT>Global, Remove All</DT>
<DD>Delete all breakpoints</DD>
</DL>
</BODY>
</HTML>

View file

@ -0,0 +1,77 @@
<HTML>
<HEAD>
<TITLE>Function Browser Help</TITLE>
</HEAD>
<BODY>
<H1>The Function Browser</H1>
<img src="images/browser1.png" alt="layout1" width=164 height=171 align="right" border=0>
<img src="images/browser2.png" alt="layout2" width=164 height=170 align="right" border=0>
<h2>Overview</h2>
<p>The Function Browser may be used to search for specific functions
in the executable, allowing the user to easily browse through source
code and set and clear breakpoints at anywhere in the executable
with ease. Its powerful regular expression searches allow the user
to easily set breakpoints on multiple functions at once.</p>
<p>The Function Browser has two different layouts. Both layouts contain the same four sections;
Files, Function Filter, Functions, and Source Display.</p>
<h3>Files</h3>
<p>The Files section displays a list of all the source files. The files are
read from the debug information in the program being debugged. To see
the list of functions in a file, click on it. The function list should appear
in the Functions Display and the source should appear in the Source Display.
You can select multiple files by using the Control or Shift keys while
clicking the left mouse button. When multiple files are selected, all the functions in those files
are displayed in the Functions Display.
</p>
<p>At the bottom of the Files Display, you should see a checkbutton labelled "Hide .h files"
and a button labelled "Select All". Checking "Hide .h files" will remove all
files ending in ".h" from the Files Display. Clicking "Select All" will select all files
in the Files Display.</p>
<h3>Function Filter</h3>
<p>Above the Function Display you should see a section labelled "Function Filter".
The purpose of this section is to apply a filter to the list of functions in the Functions Display.
For example, if you click "Select All" in the Files Display, then many hundreds of functions
could appear in the Functions Display. To see all functions containing the string "print", for example, click on the combobox in the Function Filter and select "contains".
Then type "print" into the box to the right and hit the enter or return key. You should see the Function
Display updated with a list of all functions containing "print".</p>
<p>Insight remember what the last filter you used was and will always open the Function
Browser window with the last filter settings.
</p>
<h3>Function Display</h3>
<p>The Function Display contains the list of functions in the files that have been
selected in the Files Display, after running them through any filter settings in the Filter Display.
There are two buttons at the bottom of the display that allow you so set or delete breakpoints on every function
in the Function Display in one operation.
</p>
<p>For example, to set a breakpoint of every function name containing "print", follow the example in the Function Filter section to
get a list of all functions containing "print". Then simply click the "Set BP" button.</p>
<h3>Source Display</h3>
<p>The Source Display shows the source code for any file selected in the File Display. If a function
is selected in the Function Display, the first line of that function containing
executable code will be highlighted. If no source file is found, then the function will be
displayed disassembled.</p>
<p>At the bottom of the window are two comboboxes and a text field. The combobox on the far left
contains the function name or file location to display. Normally this is just output for your information, however
you can type the name of any function into this box to see its source.
</p>
<p>To the right of this is another combobox that allows you to toggle between source and assembly.
</p>
<p>To the far right is an empty field. You can type a string in it and hit enter to
search the current source file for any string.</p>
<p>In the source window itself, you can set breakpoints just like the source window.</p>
<h3>Popup Menu</h3>
<p>If you click the right mouse button while over the File Browser, you should get a simple menu
with three options; <i>Toggle Layout</i>, <i>Help</i>, and <i>Close</i>. <i>Toggle Layout</i>
switches you between the two different Browser Window layouts. Choose the one you like best;
Insight will remember it between sessions. <i>Help</i> pops up this help window. <i>Close</i> closes the Function Browser.
</p>
</BODY>
</HTML>

View file

@ -0,0 +1,74 @@
<HTML>
<HEAD>
<TITLE>Console Window Help</TITLE>
</HEAD>
<BODY>
<CENTER><H2>The Console Window</H2></CENTER>
<P>The Console Window provides the traditional command-line interface to GDB.
It is very similar to the command-line you get when GDB is run with "-nw".</P>
<UL>
<LI><A HREF="#display">Console Display</A></LI>
<LI><A HREF="#editing">Editing Commands</A></LI>
<LI><A HREF="#history">History Commands</A></LI>
<LI><A HREF="#display_hlp">Getting Help</A></LI>
</UL>
<H4><A NAME="display">Console Display</A></H4>
The Console Display is simply a scrolled window in which the debugger prompt
appears. By default, the prompt is set to "(gdb) ", but it may be changed via a
command line option.
<P>To execute commands in the console window, simply enter
the command in the display. If the debugger is busy, the message "Error: The
debugger is busy." appears informing the user that the command was not accepted.</P>
<P>Whenever a command is executed, the debugger's windows will update to display
any new state information. Any output from the command is also echoed to the Console
Window for ease of use. If an error occurs, an error message is printed to the Console
Window. All error messages appear in the Console Window using a red typeface.
</P>
<BR>
<H4><A NAME="editing">Editing Commands</A></H4>
<P>The Console Window shell has many powerful features to help edit commands.</P>
<UL>
<LI> Return or Enter causes the command to be executed.
<LI> Control-A moves the cursor to the beginning of the line.</LI>
<LI> Control-E moves the cursor to the end of the line.</LI>
<LI> Control-D or DELETE delete the character to the right of the cursor.</LI>
<LI> BACKSPACE deletes the character to the left of the cursor.</LI>
<LI> Control-B or LeftArrow moves the cursor to the left.</LI>
<LI> Control-F or RightArrow moves the cursor to the right.</LI>
<LI> Control-K deletes everything to the right of the cursor.</LI>
<LI> Control-U deletes the text between the cursor and the start of the line.</LI>
<LI> Control-W deletes the previous word</LI>
<LI> END deletes the whole line.</LI>
<LI> The mouse may also be used to position the cursor and cut and paste.</LI>
</UL>
<H4><A NAME="history">History Commands</A></H4>
<UL>
<LI> Conrol-P or UpArrow recalls the previous command.</LI>
<LI> Conrol-N or DownArrow recalls the next command.</LI>
<LI> Shift-UpArrow or Control-UpArrow will search through previous commands
for commands that start with the same characters as the current line. For
example, if you type "pr" and hit Shift-UpArrow, it may find commands in the
history such as "print foo" or "print sol[x]". Each time you search it will
go back further in the history. If nothing is on the current line, it
acts just like Control-P or UpArrow.</LI>
<LI> Shift-DownArrow or Control-DownArrow work in the opposite direction of
Shift-UpArrow and Control-DownArrow. </LI>
</UL>
<BR>
<H4><A NAME="display_hlp">Getting Help</A></H4>
The Console Window has its own online help system. To access the help system, enter
"help" at the prompt and follow the on-screen instructions. For more help, please
consult the <!-- What is this really called? --> <I>GDB User's Guide</I>.
</BODY>
</HTML>

View file

@ -0,0 +1,133 @@
<HTML>
<HEAD>
<TITLE>Internal Debugging Help</TITLE>
</HEAD>
<BODY>
<H2>Insight Internal Debugging Functions</H2>
<H3>Overview</H3>
<P> This describes the basic internal functions for debugging Insight.
This information is for Insight developers trying to debug Insight,
not for users trying to debug other programs.</P>
<H3>Environment Variables</H3>
<P><b>GDBTK_DEBUG</b> - Setting this variable controls the Debug
window.</P>
<P><b>GDBTK_DEBUG</b> may have the following values:</P>
<DL>
<DT>0 or unset</DT>
<DD>The Debug window is not opened and not listed on the menu. (You
may still open it by typing Ctrl-U in the source window.)</DD>
<DT>1</DT>
<DD>The Debug window is listed on the menu, but not opened.</DD>
<DT>2</DT>
<DD>The Debug window is opened at startup.</DD>
</DL>
<HR>
<P><b>GDBTK_TRACE</b> - This variable determines if tracing is enabled.
Tracing may only be enabled at GDBTK startup. Changing <b>GDBTK_TRACE</b>
while GDBTK is running has no effect.</P>
<P><b>GDBTK_TRACE</b> may have the following values:</P>
<DL>
<DT>0 or unset</DT>
<DD>Tracing is not enabled.</DD>
<DT>1</DT>
<DD>Tracing is enabled, but not started. To start tracing, you need to do
so in the Debug Window or from the console. (The command to do this is "tk
::debug::trace_start).</DD>
<DT>2</DT>
<DD>Tracing is enabled and started immediately.</DD>
</DL>
<P><b>GDBTK_DEBUGFILE</b> - This variable contains an optional filename
where GDBTK will write all debugging information. This information will include
the output of all "debug" and "dbug" commands, as well as tracing, if it is
enabled. The value of
<b>GDBTK_DEBUGFILE</b> will not change what is displayed in the Debug
Window, with one exception; when the Debug Window is opened, it will read
the contents of <b>GDBTK_DEBUGFILE</b> (if it is set and not "stdout").
<P><b>GDBTK_DEBUGFILE</b> may have the following values:</P>
<DL>
<DT>unset</DT>
<DD>No information will be logged.</DD>
<DT><i>filename</i></DT>
<DD>Debugging information will be logged to <i>filename</i>.
<DT>"stdout"</DT>
<DD>Debugging information will be written to stdout</DD>
</DL>
<HR>
<H3>Tcl Debugging Functions</H3>
<P> All debugging functions have been moved into debug.tcl in the ::debug
namespace. "debug" and "dbug" are imported into the global namespace.</P>
<P> The following are the standard debug message functions.</P>
<pre>
# -----------------------------------------------------------------------------
# NAME: debug::debug
#
# SYNOPSIS: debug { {msg ""} }
#
# DESC: Writes a message to the proper output. The priority of the
# message is assumed to be "I" (informational). This function
# is provided for compatibility with the previous debug function.
# For higher priority messages, use dbug.
#
# ARGS: msg - Message to be displayed.
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# NAME: debug::dbug
#
# SYNOPSIS: dbug { level msg }
#
# DESC: Writes a message to the proper output. Unlike debug, this
# function take a priority level.
#
# ARGS: msg - Message to be displayed.
# level - One of the following:
# "I" - Informational only
# "W" - Warning
# "E" - Error
# "X" - Fatal Error
# ----------------------------------------------------------------------------
</pre>
<P> These next functions are used to trace variables, which should not be
confused with the functions tracing.<P>
<pre>
# ----------------------------------------------------------------------------
# NAME: debug::trace_var
# SYNOPSIS: debug::trace_var {varName mode}
# DESC: Sets up variable trace. When the trace is activated,
# debugging messages will be displayed.
# ARGS: varName - the variable name
# mode - one of more of the following letters
# r - read
# w - write
# u - unset
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# NAME: debug::remove_trace
# SYNOPSIS: debug::remove_trace {var mode}
# DESC: Removes a trace set up with "trace_var".
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# NAME: debug::remove_all_traces
# SYNOPSIS: debug::remove_all_traces
# DESC: Removes all traces set up with "trace_var".
# ----------------------------------------------------------------------------
</pre>
<P> The following two functions may be used to start and stop tracing
programmatically.</P>
<pre>
# -----------------------------------------------------------------------------
# NAME: ::debug::trace_start
# SYNOPSIS: ::debug::trace_start
# DESC: Starts logging of function trace information.
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# NAME: ::debug::trace_stop
# SYNOPSIS: ::debug::trace_stop
# DESC: Stops logging of function trace information.
# -----------------------------------------------------------------------------
</pre>
</BODY>
</HTML>

View file

@ -0,0 +1,20 @@
<HTML>
<HEAD>
<TITLE>Global Preferences Help</TITLE>
</HEAD>
<BODY>
<H1>Global Preferences</H1>
<H3>Overview</H3>
<P>Not yet done.</P>
<P>Global Preferences topics:
<UL>
<LI><UL><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
</UL>
</UL></P>
<H3><A NAME="">stuff</A></H3>
</BODY>
</HTML>

View file

@ -0,0 +1,34 @@
<HTML>
<HEAD>
<TITLE>Help Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Help Window</H1>
<H2>Overview</H2>
<P>This is some nice text which describes the help window, its role
in deugging, and perhaps some of the nifty things people can do with
this window.</P>
<P>Help Window topics:
<UL>
<LI><A HREF="#menus">Menus</A>
<UL>
<LI><A HREF="#menus_file">File Menu</A></LI>
<LI><A HREF="#menus_topics">Topics Menu</A></LI>
</LI>
<LI><A HREF="#display">Help Display</A>
<UL>
<LI><A HREF="#display_nav">Navigating the Help Window</A></LI>
<LI><A HREF="#display_link">Definition and Page Links</A></LI>
</UL></LI>
</UL></P>
<H2><A NAME="menus">Menus</A></H2>
<H3><A NAME="menus_file">File Menu</A></H3>
<H3><A NAME="menus_topics">Topics Menu</A></H3>
<H3><A NAME="display">Help Display</A></H3>
<H3><A NAME="display_nav">Navigating the Help Window</A></H3>
<H3><A NAME="display_link">Definition and Page Links</A></H3>
</BODY>
</HTML>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Insight Index</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Quanta Plus">
</head>
<body>
<img src="images/insightbwr.png" width=300 height=120 border=0>
<UL>
<LI><A HREF="breakpoint.html">Breakpoint Window</A></LI>
<LI><A HREF="console.html">Console Window</A></LI>
<LI><A HREF="browser.html">Function Browser</A></LI>
<LI><A HREF="locals.html">Locals Window</A></LI>
<LI><A HREF="memory.html">Memory Window</A></LI>
<LI><A HREF="register.html">Register Window</A></LI>
<LI><A HREF="session.html">Sessions</A></LI>
<LI><A HREF="source.html">Source Window</A></LI>
<LI><A HREF="stack.html">Stack Window</A></LI>
<LI><A HREF="target.html">Target Window</A></LI>
<LI><A HREF="thread.html">Thread Window</A></LI>
<LI><A HREF="watch.html">Watch Window</A></LI>
</UL>
<hr>
<h2>For Developers Only</h2>
<ul>
<li><a href="debug.html">"Internal Debugging Functions</a></li>
</ul>
<hr>
<br>
<a href="http://sources.redhat.com/insight/" name="Insight Home Page">Insight Home Page</a>
<br><br><hr><br>
<A HREF="license.html">GNU General Public License</A>
</body>
</html>

View file

@ -0,0 +1,305 @@
<HTML>
<HEAD>
<TITLE>GNU General Public License</TITLE>
</HEAD><BODY>
<B>The GNU General Public License
<P></P>
</B>Version 2, June 1991
<P></P>
Copyright © 1989, 1991 Free Software Foundation, Inc.
<BR>59 Temple Place / Suite 330, Boston, MA 02111-1307, USA
<P></P>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
<P></P>
<B>Preamble
<P></P>
</B>The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and
change free software to make sure the software is free for all its users. This General Public
License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some
other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs,
too.
<P></P>
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom to
distribute copies of free software (and charge for this service if you wish),
that you receive source code or can get it if you want it, that you can change the
software or use pieces of it in new free programs; and that you know you can
do these things.
<P></P>
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of the
software, or if you modify it.
<P></P>
For example, if you distribute copies of such a program, whether gratis or for
a fee, you must give the recipients all the rights that you have. You must
make sure that they, too, receive or can get the source code. And you must show
them these terms so they know their rights.
<P></P>
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute and/or
modify the software.
<P></P>
Also, for each author's protection and ours, we want to make certain that everyone understands that
there is no warranty for this free software. If the software is modified by
someone else and passed on, we want its recipients to know that what they have is
not the original, so that any problems introduced by others will not reflect on
the original authors' reputations.
<P></P>
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for
copying, distribution and modification follow.
<P></P>
<B>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
<P></P>
</B>0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms of this
General Public License. The `Program”, below, refers to any such program or work, and a `work based on the Program' means either the Program or any derivative work under copyright law: that is
to say, a work containing the Program or a portion of it, either verbatim or
with modifications and/or translated into another language. (Hereinafter,
translation is included without limitation in the term `modification'.) Each licensee is addressed as `you'.
<P></P>
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running the Program is
not restricted, and the output from the Program is covered only if its contents
constitute a work based on the Program (independent of having been made by
running the Program). Whether that is true depends on what the Program does.
<P></P>
<OL><LI> You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this License
and to the absence of any warranty; and give any other recipients of the Program
a copy of this License along with the Program.
<P></P>
</OL>You may charge a fee for the physical act of transferring a copy, and you may
at your option offer warranty protection in exchange for a fee.
<P></P>
<OL START="2"><LI> You may modify your copy or copies of the Program or any portion of it, thus
forming a work based on the Program, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all of
these conditions:
<P></P>
</OL>a) You must cause the modified files to carry prominent notices stating that you
changed the files and the date of any change.
<P></P>
b) You must cause any work that you distribute or publish, that in whole or in
part contains or is derived from the Program or any part thereof, to be licensed
as a whole at no charge to all third parties under the terms of this License.
<P></P>
c) If the modified program normally reads commands interactively when run, you
must cause it, when started running for such interactive use in the most ordinary
way, to print or display an announcement including an appropriate copyright
notice and a notice that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these conditions,
and telling the user how to view a copy of this License. (Exception: if the
Program itself is interactive but does not normally print such an announcement,
your work based on the Program is not required to print an announcement.)
<P></P>
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License, and its
terms, do not apply to those sections when you distribute them as separate
works. But when you distribute the same sections as part of a whole which is a work
based on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the entire whole,
and thus to each and every part regardless of who wrote it.
<P></P>
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise the
right to control the distribution of derivative or collective works based on the
Program.
<P></P>
In addition, mere aggregation of another work not based on the Program with
the Program (or with a work based on the Program) on a volume of a storage or
distribution medium does not bring the other work under the scope of this License.
<P></P>
<OL START="3"><LI> You may copy and distribute the Program (or a work based on it, under Section
2) in object code or executable form under the terms of Sections 1 and 2 above
provided that you also do one of the following:
<P></P>
</OL>a) Accompany it with the complete corresponding machine-readable source code,
which must be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
<P></P>
b) Accompany it with a written offer, valid for at least three years, to give any
third party, for a charge no more than your cost of physically performing
source distribution, a complete machine-readable copy of the corresponding source
code, to be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
<P></P>
c) Accompany it with the information you received as to the offer to distribute
corresponding source code. (This alternative is allowed only for noncommercial
distribution and only if you received the program in object code or executable
form with such an offer, in accord with Subsection b above.)
<P></P>
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all the
source code for all modules it contains, plus any associated interface definition
files, plus the scripts used to control compilation and installation of the
executable. However, as a special exception, the source code distributed need not
include anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself accompanies the
executable.
<P></P>
If distribution of executable or object code is made by offering access to
copy from a designated place, then offering equivalent access to copy the source
code from the same place counts as distribution of the source code, even though
third parties are not compelled to copy the source along with the object code.
<P></P>
<OL START="4"><LI> You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate your
rights under this License. However, parties who have received copies, or
rights, from you under this License will not have their licenses terminated so long
as such parties remain in full compliance.
<P></P>
<LI> You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to modify or distribute the Program or
its derivative works. These actions are prohibited by law if you do not accept
this License. Therefore, by modifying or distributing the Program (or any work
based on the Program), you indicate your acceptance of this License to do so,
and all its terms and conditions for copying, distributing or modifying the
Program or works based on it.
<P></P>
<LI> Each time you redistribute the Program (or any work based on the Program), the
recipient automatically receives a license from the original licensor to copy,
distribute or modify the Program subject to these terms and conditions. You
may not impose any further restrictions on the recipients' exercise of the rights granted herein.
<P></P>
</OL>You are not responsible for enforcing compliance by third parties to this
License.
<P></P>
<OL START="7"><LI> If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of this
License. If you cannot distribute so as to satisfy simultaneously your obligations
under this License and any other pertinent obligations, then as a consequence
you may not distribute the Program at all. For example, if a patent license
would not permit royalty-free redistribution of the Program by all those who
receive copies directly or indirectly through you, then the only way you could
satisfy both it and this License would be to refrain entirely from distribution of
the Program.
<P></P>
</OL>If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and the
section as a whole is intended to apply in other circumstances.
<P></P>
It is not the purpose of this section to induce you to infringe any patents or
other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system, which is implemented by public license practices. Many people
have made generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that system; it is up
to the author/donor to decide if he or she is willing to distribute software
through any other system and a licensee cannot impose that choice.
<P></P>
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
<P></P>
<OL START="8"><LI> If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
<P></P>
<LI> The Free Software Foundation may publish revised and/or new versions of the
General Public License from time to time. Such new versions will be similar in
spirit to the present version, but may differ in detail to address new problems
or concerns.
<P></P>
</OL>Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and `any later version', you have the option of following the terms and conditions either of that
version or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of this License, you may choose any
version ever published by the Free Software Foundation.
<P></P>
<OL><LI> If you wish to incorporate parts of the Program into other free programs whose
distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation, write to
the Free Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status of all
derivatives of our free software and of promoting the sharing and reuse of software
generally.
<P></P>
</OL>NO WARRANTY
<P></P>
<OL><LI> BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE
PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM `AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.
<P></P>
<LI> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
<P></P>
</OL>END OF TERMS AND CONDITIONS
<P></P>
<B>How to Apply These Terms to Your New Programs
<P></P>
</B>If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
<P></P>
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively convey the exclusion
of warranty; and each file should have at least the `copyright' line and a pointer to where the full notice is found.
<P></P>
<I>one line for the program's name and a brief idea of what it does.
<BR></I>Copyright (C) 19<I>yy</I> <I>name of author</I>
<BR>
<BR>This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
<BR>
<BR>This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
<BR>
<BR>You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.
<P></P>
Also add information on how to contact you by electronic and paper mail.
<P></P>
If the program is interactive, make it output a short notice like the
following example when it starts in an interactive mode:
<P></P>
Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes
with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain
conditions; type `show c' for details.
<P></P>
The hypothetical commands <B>show w</B> and <B>show c</B> should show the appropriate parts of the General Public License. Of course,
the commands you use may be called something other than show w and show c; they can be mouse clicks or menu items—whatever suits your program.
<P></P>
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a `copyright disclaimer' for the program, if necessary. The following is a sample (when copying, alter
the names).
<P></P>
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
<BR>
<BR>signature of Ty Coon, 1 April 1989
<BR>Ty Coon, President of Vice
<P></P>
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may consider
it more useful to permit linking proprietary applications with the library. If
this is what you want to do, use the GNU Library General Public License instead of this License.
<P></P>
</BODY>
</HTML>

View file

@ -0,0 +1,47 @@
<HTML>
<HEAD>
<TITLE>Local Variables Help</TITLE>
</HEAD>
<BODY>
<H1>The Local Variables Window</H1>
<H2>Overview</H2>
<p>The Local Variables Window displays all local variables in scope. It may be used to
visualize and edit local variables. To open the Local Variables window, click on
small house icon on the toolbar, or select "Local Variables" under the View
pulldown menu.</p>
<H3>Locals Display</H3>
<p>Pointers, structures, and classes appear in the display with small expansion
box before their names. To dereference pointers or
view the members of classes or structures, click
the closed expansion box (which appears as a small plus sign, "+") to "expand"
the listing. The expansion box changes to a minus sign, "-", indicating that the
display is now open. Pointers, structures and classes may be expanded recursively
to allow multiple pointer dereferences and embedded structure viewing.</p>
<P>The Locals Display updates after every execution of the program and highlights
in green those variables whose values have changed.</P>
<P>The Locals Window will, by default, display all pointers in hexadecimal and all
other variables in decimal. To change the display format for a variable, select
the Format option from the popup-menu.</P>
<H3>Editing a Variable</H3>
<p>To edit a variable, either double-click the left mouse button on the value of the variable in
the display or select the Edit option from the pop-up menu. To abort editing a variable's value,
simply press the escape key on the keyboard. The variable's original value is restored.</p>
<H3>Local Variable Pop-up Menu</H3>
<p>The pop-up menu provides quick access to the functions of the Local Variables Window.
To use the pop-up menu, click the right mouse button while over a variable.</p>
<DL>
<dt>Format<dd>Change the display format of the variable.</dd></dt>
<dt>Edit<dd>Edit the variable's value.</dd></dt>
<dt>Delete<dd>Remove the variable from the display.</dd></dt>
<dt>Dump Memory<dd>Open a Memory Window with the variable's value as an aaddress.</dd></dt>
<dt>Help<dd>Open this help page.</dd></dt>
<dt>Close<dd>Close the Local Variables Window.</dd></dt>
</DL>
</BODY>
</HTML>

View file

@ -0,0 +1,240 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i686) [Netscape]">
<TITLE>Memory Window Help</TITLE>
</HEAD>
<BODY>
<H1>
The Memory Window</H1>
The Memory Window allows users to display and edit the contents of memory.
The Memory Window Preferences controls all of the display characteristics
of the Memory Window.
<BR>&nbsp;
<LI>
<A HREF="#menus">Address Menu</A></LI>
<LI>
<A HREF="#display">Memory Display</A></LI>
<LI>
<A HREF="#prefs">Memory Window Preferences</A></LI>
<H2>
<HR WIDTH="100%"></H2>
<H2>
<A NAME="menus"></A>Address Menu</H2>
<IMG SRC="images/mem_menu.gif" HEIGHT=66 WIDTH=160>
<P>This pulldown menu contains the following three items.
<DL>
<DT>
<A NAME="menus_auto"></A>Auto Update</DT>
<DD>
When selected, causes the Memory Window to update the display every.&nbsp;
If it is not selected, the display will be frozen until it is selected
or "Update Now" is selected.</DD>
<DT>
<A NAME="menus_now"></A>Update Now</DT>
<DD>
Forces the Memory Window to update the display immediately.</DD>
<DT>
<A NAME="menus_prefs"></A>Preferences</DT>
<DD>
Opens the <A HREF="#prefs">Memory Window Preferences</A> dialog.</DD>
</DL>
<H2>
<HR WIDTH="100%"></H2>
<H2>
<A NAME="display"></A>Memory Display</H2>
Like the <A HREF="register.html">Register Window</A>, the Memory Window
display is organized into a spreadsheet. The address of any cell in the
Display can be determined by appending the row and column headers for the
cell. Optionally, an ASCII display of the memory appears at the right.
Any non-ASCII-representable byte in memory will appear in the ASCII Display
as a control character (a dot, ".", by default). The <A HREF="#pref">Memory
Preferences Dialog</A> may be used to alter the appearance of the Memory
Window.
<P><A NAME="display_nav"></A>To navigate the Memory Window, use the mouse
and click the cell of interest. As an alternative, pressing the arrow keys
on the keyboard will focus successive cells, from left to right, top to
bottom. The focus will wrap from left to right, so hitting the right arrow
key will keep advancing the address of the cell selected.
<H4>
<A NAME="display_edit"></A>Editing Memory</H4>
To edit memory, simply enter the new value of the memory into the cell
and press the enter key on the keyboard. As with the
<A HREF="register.html">Register
Window</A>, be careful of the input format used to enter data -- the debugger
is capable of parsing binary, octal, decimal, and hexadecimal values. All
entries will be padded with leading zeroes, if necessary.&nbsp; After you
hit enter, the memory window will automatically shift focus to the next
cell.
<P>To edit part of the value of a cell, you can use the mouse to poistion
the cursor to the exact part of the value you want to change.&nbsp; You
can also use the backspace key to delete part of the value without deleting
the whole value.
<P>Another way to edit memory is to edit the ASCII window.&nbsp; To do
this, select a cell using the mouse.&nbsp; Then type in a new string.
<H4>
<A NAME="display_popup"></A>Memory Pop-up Menu</H4>
Clicking the right mouse button while the mouse cursor lies within the
bounds of any cell brings up the following menu:
<P><IMG SRC="images/mem_popup.gif" HEIGHT=100 WIDTH=220>
<DL>
<DT>
Auto Update</DT>
<DL>
<DT>
When selected, the Memory Window will track changes in memory shown in
the Display.&nbsp; When not selected, the Memory Window is "frozen", representing
a "snapshot" of memory.</DT>
</DL>
<DT>
Update Now</DT>
<DL>
<DT>
&nbsp;Forces the Memory Window to update the display immediately.</DT>
</DL>
<DT>
Go To <I>address</I></DT>
<DD>
The Memory Window Display is updated to show memory starting at address
<I>address</I>.</DD>
<DT>
Open New Window at <I>address</I></DT>
<DD>
A new Memory Window is opened, displaying memory at address <I>address</I></DD>
<DT>
Preferences...</DT>
<DD>
Opens the Memory Window Preferences for editing the appearance of the Memory
Window Display.</DD>
</DL>
<H2>
<HR WIDTH="100%"></H2>
<H2>
<A NAME="prefs"></A>Memory Window Preferences</H2>
Memory Window Preference Dialog governs the appearance of the Memory Window:
the total number of bytes displayed, the size of each cell, ASCII control
character.
<P><IMG SRC="images/mem_pref.gif" HEIGHT=417 WIDTH=330>
<H4>
<A NAME="prefs_size"></A>Size of the Display Cells</H4>
This attribute controls how many bytes appear in each cell. Valid cell
sizes in the Memory Window may be:
<DL>
<DT>
Byte</DT>
<DD>
Each cell is exactly one byte</DD>
<DT>
Half Word</DT>
<DD>
Cells are displayed with two bytes</DD>
<DT>
Word</DT>
<DD>
Each cell contains four bytes</DD>
<DT>
Double Word</DT>
<DD>
Cells contain eight bytes</DD>
<DT>
Float</DT>
<DD>
Each cell contains four bytes, displayed as a floating point number</DD>
<DT>
Double Float</DT>
<DD>
Cells are displayed as floating point, eight bytes each</DD>
</DL>
<H4>
<A NAME="prefs_fmt"></A>Format of the Display Cells</H4>
The Format option of the Memory Preferences Dialog governs how the debugger
represents the memory. Possible representations include:
<DL>
<DT>
Binary</DT>
<DD>
The values are shown as binary numbers</DD>
<DT>
Signed Decimal</DT>
<DD>
The values are shown as signed decimal numbers</DD>
<DT>
Octal</DT>
<DD>
Each cell is represented as an octal number</DD>
<DT>
Unsigned Decimal</DT>
<DD>
Values are displayed as unsigned decimals</DD>
<DT>
Hex</DT>
<DD>
Memory is displayed as a hexadecimal number. This is the default.</DD>
</DL>
<H4>
<A NAME="prefs_bytes"></A>Size of the Memory Window</H4>
The size of the memory window determines how much memory is actually presented
to the user. The total number of bytes shown can either be determined by
the size of the window, in which case resizing the Memory Window will cause
more or less memory to be displayed, or fixed at some specified number
of bytes. By default, the Memory Window shows 128 bytes of memory.
<H4>
<A NAME="prefs_misc"></A>Miscellaneous</H4>
Miscellaneous memory preferences include the option to display the ASCII
representation of the memory, including what character to use for non-ASCII
bytes (the "control" character). Additionally, users may specify the number
of bytes per row, either by typing a number into the box or by choosing one
from the list. The default is sixteen bytes per row. If the entered value is
not a multiple of the cell size then it will be automatically rounded up. The
maximum permitted value is 150 (before rounding).
</BODY>
</HTML>

View file

@ -0,0 +1,48 @@
<HTML>
<HEAD>
<TITLE>Register Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Register Window</H1>
<P>The Register Window lists registers and their contents for
the selected stack frame. It permits viewing the contents of registers
in different formats, editing register values, and some display
customizations.</P>
<img src="images/reg.png" alt="register window" width=387 height=370 align="middle" border=0>
<p>In the image above, you can see all the registers on the left and their values on the right.
At the top is an option menu to allow you to choose what group of registers to display.
The groups names are preset according to the architecture being debugged. The default is "all".
Registers highlighted in green have recently changed.
</p>
<P>The Register Window will update the register contents in the display
to match the stack frame currently being viewed in the <A HREF="source.html">
Source Window</A> and <A HREF="stack.html">Stack Window</A>.</P>
<p>Each time the program stops, the register window will automatically update.
Registers that have changed since the last stop will be displayed in green.</p>
<H3>The Register Pop-up Menu</H3>
<img src="images/reg_menu.png" alt="register popup menu" width=396 height=388 border=0>
<P>
To activate the pop-up menu, click the right mouse button over a register.
This will allow you change the way the register is displayed, or to remove
it from the display. Or you can add the register to the watch window.
For integer registers, you can also open a memory window at the
location pointed to by the register.</P>
<H3>Editing a Register</H3>
<P>
To edit a register, simply click on it with the left mouse button. Type
in the new value and hit enter. You can enter a decimal, hex, or float number and
the type will be converted if possible. You may also enter an expression to be evaluated.
For example, to set $r3 to the same as $r4, edit $r3 and enter "$r4" as the value. In the same
way, you can set $pc to "main".
The value of the register is set to the current value of the expression; it will not be reevaluated
if the expression's value later changes.
</P>
<P>Press the escape key on the keyboard to cancel your edit.</P>
</BODY>
</HTML>

View file

@ -0,0 +1,40 @@
<html>
<head>
<title>Sessions</title>
</head>
<body>
<center><h2>Sessions</h2></center>
Insight will save your session for you automatically. The ``session''
is essentially a group of settings which are keyed by the name of the
inferior which you are debugging.<p>
Insight will show a list of the five most recent previous sessions on
the <tt>File</tt> menu. Choosing an item from this list will cause
Insight to load the indicated executable and restore all the settings
saved in the session.<p>
The settings stored in a session are:
<ul>
<li> The name of the executable.
<li> The inferior's command-line arguments.
<li> The target.
<li> The path used when searching for source files.
<li> The current working directory.
<li> The breakpoints and watchpoints, including conditions, actions,
and the like.
</ul>
<p>
More items may be added to this list as the need arises.<p>
At present there is no way to disable session saving.<p>
</body>
</html>

View file

@ -0,0 +1,424 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i686) [Netscape]">
<TITLE>Source Window Help</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>The Source Window</H1></CENTER>
<BR>The Source Window is the primary interface between the user and
the debugger; it is automatically opened when the debugger starts. The
Source Window displays the status of the program, controls execution of
the program, and allows visualization of the program execution.
<H3><A HREF="#menus">Menus</A></H3>
<UL>
<LI><A HREF="#menus_file">File Menu</A></LI>
<LI><A HREF="#menus_run">Run Menu</A></LI>
<LI><A HREF="#menus_view">View Menu</A></LI>
<LI><A HREF="#menus_control">Control Menu</A></LI>
<LI><A HREF="#menus_prefs">Preferences Menu</A></LI>
</UL>
<H3><A HREF="#toolbar">Toolbar</A></H3>
<UL>
<LI><A HREF="#toolbar_exec">Execution Control Buttons</A></LI>
<LI><A HREF="#toolbar_window">Window Buttons</A></LI>
<LI><A HREF="#toolbar_frame">Frame Control</A></LI>
</UL>
<H3><A HREF="#display">Source Window Display</A></H3>
<UL>
<LI><A HREF="#setting_a_breakpoint">Setting a Breakpoint</A></LI>
<LI><A HREF="#viewing_breakpoints">Viewing Breakpoints</A></LI>
<LI><A HREF="#display_balloon">Variable Balloons</A></LI>
<LI><A HREF="#display_popup">Source Pop-up Menus</A></LI>
</UL>
<H3><A HREF="#status">Source Window Status Bars</A></H3>
<UL>
<LI><A HREF="#status_bar">Program Status Bar</A></LI>
<LI><A HREF="#status_mode">Source Display Status Bar</A></LI>
</UL>
<H3><A HREF="#search">Search Entry</A></H3>
<HR>
<H2><A NAME="menus"></A>Menus</H2>
<IMG SRC="images/src_menu.gif">
<H4><A NAME="menus_file"></A>File Menu</H4>
<DL>
<DT>Open</DT>
<DD>Opens a file selection dialog to select the executable to debug</DD>
<DT>Close</DT>
<DD>Closes a previously opened executable file</DD>
<DT>Source</DT>
<DD>Reads and executes GDB commands from a text file</DD>
<DT>Target Settings...</DT>
<DD>Opens the <A HREF="target.html">Target Selection Dialog</A> to edit target
settings</DD>
<DT>Page Setup</DT>
<DD>(Windows only) Opens the Windows Page Setup dialog to configure printing</DD>
<DT>Print</DT>
<DD>Print the contents of the Source Window Display</DD>
<DT>Exit</DT>
<DD>Exits the debugger</DD>
</DL>
<H4><A NAME="menus_run"></A>Run Menu</H4>
<DL>
<DT>Connect to target</DT>
<DD>Connect to the target specified in the <A HREF="target.html">Target Selection Dialog</A>. Open the dialog if there are no current settings.</DD>
<DT>Download</DT>
<DD>Initiates download of the executable onto the target via the protocol specified
in the <A HREF="target.html">Target Selection Dialog</A></DD>
<DT>Run</DT>
<DD>Runs or re-runs the program</DD>
<DT>Disconnect</DT>
<DD>Close a previously opened connection</DD>
</DL>
<H4><A NAME="menus_view"></A>View Menu</H4>
<DL>
<DT>Stack</DT>
<DD>Open a <A HREF="stack.html">Stack Window</A></DD>
<DT>Registers</DT>
<DD>Open a <A HREF="register.html">Register Window</A></DD>
<DT>Memory</DT>
<DD>Open a <A HREF="memory.html">Memory Window</A></DD>
<DT>Watch Expressions</DT>
<DD>Open a <A HREF="watch.html">Watch Window</A></DD>
<DT>Local Variables</DT>
<DD>Open a <A HREF="locals.html">Locals Window</A></DD>
<DT>Breakpoints</DT>
<DD>Open a <A HREF="breakpoint.html">Breakpoint Window</A></DD>
<DT>Console</DT>
<DD>Open a <A HREF="console.html">Console Window</A></DD>
<DT>Function Browser</DT>
<DD>Open a window allowing the user to easily search for functions and
set breakpoints.</DD>
<DT>Thread List</DT>
<DD>Open a window that displays all current threads and allows the user
to change active threads</DD>
</DL>
<H4><A NAME="menus_control"></A>Control Menu</H4>
<DL>
<DT><A HREF="#step_button">Step</A></DT>
<DD>Step program until it reaches a different source line</DD>
<DT><A HREF="#next_button">Next</A></DT>
<DD>Step program, proceeding through subroutine calls</DD>
<DT><A HREF="#finish_button">Finish</A></DT>
<DD>Execute until the current stack frame returns</DD>
<DT><A HREF="#continue_button">Continue</A></DT>
<DD>Continue program being debugged, after signal or breakpoint</DD>
<DT><A HREF="#stepi_button">Step Asm Inst</A></DT>
<DD>Step one instruction exactly</DD>
<DT><A HREF="#nexti_button">Next Asm Inst</A></DT>
<DD>Step one instruction, but proceed through subroutine calls</DD>
<DT>Automatic Step</DT>
<DD>Automatically step the program every two seconds</DD>
</DL>
<H4><A NAME="menus_prefs"></A>Preferences Menu</H4>
<DL>
<DT>Global</DT>
<DD>Opens the <A HREF="gbl_pref.html">Global Preferences Dialog</A> and allows
editing of global settings</DD>
<DT>Source</DT>
<DD>Opens the <A HREF="src_pref.html">Source Preferences Dialog</A> and allows
editing of Source Window settings</DD>
</DL>
<HR>
<H2><A NAME="toolbar"></A>Toolbar</H2>
<IMG SRC="images/src_toolbar.gif">
The Source Window toolbar consists of three functional sections: execution
control buttons, debugger window buttons, and stack frame control buttons.
<BR>
<H4><A NAME="toolbar_exec"></A>Execution Control Buttons</H4>
These convenience buttons provide on-screen access to the most important
debugger execution control functions:
<DL>
<DT><A NAME="run_button"></A><IMG SRC="../images/run.gif"> or
<IMG SRC="../images2/run.gif"> Run </DT>
<DD>The Run Button will start execution of the program, including target selection
and downloading, if necessary. If the program is already running, the Run
Button will start the program from the beginning (re-run it).</DD>
<DT><A NAME="stop_button"></A><IMG SRC="../images/stop.gif"> or
<IMG SRC="../images2/stop.gif"> Stop</DT>
<DD>The Stop Button will interrupt execution of the program (provided this
feature is supported by the underlying debugging protocol and hardware)
or cancel downloads. It is also used as an indication that the debugger
is busy.</DD>
<DT><A NAME="step_button"></A><IMG SRC="../images/step.gif"> or <IMG SRC="../images2/step.gif">Step</DT>
<DD>Step the program until it reaches a different source line</DD>
<DT><A NAME="next_button"></A><IMG SRC="../images/next.gif"> or <IMG SRC="../images2/next.gif">Next</DT>
<DD>Step the program, proceeding through subroutine calls</DD>
<DT><A NAME="finish_button"></A><IMG SRC="../images/finish.gif"> or <IMG SRC="../images2/finish.gif"> Finish</DT>
<DD>Execute until the current stack frame returns</DD>
<DT><A NAME="continue_button"></A><IMG SRC="../images/continue.gif"> or <IMG SRC="../images2/continue.gif"> Continue</DT>
<DD>Continue the program being debugged, after signal or breakpoint</DD>
<DT><A NAME="stepi_button"></A><IMG SRC="../images/stepi.gif"> or <IMG SRC="../images2/stepi.gif"> Step Asm Inst</DT>
<DD>Step one instruction exactly. This function is only available when the
Source Window is displaying assembler code.</DD>
<DT><A NAME="nexti_button"></A><IMG SRC="../images/nexti.gif"> or <IMG SRC="../images2/nexti.gif"> Next Asm Inst</DT>
<DD>Step one instruction, but proceed through subroutine calls. This function
is only available when the Source Window is displaying assembler code.</DD>
</DL>
<H4>
<A NAME="toolbar_window"></A>Window Buttons</H4>
The Debugger Window buttons give instant access to the Debugger's auxiliary
windows:
<DL>
<DT><A NAME="register_button"></A><IMG SRC="../images/reg.gif"> or <IMG SRC="../images2/reg.gif"> Registers</DT>
<DD>Open a <A HREF="register.html">Register Window</A></DD>
<DT><A NAME="memory_button"></A><IMG SRC="../images/memory.gif"> or <IMG SRC="../images2/memory.gif"> Memory</DT>
<DD>Open a <A HREF="memory.html">Memory Window</A></DD>
<DT><A NAME="stack_button"></A><IMG SRC="../images/stack.gif"> or <IMG SRC="../images2/stack.gif"> Stack</DT>
<DD>Open a <A HREF="stack.html">Stack Window</A></DD>
<DT><A NAME="watch_button"></A><IMG SRC="../images/watch.gif"> or <IMG SRC="../images2/watch.gif"> Watch Expressions</DT>
<DD>Open a <A HREF="watch.html">Watch Window</A></DD>
<DT><A NAME="locals_button"></A><IMG SRC="../images/vars.gif"> or <IMG SRC="../images2/vars.gif"> Local Variables</DT>
<DD>Open a <A HREF="locals.html">Locals Window</A></DD>
<DT><A NAME="breakpoints_button"></A><IMG SRC="../images/bp.gif"> or <IMG SRC="../images2/bp.gif"> Breakpoints</DT>
<DD>Open a <A HREF="breakpoint.html">Breakpoint Window</A></DD>
<DT><A NAME="console_button"></A><IMG SRC="../images/console.gif"> or <IMG SRC="../images2/console.gif"> Console</DT>
<DD>Open a <A HREF="console.html">Console Window</A></DD>
</DL>
<H4><A NAME="toolbar_frame"></A>Frame Control</H4>
The Frame Control area of the toolbar displays information about the PC
of the current frame, and the frame control buttons may be used to navigate
through the call stack. Whenever any of these buttons are used, both the
Source Window Display and the <A HREF="stack.html">Stack Window</A> will
show the selected frame.
<DL>
<DT><IMG SRC="images/frame_info.gif" > Frame Information Display</DT>
<DD>The left half of the frame information display shows the value of the PC
in the current frame. The right half shows the line number of the PC in
the source file, if available.</DD>
<DT><A NAME="up_button"></A><IMG SRC="../images/up.gif"> or <IMG SRC="../images2/up.gif"> Up</DT>
<DD>Select and view the stack frame that called this one</DD>
<DT><A NAME="down_button"></A><IMG SRC="../images/down.gif"> or <IMG SRC="../images2/down.gif"> Down</DT>
<DD>Select and view the stack frame called by this one</DD>
<DT><A NAME="bottom_button"></A><IMG SRC="../images/bottom.gif"> or <IMG SRC="../images2/bottom.gif"> Bottom</DT>
<DD>Select and view the bottom-most stack frame</DD>
</DL>
<HR>
<H2><A NAME="display"></A>Source Display</H2>
The Source Display is used for many things: browsing source code, setting
and clearing breakpoints, and a few other special functions. Executable
lines (those for which executable code was generated by the compiler) are
denoted with a marker (a dash, "-") in the first column of the display.
<P>The debugger highlights the PC in the current frame in either green,
indicating that the PC is in the bottom-most frame (i.e., it is being executed)
or gold, indicating that the PC is contained in a frame that is not currently
executing (because it has called another function). A blue highlight is
used by the debugger to indicate a browsing position: the PC is contained
in a frame that is not executing or on the call stack. All highlight colors
are user selectable in the <A HREF="src_pref.html">Source Preferences</A>.
<BR>
<H4><A NAME="setting_a_breakpoint"></A>Setting a Breakpoint</H4>
Moving the mouse pointer over the "hot spot" of an executable line will
change the mouse cursor to a large dot. Clicking the left mouse button
will then toggle a breakpoint at this line. If no breakpoint exists, one
will be installed and the dash in the left margin will change into a red
breakdot. If a breakpoint exists, it will be removed and the red breakdot
will revert back to a dash. The executable line marker shows the status
of each line: an empty marker (the dash) indicates that no breakpoints
are set at the line. A colored breakdot indicates that a breakpoint exists
at the line (see <A HREF="#display_popup">Source Pop-up Menus</A> for more
information on setting different types of breakpoints and their representations
in the Source Display).
<P>Black breakdots in the Source Window display indicate that the breakpoint
has been disabled. To re-enable the breakpoint, click the enable/disable
checkbox in the Breakpoint Window (see <A HREF="breakpoint.html#display_state">
Enabling/Disabling Breakpoints</A>).
<BR>
<H4><A NAME="viewing_breakpoints"></A>Viewing Breakpoints</H4>
You can find out more information about a breakpoint by moving the cursor
over a breakpoint. A balloon window will pop up with additional information.
To get a list of all the active breakpoints, you will need to open a
<A HREF="breakpoint.html">breakpoint window</A>.
<IMG SRC="images/src_bp_bal.gif">
<BR>
<H4><A NAME="display_balloon"></A>Variable Balloons</H4>
If the program to be debugged has started and is stopped, the display
will show the value of variables in variable
balloons. To activate a variable balloon, simply hold the mouse cursor
over the name of a variable in the Source Display for a second or two:
the debugger displays the name of the variable, its type, and its value
in a pop-up balloon.
<IMG SRC="images/src_bal.gif">
<BR>
<H4><A NAME="display_popup"></A>Source Pop-up Menus</H4>
The Source Display has two pop-up menus. One is activated by clicking the
right mouse button when the mouse cursor is over an executable line marker's
hot spot. This pop-up menu looks like this:
<P><IMG SRC="images/src_bpop.gif">
<DL>
<DT>Continue to Here</DT>
<DD>Continue program execution until it reaches this point. All breakpoints
will be ignored. Be aware that if the program never executes the line you selected,
it will run until completion.</DD>
<DT>Set Breakpoint</DT>
<DD>Set a breakpoint at this line. This has the same effect as left clicking
on this line. Breakpoints are shown as red breakdots in the Source Window
Display.</DD>
<DT>Set Temporary Breakpoint</DT>
<DD>Set a temporary breakpoint at this line. Temporary breakpoints are shown
as orange breakdots in the Source Window Display. The remove themselves automatically
the first time they are hit.</DD>
<A NAME="thread_bp"></A>
<DT>Set Breakpoint on Thread(s)...</DT>
<DD>GDB allows the user to set a breakpoint on a particular thread or threads. This
menu item will display a dialog with a list of threads. The user can select a list
of threads that will have breakpoints set at the selected line number. A warning
will be displayed if there are no active threads.</DD>
<IMG SRC="images/src_thread.gif">
</DL>
The other pop-up menu is activated by clicking the right mouse button anywhere
else in the Source Display. It is only available when a variable or number
in the display lies below the mouse cursor or is selected (by clicking
the left mouse button and dragging the mouse to highlight the variable/number).
The pop-up menu looks like this:
<P><IMG SRC="images/src_pop.gif">
<DL>
<DT><A NAME="add_to_watch"></A>Add <I>expr</I> to Watch</DT>
<DD>Adds the selected expression to the <A HREF="watch.html">Watch Window</A>,
opening it, if necessary.</DD>
<DT>Dump Memory at <I>expr</I></DT>
<DD>Opens a new <A HREF="memory.html">Memory Window</A> at the selected expression.
If the expression is a variable, then the Memory Window is opened with
memory addresses starting at the value of the variable.</DD>
<DT>Open Another SOurce Window</DT>
<DD>GDB allows multiple source windows to co-exist. You can, for example, have
one window in source mode and one in assembly mode. Or you can use one window
to browse the stack or other files.</DD>
</DL>
<H4><A NAME="status"></A>Source Window Status Bars</H4>
The Source Window has two status bars which inform the user of the status
of the program (the "status bar") and the status of the Source Window.
<P>The&nbsp;<A NAME="status_bar"></A>Program Status Bar (or simply "Status
Bar") displays the status of the program. Common messages seen here include:
<DL>
<DT>No program loaded.</DT>
<DD>No program has been loaded into target memory.</DD>
<DT>Program is ready to run.</DT>
<DD>A program has been loaded into target memory and may be executed. Start
the program by hitting <A HREF="#run_button">Run</A>.</DD>
<DT>Program stopped at <I>line/address</I></DT>
<DD>The program stopped at line <I>line</I> or address <I>address</I>. Execution
may continue by hitting any of the <A HREF="#toolbar_exec">execution control
buttons</A> on the toolbar.</DD>
<DT>Program terminated. 'Run' will restart.</DT>
<DD>The program exited. Pressing <A HREF="#run_button">Run</A> will restart
it.</DD>
</DL>
The Status Bar also displays some help information. For instance, the Status
Bar will show the function of a button on the toolbar or the Source Display
Status Bar as well as any keyboard shortcut for any button in the Source
Window.
<BR>
<H4><A NAME="status_mode"></A>Source Display Status Bar</H4>
<IMG SRC="images/src_stat.gif">
The Source Display Status Bar shows the current state of the Source Window:
the name of the file displayed in the Display, the name of the function
in the Display which contains the PC for the current frame (if any), and
the display mode.
<P>The <A NAME="file_selector"></A>Source File Selector is a dropdown
menu which contains the names of all the files that were compiled into
the program being debugged.
<P>Normally, the File Selector displays the name of the file currently
being viewed, but any file from the dropdown menu may be selected for browsing.
Simply select the file to view from the available choices (or type it directly
into the File Selector) and the Source Window will load that file into
the Display. To return to the PC of the program, simply press the
<A HREF="#bottom_button">Bottom
Frame Control Button</A>.
<P>The <A NAME="function_selector"></A>Source Function Selector displays
the name of the function containing the Source Window's PC, if one exists,
but it may be used to browse any function in the current file. Simply type
the name of the desired function into the Function Selector or select it
from the dropdown menu. The Source Window's PC is updated to point at this
function. To return to the PC of the program, simply press the
<A HREF="#bottom_button">Bottom
Frame Control Button</A>.
<P>The <A NAME="mode_selector"></A>Source Display Mode Selector displays
the viewing mode of the current file/function shown in the Source Window
Display.
<P>The function of the "step" keyboard shortcut will differ depending on
the mode the Source Window Display. "Stepping" in Source Mode (or in the
Source Pane of SRC+ASM Mode) will cause a source-level step. "Stepping"
in Assembly or Mixed Mode (or in the Assembly Pane of the SRC+ASM Mode)
will cause the debugger to step exactly one machine instruction. This also
applies to the shortcut for "next".
<P>The Display Mode Selector may be used to change the view of the current
source file. The available display modes are
<DL>
<DT>SOURCE</DT>
<DD>The contents of the Display are shown as source code. If source code is
not available (either because no debugging information is available or
the source file is not found), the Source Window will temporarily set the Display
Mode to "ASSEMBLY".</DD>
<DT>ASSEMBLY</DT>
<DD>A disassembly of the target's memory is shown in the Display. Even assembly
source files show a disassembly of target memory; to see the assembly source
code, use the SOURCE mode. Note that the debugger can only display assembly
code on a function-by-function basis. It cannot display all the instructions
generated from a single source file.</DD>
<DT>MIXED</DT>
<DD>The Display shows source code mixed with the assembler instructions which
were generated for those lines by the compiler for the current function.
Note that the addresses of the assembly lines is not necessarily monotonically
increasing. If the source file associated with the function cannot be found,
the Source Window will revert to ASSEMBLY mode.</DD>
<DT>SRC+ASM</DT>
<DD>The Source Window Display is divided into two panes: an assembly pane and
a source pane. Breakpoints may be set/cleared in either pane.</DD>
</DL>
<HR>
<H2><A NAME="search"></A>Search Entry</H2>
The Search Entry facilitates searching for text in the Source Window Display.
Simply enter the text to be found into the Search Entry and press the Enter
key on the keyboard to search forwards in the Source Window Display (hold
down the Shift key to search backwards). If a match is found, it is highlighted
in the Source Window and the Program Status Bar displays information about
where the match was found.
<P>The Search Entry can also jump the Source Window to a specific line.
Enter the line number preceded by an "at" sign (@) into the Search Entry
and press enter. If entered line number is greater than the total number
of lines in the Source Window Display, the Display will jump to the end
of the current file.
</BODY>
</HTML>

View file

@ -0,0 +1,20 @@
<HTML>
<HEAD>
<TITLE>Source Window Preferences Help</TITLE>
</HEAD>
<BODY>
<H1>Source Window Preferences</H1>
<H3>Overview</H3>
<P>Not yet done.</P>
<P>Source Preferences topics:
<UL>
<LI><UL><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
</UL>
</UL></P>
<H3><A NAME="">stuff</A></H3>
</BODY>
</HTML>

View file

@ -0,0 +1,50 @@
<HTML>
<HEAD>
<TITLE>Stack Window Help</TITLE>
</HEAD>
<BODY>
<CENTER>
<H2>The Stack Window</H2>
</CENTER>
<BR>The Stack Window allows users to view the call stack and jump between
levels of the stack.
<UL>
<LI><A HREF="#display">Stack Display</A></LI>
<LI><A HREF="#display_nav">Navigating the Stack Window</A></LI>
<LI><A HREF="#display_lvl">Changing the Stack Level</A></LI>
</UL>
<H2><A NAME="display">Stack Display</A></H2>
The Stack Display consists of a listbox which displays levels of the call stack
on per line. Each line contains the level number (useful when using the
<A HREF="console.html">Console Window</A>) and a description of the function executing
in that level. Typically, the function name and either the address of the function
or the file and line number where the function is defined are displayed. The
Stack Window may also be used to jump between levels of the stack.
<BR>
<H2><A NAME="display_nav">Navigating the Stack Window</A></H2>
Navigation of the Stack Window is accomplished by clicking on the desired level
with the left mouse button. The <A HREF="source.html#display">Source Window
Display</A> updates to show the selected frame. All other secondary windows,
<A HREF="register.html">Registers</A>, <A HREF="watch.html">Watch</A>, and
<A HREF="locals.html">Locals</A> update their displays for the selected frame.
<BR>
<H2><A NAME="display_lvl">Changing Stack Levels</A></H2>
To switch frames, simply click the left mouse button on the desired frame and the
debugger will switch contexts, updating all windows. The selected frame is highlighted
(in gold, by default).
<P>As an alternative, changing stack levels may be accomplished via the
<A HREF="source.html#toolbar_frame">Frame Control Buttons</A> on the Source Window's
Toolbar. These buttons may be used to change frames one level at a time (either
immediately up or immediately down) or to jump to the bottom-most stack frame.
See <A HREF="source.html#toolbar_frame">Source Frame Control Buttons</A> for more
information.</P>
</BODY>
</HTML>

View file

@ -0,0 +1,110 @@
<HTML>
<HEAD>
<TITLE>Target Selection Help</TITLE>
</HEAD>
<BODY>
<H1>The Target Selection Dialog</H1>
<h2>Overview</h2>
<P>The Target Selection Dialog allows users to specify the debug target,
the interface used to connect to the target, and some useful run
options.</P>
<P>
<h3><A HREF="#select">Selecting a Target</A></h3>
<UL>
<LI><A HREF="#select">Specifying a Target</A></LI>
<LI><A HREF="#select_int">Choosing a Connection Interface</A></LI>
</UL>
<h3><A HREF="#options">Options</A></h3>
<UL>
<LI><A HREF="#options_run_until_main">Run until 'main'</A></LI>
<LI><A HREF="#options_bp_at_exit">Set breakpoint at 'exit'</A></LI>
<LI><A HREF="#options_set_bp_at">Set user-specifid breakpoint</A></LI>
<LI><A HREF="#options_download_dialog">Display Download Dialog</A></LI>
<LI><A HREF="#options_use_xterm">Use xterm for inferior's tty (unix only)
</A></LI>
</UL>
<h3><A HREF="#more_options">More Options</A></h3>
<UL>
<LI><A HREF="#more_options_attach">Attach to Target</A></LI>
<LI><A HREF="#more_options_load">Download Program</A></LI>
<LI><A HREF="#more_options_run">Run Program</A></LI>
<LI><A HREF="#more_options_cont">Continue from Last Stop</A></LI>
</UL></P>
<H3><A NAME="select">Selecting a Target</A></H3>
Selecting a target involves choosing a target for debugging and setting connection
interface options for the target.
<P>Common targets include: "Exec" for native debuggers, "Remote/Serial" for establishing
a connection to a target board via a serial line, "Remote/TCP" for TCP connections,
and "Simulator" for connections to the simulator. There may be more depending on the
configuration of the debugger being used.</P>
<P>In general, "remote" targets are always serial connections which require the user
to specify the serial port and baud rate to be used for the connection and
"remote/tcp" targets are always TCP connections which require specifying the hostname
and port number of the machine to which to connect. Depending upon configuration,
there may be numerous serial- and TCP-based connections. These always follow the
naming convention <I>target</I>/Serial and <I>target</I>/TCP.</P>
<P>To select a target, choose one of the available targets
from the dropdown menu in the Connection Frame. Then <A NAME="#select_int">specify
the interface options</A> for this target: selecting the baudrate and serial port
from the dropdown menus (serial targets only) or entering the hostname and port number
(TCP targets only).</P>
<H3><A NAME="options">Options</A></H3>
Three run options which may be selected include:
<DL>
<DT><A NAME="options_run_until_main">Run until 'main'</A>
<DD>Sets a breakpoint at main()
<DT><A NAME="options_bp_at_exit">Set breakpoint at 'exit'</A>
<DD>Sets a breakpoint at exit()
<DT><A NAME="options_set_bp_at">Set breakpoint at</A>
<DD>Sets a breakpoint at a user-specified locaiton</A>
<DT><A NAME="options_download_dialog">Display Download Dialog</A>
<DD>Displays a dialog showing the progress of the download to
the target section by section
<DT><A NAME="options_use_xterm">Use xterm as inferior's tty</A>
<DD>Causes insight to open a tty for inferior I/O (unix versions
only)
</DL>
<BR>
<H3><A NAME="more_options">More Options</A></H3>
Several additional run options may be set for each target from the Target Selection
Dialog. These options govern the behavior of the debugger's
<A NAME="source.html#run_button">Run Button</A>. The debugger automatically selects
default values for these options whenever a target is selected with the dropdown menu
in the Connection Frame. To modify this default behavior, click the small triangle
next to "More Options" at the bottom of the dialog. The Run Options for the current
target are displayed, allowing modification of the actions for the target. When the
"OK" button is selected, these settings are saved and will be used as the default
for the target in future sessions.
<DL>
<DT><A NAME="more_options_attach">Attach to Target</A>
<DD>Establish a connection to the target board.
<DT><A NAME="more_options_load">Download Program</A>
<DD>Download the program to the target board.
<DT><A NAME="more_options_run">Run Program</A>
<DD>Run the program on the target board, creating a new
"process". This option may not be specified along with
the continue option. See note below.
<DT><A NAME="more_options_cont">Continue from Last Stop</A>
<DD>Continue the program on the target board from where
it last stopped. This option may not be specified
along with the "run" option. See note below.
</DL>
<P>Note that all remote targets typically do not "run" programs. Since target
boards are usually incapable of creating a new "process", these targets
seldom "Run". The defaults for all remote targets reflect this distinction: they
are all set to "Continue".</P>
<P>Only one of the options "Run Program" and "Continue from Last Stop" may be used.
Typically, the default behavior of this setting should not be altered.</P>
</BODY>
</HTML>

View file

@ -0,0 +1,46 @@
<HTML>
<HEAD>
<TITLE>Thread Window Help</TITLE>
</HEAD>
<BODY>
<CENTER>
<H2>The Thread Window</H2>
</CENTER>
<BR>The Thread Window displays a list of threads and/or processes. The exact
contents are OS-specific.
<UL>
<LI><A HREF="#display">Thread Display</A></LI>
<LI><A HREF="#current">Changing the Current Thread</A></LI>
<LI><A HREF="#bp">Setting Breakpoints on Thread(s)</A></LI>
</UL>
<H2><A NAME="display">Thread Display</A></H2>
The Thread Display consists of a listbox which displays information on
threads and/or processes that are part of the executable being debugged.
The first column is the GDB thread number, which is used internally by GDB
to track the thread. The rest of the columns are OS-dependent. The output is identical
to the output of the console command "info threads".
<BR>
<H2><A NAME="current">Changing the Current Thread</A></H2>
The source window can only display the current location and source for one thread
at a time. That thread is called the "current thread".
To change the current thread, simply click the left mouse button on the desired
line and the
debugger will switch contexts, updating all windows. The current thread will
be highlighted.
<BR>
<H2><A NAME="bp">Setting Breakpoints on Thread(s)</A></H2>
Normally if you set a breakpoint on a line or function, every thread that hits
that location will stop execution and return to the debugger. To set a breakpoint
or a specific thread or threads, you need to use the source window. See
<A HREF="source.html#thread_bp">Set Breakpoint on Threads</A>
</BODY>
</HTML>

View file

@ -0,0 +1,47 @@
<HTML>
<HEAD>
<TITLE>Console Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Console Window</H1>
<H3>Overview</H3>
<P>The Console Window is perhaps the most powerful tool in the debugger. It
provides functionality equivalent to almost all of the debugger's secondary
windows, macro definitions, and other more advanced features.</P>
<P>Console Window topics:
<UL>
<LI><UL><A HREF="#display">Console Display</A>
<LI><A HREF="#display_cmd">Executing Commands</A>
<LI><A HREF="#display_hlp">Getting Help</A>
</UL>
</UL></P>
<H3><A NAME="display">Console Display</A></H3>
The Console Display is simply a scrolled window in which the debugger prompt
appears. By default, the prompt is set to "(gdb) ", but it may be changed via a
command line option.
<P>To <A NAME="display_cmd">execute commands</A> in the console window, simply enter
the command in the display. If the debugger is busy, the message "Error: The
debugger is busy." appears informing the user that the command was not accepted.</P>
<P>Whenever a command is executed, the debugger's windows will update to display
any new state information. Any output from the command is also echoed to the Console
Window for ease of use. If an error occurs, an error message is printed to the Console
Window. All error messages appear in the Console Window using a red colored typeface.
</P>
<P>The Console Window responds to special character commands just as a shell window
does: it has a history mechanism which allows the user to scan previously used commands
by pressing the up and down arrow keys on the keyboard, jumping to the beginning or
end of a line by entering Ctrl-A or Ctrl-E, erasing a line by pressing Ctrl-K, and
more. Users familiar with GNU Emacs will recognize these keys as commonly used
keystrokes from that editor.</P>
<H3><A NAME="display_hlp">Getting Help</A></H3>
The Console Window has its own online help system. To access the help system, enter
"help" at the prompt and follow the on-screen instructions. For more help, please
consult the <!-- What is this really called? --> <I>GDB User's Guide</I>.
</BODY>
</HTML>

View file

@ -0,0 +1,20 @@
<HTML>
<HEAD>
<TITLE>Global Preferences Help</TITLE>
</HEAD>
<BODY>
<H1>Global Preferences</H1>
<H3>Overview</H3>
<P>Not yet done.</P>
<P>Global Preferences topics:
<UL>
<LI><UL><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
</UL>
</UL></P>
<H3><A NAME="">stuff</A></H3>
</BODY>
</HTML>

View file

@ -0,0 +1,32 @@
<HTML>
<HEAD>
<TITLE>Help Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Help Window</H1>
<H2>Overview</H2>
<P>This is some nice text which describes the help window, its role
in deugging, and perhaps some of the nifty things people can do with
this window.</P>
<P>Help Window topics:
<UL>
<LI><UL><A HREF="#menus">Menus</A>
<LI><A HREF="#menus_file">File Menu</A>
<LI><A HREF="#menus_topics">Topics Menu</A>
</UL>
<LI><UL><A HREF="#display">Help Display</A>
<LI><A HREF="#display_nav">Navigating the Help Window</A>
<LI><A HREF="#display_link">Definition and Page Links</A>
</UL>
</UL></P>
<H2><A NAME="menus">Menus</A></H2>
<H3><A NAME="menus_file">File Menu</A></H3>
<H3><A NAME="menus_topics">Topics Menu</A></H3>
<H3><A NAME="display">Help Display</A></H3>
<H3><A NAME="display_nav">Navigating the Help Window</A></H3>
<H3><A NAME="display_link">Definition and Page Links</A></H3>
</BODY>
</HTML>

View file

@ -0,0 +1,10 @@
{Source Window} {source.html} {The Source Window}
{Register Window} {register.html} {The Register Window}
{Memory Window} {memory.html} {The Memory Window}
{Locals Window} {locals.html} {The Locals Window}
{Watch Window} {watch.html} {The Watch Window}
{Tracepoint Window} {tp.html} {The Tracepoint Window}
{Console Window} {console.html} {The Console Window}
{Stack Window} {stack.html} {The Stack Window}
{TDump Window} {tdump.html} {The Tracepoint Dump Window}
{GPL} {license.html} {The GNU Public License}

View file

@ -0,0 +1,305 @@
<HTML>
<HEAD>
<TITLE>GNU General Public License</TITLE>
</HEAD><BODY>
<B>The GNU General Public License
<P></P>
</B>Version 2, June 1991
<P></P>
Copyright © 1989, 1991 Free Software Foundation, Inc.
<BR>59 Temple Place / Suite 330, Boston, MA 02111-1307, USA
<P></P>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
<P></P>
<B>Preamble
<P></P>
</B>The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and
change free software to make sure the software is free for all its users. This General Public
License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some
other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs,
too.
<P></P>
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom to
distribute copies of free software (and charge for this service if you wish),
that you receive source code or can get it if you want it, that you can change the
software or use pieces of it in new free programs; and that you know you can
do these things.
<P></P>
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of the
software, or if you modify it.
<P></P>
For example, if you distribute copies of such a program, whether gratis or for
a fee, you must give the recipients all the rights that you have. You must
make sure that they, too, receive or can get the source code. And you must show
them these terms so they know their rights.
<P></P>
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute and/or
modify the software.
<P></P>
Also, for each author's protection and ours, we want to make certain that everyone understands that
there is no warranty for this free software. If the software is modified by
someone else and passed on, we want its recipients to know that what they have is
not the original, so that any problems introduced by others will not reflect on
the original authors' reputations.
<P></P>
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for
copying, distribution and modification follow.
<P></P>
<B>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
<P></P>
</B>0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms of this
General Public License. The `Program”, below, refers to any such program or work, and a `work based on the Program' means either the Program or any derivative work under copyright law: that is
to say, a work containing the Program or a portion of it, either verbatim or
with modifications and/or translated into another language. (Hereinafter,
translation is included without limitation in the term `modification'.) Each licensee is addressed as `you'.
<P></P>
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running the Program is
not restricted, and the output from the Program is covered only if its contents
constitute a work based on the Program (independent of having been made by
running the Program). Whether that is true depends on what the Program does.
<P></P>
<OL><LI> You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this License
and to the absence of any warranty; and give any other recipients of the Program
a copy of this License along with the Program.
<P></P>
</OL>You may charge a fee for the physical act of transferring a copy, and you may
at your option offer warranty protection in exchange for a fee.
<P></P>
<OL START="2"><LI> You may modify your copy or copies of the Program or any portion of it, thus
forming a work based on the Program, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all of
these conditions:
<P></P>
</OL>a) You must cause the modified files to carry prominent notices stating that you
changed the files and the date of any change.
<P></P>
b) You must cause any work that you distribute or publish, that in whole or in
part contains or is derived from the Program or any part thereof, to be licensed
as a whole at no charge to all third parties under the terms of this License.
<P></P>
c) If the modified program normally reads commands interactively when run, you
must cause it, when started running for such interactive use in the most ordinary
way, to print or display an announcement including an appropriate copyright
notice and a notice that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these conditions,
and telling the user how to view a copy of this License. (Exception: if the
Program itself is interactive but does not normally print such an announcement,
your work based on the Program is not required to print an announcement.)
<P></P>
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License, and its
terms, do not apply to those sections when you distribute them as separate
works. But when you distribute the same sections as part of a whole which is a work
based on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the entire whole,
and thus to each and every part regardless of who wrote it.
<P></P>
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise the
right to control the distribution of derivative or collective works based on the
Program.
<P></P>
In addition, mere aggregation of another work not based on the Program with
the Program (or with a work based on the Program) on a volume of a storage or
distribution medium does not bring the other work under the scope of this License.
<P></P>
<OL START="3"><LI> You may copy and distribute the Program (or a work based on it, under Section
2) in object code or executable form under the terms of Sections 1 and 2 above
provided that you also do one of the following:
<P></P>
</OL>a) Accompany it with the complete corresponding machine-readable source code,
which must be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
<P></P>
b) Accompany it with a written offer, valid for at least three years, to give any
third party, for a charge no more than your cost of physically performing
source distribution, a complete machine-readable copy of the corresponding source
code, to be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
<P></P>
c) Accompany it with the information you received as to the offer to distribute
corresponding source code. (This alternative is allowed only for noncommercial
distribution and only if you received the program in object code or executable
form with such an offer, in accord with Subsection b above.)
<P></P>
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all the
source code for all modules it contains, plus any associated interface definition
files, plus the scripts used to control compilation and installation of the
executable. However, as a special exception, the source code distributed need not
include anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself accompanies the
executable.
<P></P>
If distribution of executable or object code is made by offering access to
copy from a designated place, then offering equivalent access to copy the source
code from the same place counts as distribution of the source code, even though
third parties are not compelled to copy the source along with the object code.
<P></P>
<OL START="4"><LI> You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate your
rights under this License. However, parties who have received copies, or
rights, from you under this License will not have their licenses terminated so long
as such parties remain in full compliance.
<P></P>
<LI> You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to modify or distribute the Program or
its derivative works. These actions are prohibited by law if you do not accept
this License. Therefore, by modifying or distributing the Program (or any work
based on the Program), you indicate your acceptance of this License to do so,
and all its terms and conditions for copying, distributing or modifying the
Program or works based on it.
<P></P>
<LI> Each time you redistribute the Program (or any work based on the Program), the
recipient automatically receives a license from the original licensor to copy,
distribute or modify the Program subject to these terms and conditions. You
may not impose any further restrictions on the recipients' exercise of the rights granted herein.
<P></P>
</OL>You are not responsible for enforcing compliance by third parties to this
License.
<P></P>
<OL START="7"><LI> If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of this
License. If you cannot distribute so as to satisfy simultaneously your obligations
under this License and any other pertinent obligations, then as a consequence
you may not distribute the Program at all. For example, if a patent license
would not permit royalty-free redistribution of the Program by all those who
receive copies directly or indirectly through you, then the only way you could
satisfy both it and this License would be to refrain entirely from distribution of
the Program.
<P></P>
</OL>If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and the
section as a whole is intended to apply in other circumstances.
<P></P>
It is not the purpose of this section to induce you to infringe any patents or
other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system, which is implemented by public license practices. Many people
have made generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that system; it is up
to the author/donor to decide if he or she is willing to distribute software
through any other system and a licensee cannot impose that choice.
<P></P>
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
<P></P>
<OL START="8"><LI> If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
<P></P>
<LI> The Free Software Foundation may publish revised and/or new versions of the
General Public License from time to time. Such new versions will be similar in
spirit to the present version, but may differ in detail to address new problems
or concerns.
<P></P>
</OL>Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and `any later version', you have the option of following the terms and conditions either of that
version or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of this License, you may choose any
version ever published by the Free Software Foundation.
<P></P>
<OL START="a"><LI> If you wish to incorporate parts of the Program into other free programs whose
distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation, write to
the Free Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status of all
derivatives of our free software and of promoting the sharing and reuse of software
generally.
<P></P>
</OL>NO WARRANTY
<P></P>
<OL START="b"><LI> BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE
PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM `AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.
<P></P>
<LI> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
<P></P>
</OL>END OF TERMS AND CONDITIONS
<P></P>
<B>How to Apply These Terms to Your New Programs
<P></P>
</B>If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
<P></P>
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively convey the exclusion
of warranty; and each file should have at least the `copyright' line and a pointer to where the full notice is found.
<P></P>
<I>one line for the program's name and a brief idea of what it does.
<BR></I>Copyright (C) 19<I>yy</I> <I>name of author</I>
<BR>
<BR>This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
<BR>
<BR>This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
<BR>
<BR>You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.
<P></P>
Also add information on how to contact you by electronic and paper mail.
<P></P>
If the program is interactive, make it output a short notice like the
following example when it starts in an interactive mode:
<P></P>
Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes
with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain
conditions; type `show c' for details.
<P></P>
The hypothetical commands <B>show w</B> and <B>show c</B> should show the appropriate parts of the General Public License. Of course,
the commands you use may be called something other than show w and show c; they can be mouse clicks or menu items—whatever suits your program.
<P></P>
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a `copyright disclaimer' for the program, if necessary. The following is a sample (when copying, alter
the names).
<P></P>
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
<BR>
<BR>signature of Ty Coon, 1 April 1989
<BR>Ty Coon, President of Vice
<P></P>
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may consider
it more useful to permit linking proprietary applications with the library. If
this is what you want to do, use the GNU Library General Public License instead of this License.
<P></P>
</BODY>
</HTML>

View file

@ -0,0 +1,83 @@
<HTML>
<HEAD>
<TITLE>Locals Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Locals Window</H1>
<H2>Overview</H2>
<P>The Locals Window displays all local variables in scope. It may be used to
visualize local variables. Local variables need to be collected
before they can be viewed. See <A HREF="tracedlg.html#t_actions_add">Adding
an Action</A> in the Tracepoint Dialog for more information.</P>
<P>Locals Window topics:
<UL>
<LI><UL><A HREF="#menus">Variable Menu</A>
<LI><A HREF="#menus_fmt">Format</A>
</UL>
<LI><UL><A HREF="#display">Locals Display</A>
<LI><A HREF="#display_deref">Dereferencing Pointers</A>
<LI><A HREF="#display_struct">Viewing a Structure or Class</A>
<LI><A HREF="#display_popup">Locals Pop-up Menu</A>
</UL>
</UL></P>
<H3><A NAME="menus">Variable Menu</A></H3>
The Variable Menu gives on-screen access to the funtions of the Locals Window.
To use any of these functions, first use the left mouse button to select a
variable from the display. Then select:
<DL>
<DT><A NAME="menus_fmt">Format</A>
<DD>Change the display format of the variable
</DL>
<H3><A NAME="display">Locals Display</A></H4>
The Locals Window Display consists of a scrolled listbox which contains all
local variables, one per line. Locals which were not collected at the current
tracepoint will display a memory-access error. To use any of the functions of
the Locals Window, use the left mouse button to select any element from the
Display.
<P>Pointers, structures, and classes appear in the display with small exapansion
box before their names. To <A NAME="display_deref">dereference pointers</A> or
<A NAME="display_struct">view the members of classes or structures</A>, click
the closed expansion box (which appears as a small plus sign, "+") to "expand"
the listing. The expansion box changes to a minus sign, "-", indicating that the
display is now open. Pointers, structures and classes may be expanded recursively
to allow multiple pointer dereferences and embedded structure viewing.
<P>The Locals Display updates as the trace buffer is navigated, highlighting
in blue those variables whose values have changed.</P>
<P>The Locals Window will, by default, display all pointers in hexadecimal and all
other variables in decimal. To change the default display of variables, use the
"set output-radix" command in the console window. (Type "help set output-radix" in the
console window for help. To make this change permanent, it must be added to the user's
init file -- .gdbinit.) To change the display format for a variable,
select the Format option from either the Variable Menu or the
<A HREF="#display_popup">Locals Pop-up Menu</A>.
<BR>
<H4><A NAME="display_popup">Locals Pop-up Menu</A></H4>
The Locals Pop-up Menu provides quick access to the functions of the Locals Window.
To use the Locals Pop-up Menu, first select a variable from the Display (by clicking
the left mouse button on it) and click the right mouse button, choosing from the
pop-up:
<DL>
<DT>Format
<DD>Change the display format of the variable. The variable may be displayed
as:
<DL>
<DT>Hex
<DD>hexadecimal (base 16)
<DT>Decimal
<DD>decimal (base 10)
<DT>Binary
<DD>binary (base 2)
<DT>Octal
<DD>octal (base 8)
</DL>
</DL>
</BODY>
</HTML>

View file

@ -0,0 +1,142 @@
<HTML>
<HEAD>
<TITLE>Memory Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Memory Window</H1>
<H2>Overview</H2>
<P>The Memory Window allows users to display the contents of collected
memory. The Memory Window Preferences controls all of the display
characteristics of the Memory Window.</P>
<P>Memory Window topics:
<UL>
<LI><UL><A HREF="#menus">Address Menu</A>
<LI><A HREF="#menus_auto">Auto Update</A>
<LI><A HREF="#menus_now">Update Now</A>
<LI><A HREF="#menus_prefs">Preferences</A>
</UL>
<LI><UL><A HREF="#display">Memory Display</A>
<LI><A HREF="#display_nav">Navigating the Memory Window</A>
<LI><A HREF="#display_popup">Memory Pop-up Menu</A>
</UL>
<LI><UL><A HREF="#prefs">Memory Window Preferences</A>
<LI><A HREF="#prefs_size">Size of the Display Cell</A>
<LI><A HREF="#prefs_fmt">Format of the Display Cell</A>
<LI><A HREF="#prefs_bytes">Size of the Memory Window</A>
<LI><A HREF="#prefs_misc">Miscellaneous</A>
</UL>
</UL></P>
<H3><A NAME="menus">Address Menu</A></H3>
<DL>
<DT><A NAME="menus_auto">Auto Update</A>
<DD>When selected, casues the Memory Window to update the Display.
<DT><A NAME="menus_now">Update Now</A>
<DD>Forces the Memory Window to update the Display.
<DT><A NAME="menus_prefs">Preferences</A>
<DD>Opens the Memory Window Preferences dialog.
</DL>
<H3><A NAME="display">Memory Display</A></H3>
Like the <A HREF="register.html">Register Window</A>, the Memory Window
Display is organized into a spreadsheet. The address of any cell in the
Display can be determined by appeding the row and column headers for the
cell. Optionally, an ASCII display of the memory appears at the right.
Any non-ASCII-representable byte in memory will appear in the ASCII Display
as a control character (a dot, ".", by default). The <A HREF="#pref">Memory
Preferences Dialog</A> may be used to alter the appearance of the
Memory Window. Any uncollected memory will appear as "N/A", indicating that
this memory was not collected when the trace experiment was run.
<P><A NAME="display_nav">To navigate the Memory Window</A>, use the mouse
and click the cell of interest. As an alternative, pressing the TAB key on
the keyboard will focus successive cells, from left to right, top to bottom.
The focus will wrap from the bottom of the Display to the top.</P>
<BR>
<H4><A NAME="display_popup">Memory Pop-up Menu</A></H4>
Clicking the right mouse button while the mouse cursor lies within the
bounds of any cell will allow users to:
<DL>
<DT>Auto Update
<DD>When selected, the Memory Window will track changes in
memory shown in the Display. Cells in which changes have
occured will be highlighted. When not selected, the Memory
Window is "frozen", representing a "snapshot" of memory.
<DT>Update Now
<DD>Causes the Memory Window to update all the cells shown.
<DT>Go To <I>address</I>
<DD>The Memory Window Display is updated to show memory starting
at address <I>address</I>.
<DT>Open New Window at <I>address</I>
<DD>A new Memory Window is opened, displaying memory at address
<I>address</I>
<DT>Memory Preferences...
<DD>Opens the Memory Window Preferences for editing the appearance
of the Memory Window Display.
</DL>
<BR>
<H3><A NAME="prefs">Memory Window Preferences</A></H3>
Memory Window Preference Dialog governs the appearance of the Memory Window:
the total number of bytes displayed, the size of each cell, ASCII control
character.
<BR>
<H4><A NAME="prefs_size">Size of the Display Cells</A></H4>
This attribute controls how many bytes appear in each cell. Valid cell
sizes in the Memory Window may be:
<DL>
<DT>Byte
<DD>Each cell is exactly one byte
<DT>Half Word
<DD>Cells are displayed with two bytes
<DT>Word
<DD>Each cell contains four bytes
<DT>Double Word
<DD>Cells contain eight bytes
<DT>Float
<DD>Each cell contains four bytes, displayed as a floating point
number
<DT>Double Float
<DD>Cells are displayed as floating point, eight bytes each
</DL>
<BR>
<H4><A NAME="prefs_fmt">Format of the Display Cells</A></H4>
The Format option of the Memory Preferences Dialog governs how the debugger
represents the memory. Possible representations include:
<DL>
<DT>Binary
<DD>The values are shown as binary numbers
<DT>Signed Decimal
<DD>The values are shown as signed decimal numbers
<DT>Octal
<DD>Each cell is represented as an octal number
<DT>Unsigned Decimal
<DD>Values are displayed as unsigned decimals
<DT>Hex
<DD>Memory is displayed as a hexadecimal number. This is
the default.
</DL>
<BR>
<H4><A NAME="prefs_bytes">Size of the Memory Window</A></H4>
The size of the memory window determines how much memory is actually
presented to the user. The total number of bytes shown can either be
determined by the size of the window, in which case resizing the Memory
Window will cause more or less memory to be displayed, or fixed at some
specified number of bytes. By default, the Memory Window shows 128 bytes
of memory.
<BR>
<H4><A NAME="prefs_misc">Miscellaneous</A></H4>
Miscellaneous memory preferences include the option to display the ASCII
representation of the memory, including what character to use for non-ASCII
bytes (the "control" character). Additionally, users may specify the number
of bytes per row, either four, eight, sixteen, or thirty-two. The default is
sixteen bytes per row.
</BODY>
</HTML>

View file

@ -0,0 +1,20 @@
<HTML>
<HEAD>
<TITLE>Register Window Preferences Help</TITLE>
</HEAD>
<BODY>
<H1>Register Window Preferences</H1>
<H3>Overview</H3>
<P>Not yet done.</P>
<P>Register Window Preferences topics:
<UL>
<LI><UL><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
</UL>
</UL></P>
<H3><A NAME="">stuff</A></H3>
</BODY>
</HTML>

View file

@ -0,0 +1,105 @@
<HTML>
<HEAD>
<TITLE>Register Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Register Window</H1>
<H2>Overview</H2>
<P>The Register Window lists all the registers and their contents for
the selected stack frame. It permits viewing the contents of registers
in different formats and some display customizations.</P>
<P>Any register that was not collected will be displayed as having a value
of "0x0". To collect registers, add them to the collection action in the
<A HREF="tracedlg.html">Tracepoint Dialog</A>.
<P>The Register Window will update the register contents in the display
to match the stack frame currently being viewed in the <A HREF="source.html">
Source Window</A> and <A HREF="stack.html">Stack Winodw</A>.</P>
<P>Register Window topics:
<UL>
<LI><UL><A HREF="#menus">Register Menu</A>
<LI><A HREF="#menus_fmt">Format</A>
<LI><A HREF="#menus_remove">Remove from Display</A>
<LI><A HREF="#menus_all">Display All Registers</A>
</UL>
<LI><UL><A HREF="#display">Register Display</A>
<LI><A HREF="#display_nav">Navigating the Register Display</A>
<LI><A HREF="#display_popup">Register Pop-up Menu</A>
<LI><A HREF="#display_format">Changing the Display Format of
a Register</A>
<LI><A HREF="#display_remove">Removing a Register
from the display</A>
<LI><A HREF="#display_all">Displaying all Registers</A>
</UL>
</UL></P>
<H3><A NAME="menus">Register Menu</A></H3>
The Register Menu provides on-screen access to the functionality of the
Register Window. To use any item from this menu, first use the mouse and
select (click the left mouse button) on any register cell. Users may then
select:
<BR>
<DL>
<DT><A NAME="menus_fmt"><A HREF="#display_format">Format</A></A>
<DD>Change the display format of the selected register
<DT><A NAME="menus_remove"><A HREF="#display_remove">Remove
from Display</A></A>
<DD>Remove the selected register from the Register
Window Display
<DT><A NAME="menus_all"><A HREF="#display_all">Display All
Registers</A></A>
<DD>Display all registers in the Display. This item
is only available when a register was previously
removed from the Display.
</DL>
<H3><A NAME="display">Register Display</A></H3>
The Register Display contains name and value pairs for each register
available on the target hardware. These "cells" are layed out as a
spreadsheet for ease of use.
<P><A NAME="display_nav"></A>To navigate the Register Display, use either
the mouse and left mouse button or the arrow keys on the keyboard to
highlight the appropriate cell. Users may then use the <A HREF="#menus">
Register Menu</A> or use the Register Pop-up Menu to access special display
options for the Register Window.</P>
<BR>
<H4><A NAME="display_popup">The Register Pop-up Menu</A></H4>
All of the special functions of the register window are accessed through
the Register Pop-up Menu. To use the Menu, simply select a register (see
<A HREF="#display_nav">Navigating the Register Display</A>) and click the
right mouse button. The Menu offers:
<DL>
<DT><A NAME="display_format">Format</A>
<DD><DL>Change the display format of the register. Valid display types
are:
<DT>Hex
<DD>The register's contents are displayed in
hexadecimal (base 16).
<DT>Decimal
<DD>The value is shown as
a decimal number (base 10).
<DT>Natural
<DD>The register is displayed in its natural format.
<DT>Binary
<DD>The contents of the register are displayed
as a binary number (base 2).
<DT>Octal
<DD>The register's contents are shown in octal (base 8).
<DT>Raw
<DD>The raw contents of the register are shown.
</DL>
<DT><A NAME="display_remove">Remove</A>
<DD>Remove the selected register from the display. To display
the removed register again, select the "Display All Registers"
option from the Register Menu or the Register Pop-up Menu.
<DT><A NAME="display_all">Display All Registers</A>
<DD>Causes the Register Window Display to show all registers,
including those which were previously "removed". This menu
item is only available when removed registers exist.
</DL>
</BODY>
</HTML>

View file

@ -0,0 +1,371 @@
<HTML>
<HEAD>
<TITLE>Source Window Help</TITLE>
</HEAD>
<BODY>
<CENTER><H1>The Source Window</H1></CENTER>
<H3>Overview</H3>
<BR>
The Source Window is the primary interface between the user and the
debugger; it is automatically opened when the debugger starts.
The Source Window displays the status of the trace experiment, controls
navigation of the trace buffer, and allows visualization of the program
execution.
<P>Source Window topics:
<UL>
<LI><UL><A HREF="#menus">Menus</A>
<LI><A HREF="#menus_file">File Menu</A>
<LI><A HREF="#menus_run">Run Menu</A>
<LI><A HREF="#menus_view">View Menu</A>
<LI><A HREF="#menus_trace">Trace Menu</A>
<LI><A HREF="#menus_prefs">Preferences Menu</A>
</UL>
<LI><UL><A HREF="#toolbar">Toolbar</A>
<LI><A HREF="#toolbar_exec">Trace Control Buttons</A>
<LI><A HREF="#toolbar_window">Window Buttons</A>
<LI><A HREF="#toolbar_frame">Frame Control</A>
</UL>
<LI><UL><A HREF="#display">Source Window Display</A>
<LI><A HREF="#display_balloon">Variable Balloons</A>
<LI><A HREF="#display_popup">Source Pop-up Mens</A>
</UL>
<LI><UL><A HREF="#status">Source Window Status Bars</A>
<LI><A HREF="#status_bar">Program Status Bar</A>
<LI><A HREF="#status_mode">Source Display Status Bar</A>
</UL>
<LI><A HREF="#search">Search Entry</A>
</UL></P>
<H3><A NAME="menus">Menus</A></H3>
<H4><A NAME="menus_file">File Menu</A></H4>
The File menu contains the following items:
<DL>
<DT>Open
<DD>Opens a file selection dialog to select the executable to debug
<DT>Target Settings...
<DD>Opens the <A HREF="target.html">Target Selection Dialog</A>
to edit target settings
<DT>Page Setup
<DD>(Windows only) Opens the Windows Page Setup dialog to
configure printing
<DT>Print
<DD>(Windows only) Print the contents of the Source Window Display
<DT>Exit
<DD>Exits the debugger
</DL>
<H4><A NAME="menus_run">Run Menu</A></H4>
The Run menu contains the following items:
<DL>
<DT>Connect to target
<DD>Establish a connection to a target. This option will open
the <A HREF="target.html">Target Selection Dialog</A> if no
previous connection has been established in the current
session.
<DT>Begin Collection
<DD>Start collecting trace data on the target
<DT>End Collection
<DD>Stop collecting trace data on the target
<DT>Disconnect
<DD>Disconnect the debugger from the target
</DL>
<H4><A NAME="menus_view">View Menu</A></H4>
The View menu contains the following items:
<DL>
<DT>Stack
<DD>Open a <A HREF="stack.html">Stack Window</A>
<DT>Registers
<DD>Open a <A HREF="register.html">Register Window</A>
<DT>Memory
<DD>Open a <A HREF="memory.html">Memory Window</A>
<DT>Watch Expressions
<DD>Open a <A HREF="watch.html">Watch Window</A>
<DT>Local Variables
<DD>Open a <A HREF="locals.html">Locals Window</A>
<DT>Tracepoints
<DD>Open a <A HREF="tp.html">Tracepoint Window</A>
<DT>Tdump
<DD>Open a <A HREF="tdump.html">Tracepoint Dump Window</A>
<DT>Console
<DD>Open a <A HREF="console.html">Console Window</A>
</DL>
<H4><A NAME="menus_trace">Trace Menu</A></H4>
The Trace Menu contains the following items:
<DL>
<DT>Next Hit
<DD>Update all displays with the next tracepoint in the
tracepoint buffer
<DT>Previous Hit
<DD>Go to the previous tracepoint in the buffer
<DT>First Hit
<DD>View the first tracepoint in the buffer
<DT>Next Line Hit
<DD>Go to the next tracepoint in the buffer in the same
frame as the current tracepoint
<DT>Next Hit Here
<DD>Jump to the next reference of the current tracepoint
in the buffer
<DT>Tfind Line...
<DD>Opens a dialog allowing the user to specify which source
line to inpect in the tracepoint buffer
<DT>Tfind PC...
<DD>Opens a dialog allowing the user to specify the PC of the
tracepoint to view
<DT>Tfind Tracepoint...
<DD>Opens a dialog allowing the user to specify which tracepoint
to view (by number). This option is most commonly used in
conjunction with the <A HREF="console.html">Console Window</A>.
</DL>
<H4><A NAME="menus_prefs">Preferences Menu</A></H4>
The Preferences menu contains the following items:
<DL>
<DT>Global
<DD>Opens the <A HREF="gbl_pref.html">Global Preferences Dialog</A>
and allows editing of global settings
<DT>Source
<DD>Opens the <A HREF="src_pref.html">Source Preferences Dialog</A>
and allows editing of Source Window settings
<DT>Register
<DD>Opens the <A HREF="reg_pref.html">Register Preferences Dialog</A>
and allows editing of Register Window settings
</DL>
<H3><A NAME="toolbar">Toolbar</A></H3>
The Source Window toolbar consists of three functional sections: trace
control buttons, debugger window buttons, and stack frame control buttons.
<BR>
<H4><A NAME="toolbar_exec">Tracing Control Buttons</A></H4>
These convenience buttons provide on-screen access to the most important
debugger tracing control functions:
<DL>
<DT><A NAME="run_button"><IMG SRC="%run"> TStart</A> or
<A NAME="stop_button"><IMG SRC="%stop"></A> TStop
<DD>The TStart Button causes the target to start collecting trace data
<DD>The TStop Button causes the target to stop collecting trace data
<DT>Next Hit
<DD>Update all displays with the next tracepoint in the
tracepoint buffer
<DT>Previous Hit
<DD>Go to the previous tracepoint in the buffer
<DT>First Hit
<DD>View the first tracepoint in the buffer
<DT>Next Line Hit
<DD>Go to the next tracepoint in the buffer in the same
frame as the current tracepoint
<DT>Next Hit Here
<DD>Jump to the next reference of the current tracepoint
in the buffer
</DL>
<H4><A NAME="toolbar_window">Window Buttons</A></H4>
The Debugger Window buttons give instant access to the Debugger's
auxillary windows:
<DL>
<DT><A NAME="register_button"><IMG SRC="%register"></A> Registers
<DD>Open a <A HREF="register.html">Register Window</A>
<DT><A NAME="memory_button"><IMG SRC="%memory"></A> Memory
<DD>Open a <A HREF="memory.html">Memory Window</A>
<DT><A NAME="stack_button"><IMG SRC="%stack"></A> Stack
<DD>Open a <A HREF="stack.html">Stack Window</A>
<DT><A NAME="watch_button"><IMG SRC="%watch"></A> Watch Expressions
<DD>Open a <A HREF="watch.html">Watch Window</A>
<DT><A NAME="locals_button"><IMG SRC="%locals"></A> Local Variables
<DD>Open a <A HREF="locals.html">Locals Window</A>
<DT><A NAME="tracepoints_button">Tracepoints</A>
<DD>Open a <A HREF="tp.html">Tracepoint Window</A>
<DT>Tracepoint Dump Window
<DD>Open a <A HREF="tdump.html">Tdump Window</A>
<DT><A NAME="console_button"><IMG SRC="%console"></A> Console
<DD>Open a <A HREF="console.html">Console Window</A>
</DL>
<H4><A NAME="toolbar_frame">Frame Control</A></H4>
The Frame Control area of the toolbar displays information about the PC of
the current frame, and the frame control buttons may be used to navigate
through the call stack. Whenever any of these buttons are used, both the
Source Window Display and the <A HREF="stack.html">Stack Window</A> will
show the selected frame. In order to use the Stack Window in tracing mode,
the stack pointer must be collected.
<DL>
<!-- is this a problem for windows? no file join? -->
<DT><IMG SRC="images/frame_info.gif"> Frame Information Display
<DD>The left half of the frame information display shows the
value of the PC in the current frame. The right half shows
the line number of the PC in the source file, if available.
<DT><A NAME="up_button"><IMG SRC="%up"></A> Up
<DD>Select and view the stack frame that called this one
<DT><A NAME="down_button"><IMG SRC="%down"></A> Down
<DD>Select and view the stack frame called by this one
<DT><A NAME="bottom_button"><IMG SRC="%bottom"></A> Bottom
<DD>Select and view the bottom-most stack frame
</DL>
<H3><A NAME="display">Source Display</A></H3>
The Source Display is used for many things: browsing source code, setting,
editing, and deleting tracepoints, and a few other special functions.
Executable lines (those for which executable code was generated by the
compiler) are denoted with a marker (a dash, "-") in the first column of
the display.
<P>The debugger highlights the PC in the current frame in either green,
indicating that the PC is in the current tracepoint, or gold, indicating
that the PC is contained in a frame that is not the current tracepoint, i.e.,
as part of a stack backtrace. A blue highlight is used by the debugger to
indicate a browsing position. All highlight colors
are user-selectable in the <A HREF="src_pref.html">Source Preferences</A>.</P>
<BR>
<H4><A NAME="setting_a_tracepoint">Setting a Tracepoint</A></H4>
Moving the mouse pointer over the "hot spot" of an executable line will change
the mouse cursor to a large dot. Clicking the left mouse button will then allow
tracepoint to be inserted at this line. If no tracepoint exists, the
<A HREF="tracedlg.html">Add Tracepoint Dialog</A> will appear. If a tracepoint
is installed, the dash in the left margin will change into a magenta breakdot.
If a tracepoint exists, the <A HREF="tracedlg.html">Edit Tracepoint Dialog</A>
appears, allowing either modification of the tracepoint or deletion of the
tracepoint. If the tracepoint is deleted, the breakdot will revert to a dash.</P>
<P>The executable line marker shows the status of each line: an empty marker
(the dash) indicates that no tracepoint is set at the line. A colored breakdot
indicates that a tracepoint exists at the line.</P>
<P>The display will attempt to show the value of variables in
<A NAME="display_balloon">variable balloons</A>. To activate a
variable balloon, simply hold the mouse cursor over the name of
a variable in the Source Display for a second or two: the debugger displays the
name of the variable, its type, and its value in a pop-up balloon. If the
variable was not collected, the Variable Balloon will show a memory-access error.</P>
<BR>
<H4><A NAME="display_popup">Source Pop-up Menus</A></H4>
The Source Display has two pop-up menus. One is activated by clicking the
right mouse button when the mouse cursor is over an executable line marker's
hot spot. This pop-up menu provides access to:
<DL>
<DT>Set Tracepoint
<DD>Opens the <A HREF="#tracedlg">Add/Edit Tracepoint Dialog</A>,
which allows new tracepoints to be set and modification and
deletion of existing tracepoints.
</DL>
<P>The other pop-up menu is activated by clicking the right mouse button
anywhere else in the Source Display. It is only available when a variable
or number in the display lies below the mouse cursor or is selected
(by clicking the left mouse button and dragging the mouse to highlight
the variable/number). The pop-up menu allows users to:
<DL>
<DT><A NAME="add_to_watch">Add <I>expr</I> to Watch</A>
<DD>Adds the selected expression to the <A HREF="watch.html">Watch
Window</A>, opening it, if necessary.
<DT>Dump Memory at <I>expr</I>
<DD>Opens a new <A HREF="memory.html">Memory Window</A> at the
selected expression. If the expression is a variable, then
the Memory Window is opened with memory addresses starting
at the value of the variable.
<DT>Set Tracepoint Range
<DD>This option is only available when a range of lines is highlighted
in the Source Display. It allows tracepoints with the same
properties to be set at every executable line in the range. If
any tracepoints exist in the range already, the debugger will
ask if the properties of the existing tracepoint should be
replaced with the properties of the range.
</DL>
</P>
<H4><A NAME="status">Source Window Status Bars</A></H4>
The Source Window has two status bars which inform the user of the
status of the program (the "status bar") and the status of the Source
Window.
<P>The <A NAME="status_bar">Program Status Bar</A> (or simply "Status Bar")
displays the status of the program. Common messages seen here include:
<DL>
<DT>No program loaded.
<DD>No program has been loaded into target memory.
<DT>Inspecting trace at <I>line/address</I>
<DD>The debugger is inspecting the tracepoint at line
<I>line</I> or address <I>address</I>. Use the
<A HREF="#toolbar_exec">Tracing Control Buttons</A>
to navigate through the trace buffer.
</DL>
<P>The Status Bar also displays some help information. For instance,
the Status Bar will show the function of a button on the toolbar or
the Source Display Status Bar as well as any keyboard shortcut for this
button.</P>
<BR>
<H4><A NAME="status_mode">Source Display Status Bar</A></H4>
current state of the Source Window: the name of the file displayed in
the Display, the name of the function in the Display which contains
the PC for the current frame (if any), and the display mode.
<P>The <A NAME="file_selector">Source File Selector</A> is a dropdown
menu which contains the names of all the files that were compiled into
the program being debugged.</P>
<P>Normally, the File Selector displays the name of the file currently being
viewed, but any file from the dropdown menu may be selected for browsing.
Simply select the file to view from the available choices (or type it directly
into the File Selector) and the Source Window will load that file into
the Display. To return to the current tracepoint, simply press the
<A HREF="#bottom_button">Bottom Frame Control Button</A>.</P>
<P>The <A NAME="function_selector">Source Function Selector</A> displays the
name of the function containing the Source Window's PC, if one exists, but it
may be used to browse any function in the current file. Simply type the name
of the desired function into the Function Selector or select it from the
dropdown menu. The Source Window's PC is updated to point at this function.
To return to the current tracepoint, simply press the
<A HREF="#bottom_button">Bottom Frame Control Button</A>.</P>
<P>The <A NAME="mode_selector">Source Display Mode Selector</A> displays
the viewing mode of the current file/function shown in the Source
Window Display.</P>
<P>The Display Mode Selector may be used to change the view of the current
source file. The available display modes are
<DL>
<DT>SOURCE
<DD>The contents of the Display are shown as source code.
If source code is not available (either because no debugging
information is available or the source file is not found),
the Source Window will revert the Display Mode to "ASSEMBLY".
<DT>ASSEMBLY
<DD>A disassembly of the target's memory is shown in the Display.
Even assembly source files show a disassembly of target memory;
to see the assembly source code, use the SOURCE mode. Note that the
debugger can only display assmebly code on a function-by-function
basis. It cannot display all the instructions generated from a single
source file.
<DT>MIXED
<DD>The Display shows source code mixed with the assembler
instructions which were generated for those lines by the
compiler for the current funtion. Note that the addresses
of the assembly lines is not necessarily monotonically
increasing. If the source file associated with the function
cannot be found, the Source Window will revert to ASSEMBLY mode.
<DT>SRC+ASM
<DD>The Source Window Display is divided into two panes: an
assembly pane and a source pane. Tracepoints may be set/cleared
in either pane.
</DL>
<BR>
<H3><A NAME="search">Search Entry</A></H3>
The Search Entry facilitates searching for text in the Source Window Display. Simply enter the
text to be found into the Search Entry and press the Enter key on the keyboard to search
forwards in the Source Window Display (hold down ths Shift key to search backwards). If
a match is found, it is highlighted in the Source Window and the Program Status Bar
displays information about where the match was found.
<P>The Search Entry can also jump the Source Window to a specific line. Enter the line
number preceeded by an at-sign (@) into the Search Entry and press enter. If entered
line number is greater than the total number of lines in the Source Window Display,
the Display will jump to the end of the current file.</P>
</BODY>
</HTML>

View file

@ -0,0 +1,20 @@
<HTML>
<HEAD>
<TITLE>Source Window Preferences Help</TITLE>
</HEAD>
<BODY>
<H1>Source Window Preferences</H1>
<H3>Overview</H3>
<P>Not yet done.</P>
<P>Source Preferences topics:
<UL>
<LI><UL><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
<LI><A HREF="#">stuff</A>
</UL>
</UL></P>
<H3><A NAME="">stuff</A></H3>
</BODY>
</HTML>

View file

@ -0,0 +1,51 @@
<HTML>
<HEAD>
<TITLE>Stack Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Stack Window</H1>
<H3>Overview</H3>
<P>The Stack Window allows users to view the call stack and jump between
levels of the stack. To use the Stack Window in tracepoint mode, the
stack pointer must be collected. See
<A HREF="tracedlg.html#t_actions_add">Adding an Action</A> in the Tracepoint
Dialog for more information on collecting registers.</P>
<P>Stack Window topics:
<UL>
<LI><UL><A HREF="#display">Stack Display</A>
<LI><A HREF="#display_nav">Navigating the Stack Window</A>
<LI><A HREF="#display_lvl">Changing the Stack Level</A>
</UL>
</UL></P>
<H3><A NAME="display">Stack Display</A></H3>
The Stack Display consists of a listbox which displays levels of the call stack
one per line. Each line contains the level number (useful when using the <A
HREF="console.html">Console Window</A>) and a description of the function executing
in that level. Typically, the function name and either the address of the function
or the file and line number where the function is defined are displayed. The
Stack Window may also be used to jump between levels of the stack.
<BR>
<H4><A NAME="display_nav">Navigating the Stack Window</A></H4>
Navigation of the Stack Window is accomplished by clicking on the desired level
with the left mouse button. The <A HREF="source.html#display">Source Window
Display</A> updates to show the selected frame. All other secondary windows,
<A HREF="register.html">Registers</A>, <A HREF="watch.html">Watch</A>, and
<A HREF="locals.html">Locals</A> update their displays for the selected frame.
<BR>
<H4><A NAME="display_lvl">Changing Stack Levels</A></H4>
To switch frames, simply click the left mouse button on the desired frame and the
debugger will switch contexts, updating all windows. The selected frame is highlighted
(in gold, by default).
<P>As an alternative, changing stack levels may be accomplished via the
<A HREF="source.html#toolbar_frame">Frame Control Buttons</A> on the Source Window's
Toolbar. These buttons may be used to change frames one level at a time (either
immediately up or immediately down) or to jump to the bottom-most stack frame.
See <A HREF="source.html#toolbar_frame">Source Frame Control Buttons</A> for more
information.</P>
</BODY>
</HTML>

View file

@ -0,0 +1,68 @@
<HTML>
<HEAD>
<TITLE>Target Selection Help</TITLE>
</HEAD>
<BODY>
<H1>The Target Selection Dialog</H1>
<H3>Overview</H3>
<P>The Target Selection Dialog allows users to specify the debug target,
the interface used to connect to the target, and some useful run
options.</P>
<P>Target Selection topics:
<UL>
<LI><UL><A HREF="#select">Selecting a Target</A>
<LI><A HREF="#select_tar">Specifying a Target</A>
<LI><A HREF="#select_int">Choosing a Connection Interface</A>
</UL>
<LI><UL><A HREF="#options">Run Options</A>
<LI><A HREF="#options_run_until_main">Run until 'main'</A>
<LI><A HREF="#options_bp_at_exit">Set breakpoint at 'exit'</A>
<LI><A HREF="#options_download_dialog">Display Download Dialog</A>
<LI><A HREF="#options_compare_to_remote_executable">Compare to
remote executable</A>
</UL>
</UL></P>
<H3><A NAME="select">Selecting a Target</A></H3>
Selecting a target involves choosing a target for debugging and setting connection
interface options for the target.
<P>Common targets include: "exec" for native debuggers, "remote" for establishing
a connection to a target board via a serial line, "remotetcp" for TCP connections,
and "sim" for connections to the simulator. There may be more depending on the
configuration of the debugger being used.</P>
<P>In general, "remote" targets are always serial connections which require the user
to specify the serial port and baud rate to be used for the connection and
"remotetcp" targets are always TCP connections which require specifying the hostname
and port number of the machine to which to connect. Depending upon configuration,
there may be numerous serial- and TCP-based connections. These always follow the
naming convention <I>target</I> and <I>target</I>tcp.</P>
<P>To <A NAME="select_tar"> select a target</A>, choose one of the available targets
from the dropdown menu in the Connection Frame. Then <A NAME="#select_int">specify
the interface options</A> for this target: selecting the baudrate and serial port
from the dropdown menus (serial targets only) or entering the hostname and port number
(TCP targets only).</P>
<H3><A NAME="options">Run Options</A></H3>
Three run options which may be selected include:
<DL>
<DT><A NAME="options_run_until_main">Run until 'main'
<DD>Sets a breakpoint at main(). This has no effect when using
GDB in tracing mode.
<DT><A NAME="options_bp_at_exit">Set breakpoint at 'exit'
<DD>Sets a breakpoint at exit(). This has no effect when using
GDB in tracing mode.
<DT><A NAME="options_download_dialog">Display Download Dialog
<DD>Displays a dialog showing the progress of the download to
the target section by section. This has no effect when using
GDB in tracing mode.
<DT><A NAME="options_compare_to_remote_executable">
Compare to remote executable</A>
<DD>When attaching to a tracing target, compare the host's and target's
executable by computing the checksum of each loadable section.
</DL>
</BODY>
</HTML>

View file

@ -0,0 +1,16 @@
<HTML>
<HEAD>
<TITLE>Trace Dump Window Help</TITLE>
</HEAD>
<BODY>
<H1>The TDump Window</H1>
<H3>Overview</H3>
<P>The Tdump Window displays all of the information contained in the
trace buffer for the current tracepoint. To view the contents of the
trace buffer for a specific tracepoint, use the <A HREF="source.html#toolbar_exec">
Tracing Control Buttons</A> on the <A HREF="source.html#toolbar">Source Window Toolbar
</A>, or jump to the tracepoint using one of the Tfind Dialogs accessible
through the Source Window's <A HREF="source.html#menus_trace">Trace Menu</A>.
</P>
</BODY>
</HTML>

View file

@ -0,0 +1,111 @@
<HTML>
<HEAD>
<TITLE>Tracepoint Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Tracepoint Window</H1>
<H3>Overview</H3>
<P>The Tracepoint Window lists all the various tracepoints that exist in
the program. It facilitates modifying tracepoints (make them
temporary or normal, disabled or enabled) and removing tracepoints.</P>
<P>Tracepoint Window topics:
<UL>
<LI><UL><A HREF="#menus">Menus</A>
<LI><A HREF="#menus_bp">Tracepoint Menu</A>
<LI><A HREF="#menus_global">Global Menu</A>
</UL>
<LI><UL><A HREF="#display">Tracepoint Display</A>
<LI><A HREF="#display_state">Enabling/Disabling Tracepoints</A>
<LI><A HREF="#display_remove">Removing Tracepoints</A>
<LI><A HREF="#display_popup">Tracepoint Pop-up Menu</A>
</UL>
</UL></P>
<H3><A NAME="menus">Menus</A></H3>
The Tracepoint Window contains two menus, one which deals specifically with
the individual tracepoints selected in the window, and one whose commands
affect all tracepoints.
<BR>
<H4><A NAME="menus_bp">Tracepoint Menu</A></H4>
The Tracepoint Menu operates on the selected tracepoint only. The
state of a tracepoint may be changed by selecting the desired state
from the menu:
<DL>
<DT>Actions
<DD><A HREF="tracedlg.html">Display the Tracepoint Dialog</A> for
this tracepoint.
<DT>Enabled
<DD>The tracepoint is active and will stop the debugger
when it is hit.
<DT>Disabled
<DD>The tracepoint is being ignored. A disabled tracepoint
will never get hit.
<DT>Remove
<DD>Deletes the tracepoint
</DL>
<BR>
<H4><A NAME="menus_global">Global Menu</A></H4>
Items on the Global Menu affect all defined tracepoints. Users may:
<DL>
<DT>Enable All
<DD>Enable all tracepoints
<DT>Disable All
<DD>Disable all tracepoints
<DT>Remove All
<DD>Delete all tracepoints
</DL>
<BR>
<H4><A NAME="display">Tracepoint Display</A></H4>
The Tracepoint Display is a table of tracepoints. The first column of the
table (unlabeled) shows a checkbutton, indicating whether the tracepoint
is enabled (checked) or disabled (unchecked). Disabled tracepoints are
ignored and will not cause any actions to be performed on the target.
<P>To use the Tracepoint Menu or the Tracepoint Pop-up Menu, first use
the left mouse button to select a tracepoint from the list, then make the
menu selection.</P>
<H3>Modifying Tracepoints</H3>
To <A NAME="display_state">enable</A> a tracepoint, simply click the
checkbutton in the first column of the desired tracepoint so that it is
selected (checked). To disable a tracepoint, "uncheck" the checkbutton.
<P>To remove a <A NAME="display_remove">tracepoint</A>, use the left mouse
button to select the tracepoint to remove and use either the tracepoint Menu
or the Tracepoint Pop-up Menu to select "remove". To re-install a tracepoint,
use the <A HREF="source.html#setting_a_tracepoint">Source Window Display</A>.
</P>
<BR>
<H4><A NAME="display_popup">Tracepoint Pop-up Menu</A></H4>
The Tracepoint Pop-up Menu is accessed by using the mouse cursor to select
a tracepoint from the Tracepoint Display and then clicking the right button
on the mouse. The Pop-up allows expert users quicker access to the functions
of the Tracepoint Menu:
<DL>
<DT>Actions
<DD>Display the <A HREF="tracedlg.html">Tracepoint Dialog</A> for
the selected tracepoint. This allows the tracepoint's actions
to viewed or edited.
<DT>Enabled
<DD>The tracepoint is active and will causes actions to be
performed on the target when it is hit
<DT>Disabled
<DD>The tracepoint is being ignored. A disabled tracepoint
will never perform any actions or be recorded in the trace
buffer.
<DT>Remove
<DD>Deletes the tracepoint
<DT>Global, Enable All
<DD>Enable all tracepoints
<DT>Global, Disable All
<DD>Disable all tracepoints
<DT>Global, Remove All
<DD>Delete all tracepoints
</DL>
</BODY>
</HTML>

View file

@ -0,0 +1,134 @@
<HTML>
<HEAD>
<TITLE>Tracepoint Dialogs Help</TITLE>
</HEAD>
<BODY>
<H1>Tracepoint Dialogs</H1>
<H3>Overview</H3>
<P>There are two Tracepoint Dialogs which help users set tracepoints:
The Tracepoint Dialog is used to view and add actions and The Actions
Dialog is used to edit a particular action specified in the
tracepoint's Action List.</P>
<P>Tracepoint Dialogs topics:
<UL>
<LI><A HREF="#tracedlg">The Tracepoint Dialog</A>
<UL>
<LI><A HREF="#t_experiment">Experiment Frame</A>
<LI><A HREF="#t_actions">Actions Frame</A>
<UL>
<LI><A HREF="#t_actions_passcount">Number of Passes</A>
<LI><A HREF="#t_actions_add">Adding Actions</A>
<LI><A HREF="#t_actions_modify">Modifying Actions</A>
</UL>
</UL>
<LI><A HREF="#actionsdlg">The Actions Dialog</A>
<UL>
<LI><A HREF="#a_variables">Variables List</A>
<LI><A HREF="#a_collect">Collection List</A>
<LI><A HREF="#a_other">Other Entry</A>
</UL>
</UL></P>
<H3><A NAME="tracedlg">The Tracepoint Dialog</H3>
The Tracepoint Dialog is the gateway to viewing and editing
the properties of any tracepoint. The same dialog is used
to add new tracepoints and edit and delete existing tracepoints,
for both single tracepoints and ranges of tracepoints.
<H4><A NAME="t_experiment">Experiment Frame</A></H4>
The Experiment Frame displays information about the tracepoint's
location in the program and its status. Specifically,
<DL>
<DT>Number
<DD>The internal number for this tracepoint. New tracepoints
all have the number "-1". This number may be used to
refer to specific tracepoints when using the
<A HREF="console.html">Console Window</A>
<DT>Hit Count
<DD>The number of times the tracepoint has been hit
<DT>Thread
<DD>The thread in which the tracepoint exists. This
feature is not currently implemented.
<DT>Function
<DD>The function in which the tracepoint is set
<DT>File
<DD>The file in which the tracepoint is set
<DT>Line(s)
<DD>The line at which the tracepoint is set or the
lines which the tracepoint range affects
</DL>
<BR>
<H4><A NAME="t_actions">Actions Frame</A></H4>
The Actions Frame displays the user-settable properties of the
tracepoint, including all actions and a pass count.
<P>A pass count specifies the number of times that the tracepoint
can be hit on the target before the tracing experiment ceases. A
pass count of five means that this tracepoint will issue a silent
"tstop" when it is hit the fifth time (after it has performed all
it actions). A pass count of zero (0) means that the tracepoint
will never causes the trace experiment to terminate on the target.</P>
<P>To <A NAME="t_actions_add">add an action</A> for the tracepoint,
select the appropriate action from the Action ComboBox and click
"Add". The <A HREF="#actionsdlg">Action Dialog</A> appears to
allow editing the action's properties.</P>
<P>Currently, there are two actions: collect and while-stepping.
Any number of collect actions may be added to specify that the
target should collect variables, registers, and memory when
it is hit. The while-stepping action may be used to collect
data for a specified number of machine instructions. Only one
while-stepping action may be specified for any tracepoint.</P>
<P>To <A NAME="t_actions_modify">modify the actions</A> associated
with a tracepoint, double-click the left mouse button on the action
listed in the Action Frame, and the <A HREF="#actionsdlg">Actions
Dialog</A> will appear.</P>
<P>To accept the tracepoint as displayed, click the OK button. To abort
installing or editing the tracepoint, click the CANCEL button. To delete
the tracepoint (if it is not a new tracepoint), click the DELETE button.</P>
<H3><A NAME="actionsdlg">The Actions Dialog</A></H3>
The Actions Dialog is used to edit an action for the tracepoint. It
consists of two lists, one containing all (uncollected) local variables
(including function arguments) and registers, and one containing everything
being collected.
<P>The <A NAME="#a_variables">Variables List</A> lists all uncollected local variables,
function arguments, and registers and may also display the special indentifiers
"All Locals", "All Arguments", and "All Registers". Global variables (and file static
variables) do not appear on the Variable List.</P>
<P>To move a variable from the Variables List to the Collection List, double-click
the variable in the Variables List or select the variable in the Variable
List and press the "<<< Collect" button. To specify a range of variables to be
collected, select them in the Variables list and click the "<<< Collect" button.</P>
<P><A NAME="a_collect">The Collection List displays all data being collected
by the action, including the special types "All Locals", "All Registers", and
"All Arguments", which specify that every local variable, every register, and
every function argument will be collected, respectively. Specifying a local
variable, for example, and "All Locals" will cause only the special identifier
"All Locals" to be sent to the target. Analogously, "All Registers" and "All
Arguments" also override any register or function argument specifically listed
in the Collection List.</P>
<P>To remove data from the Collection List, double-click any of the entries listed
in the List, or select a range of data to be removed and press the "Ignore >>>"
button. All local variables, function arguments, registers, and special identifiers
will be returned to the Variable List, while any expression (memory ranges, globals)
will simply "disappear". To add these again, use the <A HREF="#a_other">Other Entry</A>
at the bottom of the display.</P>
<P>The <A NAME="#a_other">Other Entry</A> can be used to move any variable listed in
either the Collection List or the Variable List to the other list. It can also
be used to specify expressions for collection, such as memory ranges and global variables.
Simply enter the name of the global variable or the expression and press the enter key on
the keyboard. If the expression is valid, it will be added/removed from the Collection
List.</P>
</BODY>
</HTML>

View file

@ -0,0 +1,118 @@
<HTML>
<HEAD>
<TITLE>Watch Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Watch Window</H1>
<H3>Overview</H3>
<P>The Watch Window may be used to inspect any collected expression, including
global variables, static variables, local variables, function arguments,
and registers.</P>
<P>Watch Window topics:
<UL>
<LI><UL><A HREF="#menus">Watch Menu</A>
<LI><A HREF="#menus_fmt">Format</A>
<LI><A HREF="#menus_remove">Remove</A>
</UL>
<LI><UL><A HREF="#new">Adding Watch Expressions</A>
<LI><A HREF="#new_ent">In the Watch Window</A>
<LI><A HREF="#new_src">In the Source Window</A>
<LI><A HREF="#new_cast">Casting Pointers</A>
</UL>
<LI><UL><A HREF="#display">Watch Display</A>
<LI><A HREF="#display_deref">Dereferencing Pointers</A>
<LI><A HREF="#display_struct">Viewing a Structure or Class</A>
<LI><A HREF="#display_popup">Watch Pop-up Menu</A>
</UL>
</UL></P>
<H3><A NAME="menus">Watch Menu</A></H3>
The Watch Menu gives on-screen access to the funtions of the Watch Window.
To use any of these functions, first use the left mouse button to select an
expression from the display. Then select:
<DL>
<DT><A NAME="menus_fmt">Format</A>
<DD>Change the display format of the expression
<DT><A NAME="menus_remove">Remove</A>
<DD>Remove the expression from the Watch Window
</DL>
<H3><A NAME="new">Adding Watch Expressions</A></H3>
<A NAME="new_ent">To add an expression to the Watch Window</A>, simply enter
the expression into the entry at the bottom of the window and press return
or click the "Add Watch" button. The expression is validated and added to the
Watch Window Display.
<P><A NAME="new_src">To add an expression to the Watch Window from the
<A HREF="source.html">Source Window</A></A>, use the
"<A HREF="source.html#add_to_watch">Add to Watch</A>" option of the
<A HREF="source.html#display_popup">Source Window Pop-up Menu</A>.</P>
<P>Any legal expression may be added to the Watch Window, which will
evaluate each of its expressions everytime the program runs. Be cautious
adding expressions which cause assignments, such as "<CODE>i++</CODE>".</P>
<P>Adding a register to the Watch Window can be advantages when debugging
via a slow serial line. In this case, keeping the entire Register Window open
may be inefficient. Consider adding the register to the Watch Window. Simply
enter the name of the register preceded with a dollar sign ($) into the
Entry. For example, to watch the PC register, enter "<CODE>$pc</CODE>" into
the Watch Window Entry. The program counter is added to the Display.</P>
<P><A NAME="new_cast">To cast pointers</A>, simply enter the cast into the
Watch Window Entry at the bottom of the window. Use the same syntax for the
cast that the source file uses. If the source file uses C, the a simple
cast of "<CODE>ptr</CODE>" of type "<CODE>void *</CODE>" can be cast to type
"<CODE>my_struct</CODE>" by entering "<CODE>(my_struct *) ptr</CODE>" into
the Entry.</P>
<H3><A NAME="display">Watch Display</A></H3>
The Watch Window Display consists of a scrolled listbox which contains all
watch expressions, one per line. To use any of the functions of the Watch
Window, use the left mouse button to select any element from the Display.
<P>Pointers, structures, and classes appear in the display with a small
exapansion box before their names. To <A NAME="display_deref">dereference
pointers</A> or <A NAME="display_struct">view the members of classes or
structures</A>, click the closed expansion box (which appears as a small
plus sign, "+") to "expand" the listing. The expansion box changes to a
minus sign, "-", indicating that the display is now open. Pointers,
structures and classes may be expanded recursively to allow multiple pointer
dereferences and embedded structure viewing.
<P>The Locals Display updates as the trace buffer is navigated, highlighting
in blue those variables whose values have changed.</P>
<P>The Watch Window will, by default, display all pointers in hexadecimal and all
other variables in decimal. To change the default display of variables, use the
"set output-radix" command in the console window. (Type "help set output-radix" in the
console window for help. To make this change permanent, it must be added to the user's
init file -- .gdbinit.) To change the display
format for a variable, select the Format option from either the Variable Menu or the
<A HREF="#display_popup">Watch Pop-up Menu</A>.
<BR>
<H4><A NAME="display_popup">Watch Pop-up Menu</A></H4>
The Watch Pop-up Menu provides quick access to the functions of the Watch Window.
To use the Locals Pop-up Menu, first select an expression from the Display (by
clicking the left mouse button on it) and click the right mouse button, choosing
from the pop-up:
<DL>
<DT>Format
<DD>Change the display format of the expression. The expression may be
displayed as:
<DL>
<DT>Hex
<DD>hexadecimal (base 16)
<DT>Decimal
<DD>decimal (base 10)
<DT>Binary
<DD>binary (base 2)
<DT>Octal
<DD>octal (base 8)
</DL>
</DL>
</BODY>
</HTML>

View file

@ -0,0 +1,86 @@
<HTML>
<HEAD>
<TITLE>Watch Window Help</TITLE>
</HEAD>
<BODY>
<H1>The Watch Window</H1>
<img src="images/watch.png" alt="Watch Window Image" width=545 height=308 border=0>
<H2>Overview</H2>
<P>The Watch Window may be used to inspect and edit any expression, including
global variables, static variables, local variables, function arguments,
and registers. All expressions in scope are displayed with the expression in
blue, the expression type in red, and the expression value in black. When an
expression value changes, it is displayed in green. Expressions that are not
in scope are all gray.</P>
<H3>Adding Watch Expressions</H3>
<p>To add an expression to the Watch Window, simply enter
the expression into the entry at the bottom of the window and press return
or click the "Add Watch" button. The expression is validated and added to the
Watch Window Display.</p>
<P>To add an expression to the Watch Window from the
<A HREF="source.html">Source Window</A>, use the
"<A HREF="source.html#add_to_watch">Add to Watch</A>" option of the
<A HREF="source.html#display_popup">Source Window Pop-up Menu</A>.</P>
<P>Any legal expression may be added to the Watch Window, which will
evaluate each of its expressions everytime the program runs. Be cautious
adding expressions which cause assignments, such as "<CODE>i++</CODE>".</P>
<P>Adding a register to the Watch Window can be advantages when debugging
via a slow serial line. In this case, keeping the entire Register Window open
may be inefficient. Consider adding the register to the Watch Window. Simply
enter the name of the register preceded with a dollar sign ($) into the
Entry. For example, to watch the PC register, enter "<CODE>$pc</CODE>" into
the Watch Window Entry. The program counter is added to the Display.</P>
<P>To cast pointers, simply enter the cast into the
Watch Window Entry at the bottom of the window. Use the same syntax for the
cast that the source file uses. If the source file uses C, the a simple
cast of "<CODE>ptr</CODE>" of type "<CODE>void *</CODE>" can be cast to type
"<CODE>my_struct</CODE>" by entering "<CODE>(my_struct *) ptr</CODE>" into
the Entry.</P>
<H3>Watch Display</H3>
<p>The Watch Window Display consists of a scrolled listbox which contains all
watch expressions, one per line. To use any of the functions of the Watch
Window, use the left mouse button to select any element from the Display.</p>
<P>Pointers, structures, and classes appear in the display with a small
exapansion box before their names. To dereference
pointers or view the members of classes or
structures, click the closed expansion box (which appears as a small
plus sign, "+") to "expand" the listing. The expansion box changes to a
minus sign, "-", indicating that the display is now open. Pointers,
structures and classes may be expanded recursively to allow multiple pointer
derefernces and embedded structure viewing.</P>
<P>The Watch Display updates after every execution of the program and
highlights in green those expressions whose values have changed.</P>
<P>The Watch Window will, by default, display all pointers and registers in
hexadecimal and all other expressions in decimal. To change the display
format for an expression, select the Format option from the pop-up menu.</P>
<H3>Editing an Expression</H3>
<p>To edit an expression, either double-click the left mouse button on the expression
in the Display or select the Edit option from the popup-menu. To abort editing
an expression's value, simply press
the escape key on the keyboard. The expression's original value is restored.</p>
<H3>Watch Pop-up Menu</H3>
<p>The pop-up menu provides quick access to the functions of the Watch Window.
To use the pop-up menu, click the right mouse button while over a variable.</p>
<DL>
<dt>Format<dd>Change the display format of the variable.</dd></dt>
<dt>Edit<dd>Edit the variable's value.</dd></dt>
<dt>Delete<dd>Remove the variable from the display.</dd></dt>
<dt>Dump Memory<dd>Open a Memory Window with the variable's value as an aaddress.</dd></dt>
<dt>Help<dd>Open this help page.</dd></dt>
<dt>Close<dd>Close the Local Variables Window.</dd></dt>
</DL>
</BODY>
</HTML>

View file

@ -0,0 +1,98 @@
# Open a viewer for HTML help info
# Copyright (C) 2002, 2008, Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ------------------------------------------------------------------------------
# NAME: public proc open_help
# SYNOPSIS: open_help file
# DESC: Opens html help file using an appropriate
# browser.
# ------------------------------------------------------------------------------
proc open_help {hfile} {
debug $hfile
# create full pathname link
set link file://[file join $::GDBTK_LIBRARY help $hfile]
# windows is easy
if {$::gdbtk_platform(platform) == "windows"} {
ide_shell_execute open $link
return
}
#
# for Unix, we never know what is installed
#
# set list of viewer apps to try
switch [pref get gdb/compat] {
"KDE" {
set apps {htmlview khelpcenter firefox opera mozilla}
}
"GNOME" {
set apps {htmlview firefox opera mozilla gnome-help khelpcenter}
}
default {
set apps {htmlview firefox opera mozilla gnome-help khelpcenter netscape}
}
}
# If the user has previously entered a browser name, append it
# to the list. Should it go first or last?
set bname [pref get gdb/help/browsername]
if {$bname != ""} {
lappend apps $bname
}
# now loop through list checking each application
foreach app $apps {
debug "app=$app"
if {[catch "exec $app $link &" result]} {
debug "$app failed: $result"
} else {
return
}
}
# if we reached here, nothing worked, so prompt for a name
set text "No help browser was found on your system.\n\
Please enter the name of an HTML viewer application."
while {[set app [prompt_helpname $text]] != "0"} {
if {$app != ""} {
if {[catch "exec $app $link &" result]} {
dbug W "$app failed: $result"
set text "Could not run application $app.\n\
Please enter the name of an HTML viewer application."
} else {
pref set gdb/help/browsername $app
return
}
}
}
}
# displays an entry dialog and asks for the name of an application
# returns 0 on cancel
# name on success
proc prompt_helpname {text} {
iwidgets::promptdialog .pd -title "Browser Query" -modality application \
-labeltext $text
if {[.pd activate]} {
set app [string trim [.pd get]]
destroy .pd
return $app
}
destroy .pd
debug "cancelled"
return 0
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

View file

@ -0,0 +1 @@
Basic Icon Set

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Some files were not shown because too many files have changed in this diff Show more