diff options
author | Tom de Vries <tdevries@suse.de> | 2020-03-12 11:34:45 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-03-12 11:34:45 +0100 |
commit | 9a2de3fc7f7c40da6e8d5553c29e6cb8a2430dc8 (patch) | |
tree | 158820210b67df56a6754567b75cf4cf16d90656 /gdb/testsuite | |
parent | 3217502e1ba7409676e192100a0147a49dd5ae7a (diff) | |
download | gdb-9a2de3fc7f7c40da6e8d5553c29e6cb8a2430dc8.zip gdb-9a2de3fc7f7c40da6e8d5553c29e6cb8a2430dc8.tar.gz gdb-9a2de3fc7f7c40da6e8d5553c29e6cb8a2430dc8.tar.bz2 |
[gdb/testsuite] Fix gdb.linespec/explicit.exp FAIL with glibc debug info
When running test-case gdb.linespec/explicit.exp with GLIBC debuginfo
installed, I run into:
...
(gdb) break -source exp^GlFAIL: gdb.linespec/explicit.exp: complete \
non-unique file name (timeout)
...
The regexp that times out is:
...
-re "break -source exp\\\x07licit" {
...
and the reason it times out is that gdb only outputs an "l" after the tab, while
the regexp expect a futher "icit".
This is a regression since commit 507dd60e28 "[gdb/testsuite, 1/2] Fix
gdb.linespec/explicit.exp with check-read1", where I merged the matching for
the two cases where GLIBC debuginfo is either installed or not, as it turns
out incorrectly, presumably because even though I tested with GLIBC debuginfo
info installed and deinstalled, that didn't make a difference because I didn't
use configure flag --with-separate-debug-dir=/usr/lib/debug.
Fix this by not explictly matching the "icit" part.
Tested on x86_64-linux, with and without GLIBC debuginfo installed, both with
make targets check and check-read1.
gdb/testsuite/ChangeLog:
2020-03-12 Tom de Vries <tdevries@suse.de>
* gdb.linespec/explicit.exp: Fix "complete non-unique file name" test
in presence of GLIBC debuginfo.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.linespec/explicit.exp | 20 |
2 files changed, 24 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 77b3695..7e9e490 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2020-03-12 Tom de Vries <tdevries@suse.de> + * gdb.linespec/explicit.exp: Fix "complete non-unique file name" test + in presence of GLIBC debuginfo. + +2020-03-12 Tom de Vries <tdevries@suse.de> + * lib/gdb.exp (gdb_core_cmd): Use string_to_regexp for regexp-matching $core. diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp index 2f31b0e..4f457dc 100644 --- a/gdb/testsuite/gdb.linespec/explicit.exp +++ b/gdb/testsuite/gdb.linespec/explicit.exp @@ -239,8 +239,26 @@ namespace eval $testfile { set tst "complete non-unique file name" send_gdb "break -source exp\t" + # We're matching two cases here: + # - without GLIBC debuginfo + # (gdb) break -source exp^Glicit^G^M + # explicit.c explicit2.c ^M + # (gdb) break -source explicit^M + # Source filename requires function, label, or line offset.^M + # (gdb) PASS: gdb.linespec/explicit.exp: complete non-unique file name + # - with GLIBC debuginfo: + # (gdb) break -source exp^Gl^G^M + # explicit.c explicit2.c explicit_bzero.c explicit_bzero_chk.c \ + # explodename.c ^M + # (gdb) break -source expl^M + # Source filename requires function, label, or line offset.^M + # (gdb) PASS: gdb.linespec/explicit.exp: complete non-unique file name gdb_test_multiple "" $tst { - -re "break -source exp\\\x07licit" { + -re "break -source exp\\\x07l" { + # At this point, either output is done (first case), or a + # further "icit" is emitted (second case). We have no reliable + # way to decide one way or another, so just send the tabs, even + # though that may be a little early in the second case. send_gdb "\t\t" gdb_test_multiple "" $tst { -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+\(expl.*\)?\r\n$gdb_prompt" { |