This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/testsuite] Improve printcmds.exp with remote targets
- From: Daniel Jacobowitz <dan at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 14 Mar 2010 23:04:20 -0400
- Subject: [commit/testsuite] Improve printcmds.exp with remote targets
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