aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2014-02-12 11:38:48 -0800
committerDoug Evans <dje@google.com>2014-02-12 11:38:48 -0800
commit85f224e7e045553393c6297736fdf05155d2aeb9 (patch)
tree539be4a886e73a3d0ec6c41be335399c98548bb4 /gdb/testsuite/gdb.dwarf2
parent9d2d0b8b042cfb82c2ac600bff13f473a78a4c7f (diff)
downloadgdb-85f224e7e045553393c6297736fdf05155d2aeb9.zip
gdb-85f224e7e045553393c6297736fdf05155d2aeb9.tar.gz
gdb-85f224e7e045553393c6297736fdf05155d2aeb9.tar.bz2
Test for binary,dwp symlinks into different directories.
* gdb.dwarf2/Makefile.in (EXECUTABLES): Add dwp-symlink. (MISCELLANEOUS): New variable. (clean): rm -rf $(MISCELLANEOUS). * gdb.dwarf2/dwp-symlink.exp: Test the case where the executable and dwp live in the same directory as symlinks, with each symlink pointed to a differently named file in a different directory.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2')
-rw-r--r--gdb/testsuite/gdb.dwarf2/Makefile.in8
-rw-r--r--gdb/testsuite/gdb.dwarf2/dwp-symlink.exp39
2 files changed, 46 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/Makefile.in b/gdb/testsuite/gdb.dwarf2/Makefile.in
index 978cdfd..7697e8c 100644
--- a/gdb/testsuite/gdb.dwarf2/Makefile.in
+++ b/gdb/testsuite/gdb.dwarf2/Makefile.in
@@ -21,7 +21,12 @@ VPATH = @srcdir@
srcdir = @srcdir@
EXECUTABLES = *.x pr10770 dw2-cp-infcall-ref-static dw2-inline-param \
- dw2-noloc dw2-ranges dw2-ref-missing-frame dw2-unresolved gdb-index
+ dw2-noloc dw2-ranges dw2-ref-missing-frame dw2-unresolved gdb-index \
+ dwp-symlink
+
+MISCELLANEOUS = \
+ dwp-symlink.dwp dwp-symlink-thelink dwp-symlink-thelink.dwp \
+ dwp-dir1 dwp-dir2 dwp-dir3
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
@@ -31,6 +36,7 @@ clean mostlyclean:
-rm -f core core.coremaker coremaker.core corefile
-rm -f *.dwo *.dwp
-rm -f $(EXECUTABLES)
+ -rm -rf $(MISCELLANEOUS)
-rm -f *.gdb-index *.with-index
distclean maintainer-clean realclean: clean
diff --git a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp
index a0e1897..1b55c68 100644
--- a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp
@@ -87,5 +87,44 @@ gdb_test "cd .." "Working directory .*"
gdb_test "ptype main" {type = int \(int, char \*\*\)} \
"relative path, binary symlink, dwp at symlink"
+# Rename the dwp file back to its original name.
+remote_exec host "mv -f [standard_output_file ${thelink}.dwp] [standard_output_file ${testfile}.dwp]"
+
# N.B. At this point the active gdb is in, essentially, some random directory.
# Restart a new copy if you add more tests here.
+
+# Now verify that the following scenario works:
+# dir1/real-binary-with-random-name
+# dir2/real-dwp-with-random-name
+# dir3/symlink-to-real-binary
+# dir3/symlink-to-real-binary.dwp
+
+set dwp_bin_dir [standard_output_file dwp-dir1]
+set dwp_dwp_dir [standard_output_file dwp-dir2]
+set dwp_symlink_dir [standard_output_file dwp-dir3]
+set dwp_real_binary "dwp-abc"
+set dwp_real_dwp "dwp-def"
+set dwp_symlink_binary "dwp-symlink-binary"
+set dwp_symlink_dwp "${dwp_symlink_binary}.dwp"
+
+remote_exec host "rm -rf ${dwp_bin_dir}"
+remote_exec host "rm -rf ${dwp_dwp_dir}"
+remote_exec host "rm -rf ${dwp_symlink_dir}"
+remote_exec host "mkdir ${dwp_bin_dir}"
+remote_exec host "mkdir ${dwp_dwp_dir}"
+remote_exec host "mkdir ${dwp_symlink_dir}"
+remote_exec host "cp [standard_output_file $testfile] ${dwp_bin_dir}/${dwp_real_binary}"
+remote_exec host "cp [standard_output_file ${testfile}.dwp] ${dwp_dwp_dir}/${dwp_real_dwp}"
+# We don't test for failure to create the symlink here.
+# We assume that if the above symlinks are created ok, these will be too.
+remote_exec host "ln -sf ${dwp_bin_dir}/${dwp_real_binary} ${dwp_symlink_dir}/${dwp_symlink_binary}"
+remote_exec host "ln -sf ${dwp_dwp_dir}/${dwp_real_dwp} ${dwp_symlink_dir}/${dwp_symlink_dwp}"
+
+clean_restart "${dwp_symlink_dir}/${dwp_symlink_binary}"
+
+if ![runto_main] {
+ return -1
+}
+
+gdb_test {print argv[0]} "/${dwp_symlink_binary}\"" \
+ "separate executable/dwp symlinks"