Commit | Line | Data |
---|---|---|
c906108c SS |
1 | # Copyright (C) 1998 Free Software Foundation, Inc. |
2 | ||
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 | |
5 | # the Free Software Foundation; either version 2 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program; if not, write to the Free Software | |
15 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
16 | ||
17 | # Please email any bugs, comments, and/or additions to this file to: | |
18 | # bug-gdb@prep.ai.mit.edu | |
19 | ||
20 | # This file was written by Elena Zannoni (ezannoni@cygnus.com) | |
21 | ||
22 | # this file tests maintenance commands and help on those. | |
23 | ||
24 | # source file used is break.c | |
25 | ||
26 | ||
27 | #maintenance check-symtabs -- Check consistency of psymtabs and symtabs | |
28 | #maintenance space -- Set the display of space usage | |
29 | #maintenance time -- Set the display of time usage | |
30 | #maintenance demangle -- Demangle a C++ mangled name | |
31 | #maintenance dump-me -- Get fatal error; make debugger dump its core | |
32 | #maintenance print -- Maintenance command for printing GDB internal state | |
33 | #maintenance info -- Commands for showing internal info about the program being debugged | |
34 | # | |
35 | #maintenance print statistics -- Print statistics about internal gdb state | |
36 | #maintenance print objfiles -- Print dump of current object file definitions | |
37 | #maintenance print psymbols -- Print dump of current partial symbol definitions | |
38 | #maintenance print msymbols -- Print dump of current minimal symbol definitions | |
39 | #maintenance print symbols -- Print dump of current symbol definitions | |
40 | #maintenance print type -- Print a type chain for a given symbol | |
41 | #maintenance print unwind -- Print unwind table entry at given address | |
42 | # | |
43 | # | |
44 | #maintenance info sections -- List the BFD sections of the exec and core files | |
45 | #maintenance info breakpoints -- Status of all breakpoints | |
46 | # | |
47 | ||
48 | ||
49 | ||
50 | if $tracelevel then { | |
51 | strace $tracelevel | |
52 | } | |
53 | ||
54 | global usestubs | |
55 | ||
56 | # | |
57 | # test running programs | |
58 | # | |
59 | set prms_id 0 | |
60 | set bug_id 0 | |
61 | ||
62 | set testfile "break" | |
63 | set srcfile ${testfile}.c | |
64 | set binfile ${objdir}/${subdir}/${testfile} | |
65 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" | |
66 | } { | |
67 | gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." | |
68 | } | |
69 | ||
70 | ||
71 | gdb_exit | |
72 | gdb_start | |
73 | gdb_reinitialize_dir $srcdir/$subdir | |
74 | gdb_load ${binfile} | |
75 | ||
76 | if ![runto_main] then { | |
77 | perror "tests suppressed" | |
78 | } | |
79 | ||
80 | ||
81 | # The commands we test here produce many lines of output; disable "press | |
82 | # <return> to continue" prompts. | |
83 | send_gdb "set height 0\n" | |
84 | gdb_expect -re "$gdb_prompt $" | |
85 | ||
86 | # use a larger expect input buffer for long help outputs. | |
87 | match_max 6000 | |
88 | ||
89 | # | |
90 | # this command does not produce any output | |
91 | # unless there is some problem with the symtabs and psymtabs | |
92 | # so that branch will really never be covered in this tests here!! | |
93 | # | |
94 | ||
95 | send_gdb "maint check-symtabs\n" | |
96 | gdb_expect { | |
97 | -re "^maint check-symtabs.*$gdb_prompt $"\ | |
98 | { pass "maint check-symtabs" } | |
99 | -re ".*$gdb_prompt $" { fail "maint check-symtabs" } | |
100 | timeout { fail "(timeout) maint check-symtabs" } | |
101 | } | |
102 | ||
103 | send_gdb "maint space\n" | |
104 | gdb_expect { | |
105 | -re "\"maintenance space\" takes a numeric argument\\..*$gdb_prompt $"\ | |
106 | { pass "maint space" } | |
107 | -re ".*$gdb_prompt $" { fail "maint space" } | |
108 | timeout { fail "(timeout) maint space" } | |
109 | } | |
110 | ||
111 | send_gdb "maint space 1\n" | |
112 | gdb_expect { | |
113 | -re "Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\ | |
114 | { pass "maint space 1" } | |
115 | -re ".*$gdb_prompt $" { fail "maint space 1" } | |
116 | timeout { fail "(timeout) maint space 1" } | |
117 | } | |
118 | ||
119 | ||
120 | send_gdb "maint time\n" | |
121 | gdb_expect { | |
122 | -re "\"maintenance time\" takes a numeric argument\\..*Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\ | |
123 | { pass "maint time" } | |
124 | -re ".*$gdb_prompt $" { fail "maint time" } | |
125 | timeout { fail "(timeout) maint time" } | |
126 | } | |
127 | ||
128 | send_gdb "maint time 1\n" | |
129 | gdb_expect { | |
130 | -re "Command execution time: $decimal.*Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\ | |
131 | { pass "maint time 1" } | |
132 | -re ".*$gdb_prompt $" { fail "maint time 1" } | |
133 | timeout { fail "(timeout) maint time 1" } | |
134 | } | |
135 | ||
136 | send_gdb "maint time 0\n" | |
137 | gdb_expect { | |
138 | -re "Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\ | |
139 | { pass "maint time 0" } | |
140 | -re ".*$gdb_prompt $" { fail "maint time 0" } | |
141 | timeout { fail "(timeout) maint time 0" } | |
142 | } | |
143 | ||
144 | ||
145 | send_gdb "maint space 0\n" | |
146 | gdb_expect { | |
147 | -re "maint space 0\r\n$gdb_prompt $"\ | |
148 | { pass "maint space 0" } | |
149 | -re ".*$gdb_prompt $" { fail "maint space 0" } | |
150 | timeout { fail "(timeout) maint space 0" } | |
151 | } | |
152 | ||
153 | send_gdb "maint demangle\n" | |
154 | gdb_expect { | |
155 | -re "\"maintenance demangle\" takes an argument to demangle\\..*$gdb_prompt $"\ | |
156 | { pass "maint demangle" } | |
157 | -re ".*$gdb_prompt $" { fail "maint demangle" } | |
158 | timeout { fail "(timeout) maint demangle" } | |
159 | } | |
160 | ||
161 | send_gdb "maint demangle main\n" | |
162 | gdb_expect { | |
163 | -re "Can't demangle \"main\".*$gdb_prompt $"\ | |
164 | { pass "maint demangle" } | |
165 | -re ".*$gdb_prompt $" { fail "maint demangle" } | |
166 | timeout { fail "(timeout) maint demangle" } | |
167 | } | |
168 | ||
169 | ||
170 | send_gdb "maint print statistics\n" | |
171 | gdb_expect { | |
172 | -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\ | |
173 | { pass "maint print statistics" } | |
174 | -re ".*$gdb_prompt $" { fail "maint print statistics" } | |
175 | timeout { fail "(timeout) maint print statistics" } | |
176 | } | |
177 | ||
178 | send_gdb "maint print objfiles\n" | |
179 | # To avoid timeouts, we avoid expects with many .* patterns that match | |
180 | # many lines. | |
181 | gdb_expect { | |
182 | -re ".*Object file.*break: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" | |
183 | { pass "maint print objfiles: header" } | |
184 | -re ".*$gdb_prompt $" { fail "maint print objfiles: header" } | |
185 | timeout { fail "(timeout) maint print objfiles: header" } | |
186 | } | |
187 | gdb_expect { | |
188 | -re ".*Psymtabs:\[\r\t \]+\n" { pass "maint print objfiles: psymtabs" } | |
189 | -re ".*$gdb_prompt $" { fail "maint print objfiles: psymtabs" } | |
190 | timeout { fail "(timeout) maint print objfiles: psymtabs" } | |
191 | } | |
192 | gdb_expect { | |
193 | -re ".*Symtabs:\[\r\t \]+\n" { pass "maint print objfiles: symtabs" } | |
194 | -re ".*$gdb_prompt $" { fail "maint print objfiles: symtabs" } | |
195 | timeout { fail "(timeout) maint print objfiles: symtabs" } | |
196 | } | |
197 | gdb_expect { | |
198 | -re ".*$gdb_prompt $" { pass "maint print objfiles: prompt" } | |
199 | timeout { fail "(timeout) maint print objfiles: prompt" } | |
200 | } | |
201 | ||
202 | send_gdb "maint print psymbols\n" | |
203 | gdb_expect { | |
204 | -re "print-psymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\ | |
205 | { pass "maint print psymbols w/o args" } | |
206 | -re ".*$gdb_prompt $" { fail "maint print psymbols w/o args" } | |
207 | timeout { fail "(timeout) maint print psymbols w/o args" } | |
208 | } | |
209 | ||
210 | send_gdb "maint print psymbols psymbols_output\n" | |
211 | gdb_expect { | |
212 | -re "^maint print psymbols psymbols_output\r\n$gdb_prompt $"\ | |
213 | { | |
214 | send_gdb "shell ls psymbols_output\n" | |
215 | gdb_expect { | |
216 | -re "psymbols_output\r\n$gdb_prompt $"\ | |
217 | { | |
218 | # We want this grep to be as specific as possible, | |
219 | # so it's less likely to match symbol file names in | |
220 | # psymbols_output. Yes, this actually happened; | |
221 | # poor expect got tons of output, and timed out | |
222 | # trying to match it. --- Jim Blandy <jimb@cygnus.com> | |
223 | send_gdb "shell grep 'main.*function' psymbols_output\n" | |
224 | gdb_expect { | |
225 | -re ".main., function, $hex.*$gdb_prompt $"\ | |
226 | { pass "maint print psymbols" } | |
227 | -re ".*$gdb_prompt $" { fail "maint print psymbols" } | |
228 | timeout { fail "(timeout) maint print psymbols" } | |
229 | } | |
230 | gdb_test "shell rm -f psymbols_output" "" | |
231 | ||
232 | } | |
233 | -re ".*$gdb_prompt $" { fail "maint print psymbols" } | |
234 | timeout { fail "(timeout) maint print psymbols" } | |
235 | } | |
236 | } | |
237 | -re ".*$gdb_prompt $" { fail "maint print psymbols" } | |
238 | timeout { fail "(timeout) maint print psymbols" } | |
239 | } | |
240 | ||
241 | ||
242 | send_gdb "maint print msymbols\n" | |
243 | gdb_expect { | |
244 | -re "print-msymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\ | |
245 | { pass "maint print msymbols w/o args" } | |
246 | -re ".*$gdb_prompt $" { fail "maint print msymbols w/o args" } | |
247 | timeout { fail "(timeout) maint print msymbols w/o args" } | |
248 | } | |
249 | ||
250 | send_gdb "maint print msymbols msymbols_output\n" | |
251 | gdb_expect { | |
252 | -re "^maint print msymbols msymbols_output\r\n$gdb_prompt $"\ | |
253 | { | |
254 | send_gdb "shell ls msymbols_output\n" | |
255 | gdb_expect { | |
256 | -re "msymbols_output\r\n$gdb_prompt $"\ | |
257 | { | |
258 | send_gdb "shell grep factorial msymbols_output\n" | |
259 | gdb_expect { | |
260 | -re "\\\[ *$decimal\\\] T\[ \t\]+$hex factorial.*$gdb_prompt $"\ | |
261 | { pass "maint print msymbols" } | |
262 | -re ".*$gdb_prompt $" { fail "maint print msymbols" } | |
263 | timeout { fail "(timeout) maint print msymbols" } | |
264 | } | |
265 | gdb_test "shell rm -f msymbols_output" "" | |
266 | ||
267 | } | |
268 | -re ".*$gdb_prompt $" { fail "maint print msymbols" } | |
269 | timeout { fail "(timeout) maint print msymbols" } | |
270 | } | |
271 | } | |
272 | -re ".*$gdb_prompt $" { fail "maint print msymbols" } | |
273 | timeout { fail "(timeout) maint print msymbols" } | |
274 | } | |
275 | ||
276 | ||
277 | send_gdb "maint print symbols\n" | |
278 | gdb_expect { | |
279 | -re "Arguments missing: an output file name and an optional symbol file name.*$gdb_prompt $"\ | |
280 | { pass "maint print symbols w/o args" } | |
281 | -re ".*$gdb_prompt $" { fail "maint print symbols w/o args" } | |
282 | timeout { fail "(timeout) maint print symbols w/o args" } | |
283 | } | |
284 | ||
285 | send_gdb "maint print symbols symbols_output\n" | |
286 | gdb_expect { | |
287 | -re "^maint print symbols symbols_output\r\n$gdb_prompt $"\ | |
288 | { | |
289 | send_gdb "shell ls symbols_output\n" | |
290 | gdb_expect { | |
291 | -re "symbols_output\r\n$gdb_prompt $"\ | |
292 | { | |
293 | # See comments for `maint print psymbols'. | |
294 | send_gdb "shell grep 'main.*block' symbols_output\n" | |
295 | gdb_expect { | |
296 | -re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $"\ | |
297 | { pass "maint print symbols" } | |
298 | -re ".*$gdb_prompt $" { fail "maint print symbols" } | |
299 | timeout { fail "(timeout) maint print symbols" } | |
300 | } | |
301 | gdb_test "shell rm -f symbols_output" "" | |
302 | ||
303 | } | |
304 | -re ".*$gdb_prompt $" { fail "maint print symbols" } | |
305 | timeout { fail "(timeout) maint print symbols" } | |
306 | } | |
307 | } | |
308 | -re ".*$gdb_prompt $" { fail "maint print symbols" } | |
309 | timeout { fail "(timeout) maint print symbols" } | |
310 | } | |
311 | ||
312 | ||
313 | send_gdb "maint print type argc\n" | |
314 | gdb_expect { | |
315 | -re "type node $hex\r\nname .int. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength 4\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\ | |
316 | { pass "maint print type" } | |
317 | -re ".*$gdb_prompt $" { fail "maint print type" } | |
318 | timeout { fail "(timeout) maint print type" } | |
319 | } | |
320 | ||
321 | #send_gdb "maint print unwind &main\n" | |
322 | #gdb_expect { | |
323 | # -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+220>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $"\ | |
324 | # { pass "maint print unwind" } | |
325 | # -re ".*$gdb_prompt $" { fail "maint print unwind" } | |
326 | # timeout { fail "(timeout) maint print unwind" } | |
327 | # } | |
328 | ||
329 | set oldtimeout $timeout | |
330 | set timeout [expr $timeout + 300] | |
331 | ||
332 | # It'd be nice to check for every possible section. However, that's | |
333 | # problematic, since the relative ordering wanders from release to | |
334 | # release of the compilers. Instead, we'll just check for two | |
335 | # sections which appear to always come out in the same relative | |
336 | # order. (If that changes, then we should just check for one | |
337 | # section.) | |
338 | # | |
339 | # And by the way: This testpoint will break for PA64, where a.out's | |
340 | # are ELF files. | |
341 | # | |
342 | send_gdb "maint info sections\n" | |
343 | gdb_expect { | |
344 | -re "Exec file:\r\n.*break., file type.*$gdb_prompt $"\ | |
345 | { pass "maint info sections" } | |
346 | -re ".*$gdb_prompt $" { fail "maint info sections" } | |
347 | timeout { fail "(timeout) maint info sections" } | |
348 | } | |
349 | ||
350 | send_gdb "maint info breakpoints\n" | |
351 | gdb_expect { | |
352 | -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:60\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\ | |
353 | { pass "maint info breakpoints" } | |
354 | -re ".*$gdb_prompt $" { fail "maint info breakpoints" } | |
355 | timeout { fail "(timeout) maint info breakpoints" } | |
356 | } | |
357 | ||
358 | # Try it again, and check for shlib event info. Not supported everywhere. | |
359 | if {! [istarget "hppa*-*-hpux*"]} then { | |
360 | setup_xfail "*-*-*" | |
361 | } | |
362 | send_gdb "maint info breakpoints\n" | |
363 | gdb_expect { | |
364 | -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:60\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\ | |
365 | { pass "maint info breakpoints: shlib events" } | |
366 | -re ".*$gdb_prompt $" { | |
367 | fail "maint info breakpoints: shlib events" | |
368 | } | |
369 | timeout { | |
370 | fail "(timeout) maint info breakpoints: shlib events" | |
371 | } | |
372 | } | |
373 | ||
374 | ||
375 | send_gdb "maint print\n" | |
376 | gdb_expect { | |
377 | -re "\"maintenance print\" must be followed by the name of a print command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\ | |
378 | { pass "maint print w/o args" } | |
379 | -re ".*$gdb_prompt $" { fail "maint print w/o args" } | |
380 | timeout { fail "(timeout) maint print w/o args" } | |
381 | } | |
382 | ||
383 | send_gdb "maint info\n" | |
384 | gdb_expect { | |
385 | -re "\"maintenance info\" must be followed by the name of an info command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\ | |
386 | { pass "maint info w/o args" } | |
387 | -re ".*$gdb_prompt $" { fail "maint info w/o args" } | |
388 | timeout { fail "(timeout) maint info w/o args" } | |
389 | } | |
390 | ||
391 | send_gdb "maint\n" | |
392 | gdb_expect { | |
393 | -re "\"maintenance\" must be followed by the name of a maintenance command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\ | |
394 | { pass "maint w/o args" } | |
395 | -re ".*$gdb_prompt $" { fail "maint w/o args" } | |
396 | timeout { fail "(timeout) maint w/o args" } | |
397 | } | |
398 | ||
399 | ||
400 | set timeout $oldtimeout | |
401 | ||
402 | #============test help on maint commands | |
403 | ||
404 | send_gdb "help maint\n" | |
405 | gdb_expect { | |
406 | -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\ | |
407 | { pass "help maint" } | |
408 | -re ".*$gdb_prompt $" { fail "help maint" } | |
409 | timeout { fail "(timeout) help maint" } | |
410 | } | |
411 | ||
412 | ||
413 | send_gdb "help maint check-symtabs\n" | |
414 | gdb_expect { | |
415 | -re "Check consistency of psymtabs and symtabs\\..*$gdb_prompt $"\ | |
416 | { pass "help maint check-symtabs" } | |
417 | -re ".*$gdb_prompt $" { fail "help maint check-symtabs" } | |
418 | timeout { fail "(timeout) help maint check-symtabs" } | |
419 | } | |
420 | ||
421 | send_gdb "help maint space\n" | |
422 | gdb_expect { | |
423 | -re "Set the display of space usage\\.\r\nIf nonzero, will cause the execution space for each command to be\r\ndisplayed, following the command's output\\..*$gdb_prompt $"\ | |
424 | { pass "help maint space" } | |
425 | -re ".*$gdb_prompt $" { fail "help maint space" } | |
426 | timeout { fail "(timeout) help maint space" } | |
427 | } | |
428 | ||
429 | send_gdb "help maint time\n" | |
430 | gdb_expect { | |
431 | -re "Set the display of time usage\\.\r\nIf nonzero, will cause the execution time for each command to be\r\ndisplayed, following the command's output\\..*$gdb_prompt $"\ | |
432 | { pass "help maint time" } | |
433 | -re ".*$gdb_prompt $" { fail "help maint time" } | |
434 | timeout { fail "(timeout) help maint time" } | |
435 | } | |
436 | ||
437 | send_gdb "help maint demangle\n" | |
438 | gdb_expect { | |
439 | -re "Demangle a C\\+\\+ mangled name\\.\r\nCall internal GDB demangler routine to demangle a C\\+\\+ link name\r\nand prints the result\\..*$gdb_prompt $"\ | |
440 | { pass "help maint demangle" } | |
441 | -re ".*$gdb_prompt $" { fail "help maint demangle" } | |
442 | timeout { fail "(timeout) help maint demangle" } | |
443 | } | |
444 | ||
445 | send_gdb "help maint dump-me\n" | |
446 | gdb_expect { | |
447 | -re "Get fatal error; make debugger dump its core\\.\r\nGDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\r\nitself a SIGQUIT signal\\..*$gdb_prompt $"\ | |
448 | { pass "help maint dump-me" } | |
449 | -re ".*$gdb_prompt $" { fail "help maint dump-me" } | |
450 | timeout { fail "(timeout) help maint dump-me" } | |
451 | } | |
452 | ||
453 | send_gdb "help maint print statistics\n" | |
454 | gdb_expect { | |
455 | -re "Print statistics about internal gdb state\\..*$gdb_prompt $"\ | |
456 | { pass "help maint print statistics" } | |
457 | -re ".*$gdb_prompt $" { fail "help maint print statistics" } | |
458 | timeout { fail "(timeout) help maint print statistics" } | |
459 | } | |
460 | ||
461 | send_gdb "help maint print objfiles\n" | |
462 | gdb_expect { | |
463 | -re "Print dump of current object file definitions\\..*$gdb_prompt $"\ | |
464 | { pass "help maint print objfiles" } | |
465 | -re ".*$gdb_prompt $" { fail "help maint print objfiles" } | |
466 | timeout { fail "(timeout) help maint print objfiles" } | |
467 | } | |
468 | ||
469 | send_gdb "help maint print psymbols\n" | |
470 | gdb_expect { | |
471 | -re "Print dump of current partial symbol definitions\\.\r\nEntries in the partial symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's partial symbols\\..*$gdb_prompt $"\ | |
472 | { pass "help maint print psymbols" } | |
473 | -re ".*$gdb_prompt $" { fail "help maint print psymbols" } | |
474 | timeout { fail "(timeout) help maint print psymbols" } | |
475 | } | |
476 | ||
477 | send_gdb "help maint print msymbols\n" | |
478 | gdb_expect { | |
479 | -re "Print dump of current minimal symbol definitions\\.\r\nEntries in the minimal symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's minimal symbols\\..*$gdb_prompt $"\ | |
480 | { pass "help maint print msymbols" } | |
481 | -re ".*$gdb_prompt $" { fail "help maint print msymbols" } | |
482 | timeout { fail "(timeout) help maint print msymbols" } | |
483 | } | |
484 | ||
485 | send_gdb "help maint print symbols\n" | |
486 | gdb_expect { | |
487 | -re "Print dump of current symbol definitions\\.\r\nEntries in the full symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's symbols\\..*$gdb_prompt $"\ | |
488 | { pass "help maint print symbols" } | |
489 | -re ".*$gdb_prompt $" { fail "help maint print symbols" } | |
490 | timeout { fail "(timeout) help maint print symbols" } | |
491 | } | |
492 | ||
493 | ||
494 | send_gdb "help maint print type\n" | |
495 | gdb_expect { | |
496 | -re "Print a type chain for a given symbol\\.\r\nFor each node in a type chain, print the raw data for each member of\r\nthe type structure, and the interpretation of the data\\..*$gdb_prompt $"\ | |
497 | { pass "help maint print type" } | |
498 | -re ".*$gdb_prompt $" { fail "help maint print type" } | |
499 | timeout { fail "(timeout) help maint print type" } | |
500 | } | |
501 | ||
502 | #send_gdb "help maint print unwind\n" | |
503 | #gdb_expect { | |
504 | # -re "Print unwind table entry at given address\\..*$gdb_prompt $"\ | |
505 | # { pass "help maint print unwind" } | |
506 | # -re ".*$gdb_prompt $" { fail "help maint print unwind" } | |
507 | # timeout { fail "(timeout) help maint print unwind" } | |
508 | # } | |
509 | ||
510 | send_gdb "help maint info sections\n" | |
511 | gdb_expect { | |
512 | -re "List the BFD sections of the exec and core files\\..*$gdb_prompt $"\ | |
513 | { pass "help maint info sections" } | |
514 | -re ".*$gdb_prompt $" { fail "help maint info sections" } | |
515 | timeout { fail "(timeout) help maint info sections" } | |
516 | } | |
517 | ||
518 | ||
519 | send_gdb "help maint info breakpoints\n" | |
520 | gdb_expect { | |
521 | -re "Status of all breakpoints, or breakpoint number NUMBER.*$gdb_prompt $" { pass "help maint info breakpoints" } | |
522 | -re ".*$gdb_prompt $" { fail "help maint info breakpoints" } | |
523 | timeout { fail "(timeout) help maint info breakpoints" } | |
524 | } | |
525 | ||
526 | #send_gdb "help maint info breakpoints\n" | |
527 | #expect { | |
528 | # -re "Status of all breakpoints, or breakpoint number NUMBER\\.\[ \r\n\t\]+The \"Type\" column indicates one of:\[ \r\n\t\]+breakpoint\[ \t\]+- normal breakpoint\[ \r\n\t\]+watchpoint\[ \t\]+- watchpoint\[ \r\n\t\]+longjmp\[ \t\]+- internal breakpoint used to step through longjmp\\(\\)\[ \r\n\t\]+longjmp resume - internal breakpoint at the target of longjmp\\(\\)\[ \r\n\t\]+until\[ \t\]+- internal breakpoint used by the \"until\" command\[ \r\n\t\]+finish\[ \t\]+- internal breakpoint used by the \"finish\" command\[ \r\n\t\]+The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\[ \r\n\t\]+the disposition of the breakpoint after it gets hit\\. \"dis\" means that the\[ \r\n\t\]+breakpoint will be disabled\\. The \"Address\" and \"What\" columns indicate the\[ \r\n\t\]+address and file.line number respectively\\.\[ \r\n\t\]+Convenience variable \".*\" and default examine address for \"x\"\[ \r\n\t\]+are set to the address of the last breakpoint listed\\.\[ \r\n\t\]+Convenience variable \".bpnum\" contains the number of the last\[ \r\n\t\]+breakpoint set\\..*$gdb_prompt $"\ | |
529 | # { pass "help maint info breakpoints" } | |
530 | # -re ".*$gdb_prompt $" { fail "help maint info breakpoints" } | |
531 | # timeout { fail "(timeout) help maint info breakpoints" } | |
532 | # } | |
533 | ||
534 | send_gdb "help maint info\n" | |
535 | gdb_expect { | |
536 | -re "Commands for showing internal info about the program being debugged.*unambiguous\\..*$gdb_prompt $"\ | |
537 | { pass "help maint info" } | |
538 | -re ".*$gdb_prompt $" { fail "help maint info" } | |
539 | timeout { fail "(timeout) help maint info" } | |
540 | } | |
541 | ||
542 | send_gdb "help maint print\n" | |
543 | gdb_expect { | |
544 | -re "Maintenance command for printing GDB internal state\\.\[\r\n\]+List of maintenance print subcommands:\[\r\n\]+maintenance print msymbols -- Print dump of current minimal symbol definitions.*maintenance print objfiles -- Print dump of current object file definitions.*maintenance print psymbols -- Print dump of current partial symbol definitions.*maintenance print statistics -- Print statistics about internal gdb state.*maintenance print symbols -- Print dump of current symbol definitions.*maintenance print type -- Print a type chain for a given symbol.*Type .help maintenance print. followed by maintenance print subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\ | |
545 | { pass "help maint print" } | |
546 | -re ".*$gdb_prompt $" { fail "help maint print" } | |
547 | timeout { fail "(timeout) help maint print" } | |
548 | } | |
549 | ||
550 | send_gdb "help maint\n" | |
551 | gdb_expect { | |
552 | -re "Commands for use by GDB maintainers\\.\[\r\n\]+Includes commands to dump specific internal GDB structures in\[\r\n\]+a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+to test internal functions such as the C\\+\\+ demangler, etc\\..*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\ | |
553 | { pass "help maint" } | |
554 | -re ".*$gdb_prompt $" { fail "help maint" } | |
555 | timeout { fail "(timeout) help maint" } | |
556 | } | |
557 | ||
558 | #set oldtimeout $timeout | |
559 | #set timeout [expr $timeout + 300] | |
560 | ||
561 | send_gdb "maint dump-me\n" | |
562 | gdb_expect { | |
563 | -re "Should GDB dump core.*\\(y or n\\) $"\ | |
564 | { send_gdb "n\n" | |
565 | gdb_expect { | |
566 | -re ".*$gdb_prompt $" { pass "maint dump-me" } | |
567 | timeout { fail "(timeout) maint dump-me" } | |
568 | } | |
569 | } | |
570 | -re ".*$gdb_prompt $" { fail "maint dump-me" } | |
571 | timeout { fail "(timeout) maint dump-me" } | |
572 | } | |
573 | ||
574 | #set timeout $oldtimeout | |
575 | ||
576 | ||
577 | gdb_exit | |
578 | return 0 |