[gdb/testsuite] Fix gdb.dwarf2/dw-form-strx-out-of-bounds.exp
With test-case gdb.dwarf2/dw-form-strx-out-of-bounds.exp, I usually get:
...
(gdb) file dw-form-strx-out-of-bounds
Reading symbols from dw-form-strx-out-of-bounds...
(gdb) ptype global_var
DWARF Error: Offset from DW_FORM_GNU_str_index or DW_FORM_strx pointing \
outside of .debug_str_offsets section in CU at offset 0x2d1 [in module \
dw-form-strx-out-of-bounds]
No symbol "global_var" in current context.
(gdb) PASS: $exp: ptype global_var
...
But I just ran into:
...
(gdb) file dw-form-strx-out-of-bounds^M
Reading symbols from dw-form-strx-out-of-bounds...
DWARF Error: Offset from DW_FORM_GNU_str_index or DW_FORM_strx pointing \
outside of .debug_str_offsets section in CU at offset 0x2df [in module \
dw-form-strx-out-of-bounds]^M
(gdb) ptype global_var^M
No symbol "global_var" in current context.^M
(gdb) FAIL: $exp: ptype global_var
...
Fix this by:
- using "maint set dwarf synchronous on" to ensure that the error happens
during the file command
- updating the matching to check $gdb_file_cmd_msg
Tested gdb.dwarf2/dw-form-strx-out-of-bounds.exp and gdb.dwarf2/dw-form-strx.exp
using make-check-all.sh on x86_64-linux.
2 files changed