[commit/testsuite] Improve printcmds.exp with remote targets

Daniel Jacobowitz dan@codesourcery.com
Mon Mar 15 03:04:00 GMT 2010


With some board files, like native, gdb_load just loads the file.
With others, like a typical remote target that uses "load" but not
"run", it connects to the target and sends "load".  I once
changed gdbserver to avoid this, because of so many assumptions that
the target was not running after gdb_load, but we still have a bunch
of embedded board files that work this way.

The trick for tests that rely on the target not running is to use
gdb_file_cmd instead of gdb_load, so that's how I fixed printcmds.exp.

Tested on arm-none-eabi, committed on trunk.

-- 
Daniel Jacobowitz
CodeSourcery

2010-03-14  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.base/printcmds.exp: Use gdb_file_cmd instead of gdb_load.
	Use gdb_load later.

---
 gdb/testsuite/gdb.base/printcmds.exp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: gdb-mainline/gdb/testsuite/gdb.base/printcmds.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/printcmds.exp	2010-03-14 14:12:05.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/printcmds.exp	2010-03-14 14:12:10.000000000 -0700
@@ -770,7 +770,7 @@ gdb_test "ptype \"abc\"" " = char \\\[4\
 gdb_test "print \$cvar = \"abc\"" " = \"abc\""
 gdb_test "print sizeof (\$cvar)" " = 4"
 
-gdb_load ${binfile}
+gdb_file_cmd ${binfile}
 
 gdb_test "print \$pc" "No registers\\." "print \$pc (with file)"
 
@@ -787,6 +787,7 @@ if [set_lang_c] then {
     }
     gdb_test "p ctable1\[120\]" "120 'x'" "p ctable1\[120\] #1"
 
+    gdb_load ${binfile}
     if [runto_main] then {
 	test_integer_literals_accepted
 	test_integer_literals_rejected



More information about the Gdb-patches mailing list