Skip to content

Commit

Permalink
gdb/testsuite: fix gdb.threads/linux-dp.exp regex
Browse files Browse the repository at this point in the history
On ubuntu 22.04 with the libc6-dbg package installed, I have the
following failure:

    where
    #0  print_philosopher (n=3, left=33 '!', right=33 '!') at .../gdb/testsuite/gdb.threads/linux-dp.c:105
    #1  0x000055555555576a in philosopher (data=0x55555555937c) at .../gdb/testsuite/gdb.threads/linux-dp.c:148
    #2  0x00007ffff7e11b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
    #3  0x00007ffff7ea3a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
    (gdb) FAIL: gdb.threads/linux-dp.exp: first thread-specific breakpoint hit

The regex for this test accounts for different situations (with /
without debug symbol) but assumes that if debug info is present the
backtrace shows execution under pthread_create.  However, for the
implementation under test, we are under start_thread.

Update the regex to accept start_thread.

Tested on Ubuntu-22.04 x86_64 with and without libc6-dbg debug symbols
available.

Change-Id: I1e1536279890bca2cd07f038e026b41e46af44e0
  • Loading branch information
lancesix committed Oct 7, 2022
1 parent 7808a1f commit ae17d05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gdb/testsuite/gdb.threads/linux-dp.exp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ gdb_continue_to_breakpoint "thread 5's print"
# If you do have debug info, the output obviously depends more on the
# exact library in use; under NPTL, you get:
# #2 0x0012b7fc in start_thread (arg=0x21) at pthread_create.c:264
gdb_test "where" "print_philosopher.*philosopher.* \(from .*libpthread\|at pthread_create\|in pthread_create|from .*libc\\.\).*" \
gdb_test "where" "print_philosopher.*philosopher.* \(from .*libpthread\|at pthread_create\|in pthread_create\|in start_thread\|from .*libc\\.\).*" \
"first thread-specific breakpoint hit"

# Make sure it's catching the right thread. Try hitting the
Expand Down

0 comments on commit ae17d05

Please sign in to comment.