public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/8] gen-perf-test: clean_restart
@ 2015-07-21  3:47 Doug Evans
  0 siblings, 0 replies; only message in thread
From: Doug Evans @ 2015-07-21  3:47 UTC (permalink / raw)
  To: gdb-patches

Hi.

This patch just makes the executable arg to clean_restart optional.

2015-07-20  Doug Evans  <dje@google.com>

	* lib/gdb.exp (clean_restart): Make executable optional.

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 0805de9..6ee609b 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4869,18 +4869,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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-21  3:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-21  3:47 [PATCH 1/8] gen-perf-test: clean_restart Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).