[gdb/testsuite] Fix gdb.base/consecutive.exp with gcc-8
When running test-case gdb.base/consecutive.exp with gcc-8 instead of gcc-7,
we get:
...
(gdb) step^M
^M
-Breakpoint 3, 0x00000000004004b1 in foo () at consecutive.c:10^M
+Breakpoint 3, foo () at consecutive.c:10^M
10 return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6];^M
-(gdb) PASS: gdb.base/consecutive.exp: stopped at bp, 2nd instr
+(gdb) FAIL: gdb.base/consecutive.exp: stopped at bp, 2nd instr
...
This is due to the fact that gcc-8 generates more precise line info, making
the breakpoint address a "recommended breakpoint location", and consequently
gdb doesn't print the address prefix anymore.
Fix the FAIL by checking in the test-case whether the breakpoint address is at
"recommended breakpoint location" or not.
gdb/testsuite/ChangeLog:
2020-05-06 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (is_stmt_addresses, hex_in_list): New proc, factored out
of ...
* gdb.base/async.exp: ... here.
* gdb.base/consecutive.exp: Handle if 2nd breakpoint is at a
"recommended breakpoint location".