[commit] Make fission-reread.exp work in parallel mode.
Commit Message
Hi.
This test was passing in parallel mode, but mostly accidentally.
gdb wasn't finding the DWO file.
This patch changes fission-reread.exp to do what the other
assembler-based fission tests do, which is to set debug-file-directory
before loading the file.
Regression tested on amd64-linux (with/without testsuite parallel mode),
and committed.
2014-05-15 Doug Evans <dje@google.com>
* gdb.dwarf2/fission-reread.S: Remove directory from .dwo file path.
* gdb.dwarf2/fission-reread.exp: Set debug-file-directory before
loading file. Add test for TU lookup.
@@ -134,7 +134,7 @@ main:
.4byte 0 /* Offset to Type DIE */
.uleb128 0x2 /* (DIE (0) DW_TAG_type_unit) */
.ascii "/tmp/src/gdb/testsuite\0" /* DW_AT_comp_dir */
- .ascii "gdb.dwarf2/fission-reread.dwo\0" /* DW_AT_GNU_dwo_name */
+ .ascii "fission-reread.dwo\0" /* DW_AT_GNU_dwo_name */
.4byte .Ldebug_pubnames0 /* DW_AT_GNU_pubnames */
.4byte .Ldebug_pubtypes0 /* DW_AT_GNU_pubtypes */
.4byte .Ldebug_addr0 /* DW_AT_GNU_addr_base */
@@ -205,7 +205,7 @@ main:
.4byte .Letext0-.Ltext0 /* DW_AT_high_pc */
.4byte .Ldebug_line0 /* DW_AT_stmt_list */
.ascii "/tmp/src/gdb/testsuite\0" /* DW_AT_comp_dir */
- .ascii "gdb.dwarf2/fission-reread.dwo\0" /* DW_AT_GNU_dwo_name */
+ .ascii "fission-reread.dwo\0" /* DW_AT_GNU_dwo_name */
.4byte .Ldebug_pubnames0 /* DW_AT_GNU_pubnames */
.4byte .Ldebug_pubtypes0 /* DW_AT_GNU_pubtypes */
.4byte .Ldebug_addr0 /* DW_AT_GNU_addr_base */
@@ -32,10 +32,19 @@ if [build_executable_from_fission_assembler \
return -1
}
-clean_restart ${binfile}
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+# Make sure we can find the .dwo file, regardless of whether we're
+# running in parallel mode.
+gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \
+ "set debug-file-directory"
+gdb_load $binfile
gdb_test "break main" "Breakpoint.*at.*"
+gdb_test "ptype baz" "type = class foo {.*"
+
# If we get this far gdb didn't crash, nor did an error occur.
pass $testfile