summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-03-26 18:26:05 +0000
committerPedro Alves <palves@redhat.com>2013-03-26 18:26:05 +0000
commit12bcab2df52ecd5f129effe097084439334dcd98 (patch)
treed8242b3f19cb0d4ac85898e8124a5a719baa42da
parenteaae37beaf518a830507c48e08cf697b1906f7b9 (diff)
downloadgdb-12bcab2df52ecd5f129effe097084439334dcd98.tar.gz
Get rid of "No such file or directory" in the testsuite's btrace support detection.
When I tried running the btrace tests, I noticed something odd in the gdb.log file: (gdb) run Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace22343.x Breakpoint 1, main () at /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace22343.c:1 1 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace22343.c: No such file or directory. ^^^^^^^^^^^^^^^^^^^^^^^^^ (gdb) record btrace Target does not support branch tracing. (gdb) testcase ../../../src/gdb/testsuite/gdb.btrace/enable.exp completed in 0 seconds I knew that the btrace tests on my machine weren't supposed to work, but still, that error made me wonder if the test had something broken, and waste a few minutes looking up where that is coming from. The issue is that the btrace detection deletes the source file right after compiling it, and before GDB has a chance to open it. It's really harmless, but I'd rather spare others from going through the same exercise. We now get the regular: (gdb) run Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace24210.x ... Breakpoint 1, main () at /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace24210.c:1 1 int main(void) { return 0; } ... gdb/testsuite/ 2013-03-26 Pedro Alves <palves@redhat.com> * lib/gdb.exp (skip_btrace_tests): Delay deleting the source file until after GDB has run.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/lib/gdb.exp4
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6b0692dd00c..2d96caa0e73 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-26 Pedro Alves <palves@redhat.com>
+
+ * lib/gdb.exp (skip_btrace_tests): Delay deleting the source file
+ until after GDB has run.
+
2013-03-26 Yao Qi <yao@codesourcery.com>
* gdb.trace/actions.c, gdb.trace/circ.c: Add license header.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index ee9fdecd261..d05257d0f3c 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2129,10 +2129,10 @@ proc skip_btrace_tests {} {
verbose "$me: compiling testfile $src" 2
set compile_flags {debug nowarnings quiet}
set lines [gdb_compile $src $exe executable $compile_flags]
- file delete $src
if ![string match "" $lines] then {
verbose "$me: testfile compilation failed, returning 1" 2
+ file delete $src
return [set skip_btrace_tests_saved 1]
}
@@ -2140,8 +2140,10 @@ proc skip_btrace_tests {} {
clean_restart btrace[pid].x
if ![runto_main] {
+ file delete $src
return [set skip_btrace_tests_saved 1]
}
+ file delete $src
# In case of an unexpected output, we return 2 as a fail value.
set skip_btrace_tests_saved 2
gdb_test_multiple "record btrace" "check btrace support" {