You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

235 lines
5.2 KiB

* baseboards/aarch64-sim.exp, baseboards/am33_2.0-libremote.exp, baseboards/arm-ice.exp, baseboards/arm-sid.exp, baseboards/arm-sim.exp, baseboards/basic-sid.exp, baseboards/basic-sim.exp, baseboards/cris-sim.exp, baseboards/d30v-sim.exp, baseboards/fr30-sim.exp, baseboards/frv-sim.exp, baseboards/gdbserver-sample.exp, baseboards/generic-sim.exp, baseboards/i386-sid.exp, baseboards/iq2000-sim.exp, baseboards/jmr3904-sim.exp, baseboards/linux-gdbserver.exp, baseboards/linux-libremote.exp, baseboards/m68k-sid.exp, baseboards/mcore-moto-sim.exp, baseboards/mcore-sim.exp, baseboards/mips-lnews-sim.exp, baseboards/mips-lsi-sim.exp, baseboards/mips-sim-idt32.exp, baseboards/mips-sim-idt64.exp, baseboards/mips-sim.exp, baseboards/mmixware-sim.exp, baseboards/mn10200-sim.exp, baseboards/mn10300-sim.exp, baseboards/mt-sid.exp, baseboards/powerpc-sim.exp, baseboards/powerpcle-sim.exp, baseboards/rx-sim.exp, baseboards/sh-sid.exp, baseboards/sh-sim.exp, baseboards/sparc-sim.exp, baseboards/sparc64-sim.exp, baseboards/sparclite-sim-le.exp, baseboards/sparclite-sim.exp, baseboards/tx39-sim.exp, baseboards/unix.exp, baseboards/v850-sim.exp, baseboards/vr4100-sim.exp, baseboards/vr4111-sim.exp, baseboards/vr4300-sim.exp, baseboards/xtensa-sim.exp, lib/debugger.exp, lib/dejagnu.exp, lib/dg.exp, lib/framework.exp, lib/ftp.exp, lib/kermit.exp, lib/libgloss.exp, lib/remote.exp, lib/rlogin.exp, lib/rsh.exp, lib/standard.exp, lib/target.exp, lib/targetdb.exp, lib/telnet.exp, lib/tip.exp, lib/utils.exp, testsuite/config/default.exp, testsuite/lib/libsup.exp, testsuite/lib/util-defs.exp, testsuite/libdejagnu/tunit.exp, testsuite/libdejagnu/unit.cc, testsuite/runtest.all/libs.exp, testsuite/runtest.all/options.exp, testsuite/runtest.all/stats-sub.exp, testsuite/runtest.all/stats.exp, config/default.exp, config/gdb-comm.exp, config/gdb_stub.exp, config/sid.exp, config/sim.exp, config/unix.exp, config/vxworks.exp, configure.ac, dejagnu.h, runtest, runtest.exp: Use condensed years in copyright statement. Signed-off-by: Ben Elliston <bje@gnu.org>
10 years ago
# Copyright (C) 1992-2010 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
# DejaGnu 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 3 of the License, or
26 years ago
# (at your option) any later version.
#
# DejaGnu 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.
#
26 years ago
# You should have received a copy of the GNU General Public License
# along with DejaGnu; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
26 years ago
# This file was written by Rob Savoye <rob@welcomehome.org>.
26 years ago
# Dump the values of a shell expression representing variable names.
26 years ago
#
proc dumpvars { args } {
uplevel 1 [list foreach i [uplevel 1 "info vars $args"] {
if { [catch "array names $i" names ] } {
eval "puts \"${i} = \$${i}\""
} else {
foreach k $names {
eval "puts \"$i\($k\) = \$$i\($k\)\""
}
}
}
]
26 years ago
}
# Dump the values of a shell expression representing variable names.
26 years ago
#
proc dumplocals { args } {
uplevel 1 [list foreach i [uplevel 1 "info locals $args"] {
if { [catch "array names $i" names ] } {
eval "puts \"${i} = \$${i}\""
} else {
foreach k $names {
eval "puts \"$i\($k\) = \$$i\($k\)\""
}
}
}
]
26 years ago
}
26 years ago
# Dump the body of procedures specified by a regexp.
#
proc dumprocs { args } {
foreach i [info procs $args] {
puts "\nproc $i \{ [info args $i] \} \{ [info body $i]\}"
}
}
# Dump all the current watchpoints.
26 years ago
#
proc dumpwatch { args } {
foreach i [uplevel 1 "info vars $args"] {
set tmp ""
if { [catch "uplevel 1 array name $i" names] } {
set tmp [uplevel 1 trace vinfo $i]
if {![string match "" $tmp]} {
26 years ago
puts "$i $tmp"
}
} else {
foreach k $names {
set tmp [uplevel 1 trace vinfo [set i]($k)]
if {![string match "" $tmp]} {
26 years ago
puts "[set i]($k) = $tmp"
}
}
}
}
}
# Trap a watchpoint for an array.
26 years ago
#
proc watcharray { array element op } {
26 years ago
upvar [set array]($element) avar
switch -- $op {
26 years ago
"w" { puts "New value of [set array]($element) is $avar" }
"r" { puts "[set array]($element) (= $avar) was just read" }
"u" { puts "[set array]($element) (= $avar) was just unset" }
}
}
proc watchvar { v ignored op } {
26 years ago
upvar $v var
switch -- $op {
26 years ago
"w" { puts "New value of $v is $var" }
"r" { puts "$v (=$var) was just read" }
"u" { puts "$v (=$var) was just unset" }
}
}
# Watch when a variable is written.
26 years ago
#
proc watchunset { arg } {
if { [catch "uplevel 1 array name $arg" names ] } {
if {![uplevel 1 info exists $arg]} {
26 years ago
puts stderr "$arg does not exist"
return
}
uplevel 1 trace variable $arg u watchvar
} else {
foreach k $names {
if {![uplevel 1 info exists $arg]} {
26 years ago
puts stderr "$arg does not exist"
return
}
uplevel 1 trace variable [set arg]($k) u watcharray
}
}
}
# Watch when a variable is written.
26 years ago
#
proc watchwrite { arg } {
if { [catch "uplevel 1 array name $arg" names ] } {
if {![uplevel 1 info exists $arg]} {
26 years ago
puts stderr "$arg does not exist"
return
}
uplevel 1 trace variable $arg w watchvar
} else {
foreach k $names {
if {![uplevel 1 info exists $arg]} {
26 years ago
puts stderr "$arg does not exist"
return
}
uplevel 1 trace variable [set arg]($k) w watcharray
}
}
}
# Watch when a variable is read.
26 years ago
#
proc watchread { arg } {
if { [catch "uplevel 1 array name $arg" names ] } {
if {![uplevel 1 info exists $arg]} {
26 years ago
puts stderr "$arg does not exist"
return
}
uplevel 1 trace variable $arg r watchvar
} else {
foreach k $names {
if {![uplevel 1 info exists $arg]} {
26 years ago
puts stderr "$arg does not exist"
return
}
uplevel 1 trace variable [set arg]($k) r watcharray
}
}
}
# Delete a watchpoint.
26 years ago
#
proc watchdel { args } {
foreach i [uplevel 1 "info vars $args"] {
set tmp ""
if { [catch "uplevel 1 array name $i" names] } {
catch "uplevel 1 trace vdelete $i w watchvar"
catch "uplevel 1 trace vdelete $i r watchvar"
catch "uplevel 1 trace vdelete $i u watchvar"
} else {
foreach k $names {
catch "uplevel 1 trace vdelete [set i]($k) w watcharray"
catch "uplevel 1 trace vdelete [set i]($k) r watcharray"
catch "uplevel 1 trace vdelete [set i]($k) u watcharray"
}
}
}
}
# This file creates GDB style commands for the Tcl debugger
#
proc print { var } {
puts "$var"
}
proc quit { } {
log_and_exit
26 years ago
}
proc bt { } {
# The w command is provided by the Tcl debugger.
26 years ago
puts "[w]"
}
# Create some stub procedures since we can't alias the command names.
26 years ago
#
proc dp { args } {
uplevel 1 dumprocs $args
26 years ago
}
proc dv { args } {
uplevel 1 dumpvars $args
26 years ago
}
proc dl { args } {
uplevel 1 dumplocals $args
26 years ago
}
proc dw { args } {
uplevel 1 dumpwatch $args
}
proc q { } {
quit
}
proc p { args } {
uplevel 1 print $args
}
proc wu { args } {
uplevel 1 watchunset $args
}
proc ww { args } {
uplevel 1 watchwrite $args
}
proc wr { args } {
uplevel 1 watchread $args
}
proc wd { args } {
uplevel 1 watchdel $args
}