From 96038148d0e9f7dc89284310d065e27a3fa375f2 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Apr 2020 09:26:02 +0200 Subject: [PATCH] [gdb/testsuite] Skip gdb.base/readnever.exp with target board readnow When running test-case gdb.base/readnever.exp with target board readnow, we have: ... spawn gdb -nw -nx -data-directory data-directory -ex set sysroot -readnow \ --readnever^M gdb: '--readnow' and '--readnever' cannot be specified simultaneously^M ERROR: : spawn id exp19 not open ... Fix this by skipping the test when -readnow/--readnow is detected in GDBFLAGS. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-04-23 Tom de Vries * gdb.base/readnever.exp: Skip if GDBFLAGS contain -readnow/--readnow. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/readnever.exp | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5700fa81e2..7e6bf73fa4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-04-23 Tom de Vries + + * gdb.base/readnever.exp: Skip if GDBFLAGS contain -readnow/--readnow. + 2020-04-22 Tom de Vries * gdb.mi/dw2-ref-missing-frame-func.c (.debug_aranges): Fix diff --git a/gdb/testsuite/gdb.base/readnever.exp b/gdb/testsuite/gdb.base/readnever.exp index 737bc84e84..ab2e18e226 100644 --- a/gdb/testsuite/gdb.base/readnever.exp +++ b/gdb/testsuite/gdb.base/readnever.exp @@ -20,6 +20,13 @@ if { [build_executable "failed to build" $testfile $srcfile { debug }] == -1 } { return -1 } +# See if we have target board readnow.exp or similar. +if { [lsearch -exact $GDBFLAGS -readnow] != -1 \ + || [lsearch -exact $GDBFLAGS --readnow] != -1 } { + untested "--readnever not allowed in combination with --readnow" + return -1 +} + save_vars { GDBFLAGS } { append GDBFLAGS " --readnever" clean_restart ${binfile}