aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/sepdebug.exp
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2012-01-18 18:58:43 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2012-01-18 18:58:43 +0000
commit1db333787dc7d00ae720d8859000529224afacdc (patch)
tree5ae85a220c0b5df07c6645c7f5385c1ffac07610 /gdb/testsuite/gdb.base/sepdebug.exp
parentf83d8a90aee9d0ae60cd6c089aa19b400dbaf714 (diff)
downloadfsf-binutils-gdb-1db333787dc7d00ae720d8859000529224afacdc.zip
fsf-binutils-gdb-1db333787dc7d00ae720d8859000529224afacdc.tar.gz
fsf-binutils-gdb-1db333787dc7d00ae720d8859000529224afacdc.tar.bz2
2012-01-18 Paul Pluzhnikov <ppluzhnikov@google.com>
Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/9538 * symfile.c (find_separate_debug_file): New function. (terminate_after_last_dir_separator): Likewise. (find_separate_debug_file_by_debuglink): Also try realpath. * configure.ac (AC_CHECK_FUNCS): Add lstat. * configure: Regenerate. * config.in: Regenerate. testsuite/ChangeLog: 2012-01-18 Paul Pluzhnikov <ppluzhnikov@google.com> PR gdb/9538 * gdb.base/sepdebug.exp: New test.
Diffstat (limited to 'gdb/testsuite/gdb.base/sepdebug.exp')
-rw-r--r--gdb/testsuite/gdb.base/sepdebug.exp27
1 files changed, 22 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.base/sepdebug.exp b/gdb/testsuite/gdb.base/sepdebug.exp
index 5341bc9..ba10478 100644
--- a/gdb/testsuite/gdb.base/sepdebug.exp
+++ b/gdb/testsuite/gdb.base/sepdebug.exp
@@ -41,7 +41,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
# Note: the procedure gdb_gnu_strip_debug will produce an executable called
# ${binfile}, which is just like the executable ($binfile) but without
-# the debuginfo. Instead $binfile has a .gnudebuglink section which contains
+# the debuginfo. Instead $binfile has a .gnu_debuglink section which contains
# the name of a debuginfo only file. This file will be stored in the
# gdb.base/ subdirectory.
@@ -51,10 +51,27 @@ if [gdb_gnu_strip_debug $binfile] {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+#
+# PR gdb/9538. Verify that symlinked executable still finds the separate
+# debuginfo.
+#
+set old_subdir ${subdir}
+set subdir ${subdir}/pr9538
+
+# Cleanup any stale state.
+remote_exec build "rm -rf ${subdir}"
+
+remote_exec build "mkdir ${subdir}"
+remote_exec build "ln -s ${binfile} ${subdir}"
+clean_restart ${testfile}${EXEEXT}
+if { $gdb_file_cmd_debug_info != "debug" } then {
+ fail "No debug information found."
+}
+
+# Restore subdir
+set subdir ${old_subdir}
+
+clean_restart ${testfile}${EXEEXT}
if { $gdb_file_cmd_debug_info != "debug" } then {
fail "No debug information found."
}