OLD | NEW |
1 # Copyright 2003-2004, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2003-2004, 2007-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 if $tracelevel then { | |
17 strace $tracelevel | |
18 } | |
19 | |
20 if { [skip_cplus_tests] } { continue } | 16 if { [skip_cplus_tests] } { continue } |
21 | 17 |
22 | 18 |
23 set testfile "class2" | 19 standard_testfile .cc |
24 set srcfile ${testfile}.cc | |
25 set binfile ${objdir}/${subdir}/${testfile} | |
26 | 20 |
27 # Create and source the file that provides information about the compiler | 21 # Create and source the file that provides information about the compiler |
28 # used to compile the test case. | 22 # used to compile the test case. |
29 if [get_compiler_info ${binfile} "c++"] { | 23 if [get_compiler_info "c++"] { |
30 return -1 | 24 return -1 |
31 } | 25 } |
32 | 26 |
33 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
g c++}] != "" } { | 27 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
34 untested class2.exp | |
35 return -1 | 28 return -1 |
36 } | 29 } |
37 | 30 |
38 gdb_exit | |
39 gdb_start | |
40 gdb_reinitialize_dir $srcdir/$subdir | |
41 gdb_load ${binfile} | |
42 | |
43 # Start with "set print object off". | 31 # Start with "set print object off". |
44 | 32 |
45 gdb_test_no_output "set print object off" | 33 gdb_test_no_output "set print object off" |
46 | 34 |
47 if ![runto_main] then { | 35 if ![runto_main] then { |
48 perror "couldn't run to main" | 36 perror "couldn't run to main" |
49 continue | 37 continue |
50 } | 38 } |
51 | 39 |
52 get_debug_format | 40 get_debug_format |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 # Printing the value of an object containing no data fields: | 103 # Printing the value of an object containing no data fields: |
116 | 104 |
117 gdb_test "p e" "= \{<No data fields>\}" "print object with no data fields" | 105 gdb_test "p e" "= \{<No data fields>\}" "print object with no data fields" |
118 | 106 |
119 # Printing NULL pointers with "set print object on" | 107 # Printing NULL pointers with "set print object on" |
120 | 108 |
121 gdb_test_no_output "set print object on" | 109 gdb_test_no_output "set print object on" |
122 gdb_test "p acp" "= \\(C \\*\\) ${hex}" | 110 gdb_test "p acp" "= \\(C \\*\\) ${hex}" |
123 gdb_test "p acp->c1" "\\(A \\*\\) 0x0" | 111 gdb_test "p acp->c1" "\\(A \\*\\) 0x0" |
124 gdb_test "p acp->c2" "\\(A \\*\\) ${hex}f" | 112 gdb_test "p acp->c2" "\\(A \\*\\) ${hex}f" |
OLD | NEW |