aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp')
-rw-r--r--gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp69
1 files changed, 51 insertions, 18 deletions
diff --git a/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp b/gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp
index 53bf642..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,15 +69,45 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" \
return
}
-if { [prepare_test false] } {
- gdb_test "bt" \
+proc_with_prefix no-cfi {} {
+ if { ![prepare_test false] } {
+ return
+ }
+
+ set re_msg \
+ [string_list_to_regexp \
+ "Required frame unwinder may have been disabled," \
+ " see 'maint info frame-unwinders'"]
+ set hs {[^\r\n]}
+ set re_bt_line "#0\\s+[string_to_regexp {callback ()}] $hs+"
+ set re_bt_no_filters \
[multi_line \
- "\[^\r\n\]+Required frame unwinder may have been disabled, \[^\r\n\]+" \
- "#0\\s+callback \\(\\) \[^\r\n\]+"] \
- "verify unwind fail without CFI"
+ $re_bt_line \
+ $re_msg]
+ gdb_test "bt -no-filters" \
+ $re_bt_no_filters \
+ "verify no-filters unwind fail"
+
+ # Flush frame cache to retrigger the message.
+ gdb_test "maint flush register-cache" \
+ [string_to_regexp "Register cache flushed."]
+
+ # This output may occur when we run into the message while applying the
+ # frame filters.
+ set re_bt \
+ [multi_line \
+ $hs+$re_msg \
+ $re_bt_line]
+ gdb_test "bt" \
+ "($re_bt|$re_bt_no_filters)" \
+ "verify unwind fail"
}
-if { [prepare_test true] } {
+proc_with_prefix cfi {} {
+ if { ![prepare_test true] } {
+ return
+ }
+
if { [istarget "arm*-*-*"] } {
setup_kfail backtrace/31950 *-*-*
}
@@ -89,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