[v2,2/2] gdb/testsuite: reduce gdb.threads/threadcrash.exp reliance on libc symbols

Message ID 20240213110924.123394-4-blarsen@redhat.com
State New
Headers
Series Fixes to gdb.threads/threadcrash.exp |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Testing failed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Testing failed

Commit Message

Guinevere Larsen Feb. 13, 2024, 11:09 a.m. UTC
  The test gdb.threads/threadcrash.exp demanded GDB to fully unwind and
print the names of all functions. However, some of the functions are
from the libc library, and so the test implicitly demanded libc symbols
to be available, and would fail otherwise, as was raised in PR
gdb/31293.

This commit changes it so we only explicitly check for functions that
are provided by threadcrash.c to fix that

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31293
---
 gdb/testsuite/gdb.threads/threadcrash.exp | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
index 6c638838043..3905ad6f936 100644
--- a/gdb/testsuite/gdb.threads/threadcrash.exp
+++ b/gdb/testsuite/gdb.threads/threadcrash.exp
@@ -57,26 +57,23 @@  proc thread_apply_all {} {
 		exp_continue
 	    }
 	    -re "\[^\n\]*syscall_task .location=SIGNAL_ALT_STACK\[^\n\]*" {
-		lappend test_list [multi_line ".*sleep.*" \
-					      ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \
+		lappend test_list [multi_line ".*do_syscall_task .location=SIGNAL_ALT_STACK.*" \
 					      ".*signal_handler.*" \
 					      ".*signal handler called.*" \
-					      ".*pthread_kill.*" \
+					      ".*" \
 					      ".*thread_function.*"]
 		exp_continue
 	    }
 	    -re "\[^\n\]*syscall_task .location=SIGNAL_HANDLER\[^\n\]*" {
-		lappend test_list [multi_line ".*sleep.*" \
-					      ".*do_syscall_task .location=SIGNAL_HANDLER.*" \
+		lappend test_list [multi_line ".*do_syscall_task .location=SIGNAL_HANDLER.*" \
 					      ".*signal_handler.*" \
 					      ".*signal handler called.*" \
-					      ".*pthread_kill.*" \
+					      ".*" \
 					      ".*thread_function.*"]
 		exp_continue
 	    }
 	    -re "\[^\n\]*syscall_task .location=NORMAL\[^\n\]*" {
-		lappend test_list [multi_line ".*sleep.*" \
-					      ".*do_syscall_task .location=NORMAL.*" \
+		lappend test_list [multi_line ".*do_syscall_task .location=NORMAL.*" \
 					      ".*thread_function.*"]
 		exp_continue
 	    }
@@ -84,7 +81,7 @@  proc thread_apply_all {} {
 		lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \
 					      ".*signal_handler.*" \
 					      ".*signal handler called.*" \
-					      ".*pthread_kill.*" \
+					      ".*" \
 					      ".*thread_function.*"]
 		exp_continue
 	    }
@@ -92,7 +89,7 @@  proc thread_apply_all {} {
 		lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_HANDLER.*" \
 					      ".*signal_handler.*" \
 					      ".*signal handler called.*" \
-					      ".*pthread_kill.*" \
+					      ".*" \
 					      ".*thread_function.*"]
 		exp_continue
 	    }