Commit | Line | Data |
---|---|---|
82bf32bc JK |
1 | # Copyright 2013 Free Software Foundation, Inc. |
2 | ||
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | ||
16 | standard_testfile | |
17 | ||
18 | if [is_remote host] { | |
19 | untested "remote host" | |
20 | return 0 | |
21 | } | |
22 | ||
23 | file delete [standard_output_file ${testfile}.dwp] | |
24 | if [file exists [standard_output_file ${testfile}.dwp]] { | |
25 | unsupported "dwp file cannot be deleted" | |
26 | return 0 | |
27 | } | |
28 | if { [build_executable ${testfile}.exp ${testfile} ${srcfile}] == -1 } { | |
29 | return -1 | |
30 | } | |
31 | if ![file exists [standard_output_file ${testfile}.dwp]] { | |
32 | unsupported "testsuite run does not produce dwp files" | |
33 | return 0 | |
34 | } | |
35 | ||
36 | set thelink "${testfile}-thelink" | |
37 | ||
38 | file delete [standard_output_file ${thelink}] | |
39 | file delete [standard_output_file ${thelink}.dwp] | |
40 | # file link is only Tcl 8.4+. | |
41 | exec "ln" "-sf" "${testfile}" "[standard_output_file $thelink]" | |
42 | if ![file exists [standard_output_file $thelink]] { | |
43 | unsupported "host does not support symbolic links (binary symlink is missing)" | |
44 | return 0 | |
45 | } | |
46 | if [file exists [standard_output_file $thelink.dwp]] { | |
47 | unsupported "host does not support symbolic links (we tried to delete a file and it is still there)" | |
48 | return 0 | |
49 | } | |
50 | ||
51 | clean_restart "$testfile" | |
52 | ||
53 | gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary default, dwp default" | |
54 | ||
55 | clean_restart "$thelink" | |
56 | ||
57 | gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary symlink, dwp default" | |
58 | ||
59 | gdb_exit | |
60 | file rename [standard_output_file ${testfile}.dwp] [standard_output_file ${thelink}.dwp] | |
61 | if [file exists [standard_output_file ${testfile}.dwp]] { | |
62 | unsupported "host does not support symbolic links (binary symlink exists)" | |
63 | return 0 | |
64 | } | |
65 | if ![file exists [standard_output_file ${thelink}.dwp]] { | |
66 | unsupported "host does not support symbolic links (dwp symlink is missing)" | |
67 | return 0 | |
68 | } | |
69 | ||
70 | clean_restart "$testfile" | |
71 | ||
72 | # This case cannot work. | |
73 | gdb_test "ptype main" {type = int \(\)} "binary default, dwp at symlink" | |
74 | ||
75 | clean_restart "$thelink" | |
76 | ||
77 | gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary symlink, dwp at symlink" |