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.
10 gdb_reinitialize_dir $srcdir/$subdir
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
16 if ![file exists $binfile] then {
17 error "$binfile does not exist."
21 # xcoffread.c wrongly bitches about the lack of a text section.
22 setup_xfail "rs*-*-aix*"
23 send "file $binfile\n"
25 -re "^file $binfile\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$prompt $" {
26 pass "wierd.o read without error"
29 fail "Errors reading wierd.o"
32 error "couldn't load $binfile into $GDB (timed out)."
37 proc print_wierd_var { var } {
40 # Currently one of these symbols gives an error() in symbol
41 # reading, which causes any attempt to read (full, not
42 # partial) symbols for the file to lose.
45 # Make sure that the variable gets printed out correctly, without
46 # any sort of warning message.
49 -re "^print $var\r*\n.\[0-9\]* = 42.*$prompt $" {
50 pass "variable $var printed properly"
54 fail "variable $var not printed properly"
57 timeout { fail "variable $var not printed (timeout)" }
60 # Currently one of these symbols gives an error() in symbol
61 # reading, which causes any attempt to read (full, not
62 # partial) symbols for the file to lose.
65 # Make sure that the stabs did get loaded in a sensible way.
66 # If somehow the stabs got skipped, then the above test can
67 # pass because GDB assumes int for variables without a stab.
71 -re "type = unsigned int.*$prompt $" {pass "whatis on $var"}
72 -re "type = inttype.*$prompt $" {pass "whatis on $var"}
73 -re "$prompt $" {fail "whatis on $var"}
74 timeout {fail "whatis on $var"}
83 print_wierd_var attr32
84 print_wierd_var attr33
85 print_wierd_var attr35
86 print_wierd_var attr36
87 print_wierd_var attr37
88 print_wierd_var attr38
89 print_wierd_var attr39
90 print_wierd_var attr41
91 print_wierd_var attr42
92 print_wierd_var attr43
93 print_wierd_var attr44
94 print_wierd_var attr46
95 print_wierd_var attr47
96 print_wierd_var attr58
97 print_wierd_var attr59
98 print_wierd_var attr60
99 print_wierd_var attr61
100 print_wierd_var attr62
101 print_wierd_var attr63
102 print_wierd_var attr64
103 print_wierd_var attr65
104 print_wierd_var attr66
105 print_wierd_var attr67
106 print_wierd_var attr68
107 print_wierd_var attr69
108 print_wierd_var attr70
109 print_wierd_var attr71
110 print_wierd_var attr72
111 print_wierd_var attr73
112 print_wierd_var attr74
113 print_wierd_var attr75
114 print_wierd_var attr76
115 print_wierd_var attr77
116 print_wierd_var attr78
117 print_wierd_var attr79
118 print_wierd_var attr80
119 print_wierd_var attr81
120 print_wierd_var attr82
121 print_wierd_var attr83
122 print_wierd_var attr84
123 print_wierd_var attr85
124 print_wierd_var attr86
125 print_wierd_var attr87
126 print_wierd_var attr88
127 print_wierd_var attr89
128 print_wierd_var attr90
129 print_wierd_var attr91
130 print_wierd_var attr92
131 print_wierd_var attr93
132 print_wierd_var attr94
133 print_wierd_var attr95
134 print_wierd_var attr96
135 print_wierd_var attr97
136 print_wierd_var attr98
137 print_wierd_var attr99
138 print_wierd_var attr100
139 print_wierd_var attr101
140 print_wierd_var attr102
141 print_wierd_var attr103
142 print_wierd_var attr104
143 print_wierd_var attr105
144 print_wierd_var attr106
145 print_wierd_var attr107
146 print_wierd_var attr108
147 print_wierd_var attr109
148 print_wierd_var attr110
149 print_wierd_var attr111
150 print_wierd_var attr112
151 print_wierd_var attr113
152 print_wierd_var attr114
153 print_wierd_var attr115
154 print_wierd_var attr116
155 print_wierd_var attr117
156 print_wierd_var attr118
157 print_wierd_var attr119
158 print_wierd_var attr120
159 print_wierd_var attr121
160 print_wierd_var attr122
161 print_wierd_var attr123
162 print_wierd_var attr124
163 print_wierd_var attr125
164 print_wierd_var attr126
166 # Currently one of these symbols gives an error() in symbol
167 # reading, which causes any attempt to read (full, not
168 # partial) symbols for the file to lose.
171 # One last test, while we're at it.
172 send "ptype inttype\n"
174 -re "type = unsigned int.*$prompt $" {pass "ptype on inttype"}
175 -re "type = inttype.*$prompt $" {pass "ptype on inttype"}
176 -re "$prompt $" {fail "ptype on inttype"}
177 timeout {fail "ptype on inttype"}
180 #Prevent some failures in default.exp, which are probably GDB bugs
181 # (but trivial ones).