aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-06-04 16:13:14 +0200
committerTom de Vries <tdevries@suse.de>2020-06-04 16:13:14 +0200
commit0cfcd4f003ce0ed5467fd0ceeff4a191439c5923 (patch)
tree3b10758b532e7c94f15ebb263949f1e7564f1716 /gdb
parentc4b126b87a6cd842e567136b07ac1adca98c660f (diff)
downloadgdb-0cfcd4f003ce0ed5467fd0ceeff4a191439c5923.zip
gdb-0cfcd4f003ce0ed5467fd0ceeff4a191439c5923.tar.gz
gdb-0cfcd4f003ce0ed5467fd0ceeff4a191439c5923.tar.bz2
[gdb/testsuite] Fix use of fail in gdb_cmd_file
When building gdb using this patch: ... static void file_command (const char *arg, int from_tty) { + gdb_assert (0); ... and running the testsuite, we run into: ... Running src/gdb/testsuite/gdb.ada/O2_float_param.exp ... PASS: gdb.ada/O2_float_param.exp: compilation foo.adb FAIL: gdb.ada/O2_float_param.exp: (outputs/gdb.ada/O2_float_param/foo) \ (GDB internal error) PATH: gdb.ada/O2_float_param.exp: (outputs/gdb.ada/O2_float_param/foo) \ (GDB internal error) FAIL: gdb.ada/O2_float_param.exp: frame ... The FAIL detecting the GDB internal error is generated by this clause in gdb_file_cmd: ... -re "A problem internal to GDB has been detected" { fail "($arg) (GDB internal error)" gdb_internal_error_resync return -1 } ... The fail message has no text outside parenthesis, and could be considered empty. Also, it's the only clause in the gdb_expect that uses fail, the rest uses perror. Fix this by replacing the fail by perror, such that we have: ... Running src/gdb/testsuite/gdb.ada/O2_float_param.exp ... PASS: gdb.ada/O2_float_param.exp: compilation foo.adb ERROR: Couldn't load outputs/gdb.ada/O2_float_param/foo into \ gdb (GDB internal error). UNRESOLVED: gdb.ada/O2_float_param.exp: frame ... Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-06-04 Tom de Vries <tdevries@suse.de> * lib/gdb.exp (gdb_file_cmd): Use perror instead of fail.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/lib/gdb.exp2
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 21cfc17..ab9443e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2020-06-04 Tom de Vries <tdevries@suse.de>
+
+ * lib/gdb.exp (gdb_file_cmd): Use perror instead of fail.
+
2020-06-03 Tom de Vries <tdevries@suse.de>
PR symtab/26046
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 444cea0..63a9e3d 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1800,7 +1800,7 @@ proc gdb_file_cmd { arg } {
return -1
}
-re "A problem internal to GDB has been detected" {
- fail "($arg) (GDB internal error)"
+ perror "Couldn't load $arg into $GDB (GDB internal error)."
gdb_internal_error_resync
return -1
}