This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Make fission-{base,reread}.exp pass with cc-with-tweaks.sh -i
- From: dje at google dot com
- To: gdb-patches at sourceware dot org
- Date: Tue, 11 Sep 2012 09:45:48 -0700
- Subject: [commit] Make fission-{base,reread}.exp pass with cc-with-tweaks.sh -i
Hi.
I noticed these two tests failing with cc-with-tweaks.sh -i.
Dwarf Error: CU at offset 0x102 references unknown DWO with ID 0000000000000000 [in module /build/gdb/testsuite/gdb.dwarf2/fission-base]
The test sets debug-file-directory, but cc-with-tweaks.sh doesn't.
This patch tweaks dwo_name so that setting debug-file-directory
is unnecessary.
Committed.
2012-09-11 Doug Evans <dje@google.com>
* gdb.dwarf2/fission-base.S: Include gdb.dwarf2/ in dwo_name.
* gdb.dwarf2/fission-reread.S: Ditto.
* gdb.dwarf2/fission-base.exp: Remove setting of debug-file-directory.
* gdb.dwarf2/fission-reread.exp: Ditto.
Index: gdb.dwarf2/fission-base.S
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/fission-base.S,v
retrieving revision 1.1
diff -u -p -r1.1 fission-base.S
--- gdb.dwarf2/fission-base.S 28 Jun 2012 01:10:38 -0000 1.1
+++ gdb.dwarf2/fission-base.S 11 Sep 2012 16:39:24 -0000
@@ -85,8 +85,8 @@ main:
.uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
.ascii "GNU C 4.6.x-fission\0" # DW_AT_producer
.byte 0x1 # DW_AT_language
- .ascii "fission-base.c\0" # DW_AT_name
- .ascii "/tmp/src/gdb/testsuite/gdb.dwarf2\0" # DW_AT_comp_dir
+ .ascii "gdb.dwarf2/fission-base.c\0" # DW_AT_name
+ .ascii "/tmp/src/gdb/testsuite\0" # DW_AT_comp_dir
.byte 0 # DW_AT_GNU_dwo_id
.byte 0
.byte 0
@@ -142,10 +142,13 @@ main:
.8byte .Ltext0 # DW_AT_low_pc
.8byte .Letext0-.Ltext0 # DW_AT_high_pc
.4byte .Ldebug_line0 # DW_AT_stmt_list
- .ascii "/tmp/src/gdb/testsuite/gdb.dwarf2\0" # DW_AT_comp_dir
+ .ascii "/tmp/src/gdb/testsuite\0" # DW_AT_comp_dir
# Normally dwo_name would be "fission-base.dwo".
# Simplification: Leave the DWO contents in the executable.
- .ascii "fission-base\0" # DW_AT_GNU_dwo_name
+ # "gdb.dwarf2/" is included so that gdb can load the file without
+ # having to set "debug-file-directory". This is useful when
+ # testing with cc-with-tweaks.sh -i.
+ .ascii "gdb.dwarf2/fission-base\0" # DW_AT_GNU_dwo_name
.4byte .Ldebug_pubnames0 # DW_AT_GNU_pubnames
.4byte .Ldebug_pubtypes0 # DW_AT_GNU_pubtypes
.4byte .Ldebug_addr0_begin # DW_AT_GNU_addr_base
Index: gdb.dwarf2/fission-base.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/fission-base.exp,v
retrieving revision 1.1
diff -u -p -r1.1 fission-base.exp
--- gdb.dwarf2/fission-base.exp 28 Jun 2012 01:10:38 -0000 1.1
+++ gdb.dwarf2/fission-base.exp 11 Sep 2012 16:39:24 -0000
@@ -29,20 +29,10 @@ set basename "fission-base"
standard_testfile .S
-# IWBN to use prepare_for_testing here, but we need to set debug-file-directory
-# before we load the binary.
-
-if { [build_executable "$testfile.exp" "$testfile" "$srcfile" {nodebug}] } {
+if { [prepare_for_testing "$testfile.exp" "$testfile" "$srcfile" {nodebug}] } {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-# Set debug-file-directory so we find the dwo file.
-gdb_test_no_output "set debug-file-directory $subdir"
-gdb_load [standard_output_file $testfile]
-
if ![runto_main] {
return -1
}
Index: gdb.dwarf2/fission-reread.S
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/fission-reread.S,v
retrieving revision 1.5
diff -u -p -r1.5 fission-reread.S
--- gdb.dwarf2/fission-reread.S 30 Jul 2012 16:56:04 -0000 1.5
+++ gdb.dwarf2/fission-reread.S 11 Sep 2012 16:39:24 -0000
@@ -133,10 +133,13 @@ main:
.byte 0x90
.4byte 0 /* Offset to Type DIE */
.uleb128 0x2 /* (DIE (0) DW_TAG_type_unit) */
- .ascii "/tmp/src/gdb/testsuite/gdb.dwarf2\0" /* DW_AT_comp_dir */
- /* Normally dwo_name would be "fission-reread.dwo". */
- /* Simplification: Leave the DWO contents in the executable. */
- .ascii "fission-reread\0" /* DW_AT_GNU_dwo_name */
+ .ascii "/tmp/src/gdb/testsuite\0" /* DW_AT_comp_dir */
+ /* Normally dwo_name would be "fission-reread.dwo".
+ Simplification: Leave the DWO contents in the executable.
+ "gdb.dwarf2/" is included so that gdb can load the file without
+ having to set "debug-file-directory". This is useful when
+ testing with cc-with-tweaks.sh -i. */
+ .ascii "gdb.dwarf2/fission-reread\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 */
@@ -151,8 +154,8 @@ main:
.uleb128 0x5 /* (DIE (0xb) DW_TAG_compile_unit) */
.ascii "GNU C++ 4.6.x-fission\0" /* DW_AT_producer */
.byte 0x4 /* DW_AT_language */
- .ascii "fission-reread.cc\0" /* DW_AT_name */
- .ascii "/tmp/src/gdb/testsuite/gdb.dwarf2\0" /* DW_AT_comp_dir */
+ .ascii "gdb.dwarf2/fission-reread.cc\0" /* DW_AT_name */
+ .ascii "/tmp/src/gdb/testsuite\0" /* DW_AT_comp_dir */
.byte 0 /* DW_AT_GNU_dwo_id */
.byte 0
.byte 0
@@ -206,10 +209,13 @@ main:
.4byte .Ltext0 /* DW_AT_low_pc */
.4byte .Letext0-.Ltext0 /* DW_AT_high_pc */
.4byte .Ldebug_line0 /* DW_AT_stmt_list */
- .ascii "/tmp/src/gdb/testsuite/gdb.dwarf2\0" /* DW_AT_comp_dir */
- /* Normally dwo_name would be "fission-reread.dwo". */
- /* Simplification: Leave the DWO contents in the executable. */
- .ascii "fission-reread\0" /* DW_AT_GNU_dwo_name */
+ .ascii "/tmp/src/gdb/testsuite\0" /* DW_AT_comp_dir */
+ /* Normally dwo_name would be "fission-reread.dwo".
+ Simplification: Leave the DWO contents in the executable.
+ "gdb.dwarf2/" is included so that gdb can load the file without
+ having to set "debug-file-directory". This is useful when
+ testing with cc-with-tweaks.sh -i. */
+ .ascii "gdb.dwarf2/fission-reread\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 */
Index: gdb.dwarf2/fission-reread.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/fission-reread.exp,v
retrieving revision 1.1
diff -u -p -r1.1 fission-reread.exp
--- gdb.dwarf2/fission-reread.exp 1 Jul 2012 02:05:13 -0000 1.1
+++ gdb.dwarf2/fission-reread.exp 11 Sep 2012 16:39:24 -0000
@@ -24,20 +24,10 @@ set basename "fission-reread"
standard_testfile .S
-# IWBN to use prepare_for_testing here, but we need to set debug-file-directory
-# before we load the binary.
-
-if { [build_executable "$testfile.exp" "$testfile" "$srcfile" {nodebug}] } {
+if { [prepare_for_testing "$testfile.exp" "$testfile" "$srcfile" {nodebug}] } {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-# Set debug-file-directory so we find the dwo file.
-gdb_test_no_output "set debug-file-directory $subdir"
-gdb_load [standard_output_file $testfile]
-
gdb_test "break main" "Breakpoint.*at.*"
# If we get this far gdb didn't crash, nor did an error occur.