aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2021-06-09 18:56:23 -0700
committerKevin Buettner <kevinb@redhat.com>2021-06-11 14:55:01 -0700
commit4cc2e60671b926ad7e5ed3928c4e54e456c7c344 (patch)
tree20832d76eb7b85969b9e6699597ff22dae71018d /gdb/testsuite/gdb.base/fork-print-inferior-events.exp
parente2b9ea4bbbf16962da55062b3aef6f5238a50f3d (diff)
downloadfsf-binutils-gdb-4cc2e60671b926ad7e5ed3928c4e54e456c7c344.zip
fsf-binutils-gdb-4cc2e60671b926ad7e5ed3928c4e54e456c7c344.tar.gz
fsf-binutils-gdb-4cc2e60671b926ad7e5ed3928c4e54e456c7c344.tar.bz2
testsuite/glib-2.34: Match/consume optional libthread_db related output
When using glibc-2.34, we now see messages related to the loading of the thread library for non-thread programs. E.g. for the test case, gdb.base/execl-update-breakpoints.exp, we will see the following when starting the program: (gdb) break -qualified main Breakpoint 1 at 0x100118c: file /ironwood1/sourceware-git/f34-2-glibc244_fix/bld/../../worktree-glibc244_fix/gdb/testsuite/gdb.base/execl-update-breakpoints.c, line 34. (gdb) run Starting program: [...]/execl-update-breakpoints1 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". The two lines of output related to libthread_db are new; we didn't see these in the past. This is a side effect of libc now containing the pthread API - we can no longer tell whether the program is multi-threaded by simply looking for libpthread.so. That said, I think that we now want to load libthread_db anyway since it's used to resolve TLS variables; i.e. we need it for correctly determining the value of errno. This commit adds the necessary regular expressions to match this (optional) additional output in the two tests which were failing without it. gdb/testsuite/ChangeLog: * gdb.base/execl-update-breakpoints.exp: Add regular expression for optionally matching output related to libthread_db. * gdb.base/fork-print-inferior-events.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.base/fork-print-inferior-events.exp')
-rw-r--r--gdb/testsuite/gdb.base/fork-print-inferior-events.exp3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
index 10afaf6..eda0f50 100644
--- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
+++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
@@ -59,6 +59,7 @@ set detach_child_re "${reading_re}\\\[Detaching after fork from child .*\\\]\r\n
set detach_parent_re "${reading_re}\\\[Detaching after fork from parent .*\\\]\r\n"
set new_inf_re "${reading_re}\\\[New inferior $decimal \\(.*\\)\\\]\r\n"
set inf_detached_re "${reading_re}\\\[Inferior $decimal \\(.*\\) detached\\\]\r\n"
+set thread_db_re "(?:\\\[Thread debugging using .*? enabled\\\]\r\nUsing .*? library .*?\\.\r\n)?"
set expected_output [list \
"${attach_child_re}${new_inf_re}${detach_parent_re}${inf_detached_re}" \
@@ -84,7 +85,7 @@ foreach_with_prefix print_inferior_events { "on" "off" } {
set output [lindex $expected_output $i]
# Always add the "Starting program..." string so that we
# match exactly the lines we want.
- set output "Starting program: $binfile\\s*\r\n${output}${exited_normally_re}"
+ set output "Starting program: $binfile\\s*\r\n${thread_db_re}${output}${thread_db_re}${exited_normally_re}"
set i [expr $i + 1]
gdb_test "run" $output
}