[committed][gdb/testsuite] Fix gdb.ada/operator_bp.exp breakpoint location FAILs

Tom de Vries tdevries@suse.de
Fri May 1 15:57:33 GMT 2020


Hi,

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   <MULTIPLE>
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.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.ada/operator_bp.exp breakpoint location FAILs

gdb/testsuite/ChangeLog:

2020-05-01  Tom de Vries  <tdevries@suse.de>

	* gdb.ada/operator_bp.exp: Allow more than required amount of
	breakpoint.

---
 gdb/testsuite/gdb.ada/operator_bp.exp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

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.


More information about the Gdb-patches mailing list