OLD | NEW |
1 # Copyright 2003-2004, 2006-2012 Free Software Foundation, Inc. | 1 # Copyright 2003-2004, 2006-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # This file was written by Adam Fedor (fedor@gnu.org) | 16 # This file was written by Adam Fedor (fedor@gnu.org) |
17 | 17 |
18 if $tracelevel then { | 18 standard_testfile .m |
19 » strace $tracelevel | |
20 } | |
21 | |
22 set testfile "basicclass" | |
23 set srcfile ${testfile}.m | |
24 set binfile ${objdir}/${subdir}/${testfile} | |
25 | 19 |
26 # | 20 # |
27 # Objective-C program compilation isn't standard. We need to figure out | 21 # Objective-C program compilation isn't standard. We need to figure out |
28 # which libraries to link in. Most of the time it uses pthread | 22 # which libraries to link in. Most of the time it uses pthread |
29 # | 23 # |
30 if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [
list debug ]] != "" } { | 24 if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [
list debug ]] != "" } { |
31 return -1 | 25 return -1 |
32 } | 26 } |
33 | 27 |
34 # | 28 # |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 64 } |
71 timeout { | 65 timeout { |
72 fail "can't show language (timeout)" | 66 fail "can't show language (timeout)" |
73 return | 67 return |
74 } | 68 } |
75 } | 69 } |
76 } | 70 } |
77 | 71 |
78 proc do_objc_tests {} { | 72 proc do_objc_tests {} { |
79 global subdir | 73 global subdir |
80 global objdir | |
81 global srcdir | 74 global srcdir |
82 global binfile | 75 global binfile |
83 global gdb_prompt | 76 global gdb_prompt |
84 | 77 |
85 | 78 |
86 # Start with a fresh gdb. | 79 # Start with a fresh gdb. |
87 | 80 |
88 gdb_exit | 81 gdb_exit |
89 gdb_start | 82 gdb_start |
90 gdb_reinitialize_dir $srcdir/$subdir | 83 gdb_reinitialize_dir $srcdir/$subdir |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 # | 138 # |
146 gdb_test "print object" \ | 139 gdb_test "print object" \ |
147 "\\$\[0-9\] = .*0x0" \ | 140 "\\$\[0-9\] = .*0x0" \ |
148 " print an ivar of self" | 141 " print an ivar of self" |
149 | 142 |
150 gdb_test "print self" \ | 143 gdb_test "print self" \ |
151 "\\$\[0-9\] = \\(.*BasicClass \\*\\) 0x\[0-9a-f\]+" \ | 144 "\\$\[0-9\] = \\(.*BasicClass \\*\\) 0x\[0-9a-f\]+" \ |
152 " print self" | 145 " print self" |
153 | 146 |
154 gdb_test "print \*self" \ | 147 gdb_test "print \*self" \ |
155 "\\$\[0-9\] = \{{?isa = 0x\[0-9a-f\]+}?, object = 0x0\}" \ | 148 "\\$\[0-9\] = \{{?isa = 0x\[0-9a-f\]+( <.*>)?}?, object = 0x0\}" \ |
156 " print contents of self" | 149 " print contents of self" |
157 | 150 |
158 # | 151 # |
159 # Break in a category | 152 # Break in a category |
160 # | 153 # |
161 gdb_test "break hiddenMethod" \ | 154 gdb_test "break hiddenMethod" \ |
162 "Breakpoint.*at.* file .*$srcfile, line.61." \ | 155 "Breakpoint.*at.* file .*$srcfile, line.61." \ |
163 "breakpoint in category method" | 156 "breakpoint in category method" |
164 | 157 |
165 | 158 |
(...skipping 20 matching lines...) Expand all Loading... |
186 # | 179 # |
187 gdb_test "print-object object" \ | 180 gdb_test "print-object object" \ |
188 "BasicClass gdb test object" \ | 181 "BasicClass gdb test object" \ |
189 "Use of the print-object command" | 182 "Use of the print-object command" |
190 | 183 |
191 gdb_test "po self" \ | 184 gdb_test "po self" \ |
192 "BasicClass gdb test object" \ | 185 "BasicClass gdb test object" \ |
193 "Use of the po (print-object) command" | 186 "Use of the po (print-object) command" |
194 | 187 |
195 | 188 |
OLD | NEW |