OLD | NEW |
1 # Copyright 1988, 1990-1992, 1994-1997, 1999-2000, 2002-2003, 2007-2012 | 1 # Copyright 1988, 1990-1992, 1994-1997, 1999-2000, 2002-2003, 2007-2012 |
2 # Free Software Foundation, Inc. | 2 # Free Software Foundation, Inc. |
3 | 3 |
4 # This program is free software; you can redistribute it and/or modify | 4 # This program is free software; you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License as published by | 5 # it under the terms of the GNU General Public License as published by |
6 # the Free Software Foundation; either version 3 of the License, or | 6 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 7 # (at your option) any later version. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 # GNU General Public License for more details. | 12 # GNU General Public License for more details. |
13 # | 13 # |
14 # You should have received a copy of the GNU General Public License | 14 # You should have received a copy of the GNU General Public License |
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 |
17 # This file was written by Rob Savoye. (rob@cygnus.com) | 17 # This file was written by Rob Savoye. (rob@cygnus.com) |
18 | 18 |
19 if $tracelevel then { | |
20 strace $tracelevel | |
21 } | |
22 | |
23 # | 19 # |
24 # test running programs | 20 # test running programs |
25 # | 21 # |
26 | 22 |
27 set testfile "ptype" | 23 set testfile "ptype" |
28 set srcfile0 ${testfile}.c | 24 set srcfile0 ${testfile}.c |
29 set srcfile1 ${testfile}1.c | 25 set srcfile1 ${testfile}1.c |
30 set binfile ${objdir}/${subdir}/${testfile} | 26 set binfile ${objdir}/${subdir}/${testfile} |
31 | 27 |
32 if { [gdb_compile "${srcdir}/${subdir}/${srcfile0}" "${binfile}0.o" object {deb
ug}] != "" } { | 28 if { [gdb_compile "${srcdir}/${subdir}/${srcfile0}" "${binfile}0.o" object {deb
ug}] != "" } { |
33 untested ptype.exp | 29 untested ptype.exp |
34 return -1 | 30 return -1 |
35 } | 31 } |
36 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {deb
ug}] != "" } { | 32 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {deb
ug}] != "" } { |
37 untested ptype.exp | 33 untested ptype.exp |
38 return -1 | 34 return -1 |
39 } | 35 } |
40 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug}
] != "" } { | 36 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug}
] != "" } { |
41 untested ptype.exp | 37 untested ptype.exp |
42 return -1 | 38 return -1 |
43 } | 39 } |
44 | 40 |
45 # Create and source the file that provides information about the compiler | 41 # Create and source the file that provides information about the compiler |
46 # used to compile the test case. | 42 # used to compile the test case. |
47 if [get_compiler_info ${binfile}] { | 43 if [get_compiler_info] { |
48 return -1; | 44 return -1; |
49 } | 45 } |
50 | 46 |
51 gdb_exit | 47 gdb_exit |
52 gdb_start | 48 gdb_start |
53 gdb_reinitialize_dir $srcdir/$subdir | 49 gdb_reinitialize_dir $srcdir/$subdir |
54 gdb_load ${binfile} | 50 gdb_load ${binfile} |
55 | 51 |
56 # Test ptype of unnamed enumeration members before any action causes | 52 # Test ptype of unnamed enumeration members before any action causes |
57 # the partial symbol table to be expanded to full symbols. This fails | 53 # the partial symbol table to be expanded to full symbols. This fails |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumera
tion member #2" | 162 gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumera
tion member #2" |
167 | 163 |
168 # | 164 # |
169 # test ptype command with basic C types | 165 # test ptype command with basic C types |
170 # | 166 # |
171 # I've commented most of this out because it duplicates tests in whatis.exp. | 167 # I've commented most of this out because it duplicates tests in whatis.exp. |
172 # I've just left in a token test or 2 which is designed to test that ptype | 168 # I've just left in a token test or 2 which is designed to test that ptype |
173 # acts like whatis for basic types. If it is thought to be necessary to | 169 # acts like whatis for basic types. If it is thought to be necessary to |
174 # test both whatis and ptype for all the types, the tests should be | 170 # test both whatis and ptype for all the types, the tests should be |
175 # merged into whatis.exp, or else maintenance will be a royal pain -kingdon | 171 # merged into whatis.exp, or else maintenance will be a royal pain -kingdon |
176 #setup_xfail "mips-idt-*" "mips-sgi-*" | 172 #setup_xfail "mips-sgi-*" |
177 #send "ptype v_char\n" | 173 #send "ptype v_char\n" |
178 #gdb_expect { | 174 #gdb_expect { |
179 # -re "type = char.*$gdb_prompt $" { pass "ptype char" } | 175 # -re "type = char.*$gdb_prompt $" { pass "ptype char" } |
180 # -re ".*$gdb_prompt $" { fail "ptype char" } | 176 # -re ".*$gdb_prompt $" { fail "ptype char" } |
181 # timeout { fail "(timeout) ptype char" } | 177 # timeout { fail "(timeout) ptype char" } |
182 #} | 178 #} |
183 # | 179 # |
184 # | 180 # |
185 #setup_xfail "mips-*-*" | 181 #setup_xfail "mips-*-*" |
186 #send "ptype v_signed_char\n" | 182 #send "ptype v_signed_char\n" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 #gdb_expect { | 266 #gdb_expect { |
271 # -re "type = double.*$gdb_prompt $" { pass "ptype double" } | 267 # -re "type = double.*$gdb_prompt $" { pass "ptype double" } |
272 # -re ".*$gdb_prompt $" { fail "ptype double" } | 268 # -re ".*$gdb_prompt $" { fail "ptype double" } |
273 # timeout { fail "(timeout) ptype double" } | 269 # timeout { fail "(timeout) ptype double" } |
274 #} | 270 #} |
275 | 271 |
276 | 272 |
277 # | 273 # |
278 # test ptype command with arrays | 274 # test ptype command with arrays |
279 # | 275 # |
280 #setup_xfail "mips-idt-*" "mips-sgi-*" | 276 #setup_xfail "mips-sgi-*" |
281 #send "ptype v_char_array\n" | 277 #send "ptype v_char_array\n" |
282 #gdb_expect { | 278 #gdb_expect { |
283 # -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" } | 279 # -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" } |
284 # -re ".*$gdb_prompt $" { fail "ptype char array" } | 280 # -re ".*$gdb_prompt $" { fail "ptype char array" } |
285 # timeout { fail "(timeout) ptype char array" } | 281 # timeout { fail "(timeout) ptype char array" } |
286 #} | 282 #} |
287 # | 283 # |
288 # | 284 # |
289 #setup_xfail "mips-*-*" | 285 #setup_xfail "mips-*-*" |
290 #send "ptype v_signed_char_array\n" | 286 #send "ptype v_signed_char_array\n" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 # | 367 # |
372 | 368 |
373 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" } | 369 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" } |
374 if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"} | 370 if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"} |
375 gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]" | 371 gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]" |
376 | 372 |
377 # | 373 # |
378 ## | 374 ## |
379 ## test ptype command with pointers | 375 ## test ptype command with pointers |
380 ## | 376 ## |
381 #setup_xfail "mips-idt-*" "mips-sgi-*" | 377 #setup_xfail "mips-sgi-*" |
382 #send "ptype v_char_pointer\n" | 378 #send "ptype v_char_pointer\n" |
383 #gdb_expect { | 379 #gdb_expect { |
384 # -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" } | 380 # -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" } |
385 # -re ".*$gdb_prompt $" { fail "ptype char pointer" } | 381 # -re ".*$gdb_prompt $" { fail "ptype char pointer" } |
386 # timeout { fail "(timeout) ptype char pointer" } | 382 # timeout { fail "(timeout) ptype char pointer" } |
387 #} | 383 #} |
388 # | 384 # |
389 # | 385 # |
390 #setup_xfail "mips-*-*" | 386 #setup_xfail "mips-*-*" |
391 #send "ptype v_signed_char_pointer\n" | 387 #send "ptype v_signed_char_pointer\n" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 gdb_test "ptype {(float)0,(float)1,(float)2}" "type = float \\\[3\\\]" | 636 gdb_test "ptype {(float)0,(float)1,(float)2}" "type = float \\\[3\\\]" |
641 gdb_test "ptype {{0,1,2},{3,4,5}}" "type = int \\\[2\\\]\\\[3\\\]" | 637 gdb_test "ptype {{0,1,2},{3,4,5}}" "type = int \\\[2\\\]\\\[3\\\]" |
642 gdb_test "ptype {4,5,6}\[2\]" "type = int" | 638 gdb_test "ptype {4,5,6}\[2\]" "type = int" |
643 gdb_test "ptype *&{4,5,6}\[1\]" "Attempt to take address of value not lo
cated in memory." | 639 gdb_test "ptype *&{4,5,6}\[1\]" "Attempt to take address of value not lo
cated in memory." |
644 | 640 |
645 set timeout $prev_timeout | 641 set timeout $prev_timeout |
646 | 642 |
647 # Test ptype of user register | 643 # Test ptype of user register |
648 gdb_test "ptype \$pc" "void \\(\\*\\)\\(\\)" "ptype \$pc" | 644 gdb_test "ptype \$pc" "void \\(\\*\\)\\(\\)" "ptype \$pc" |
649 } | 645 } |
OLD | NEW |