diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d058ed0b59e..f60e65703f9 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-11-04 Tom Tromey + + * gdb.base/argv0-symlink.exp: Compute executable's directory + dynamically. + 2013-11-04 Tom Tromey * gdb.asm/asm-source.exp: Use standard_output_file. diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp index cf5785c856e..e4efe19d784 100644 --- a/gdb/testsuite/gdb.base/argv0-symlink.exp +++ b/gdb/testsuite/gdb.base/argv0-symlink.exp @@ -37,7 +37,14 @@ if ![runto_main] { } gdb_test {print argv[0]} "/$filelink\"" $test -gdb_test "info inferiors" "/$subdir/$filelink *" "$test for info inferiors" + +# For a link named /PATH/TO/DIR/LINK, we want to check the output +# against "/DIR/LINK", but computed in a way that doesn't make +# assumptions about the test directory layout. +set full_filelink [standard_output_file $filelink] +set lastdir [file tail [file dirname $full_filelink]] + +gdb_test "info inferiors" "/$lastdir/$filelink *" "$test for info inferiors" set test "kept directory symbolic link name" @@ -65,4 +72,4 @@ if ![is_remote target] { setup_kfail "*-*-*" gdb/15934 } gdb_test {print argv[0]} "/$dirlink/$filelink\"" $test -gdb_test "info inferiors" "/$subdir/$filelink *" "$test for info inferiors" +gdb_test "info inferiors" "/$lastdir/$filelink *" "$test for info inferiors"