From: Tom de Vries Date: Fri, 1 May 2020 15:57:56 +0000 (+0200) Subject: [gdb/testsuite] Fix gdb.ada/operator_bp.exp breakpoint location FAILs X-Git-Tag: binutils-2_35~894 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=693196cba23b888d7014a3533b132b756e8d4e79;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix gdb.ada/operator_bp.exp breakpoint location FAILs When running test-case gdb.ada/operator_bp.exp with gcc-10, I run into: ... FAIL: gdb.ada/operator_bp.exp: break "+" FAIL: gdb.ada/operator_bp.exp: break "-" FAIL: gdb.ada/operator_bp.exp: break "<" FAIL: gdb.ada/operator_bp.exp: break "<=" FAIL: gdb.ada/operator_bp.exp: break ">" FAIL: gdb.ada/operator_bp.exp: break ">=" FAIL: gdb.ada/operator_bp.exp: break "=" FAIL: gdb.ada/operator_bp.exp: break "and" FAIL: gdb.ada/operator_bp.exp: break "or" FAIL: gdb.ada/operator_bp.exp: break "xor" FAIL: gdb.ada/operator_bp.exp: break "not" ... The first FAIL is because two breakpoint locations are expected, but there are more than 2: ... (gdb) break "+" Breakpoint 2 at 0x402c3c: "+". (6 locations) (gdb) info break Num Type Disp Enb Address What 2 breakpoint keep y 2.1 y 0x0000000000402c3c in ops."+" at operator_bp/ops.adb:25 2.2 y 0x0000000000402e5b in ops."+" at operator_bp/ops.adb:119 2.3 y 0x0000000000414207 in system.storage_elements."+" at s-stoele.adb:82 2.4 y 0x0000000000414404 in system.storage_elements."+" at s-stoele.adb:87 2.5 y 0x0000000000414413 in system.storage_elements."+" at s-stoele.adb:87 2.6 y 0x0000000000414430 in system.storage_elements."+" at s-stoele.adb:81 ... This can be traced back to a extra debug info in the executable: ... $ readelf -w ops_test | grep system__storage_elements__Oadd <28104> DW_AT_name : system__storage_elements__Oadd__2 <2812e> DW_AT_name : system__storage_elements__Oadd ... Fix the FAILs by allowing more than the required amount of breakpoint locations. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-05-01 Tom de Vries * gdb.ada/operator_bp.exp: Allow more than required amount of breakpoint. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 210499af06d..737caffa0ea 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-05-01 Tom de Vries + + * gdb.ada/operator_bp.exp: Allow more than required amount of + breakpoint. + 2020-05-01 Tom de Vries * gdb.reverse/until-reverse.c (main): Fix Wunused-result warning. diff --git a/gdb/testsuite/gdb.ada/operator_bp.exp b/gdb/testsuite/gdb.ada/operator_bp.exp index 283d76a37f1..c882c94f12e 100644 --- a/gdb/testsuite/gdb.ada/operator_bp.exp +++ b/gdb/testsuite/gdb.ada/operator_bp.exp @@ -33,16 +33,22 @@ runto "ops_test.adb:$bp_location" # Set breakpoints for all operators, using just the operator name in quotes. +set bp_re "Breakpoint $decimal at $hex" foreach op { "+" "-" } { set op_re [string_to_regexp $op] - gdb_test "break \"$op\"" \ - "Breakpoint $decimal at $hex: \"$op_re\"\. \\(2 locations\\)" + gdb_test "break \"$op\"" "$bp_re: \"$op_re\"\. \\($decimal locations\\).*" } foreach op { "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} { set op_re [string_to_regexp $op] - gdb_test "break \"$op\"" \ - "Breakpoint $decimal at $hex: file .*ops.adb, line $decimal." + gdb_test_multiple "break \"$op\"" "" { + -re -wrap "$bp_re: file .*ops.adb, line $decimal." { + pass $gdb_test_name + } + -re -wrap "$bp_re: \"$op_re\"\. \\($decimal locations\\).*" { + pass $gdb_test_name + } + } } # Make sure we stop correctly in each operator function.