diff --git a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp index 46622c85086..cdf196859f8 100644 --- a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp +++ b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp @@ -45,11 +45,13 @@ if [remote_file host exists [standard_output_file $thelink.dwp]] { clean_restart "$testfile" -gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary default, dwp default" +set main_type_re [string_to_regexp "type = int (int, char **)"] + +gdb_test "ptype main" $main_type_re "binary default, dwp default" clean_restart "$thelink" -gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary symlink, dwp default" +gdb_test "ptype main" $main_type_re "binary symlink, dwp default" gdb_exit remote_exec host "mv -f [standard_output_file ${testfile}.dwp] [standard_output_file ${thelink}.dwp]" @@ -64,12 +66,13 @@ if ![remote_file host exists [standard_output_file ${thelink}.dwp]] { clean_restart "$testfile" -# This case cannot work. -gdb_test "ptype main" {type = int \(\)} "binary default, dwp at symlink" +gdb_test "ptype main" \ + "Could not find DWO CU .*" \ + "binary default, dwp at symlink" clean_restart "$thelink" -gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary symlink, dwp at symlink" +gdb_test "ptype main" $main_type_re "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. @@ -77,7 +80,9 @@ gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary symlink, dwp at sy # This is clean_restart, but specifying a relative path to the binary. clean_restart gdb_test "cd [file dirname [standard_output_file ${thelink}]]" \ - "Working directory .*" + "Working directory .*" \ + "cd to dir containing binary" + gdb_load "./${thelink}" gdb_test "cd .." "Working directory .*"