aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dwp-symlink.exp')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dwp-symlink.exp20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp
index ad0522b..a0daae4 100644
--- a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp
@@ -75,3 +75,23 @@ gdb_test "ptype main" {type = int \(\)} "binary default, dwp at symlink"
clean_restart "$thelink"
gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary symlink, dwp at symlink"
+
+# Verify we can still find the dwp if we change directories and we specified
+# a relative path for the program.
+
+set saved_pwd [pwd]
+
+# This is clean_restart, but specifying a relative path to the binary.
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_test "cd [file dirname [standard_output_file ${thelink}]]" \
+ "Working directory .*"
+gdb_load "./${thelink}"
+
+gdb_test "cd .." "Working directory .*"
+
+gdb_test "ptype main" {type = int \(int, char \*\*\)} \
+ "relative path, binary symlink, dwp at symlink"
+
+cd $saved_pwd