aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-10-12 23:06:15 +0100
committerPedro Alves <palves@redhat.com>2017-10-12 23:06:15 +0100
commit9192b7decc7256a41502bf68df36f429cceffc89 (patch)
tree6b910c13115d7403d1c4b675840220db33102b4d
parent74ffa566739c7e98568a9aa8b5ab8d8f3730d30d (diff)
downloadbinutils-9192b7decc7256a41502bf68df36f429cceffc89.zip
binutils-9192b7decc7256a41502bf68df36f429cceffc89.tar.gz
binutils-9192b7decc7256a41502bf68df36f429cceffc89.tar.bz2
Make gdb.base/auvx.exp work with --target_board=native-extended-gdbserver
Currently we get: Running .../src/gdb/testsuite/gdb.base/auxv.exp ... WARNING: can't generate a core file - core tests suppressed - check ulimit -c After this commit we get all the same PASSes as when native testing. The problem is that the testcase wants to create a core dump in a temporary directory and it is using the "cd" command to start the inferior with that directory as current directory, but that command only affects the inferior's cwd when native debugging. Fix it by using using the new "set cwd" command instead, which works with gdbserver as well. This still won't work with stub-like targets, because with those when we connect the inferior is already running. It'd be possible to make it work by making the inferior itself change dirs, but we'll need to make the native-gdbserver board no longer set is_remote first. gdb/testsuite/ChangeLog: 2017-10-12 Pedro Alves <palves@redhat.com> * gdb.base/auvx.exp (coredir): Update comment. (top level) <core_works>: Use "set cwd" command instead of "cd" command.
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/auxv.exp6
2 files changed, 9 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 3d2df7d..de9a852 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,4 +1,10 @@
2017-10-12 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/auvx.exp (coredir): Update comment.
+ (top level) <core_works>: Use "set cwd" command instead of "cd"
+ command.
+
+2017-10-12 Pedro Alves <palves@redhat.com>
Simon Marchi <simon.marchi@polymtl.ca>
* gdb.base/catch-fork-static.exp: No longer skip on is_remote
diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp
index 833a1fd..bc70b85 100644
--- a/gdb/testsuite/gdb.base/auxv.exp
+++ b/gdb/testsuite/gdb.base/auxv.exp
@@ -38,7 +38,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
}
# Use a fresh directory to confine the native core dumps.
-# Make it the working directory for gdb and its child.
+# Make it the working directory for the inferior.
set coredir [standard_output_file coredir.[getpid]]
file mkdir $coredir
set core_works [expr [isnative] && ! [is_remote target]]
@@ -50,8 +50,8 @@ gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set width 0"
if {$core_works} {
- if {[gdb_test "cd $coredir" ".*Working directory .*" \
- "cd to temporary directory for core dumps"]} {
+ if {[gdb_test_no_output "set cwd $coredir" \
+ "set cwd to temporary directory for core dumps"]} {
set core_works 0
}
}