aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/gdb.exp
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2015-07-24 15:35:12 -0700
committerDoug Evans <dje@google.com>2015-07-24 15:35:12 -0700
commit7b606f95c9bcfa1b569fe5d33f7d2a73d39322f4 (patch)
tree15feac90baca58063fb4104a96f154f17ab1d037 /gdb/testsuite/lib/gdb.exp
parenta97b16b8fcfc7ac818c43c9f9457966cfc47aed6 (diff)
downloadgdb-7b606f95c9bcfa1b569fe5d33f7d2a73d39322f4.zip
gdb-7b606f95c9bcfa1b569fe5d33f7d2a73d39322f4.tar.gz
gdb-7b606f95c9bcfa1b569fe5d33f7d2a73d39322f4.tar.bz2
lib/gdb.exp (clean_restart): Make executable optional.
gdb/testsuite/ChangeLog: * lib/gdb.exp (clean_restart): Make executable optional.
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r--gdb/testsuite/lib/gdb.exp21
1 files changed, 15 insertions, 6 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index f32d04a..1f3f838 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4895,18 +4895,27 @@ proc build_executable { testname executable {sources ""} {options {debug}} } {
return [eval build_executable_from_specs $arglist]
}
-# Starts fresh GDB binary and loads EXECUTABLE into GDB. EXECUTABLE is
-# the basename of the binary.
-# The return value is 0 for success, -1 for failure.
-proc clean_restart { executable } {
+# Starts fresh GDB binary and loads an optional executable into GDB.
+# Usage: clean_restart [executable]
+# EXECUTABLE is the basename of the binary.
+
+proc clean_restart { args } {
global srcdir
global subdir
- set binfile [standard_output_file ${executable}]
+
+ if { [llength $args] > 1 } {
+ error "bad number of args: [llength $args]"
+ }
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
- return [gdb_load ${binfile}]
+
+ if { [llength $args] >= 1 } {
+ set executable [lindex $args 0]
+ set binfile [standard_output_file ${executable}]
+ gdb_load ${binfile}
+ }
}
# Prepares for testing by calling build_executable_full, then