[committed][gdb/testsuite] Fix captured_command_loop breakpoint in selftests
When building gcc with CFLAGS/CXXFLAGS="-O2 -g", and running the regression
tests, I run into the following FAILs:
FAIL: gdb.gdb/complaints.exp: breakpoint in captured_command_loop
FAIL: gdb.gdb/python-interrupts.exp: breakpoint in captured_command_loop
FAIL: gdb.gdb/python-selftest.exp: breakpoint in captured_command_loop
The problem is that when setting the breakpoint at captured_command_loop:
(gdb) break captured_command_loop^M
Breakpoint 1 at 0x4230ed: captured_command_loop. (2 locations)^M
(gdb) FAIL: gdb.gdb/complaints.exp: breakpoint in captured_command_loop
there are two breakpoint locations instead of one. This is due to
PR26096 - "gdb sets breakpoint at cold clone":
$ nm gdb | grep captured_command_loop| c++filt
0000000000659f20 t captured_command_loop()
00000000004230ed t captured_command_loop() [clone .cold]
Work around this by allowing multiple breakpoint locations for
Reg-tested on x86_64-linux.
Committed to trunk.
[gdb/testsuite] Fix captured_command_loop breakpoint in selftests
- # Set a breakpoint at main
+ # Set a breakpoint at main. Allow more than one location, as
+ # workaround for PR26096 - "gdb sets breakpoint at cold clone".
gdb_test "break $function" \
- "Breakpoint.*at.* file.*, line.*" \
+ "Breakpoint.*at.* (file.*, line|locations).*" \
"breakpoint in $function"