diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c | 18 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S | 23 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c | 18 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-disp-step-self-call.S | 23 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/backtrace-through-cu-nodebug.exp | 69 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/break-dbg.exp | 12 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/command-line-input.exp | 60 | ||||
-rw-r--r-- | gdb/testsuite/gdb.multi/pending-bp.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/i386-avx-reverse.c | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/i386-avx-reverse.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 4 |
11 files changed, 161 insertions, 78 deletions
diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c index 03b868c..0fb2904 100644 --- a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c +++ b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c @@ -16,9 +16,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <unistd.h> +#include <stdlib.h> + +extern void test_call (void); + +void +unreachable (void) +{ + abort (); +} void setup_alarm (void) { alarm (300); } + +int +main () +{ + setup_alarm (); + test_call (); + unreachable (); + return 0; +} diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S index 78a6859..20a8eb7 100644 --- a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S +++ b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S @@ -18,33 +18,12 @@ handling. */ .text - - .global main -main: - nop - - callq setup_alarm - - nop - -/***********************************************/ - -/* test call/ret */ - .global test_call test_call: call test_call - nop + call unreachable .global test_ret_end test_ret_end: nop -/***********************************************/ - -/* all done */ - -done: - mov $0,%rdi - call exit - hlt .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c b/gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c index 03b868c..0fb2904 100644 --- a/gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c +++ b/gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c @@ -16,9 +16,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <unistd.h> +#include <stdlib.h> + +extern void test_call (void); + +void +unreachable (void) +{ + abort (); +} void setup_alarm (void) { alarm (300); } + +int +main () +{ + setup_alarm (); + test_call (); + unreachable (); + return 0; +} diff --git a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.S b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.S index 466e50c..20a8eb7 100644 --- a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.S +++ b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.S @@ -18,33 +18,12 @@ handling. */ .text - - .global main -main: - nop - - call setup_alarm - - nop - -/***********************************************/ - -/* test call/ret */ - .global test_call test_call: call test_call - nop + call unreachable .global test_ret_end test_ret_end: nop -/***********************************************/ - -/* all done */ - -done: - pushl $0 - call exit - hlt .section .note.GNU-stack,"",@progbits 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 diff --git a/gdb/testsuite/gdb.base/break-dbg.exp b/gdb/testsuite/gdb.base/break-dbg.exp index 3652b8e..a7c7d92 100644 --- a/gdb/testsuite/gdb.base/break-dbg.exp +++ b/gdb/testsuite/gdb.base/break-dbg.exp @@ -46,7 +46,17 @@ gdb_test "catch load" "^Catchpoint $decimal \\(load\\)" gdb_test "catch unload" "^Catchpoint $decimal \\(unload\\)" gdb_test "catch signal" "^Catchpoint $decimal \\(standard signals\\)" -gdb_test "catch syscall" "^Catchpoint $decimal \\(any syscall\\)" + +set re_warning_xml_disabled \ + [string_to_regexp \ + [join \ + [list \ + "warning: Can not parse XML syscalls information;" \ + "XML support was disabled at compile time."]]] +gdb_test "catch syscall" \ + [multi_line \ + "^($re_warning_xml_disabled" \ + ")?Catchpoint $decimal [string_to_regexp {(any syscall)}]"] gdb_test "watch -l global_var" "\[Ww]atchpoint $decimal: -location global_var" diff --git a/gdb/testsuite/gdb.base/command-line-input.exp b/gdb/testsuite/gdb.base/command-line-input.exp index af228dc..9760f1a 100644 --- a/gdb/testsuite/gdb.base/command-line-input.exp +++ b/gdb/testsuite/gdb.base/command-line-input.exp @@ -18,19 +18,59 @@ # Test issuing a command split in multiple lines with continuation # characters. -gdb_exit -gdb_start +clean_restart -set test "print 1\\\\n + 2" -gdb_test_multiple "print 1\\\n + 2" $test { - -re "^print 1\\\\\r\n \\+ 2\r\n\\\$$decimal = 3\r\n$gdb_prompt $" { - pass $test +set bs "\\" +set re_bs [string_to_regexp $bs] +set re_dollar [string_to_regexp $] + +set re \ + [multi_line \ + ^[string_to_regexp "print 1$bs"] \ + [string_to_regexp " + 2"] \ + "$re_dollar$decimal = 3" \ + "$gdb_prompt $"] +gdb_test_multiple "print 1$bs\n + 2" "print 1$bs${bs}n + 2" { + -re $re { + pass $gdb_test_name + } +} + +set re \ + [multi_line \ + ^[string_to_regexp "print 1$bs"] \ + "2" \ + "$re_dollar$decimal = 12" \ + "$gdb_prompt $"] +gdb_test_multiple "print 1$bs\n2" "print 1$bs${bs}n2" { + -re $re { + pass $gdb_test_name } } -set test "print 1\\\\n2" -gdb_test_multiple "print 1\\\n2" $test { - -re "^print 1\\\\\r\n2\r\n\\\$$decimal = 12\r\n$gdb_prompt $" { - pass $test +with_test_prefix "cancel multiline" { + send_gdb "print$bs\n 1" + gdb_test_multiple "" "setup" { + -re "print$re_bs\r\n 1" { + pass $gdb_test_name + } + } + + send_gdb "\003" + gdb_test_multiple "" "cancel" { + -re -wrap "" { + pass $gdb_test_name + } + } + + # Regression test for PR cli/33063. + gdb_test_multiple "print 2" "command after cancel" { + -re -wrap " = 2" { + pass $gdb_test_name + } + -re -wrap "" { + # Avoid undefined command error. + fail $gdb_test_name + } } } diff --git a/gdb/testsuite/gdb.multi/pending-bp.exp b/gdb/testsuite/gdb.multi/pending-bp.exp index 1cd1cfb..2458cd7 100644 --- a/gdb/testsuite/gdb.multi/pending-bp.exp +++ b/gdb/testsuite/gdb.multi/pending-bp.exp @@ -328,5 +328,7 @@ proc_with_prefix py_test_clear_thread {} { # Run all the tests. test_no_inf_display test_pending_toggle -py_test_toggle_thread -py_test_clear_thread +if { [allow_python_tests] } { + py_test_toggle_thread + py_test_clear_thread +} diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c index a3d6427..bf6cb77 100644 --- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.c +++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.c @@ -299,10 +299,10 @@ vpbroadcast_test () asm volatile ("vbroadcastss %xmm1, %xmm0"); asm volatile ("vbroadcastss %xmm1, %ymm15"); asm volatile ("vbroadcastss %0, %%ymm0" : : "m" (global_buf0)); - asm volatile ("vbroadcastss %0, %%xmm15": : "m" (dyn_buf0)); + asm volatile ("vbroadcastss %0, %%xmm15": : "m" (*dyn_buf0)); asm volatile ("vbroadcastsd %xmm1, %ymm0"); asm volatile ("vbroadcastsd %0, %%ymm15": : "m" (global_buf0)); - asm volatile ("vbroadcastf128 %0, %%ymm0" : : "m" (dyn_buf0)); + asm volatile ("vbroadcastf128 %0, %%ymm0" : : "m" (*dyn_buf0)); /* We have a return statement to deal with epilogue in different compilers. */ diff --git a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp index 7e75542..fb04260 100644 --- a/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-avx-reverse.exp @@ -395,7 +395,7 @@ if {[record_full_function "vpbroadcast"] == true} { test_one_register "vbroadcastf128" "ymm0" \ "0x17161514131211101716151413121110, 0x17161514131211101716151413121110" test_one_register "vbroadcastsd" "ymm15" \ - "0x404060004040600040406000404060, 0x0" + "0x23222120232221202322212023222120, 0x0" test_one_register "vbroadcastsd" "ymm0" \ "0x13121110131211101312111013121110, 0x13121110131211101312111013121110" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f9039dc..8d94d6b 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -9993,6 +9993,10 @@ proc gdb_stdin_log_init { } { set logfile [standard_output_file_with_gdb_instance gdb.in] set in_file [open $logfile w] + + verbose -log "" + verbose -log "Starting logfile: $logfile" + verbose -log "" } # Write to the file for logging gdb input. |