diff options
author | Tom de Vries <tdevries@suse.de> | 2025-07-19 17:08:44 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-07-19 17:08:44 +0200 |
commit | 2f108d5e69bfc4deb3bcb40798ebb278d292c2fe (patch) | |
tree | 8c8194d9aed8cd0d51ee635e59f6633e72164cd0 | |
parent | 6ca57d1619172ff388bcd96341c999caebdfe344 (diff) | |
download | binutils-2f108d5e69bfc4deb3bcb40798ebb278d292c2fe.zip binutils-2f108d5e69bfc4deb3bcb40798ebb278d292c2fe.tar.gz binutils-2f108d5e69bfc4deb3bcb40798ebb278d292c2fe.tar.bz2 |
[gdb/testsuite] Restructure gdb.base/backtrace-through-cu-nodebug.exp
I noticed that the test names in test-case
gdb.base/backtrace-through-cu-nodebug.exp are a bit inconsistent:
...
PASS: $exp: no-cfi: maint frame-unwinder disable ARCH
PASS: $exp: verify no-filters unwind fail without CFI
PASS: $exp: maint flush register-cache
PASS: $exp: verify unwind fail without CFI
PASS: $exp: cfi: maint frame-unwinder disable ARCH
PASS: $exp: Verify unwinding works based only on CFI information
...
There's both a no-cfi prefix, and "without CFI".
Fix this by using proc_with_prefix, getting us a consistent prefix:
...
PASS: $exp: no-cfi: maint frame-unwinder disable ARCH
PASS: $exp: no-cfi: verify no-filters unwind fail
PASS: $exp: no-cfi: maint flush register-cache
PASS: $exp: no-cfi: verify unwind fail
PASS: $exp: cfi: maint frame-unwinder disable ARCH
PASS: $exp: cfi: Verify unwinding works
...
While we're at it, use multi_line to make a regexp more readable.
Tested on aarch64-linux.
Reviewed-By: Keith Seitz <keiths@redhat.com>
-rw-r--r-- | gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp b/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp index 36a9d10..fce6d67 100644 --- a/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp +++ b/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp @@ -31,7 +31,7 @@ proc prepare_test {has_cfi} { "${objcallerfile}" \ object [list {additional_flags=-fomit-frame-pointer \ -funwind-tables -fasynchronous-unwind-tables}]] != "" } { - untested "couldn't compile with cfi" + untested "couldn't compile" return false } } else { @@ -41,7 +41,7 @@ proc prepare_test {has_cfi} { object [list {additional_flags=-fomit-frame-pointer \ -fno-unwind-tables \ -fno-asynchronous-unwind-tables}]] != "" } { - untested "couldn't compile without cfi" + untested "couldn't compile" return false } } @@ -54,15 +54,12 @@ proc prepare_test {has_cfi} { clean_restart "$binfile-${extension}" - with_test_prefix "${extension}" { - - if ![runto callback] then { - fail "has_cfi=$has_cfi: Can't run to callback" - return false - } - gdb_test_no_output "maint frame-unwinder disable ARCH" - return true + if ![runto callback] then { + fail "has_cfi=$has_cfi: Can't run to callback" + return false } + gdb_test_no_output "maint frame-unwinder disable ARCH" + return true } if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" \ @@ -72,7 +69,11 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" \ return } -if { [prepare_test false] } { +proc_with_prefix no-cfi {} { + if { ![prepare_test false] } { + return + } + set re_msg \ [string_list_to_regexp \ "Required frame unwinder may have been disabled," \ @@ -85,7 +86,7 @@ if { [prepare_test false] } { $re_msg] gdb_test "bt -no-filters" \ $re_bt_no_filters \ - "verify no-filters unwind fail without CFI" + "verify no-filters unwind fail" # Flush frame cache to retrigger the message. gdb_test "maint flush register-cache" \ @@ -99,10 +100,14 @@ if { [prepare_test false] } { $re_bt_line] gdb_test "bt" \ "($re_bt|$re_bt_no_filters)" \ - "verify unwind fail without CFI" + "verify unwind fail" } -if { [prepare_test true] } { +proc_with_prefix cfi {} { + if { ![prepare_test true] } { + return + } + if { [istarget "arm*-*-*"] } { setup_kfail backtrace/31950 *-*-* } @@ -111,6 +116,12 @@ if { [prepare_test true] } { # #1 0x00000000004004e9 in caller () # #2 0x00000000004004cd in main () at ... gdb_test "bt" \ - "#0 +callback $text\r\n#1 $text in caller $text\r\n#2 $text in main $text" \ - "Verify unwinding works based only on CFI information" + [multi_line \ + "#0 +callback $text" \ + "#1 $text in caller $text" \ + "#2 $text in main $text"] \ + "Verify unwinding works" } + +no-cfi +cfi |