This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[pushed] Don't run gdb.gdb/ selftests if use_gdb_stub is true
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 13 Oct 2017 17:40:10 +0100
- Subject: [pushed] Don't run gdb.gdb/ selftests if use_gdb_stub is true
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8BEE2C04AC5D
If we make the native-gdbserver board be !is_remote, then the few
tests that use the selftest-support.exp routines to debug gdb itself
start running, and fail, with something like:
Running ..../src/gdb/testsuite/gdb.gdb/selftest.exp ...
ERROR: tcl error sourcing ..../src/gdb/testsuite/gdb.gdb/selftest.exp.
ERROR: gdbserver does not support run [....] without extended-remote
while executing
"error "gdbserver does not support $command without extended-remote""
(procedure "gdb_test_multiple" line 25)
invoked from within
"gdb_test_multiple "run $INTERNAL_GDBFLAGS" "$description" {
-re "Starting program.*Breakpoint \[0-9\]+,.*$function \\(\\).* at .*main.c:.*$gdb..."
(procedure "selftest_setup" line 45)
This commit makes sure those tests continue to be skipped.
gdb/testsuite/ChangeLog:
2017-10-13 Pedro Alves <palves@redhat.com>
* lib/selftest-support.exp (selftest_setup): Extend comments, and
also skip on stub-like targets.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/lib/selftest-support.exp | 19 +++++++++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2e7eb1d..aa016c8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2017-10-13 Pedro Alves <palves@redhat.com>
+ * lib/selftest-support.exp (selftest_setup): Extend comments, and
+ also skip on stub-like targets.
+
+2017-10-13 Pedro Alves <palves@redhat.com>
+
PR gdb/22293
* gdb.base/find-unmapped.exp: Don't skip if is_remote target.
(top level): Move some tests to ...
diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
index 987b5c8..798d19d 100644
--- a/gdb/testsuite/lib/selftest-support.exp
+++ b/gdb/testsuite/lib/selftest-support.exp
@@ -124,8 +124,23 @@ proc selftest_setup { executable function } {
proc do_self_tests {function body} {
global GDB tool
- # Are we on a target board.
- if { [is_remote target] || ![isnative] } then {
+ # Are we testing with a remote board? In that case, the target
+ # won't have access to the GDB's auxilliary data files
+ # (data-directory, etc.). It's simpler to just skip.
+ if [is_remote target] {
+ return
+ }
+
+ # ... or seemingly testing with a cross debugger? Likely GDB
+ # wouldn't be able to debug itself then...
+ if ![isnative] {
+ return
+ }
+
+ # ... or with a stub-like server? I.e., gdbserver + "target
+ # remote"? In that case we won't be able to pass command line
+ # arguments to GDB, and selftest_setup wants to do exactly that.
+ if [target_info exists use_gdb_stub] {
return
}
--
2.5.5