diff options
author | Tom de Vries <tdevries@suse.de> | 2020-03-12 11:03:07 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-03-12 11:03:07 +0100 |
commit | 3217502e1ba7409676e192100a0147a49dd5ae7a (patch) | |
tree | e49505094f425c6a65ec9f59aeb288e51cf0ce2d /gdb/testsuite | |
parent | 1281424ccf3d05410398f4f495443d9e54426f91 (diff) | |
download | gdb-3217502e1ba7409676e192100a0147a49dd5ae7a.zip gdb-3217502e1ba7409676e192100a0147a49dd5ae7a.tar.gz gdb-3217502e1ba7409676e192100a0147a49dd5ae7a.tar.bz2 |
[gdb/testsuite] Use string_to_regexp on core filename in gdb_core_cmd
In commit 1281424ccf "[gdb/testsuite] Fix core file load FAIL in
tls-core.exp", I've made this change:
...
- -re ": No such file or directory.*\r\n$gdb_prompt $" {
+ -re "$core: No such file or directory.*\r\n$gdb_prompt $" {
...
However, the $core variable contains a filename which needs to be matched
as a literal string, not as a regexp.
Fix this by using string_to_regexp.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-03-12 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (gdb_core_cmd): Use string_to_regexp for regexp-matching
$core.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3d829b0..77b3695 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2020-03-12 Tom de Vries <tdevries@suse.de> + * lib/gdb.exp (gdb_core_cmd): Use string_to_regexp for regexp-matching + $core. + +2020-03-12 Tom de Vries <tdevries@suse.de> + * lib/gdb.exp (gdb_core_cmd): Make "No such file or directory" regexp more precise. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index bb70ef1..ae2d810 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4648,7 +4648,7 @@ proc gdb_core_cmd { core test } { fail "$test (bad file format)" return -1 } - -re "$core: No such file or directory.*\r\n$gdb_prompt $" { + -re -wrap "[string_to_regexp $core]: No such file or directory.*" { fail "$test (file not found)" return -1 } |