public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/testsuite: Reduce indentation in gdb.threads/threadcrash.exp
@ 2024-03-11 9:56 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2024-03-11 9:56 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=85041a8d518b4e0625b2bb1d007838dfd5cbe421
commit 85041a8d518b4e0625b2bb1d007838dfd5cbe421
Author: Tom de Vries <tdevries@suse.de>
Date: Mon Mar 11 10:57:31 2024 +0100
gdb/testsuite: Reduce indentation in gdb.threads/threadcrash.exp
In test-case gdb.threads/threadcrash.exp we have an unnecessarily indented
gdb_test_multiple:
...
gdb_test_multiple "thread apply all backtrace" \
"Get thread information" -lbl {
-re "#\[0-9\]+\\\?\\\?\[^\n\]*" {
...
Fix this by moving the command into a variable, allowing the
"gdb_test_multiple ... {" to fit on a single 80 chars line.
Tested on arm-linux and x86_64-linux.
Diff:
---
gdb/testsuite/gdb.threads/threadcrash.exp | 116 +++++++++++++++---------------
1 file changed, 58 insertions(+), 58 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
index 996e020d1e8..3d269ec88c5 100644
--- a/gdb/testsuite/gdb.threads/threadcrash.exp
+++ b/gdb/testsuite/gdb.threads/threadcrash.exp
@@ -53,64 +53,64 @@ proc thread_apply_all {} {
set unwind_fail false
- gdb_test_multiple "thread apply all backtrace" \
- "Get thread information" -lbl {
- -re "#\[0-9\]+\\\?\\\?\[^\n\]*" {
- set unwind_fail true
- exp_continue
- }
- -re "\[^\n\]*syscall_task .location=SIGNAL_ALT_STACK\[^\n\]*" {
- lappend test_list [multi_line ".*sleep.*" \
- ".*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.*" \
- ".*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.*" \
- ".*thread_function.*"]
- exp_continue
- }
- -re "\[^\n\]*spin_task .location=SIGNAL_ALT_STACK\[^\n\]*" {
- lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \
- ".*signal_handler.*" \
- ".*signal handler called.*" \
- ".*pthread_kill.*" \
- ".*thread_function.*"]
- exp_continue
- }
- -re "\[^\n\]*spin_task .location=SIGNAL_HANDLER\[^\n\]*" {
- lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_HANDLER.*" \
- ".*signal_handler.*" \
- ".*signal handler called.*" \
- ".*pthread_kill.*" \
- ".*thread_function.*"]
- exp_continue
- }
- -re "\[^\n\]*spin_task .location=NORMAL\[^\n\]*" {
- lappend test_list [multi_line ".*do_spin_task .location=NORMAL..*" \
- ".*thread_function.*"]
- exp_continue
- }
- -re "\[^\n\]*main\[^\n\]*" {
- lappend test_list ".*main.*"
- exp_continue
- }
- -re "$::gdb_prompt " {
- pass $gdb_test_name
- }
+ set cmd "thread apply all backtrace"
+ gdb_test_multiple $cmd "Get thread information" -lbl {
+ -re "#\[0-9\]+\\\?\\\?\[^\n\]*" {
+ set unwind_fail true
+ exp_continue
+ }
+ -re "\[^\n\]*syscall_task .location=SIGNAL_ALT_STACK\[^\n\]*" {
+ lappend test_list [multi_line ".*sleep.*" \
+ ".*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.*" \
+ ".*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.*" \
+ ".*thread_function.*"]
+ exp_continue
+ }
+ -re "\[^\n\]*spin_task .location=SIGNAL_ALT_STACK\[^\n\]*" {
+ lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_ALT_STACK.*" \
+ ".*signal_handler.*" \
+ ".*signal handler called.*" \
+ ".*pthread_kill.*" \
+ ".*thread_function.*"]
+ exp_continue
+ }
+ -re "\[^\n\]*spin_task .location=SIGNAL_HANDLER\[^\n\]*" {
+ lappend test_list [multi_line ".*do_spin_task .location=SIGNAL_HANDLER.*" \
+ ".*signal_handler.*" \
+ ".*signal handler called.*" \
+ ".*pthread_kill.*" \
+ ".*thread_function.*"]
+ exp_continue
+ }
+ -re "\[^\n\]*spin_task .location=NORMAL\[^\n\]*" {
+ lappend test_list [multi_line ".*do_spin_task .location=NORMAL..*" \
+ ".*thread_function.*"]
+ exp_continue
+ }
+ -re "\[^\n\]*main\[^\n\]*" {
+ lappend test_list ".*main.*"
+ exp_continue
+ }
+ -re "$::gdb_prompt " {
+ pass $gdb_test_name
+ }
}
gdb_assert {$unwind_fail == false}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-11 9:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-11 9:56 [binutils-gdb] gdb/testsuite: Reduce indentation in gdb.threads/threadcrash.exp Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).