This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Extra diagnostic for tests
- From: Vladimir Prus <vladimir at codesourcery dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 13 Sep 2006 13:52:16 +0400
- Subject: Extra diagnostic for tests
Hi,
at the moment, the dejagnu tests use PATH to find the gdb binary, and don't
report which gdb binary is used. As result, when running runtest manually on
one test, one can test with different gdb from the one used by 'make check'.
The attached patch makes gdb print to log file the location of gdb, and also
makes sure invocation parameters are always printed to log file. While we're
on it, the 'serialport' parameter to 'target' command is also reported.
OK?
- Volodya
2006-09-13 Vladimir Prus <vladimir@codesourcery.com>
* lib/gdb.exp (default_gdb_start): Always add
invocation command to log file. Report the location where
gdb was found.
* lib/gdbserver-support.exp (gdb_target_cmd): Report
the serialport on connection, not just target kind.
Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.70
diff -u -r1.70 gdb.exp
--- lib/gdb.exp 18 Aug 2006 18:34:18 -0000 1.70
+++ lib/gdb.exp 13 Sep 2006 09:45:24 -0000
@@ -1087,7 +1087,7 @@
gdb_stop_suppressing_tests;
- verbose "Spawning $GDB -nw $GDBFLAGS"
+ verbose -log "Spawning $GDB -nw $GDBFLAGS"
if [info exists gdb_spawn_id] {
return 0;
@@ -1097,6 +1097,8 @@
if { [which $GDB] == 0 } then {
perror "$GDB does not exist."
exit 1
+ } else {
+ verbose -log "GDB found at [which $GDB]"
}
}
set res [remote_spawn host "$GDB -nw $GDBFLAGS [host_info gdb_opts]"];
Index: lib/gdbserver-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdbserver-support.exp,v
retrieving revision 1.1
diff -u -r1.1 gdbserver-support.exp
--- lib/gdbserver-support.exp 8 Apr 2005 12:57:00 -0000 1.1
+++ lib/gdbserver-support.exp 13 Sep 2006 09:45:24 -0000
@@ -55,19 +55,19 @@
verbose "Connection failed"
}
-re "Remote MIPS debugging.*$gdb_prompt" {
- verbose "Set target to $targetname"
+ verbose "Set target to '$targetname $serialport'"
return 0
}
-re "Remote debugging using .*$serialport.*$gdb_prompt" {
- verbose "Set target to $targetname"
+ verbose "Set target to '$targetname $serialport'"
return 0
}
-re "Remote target $targetname connected to.*$gdb_prompt" {
- verbose "Set target to $targetname"
+ verbose "Set target to '$targetname $serialport'"
return 0
}
-re "Connected to.*$gdb_prompt" {
- verbose "Set target to $targetname"
+ verbose "Set target to '$targetname $serialport'"
return 0
}
-re "Ending remote.*$gdb_prompt" { }