aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-02-01 19:39:04 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-02-01 19:39:04 +0000
commit8a92335bfca80cc9b4cd217505ea0dcbfdefbf07 (patch)
tree1a2727b6fdead4c6894d9cdefc072b0d04fcd1bc /gdb/testsuite
parent17f2157dcc39cd6c5786ba70dd130e858728f1ac (diff)
downloadgdb-8a92335bfca80cc9b4cd217505ea0dcbfdefbf07.zip
gdb-8a92335bfca80cc9b4cd217505ea0dcbfdefbf07.tar.gz
gdb-8a92335bfca80cc9b4cd217505ea0dcbfdefbf07.tar.bz2
gdb/
* elfread.c (elf_symfile_read): Limit separate debug info additions to files with no separate debug info. * objfiles.c (add_separate_debug_objfile): Add gdb_assert calls. * symfile.c (read_symbols): Call find_separate_debug_file_in_section only for files with no separate debug info. gdb/testsuite/ * gdb.base/gnu-debugdata.exp): Create ${binfile}.debug, ${binfile}.mini_debuginfo-debuglink, add -k to xz, use now ${binfile}.mini_debuginfo-debuglink and ${binfile}.mini_debuginfo-debuglink.xz.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.base/gnu-debugdata.exp22
2 files changed, 26 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 47fed77..8fc13fe 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2013-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.base/gnu-debugdata.exp): Create ${binfile}.debug,
+ ${binfile}.mini_debuginfo-debuglink, add -k to xz, use now
+ ${binfile}.mini_debuginfo-debuglink and
+ ${binfile}.mini_debuginfo-debuglink.xz.
+
2013-02-01 Tom Tromey <tromey@redhat.com>
* gdb.dwarf2/method-ptr.exp: Use correct form for non-string
diff --git a/gdb/testsuite/gdb.base/gnu-debugdata.exp b/gdb/testsuite/gdb.base/gnu-debugdata.exp
index f34e4e8..55aa3c6 100644
--- a/gdb/testsuite/gdb.base/gnu-debugdata.exp
+++ b/gdb/testsuite/gdb.base/gnu-debugdata.exp
@@ -127,14 +127,30 @@ if {[run "strip" [transform strip] \
return -1
}
+# Separate full debug info into ${binfile}.debug.
+remote_file host delete ${binfile}.debug
+if {[run "copydebug" [transform objcopy] \
+ "--only-keep-debug ${binfile} ${binfile}.debug"]} {
+ return -1
+}
+
+# Add the .gnu_debuglink section to the .gnu_debugdata file.
+# .gnu_debuglink is normally not present in the .gnu_debugdata section but in
+# some files there may be PT_NOTE with NT_GNU_BUILD_ID and GDB could look up
+# the .debug file from it.
+if {[run "addlink" [transform objcopy] \
+ "--add-gnu-debuglink=${binfile}.debug ${binfile}.mini_debuginfo ${binfile}.mini_debuginfo-debuglink"]} {
+ return -1
+}
+
# Inject the compressed data into the .gnu_debugdata section of the
# original binary.
-remote_file host delete ${binfile}.mini_debuginfo.xz
-if {[run "xz" "xz" "${binfile}.mini_debuginfo"]} {
+remote_file host delete ${binfile}.mini_debuginfo-debuglink.xz
+if {[run "xz" "xz" "-k ${binfile}.mini_debuginfo-debuglink"]} {
return -1
}
remote_file host delete ${binfile}.test
-if {[run "objcopy 2" [transform objcopy] "--add-section .gnu_debugdata=${binfile}.mini_debuginfo.xz ${binfile}.strip ${binfile}.test"]} {
+if {[run "objcopy 2" [transform objcopy] "--add-section .gnu_debugdata=${binfile}.mini_debuginfo-debuglink.xz ${binfile}.strip ${binfile}.test"]} {
return -1
}