diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-09-28 13:22:53 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-09-28 19:30:41 -0400 |
commit | 4872f9a1b553445165dc49eaa091ca8400c130a0 (patch) | |
tree | da1319594fcdbe7a0b9b8a22b7a2a5e5cfa86b3c | |
parent | 3a6a0158ee07ba2f960ae4a898897460382dc5ec (diff) | |
download | gdb-4872f9a1b553445165dc49eaa091ca8400c130a0.zip gdb-4872f9a1b553445165dc49eaa091ca8400c130a0.tar.gz gdb-4872f9a1b553445165dc49eaa091ca8400c130a0.tar.bz2 |
gdb.base/foll-fork.exp: accept "info breakpoints" output in any order
The test currently requires the "inf 1" breakpoint to be before the "inf
2" breakpoint. This is not always the case:
info breakpoints 2
Num Type Disp Enb Address What
2 breakpoint keep y <MULTIPLE>
2.1 y 0x0000555555554730 in callee at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/foll-fork.c:9 inf 2
2.2 y 0x0000555555554730 in callee at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/foll-fork.c:9 inf 1
(gdb) FAIL: gdb.base/foll-fork.exp: follow-fork-mode=parent: detach-on-fork=off: cmd=next 2: test_follow_fork: info breakpoints
Since add_location_to_breakpoint uses only the address as a criterion to
sort locations, the order of locations at the same address is not
stable: it will depend on the insertion order. Here, the insertion
order comes from the order of SALs when creating the breakpoint, which
can vary from machine to machine. While it would be more user-friendly
to have a more stable order for printed breakpoint locations, it doesn't
really matter for this test, and it would be hard to define an order
that will be the same everywhere, all the time.
So, loosen the regexp to accept "inf 1" and "inf 2" in any order.
Co-Authored-By: Pedro Alves <pedro@palves.net>
Change-Id: I5ada2e0c6ad0669e0d161bfb6b767229c0970d16
-rw-r--r-- | gdb/testsuite/gdb.base/foll-fork.exp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp index 7f9e1cf..d6d32f6 100644 --- a/gdb/testsuite/gdb.base/foll-fork.exp +++ b/gdb/testsuite/gdb.base/foll-fork.exp @@ -193,10 +193,17 @@ proc_with_prefix test_follow_fork { follow-fork-mode detach-on-fork cmd } { pass $gdb_test_name } } + + set any {[^\r\n]+} + + set loc1_inf1 "$bpnum\\.1 $any inf 1" + set loc1_inf2 "$bpnum\\.1 $any inf 2" + + set loc2_inf1 "$bpnum\\.2 $any inf 1" + set loc2_inf2 "$bpnum\\.2 $any inf 2" + gdb_test "info breakpoints $bpnum" \ - [multi_line \ - "$bpnum\\.1 .* inf 1" \ - "$bpnum\\.2 .* inf 2"] \ + "($loc1_inf1\r\n$loc2_inf2|$loc1_inf2\r\n$loc2_inf1)" \ "info breakpoints" } } |