[2/2,gdb/testsuite] Fix FAIL in gdb.base/annota1.exp

Message ID 20211006153307.15868-2-tdevries@suse.de
State New
Headers show
Series
  • [1/2,gdb/testsuite] Refactor regexp in gdb.base/annota1.exp
Related show

Commit Message

Andrew Burgess via Gdb-patches Oct. 6, 2021, 3:33 p.m.
On openSUSE tumbleweed I run into:
...
FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout)
...
due to a message related to libthread_db:
...
^Z^Zstarting^M
[Thread debugging using libthread_db enabled]^M
Using host libthread_db library "/lib64/libthread_db.so.1".^M
^M
^Z^Zframes-invalid^M
...
which is not matched by the regexp.

Fix this by updating the regexp.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/annota1.exp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.26.2

Comments

Simon Marchi Oct. 6, 2021, 8:51 p.m. | #1
On 2021-10-06 11:33 a.m., Tom de Vries via Gdb-patches wrote:
> On openSUSE tumbleweed I run into:

> ...

> FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout)

> ...

> due to a message related to libthread_db:

> ...

> ^Z^Zstarting^M

> [Thread debugging using libthread_db enabled]^M

> Using host libthread_db library "/lib64/libthread_db.so.1".^M

> ^M

> ^Z^Zframes-invalid^M

> ...

> which is not matched by the regexp.

>

> Fix this by updating the regexp.

>

> Tested on x86_64-linux.


The patches LGTM.  Do you know why you see this message for a single
threaded program?  Is it related to gcc/glibc now always linking against
libpthread (or libpthread being merged into libc, I don't remember)?

Simon
Andrew Burgess via Gdb-patches Oct. 7, 2021, 3:43 a.m. | #2
On 10/6/21 10:51 PM, Simon Marchi wrote:
> On 2021-10-06 11:33 a.m., Tom de Vries via Gdb-patches wrote:

>> On openSUSE tumbleweed I run into:

>> ...

>> FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout)

>> ...

>> due to a message related to libthread_db:

>> ...

>> ^Z^Zstarting^M

>> [Thread debugging using libthread_db enabled]^M

>> Using host libthread_db library "/lib64/libthread_db.so.1".^M

>> ^M

>> ^Z^Zframes-invalid^M

>> ...

>> which is not matched by the regexp.

>>

>> Fix this by updating the regexp.

>>

>> Tested on x86_64-linux.

> 

> The patches LGTM.  Do you know why you see this message for a single

> threaded program?  Is it related to gcc/glibc now always linking against

> libpthread (or libpthread being merged into libc, I don't remember)?

> 


The latter, indeed.

Thanks for the review.

- Tom

Patch

diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 7a08137a1b0..13e82c176e2 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -136,6 +136,10 @@  set warning_gdb_index_re \
 	 "to use the section anyway\\."]
 set reading_re \
     "Reading \[^\r\n\]+"
+set libthread_db_re \
+    [multi_line \
+	 "\\\[Thread debugging using libthread_db enabled\\\]" \
+	 "Using host libthread_db library \[^\r\n\]+"]
 
 set run_re \
     [list \
@@ -143,7 +147,7 @@  set run_re \
 	 "\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)\)*" \
 	 "\(\r\n$warning_gdb_index_re\)?" \
 	 "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
-	 "\032\032starting\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)\)*" \
+	 "\032\032starting\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)|\r\n$libthread_db_re\)*" \
 	 "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
 	 "\032\032breakpoint 1\r\n\r\n" \
 	 "Breakpoint 1, \r\n" \