Commit | Line | Data |
---|---|---|
1458f956 JK |
1 | # Test that GDB properly ignores invalid stabs. |
2 | # Also test that GDB can debug a .o file, and that it doesn't mind | |
3 | # a file that's more minimal than what a compiler normally puts out. | |
4 | if $tracelevel then { | |
5 | strace $tracelevel | |
6 | } | |
7 | set prms_id 0 | |
8 | set bug_id 0 | |
9 | ||
10 | gdb_reinitialize_dir $srcdir/$subdir | |
11 | ||
12 | # Don't use gdb_load; it doesn't bitch if the loading produced some | |
13 | # error messages during symbol reading. | |
14 | set binfile $objdir/$subdir/wierd.o | |
15 | ||
16 | if ![file exists $binfile] then { | |
17 | error "$binfile does not exist." | |
18 | alldone | |
19 | } | |
20 | ||
b1285bd9 JK |
21 | # xcoffread.c wrongly bitches about the lack of a text section. |
22 | setup_xfail "rs*-*-aix*" | |
1458f956 JK |
23 | send "file $binfile\n" |
24 | expect { | |
25 | -re "^file $binfile\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$prompt $" { | |
26 | pass "wierd.o read without error" | |
27 | } | |
28 | -re ".*$prompt $" { | |
29 | fail "Errors reading wierd.o" | |
30 | } | |
31 | timeout { | |
32 | error "couldn't load $binfile into $GDB (timed out)." | |
33 | return -1 | |
34 | } | |
16b00357 | 35 | eof { fail "(eof) cannot read wierd.o" } |
1458f956 JK |
36 | } |
37 | ||
38 | proc print_wierd_var { var } { | |
39 | global prompt | |
40 | ||
16b00357 | 41 | # GDB does not yet understand type attributes |
1458f956 JK |
42 | setup_xfail "*-*-*" |
43 | ||
44 | # Make sure that the variable gets printed out correctly, without | |
45 | # any sort of warning message. | |
46 | send "print $var\n" | |
47 | expect { | |
48 | -re "^print $var\r*\n.\[0-9\]* = 42.*$prompt $" { | |
49 | pass "variable $var printed properly" | |
50 | return 0 | |
51 | } | |
52 | -re ".*$prompt $" { | |
53 | fail "variable $var not printed properly" | |
54 | return 0 | |
55 | } | |
56 | timeout { fail "variable $var not printed (timeout)" } | |
16b00357 | 57 | eof { fail "(eof) variable $var not printed" } |
1458f956 | 58 | } |
b1285bd9 | 59 | |
16b00357 | 60 | # GDB does not yet understand type attributes |
b1285bd9 JK |
61 | setup_xfail "*-*-*" |
62 | ||
63 | # Make sure that the stabs did get loaded in a sensible way. | |
64 | # If somehow the stabs got skipped, then the above test can | |
65 | # pass because GDB assumes int for variables without a stab. | |
66 | ||
16b00357 | 67 | gdb_test "whatis $var\n" "type = (unsigned int|inttype)" "whatis on $var" |
1458f956 JK |
68 | } |
69 | ||
70 | print_wierd_var var0 | |
71 | print_wierd_var var1 | |
72 | print_wierd_var var2 | |
73 | print_wierd_var var3 | |
74 | ||
75 | print_wierd_var attr32 | |
76 | print_wierd_var attr33 | |
77 | print_wierd_var attr35 | |
78 | print_wierd_var attr36 | |
79 | print_wierd_var attr37 | |
80 | print_wierd_var attr38 | |
81 | print_wierd_var attr39 | |
82 | print_wierd_var attr41 | |
83 | print_wierd_var attr42 | |
84 | print_wierd_var attr43 | |
85 | print_wierd_var attr44 | |
86 | print_wierd_var attr46 | |
87 | print_wierd_var attr47 | |
88 | print_wierd_var attr58 | |
89 | print_wierd_var attr59 | |
90 | print_wierd_var attr60 | |
91 | print_wierd_var attr61 | |
92 | print_wierd_var attr62 | |
93 | print_wierd_var attr63 | |
94 | print_wierd_var attr64 | |
95 | print_wierd_var attr65 | |
96 | print_wierd_var attr66 | |
97 | print_wierd_var attr67 | |
98 | print_wierd_var attr68 | |
99 | print_wierd_var attr69 | |
100 | print_wierd_var attr70 | |
101 | print_wierd_var attr71 | |
102 | print_wierd_var attr72 | |
103 | print_wierd_var attr73 | |
104 | print_wierd_var attr74 | |
105 | print_wierd_var attr75 | |
106 | print_wierd_var attr76 | |
107 | print_wierd_var attr77 | |
108 | print_wierd_var attr78 | |
109 | print_wierd_var attr79 | |
110 | print_wierd_var attr80 | |
111 | print_wierd_var attr81 | |
112 | print_wierd_var attr82 | |
113 | print_wierd_var attr83 | |
114 | print_wierd_var attr84 | |
115 | print_wierd_var attr85 | |
116 | print_wierd_var attr86 | |
117 | print_wierd_var attr87 | |
118 | print_wierd_var attr88 | |
119 | print_wierd_var attr89 | |
120 | print_wierd_var attr90 | |
121 | print_wierd_var attr91 | |
122 | print_wierd_var attr92 | |
123 | print_wierd_var attr93 | |
124 | print_wierd_var attr94 | |
125 | print_wierd_var attr95 | |
126 | print_wierd_var attr96 | |
127 | print_wierd_var attr97 | |
128 | print_wierd_var attr98 | |
129 | print_wierd_var attr99 | |
130 | print_wierd_var attr100 | |
131 | print_wierd_var attr101 | |
132 | print_wierd_var attr102 | |
133 | print_wierd_var attr103 | |
134 | print_wierd_var attr104 | |
135 | print_wierd_var attr105 | |
136 | print_wierd_var attr106 | |
137 | print_wierd_var attr107 | |
138 | print_wierd_var attr108 | |
139 | print_wierd_var attr109 | |
140 | print_wierd_var attr110 | |
141 | print_wierd_var attr111 | |
142 | print_wierd_var attr112 | |
143 | print_wierd_var attr113 | |
144 | print_wierd_var attr114 | |
145 | print_wierd_var attr115 | |
146 | print_wierd_var attr116 | |
147 | print_wierd_var attr117 | |
148 | print_wierd_var attr118 | |
149 | print_wierd_var attr119 | |
150 | print_wierd_var attr120 | |
151 | print_wierd_var attr121 | |
152 | print_wierd_var attr122 | |
153 | print_wierd_var attr123 | |
154 | print_wierd_var attr124 | |
155 | print_wierd_var attr125 | |
156 | print_wierd_var attr126 | |
157 | ||
b1285bd9 | 158 | # One last test, while we're at it. |
16b00357 | 159 | gdb_test "ptype inttype\n" "type = (unsigned int|inttype)" "ptype on inttype" |
b1285bd9 | 160 | |
1458f956 JK |
161 | #Prevent some failures in default.exp, which are probably GDB bugs |
162 | # (but trivial ones). | |
163 | gdb_exit | |
164 | gdb_start |