2010-05-25 Michael Snyder <msnyder@vmware.com>
[binutils-gdb.git] / gdb / testsuite / gdb.base / maint.exp
1 # Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2009, 2010
2 # Free Software Foundation, Inc.
3
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
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
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/>.
16
17 # This file was written by Elena Zannoni (ezannoni@cygnus.com)
18
19 # this file tests maintenance commands and help on those.
20
21 # source file used is break.c
22
23
24 #maintenance check-symtabs -- Check consistency of psymtabs and symtabs
25 #maintenance space -- Set the display of space usage
26 #maintenance set -- Set GDB internal variables used by the GDB maintainer
27 #maintenance show -- Show GDB internal variables used by the GDB maintainer
28 #maintenance time -- Set the display of time usage
29 #maintenance demangle -- Demangle a C++ mangled name
30 #maintenance dump-me -- Get fatal error; make debugger dump its core
31 #maintenance print -- Maintenance command for printing GDB internal state
32 #maintenance info -- Commands for showing internal info about the program being debugged
33 #maintenance internal-error -- Give GDB an internal error.
34 #
35 #maintenance print dummy-frames -- Print the dummy frame stack
36 #maintenance print statistics -- Print statistics about internal gdb state
37 #maintenance print objfiles -- Print dump of current object file definitions
38 #maintenance print psymbols -- Print dump of current partial symbol definitions
39 #maintenance print msymbols -- Print dump of current minimal symbol definitions
40 #maintenance print symbols -- Print dump of current symbol definitions
41 #maintenance print type -- Print a type chain for a given symbol
42 #maintenance print unwind -- Print unwind table entry at given address
43 #
44 #
45 #maintenance info sections -- List the BFD sections of the exec and core files
46 #maintenance info breakpoints -- Status of all breakpoints
47 #
48
49
50
51 if $tracelevel then {
52 strace $tracelevel
53 }
54
55 global usestubs
56
57 #
58 # test running programs
59 #
60
61 set testfile "break"
62 set srcfile ${testfile}.c
63 set srcfile1 ${testfile}1.c
64 set binfile ${objdir}/${subdir}/${testfile}
65
66 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
67 untested maint.exp
68 return -1
69 }
70
71 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
72 untested maint.exp
73 return -1
74 }
75
76 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
77 untested maint.exp
78 return -1
79 }
80
81
82 gdb_exit
83 gdb_start
84 gdb_reinitialize_dir $srcdir/$subdir
85 gdb_load ${binfile}
86
87 if ![runto_main] then {
88 perror "tests suppressed"
89 }
90
91
92 # The commands we test here produce many lines of output; disable "press
93 # <return> to continue" prompts.
94 gdb_test_no_output "set height 0"
95
96
97 #
98 # this command does not produce any output
99 # unless there is some problem with the symtabs and psymtabs
100 # so that branch will really never be covered in this tests here!!
101 #
102
103 # guo: on linux this command output is huge. for some reason splitting up
104 # the regexp checks works.
105 #
106 send_gdb "maint check-symtabs\n"
107 gdb_expect {
108 -re "^maint check-symtabs" {
109 gdb_expect {
110 -re "$gdb_prompt $" {
111 pass "maint check-symtabs"
112 }
113 timeout { fail "(timeout) maint check-symtabs" }
114 }
115 }
116 -re ".*$gdb_prompt $" { fail "maint check-symtabs" }
117 timeout { fail "(timeout) maint check-symtabs" }
118 }
119
120 gdb_test "maint space" \
121 "\"maintenance space\" takes a numeric argument\\."
122
123 gdb_test "maint space 1" \
124 "Space used: $decimal \\(\\+$decimal for this command\\)"
125
126 gdb_test "maint time" \
127 "\"maintenance time\" takes a numeric argument\\..*Space used: $decimal \\(\\+$decimal for this command\\)"
128
129 gdb_test "maint time 1" \
130 "Command execution time: $decimal.*Space used: $decimal \\(\\+$decimal for this command\\)"
131
132 gdb_test "maint time 0" \
133 "Space used: $decimal \\(\\+$decimal for this command\\)"
134
135 gdb_test_no_output "maint space 0"
136
137 gdb_test "maint demangle" \
138 "\"maintenance demangle\" takes an argument to demangle\\."
139
140 gdb_test "maint demangle main" "Can't demangle \"main\""
141
142
143
144 # The timeout value is raised, because printing all the symbols and
145 # statistical information about Cygwin and Windows libraries takes a lot
146 # of time.
147 if [istarget "*-*-cygwin*"] {
148 set oldtimeout $timeout
149 set timeout [expr $timeout + 500]
150 }
151
152 gdb_test_multiple "maint print statistics" "maint print statistics" {
153 -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Number of psym tables \\(not yet expanded\\).*Number of symbol tables.*Number of symbol tables with line tables.*Number of symbol tables with blockvectors.*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 $" {
154 # Old output for gdb 6.0 and earlier
155 pass "maint print statistics"
156 }
157 -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Number of psym tables \\(not yet expanded\\).*Number of symbol tables.*Number of symbol tables with line tables.*Number of symbol tables with blockvectors.*Total memory used for objfile obstack.*Total memory used for psymbol cache.*Total memory used for macro cache.*$gdb_prompt $" {
158 pass "maint print statistics"
159 }
160 }
161
162 # There aren't any ...
163 gdb_test "maint print dummy-frames" ""
164
165 send_gdb "maint print objfiles\n"
166
167 # To avoid timeouts, we avoid expects with many .* patterns that match
168 # many lines. Instead, we keep track of which milestones we've seen
169 # in the output, and stop when we've seen all of them.
170
171 set header 0
172 set psymtabs 0
173 set symtabs 0
174 set keep_looking 1
175
176 while {$keep_looking} {
177 gdb_expect {
178
179 -re ".*Object file.*break($EXEEXT)?: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
180 -re ".*Psymtabs:\[\r\t \]+\n" { set psymtabs 1 }
181 -re ".*Symtabs:\[\r\t \]+\n" { set symtabs 1 }
182
183 -re ".*$gdb_prompt $" {
184 set keep_looking 0
185 }
186 timeout {
187 fail "(timeout) maint print objfiles"
188 set keep_looking 0
189 }
190 }
191 }
192
193 proc maint_pass_if {val name} {
194 if $val { pass $name } else { fail $name }
195 }
196
197 maint_pass_if $header "maint print objfiles: header"
198 maint_pass_if $psymtabs "maint print objfiles: psymtabs"
199 maint_pass_if $symtabs "maint print objfiles: symtabs"
200
201 gdb_test "maint print psymbols" \
202 "print-psymbols takes an output file name and optional symbol file name" \
203 "maint print psymbols w/o args"
204
205
206
207 send_gdb "maint print psymbols psymbols_output ${srcdir}/${subdir}/${srcfile}\n"
208 gdb_expect {
209 -re "^maint print psymbols psymbols_output \[^\n\]*\r\n$gdb_prompt $" {
210 send_gdb "shell ls psymbols_output\n"
211 gdb_expect {
212 -re "psymbols_output\r\n$gdb_prompt $" {
213 # We want this grep to be as specific as possible,
214 # so it's less likely to match symbol file names in
215 # psymbols_output. Yes, this actually happened;
216 # poor expect got tons of output, and timed out
217 # trying to match it. --- Jim Blandy <jimb@cygnus.com>
218 send_gdb "shell grep 'main.*function' psymbols_output\n"
219 gdb_expect {
220 -re ".main., function, $hex.*$gdb_prompt $" {
221 pass "maint print psymbols 1"
222 }
223 -re ".*main. .., function, $hex.*$gdb_prompt $" {
224 pass "maint print psymbols 2"
225 }
226 -re ".*$gdb_prompt $" { fail "maint print psymbols" }
227 timeout { fail "(timeout) maint print psymbols" }
228 }
229 gdb_test "shell rm -f psymbols_output" ""
230 }
231 -re ".*$gdb_prompt $" { fail "maint print psymbols" }
232 timeout { fail "(timeout) maint print psymbols" }
233 }
234 }
235 -re ".*$gdb_prompt $" { fail "maint print psymbols" }
236 timeout { fail "(timeout) maint print psymbols" }
237 }
238
239 gdb_test "maint print msymbols" \
240 "print-msymbols takes an output file name and optional symbol file name" \
241 "maint print msymbols w/o args"
242
243
244 send_gdb "maint print msymbols msymbols_output ${binfile}\n"
245 gdb_expect {
246 -re "^maint print msymbols msymbols_output \[^\n\]*\r\n$gdb_prompt $" {
247 send_gdb "shell ls msymbols_output\n"
248 gdb_expect {
249 -re "msymbols_output\r\n$gdb_prompt $" {
250 send_gdb "shell grep factorial msymbols_output\n"
251 gdb_expect {
252 -re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex factorial.*$gdb_prompt $" {
253 pass "maint print msymbols"
254 }
255 -re ".*$gdb_prompt $" { fail "maint print msymbols" }
256 timeout { fail "(timeout) maint print msymbols" }
257 }
258 gdb_test "shell rm -f msymbols_output" ""
259 }
260 -re ".*$gdb_prompt $" { fail "maint print msymbols" }
261 timeout { fail "(timeout) maint print msymbols" }
262 }
263 }
264 -re ".*$gdb_prompt $" { fail "maint print msymbols" }
265 timeout { fail "(timeout) maint print msymbols" }
266 }
267
268 # Check that maint print msymbols allows relative pathnames
269 set mydir [pwd]
270 gdb_test "cd ${objdir}" \
271 "Working directory [string_to_regexp ${objdir}]\..*" \
272 "cd to objdir"
273
274 gdb_test_multiple "maint print msymbols msymbols_output2 ${subdir}/${testfile}" "maint print msymbols" {
275 -re "^maint print msymbols msymbols_output2 \[^\n\]*\r\n$gdb_prompt $" {
276 gdb_test_multiple "shell ls msymbols_output2" "maint print msymbols" {
277 -re "msymbols_output2\r\n$gdb_prompt $" {
278 gdb_test_multiple "shell grep factorial msymbols_output2" "maint print msymbols" {
279 -re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex factorial.*$gdb_prompt $" {
280 pass "maint print msymbols"
281 }
282 -re ".*$gdb_prompt $" {
283 fail "maint print msymbols"
284 }
285 timeout {
286 fail "(timeout) maint print msymbols"
287 }
288 }
289 gdb_test "shell rm -f msymbols_output2" ""
290 }
291 -re ".*$gdb_prompt $" {
292 fail "maint print msymbols"
293 }
294 timeout {
295 fail "(timeout) maint print msymbols"
296 }
297 }
298 }
299 -re ".*$gdb_prompt $" {
300 fail "maint print msymbols"
301 }
302 timeout {
303 fail "(timeout) maint print msymbols"
304 }
305 }
306 gdb_test "cd ${mydir}" \
307 "Working directory [string_to_regexp ${mydir}]\..*" \
308 "cd to mydir"
309
310 gdb_test "maint print symbols" \
311 "Arguments missing: an output file name and an optional symbol file name" \
312 "maint print symbols w/o args"
313
314
315 # Request symbols for one particular source file so that we don't try to
316 # dump the symbol information for the entire C library - over 500MB nowadays
317 # for GNU libc.
318
319 send_gdb "maint print symbols symbols_output ${srcdir}/${subdir}/${srcfile}\n"
320 gdb_expect {
321 -re "^maint print symbols symbols_output \[^\n\]*\r\n$gdb_prompt $" {
322 send_gdb "shell ls symbols_output\n"
323 gdb_expect {
324 -re "symbols_output\r\n$gdb_prompt $" {
325 # See comments for `maint print psymbols'.
326 send_gdb "shell grep 'main(.*block' symbols_output\n"
327 gdb_expect {
328 -re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $" {
329 pass "maint print symbols"
330 }
331 -re ".*$gdb_prompt $" { fail "maint print symbols" }
332 timeout { fail "(timeout) maint print symbols" }
333 }
334 gdb_test "shell rm -f symbols_output" ""
335 }
336 -re ".*$gdb_prompt $" { fail "maint print symbols" }
337 timeout { fail "(timeout) maint print symbols" }
338 }
339 }
340 -re ".*$gdb_prompt $" { fail "maint print symbols" }
341 timeout { fail "(timeout) maint print symbols" }
342 }
343
344 set msg "maint print type"
345 gdb_test_multiple "maint print type argc" $msg {
346 -re "type node $hex\r\nname .int. \\($hex\\)\r\ntagname .<NULL>. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ntype_chain $hex\r\ninstance_flags $hex\r\nflags\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\n$gdb_prompt $" {
347 pass $msg
348 }
349 }
350
351 if [istarget "hppa*-*-11*"] {
352 setup_xfail hppa*-*-*11* CLLbs14860
353 gdb_test_multiple "maint print unwind &main" "maint print unwind" {
354 -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\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 $" {
355 pass "maint print unwind"
356 }
357 -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n$gdb_prompt $" {
358 xfail "maint print unwind"
359 }
360 }
361 }
362
363 set oldtimeout $timeout
364 set timeout [expr $timeout + 300]
365
366 # It'd be nice to check for every possible section. However, that's
367 # problematic, since the relative ordering wanders from release to
368 # release of the compilers. Instead, we'll just check for two
369 # sections which appear to always come out in the same relative
370 # order. (If that changes, then we should just check for one
371 # section.)
372 #
373 # And by the way: This testpoint will break for PA64, where a.out's
374 # are ELF files.
375
376 # Standard GNU names.
377 set text_section ".text"
378 set data_section ".data"
379
380 gdb_test_multiple "maint info sections" "maint info sections" {
381 -re "Exec file:\r\n.*break($EXEEXT)?., file type.*ER_RO.*$gdb_prompt $" {
382 # Looks like RealView which uses different section names.
383 set text_section ER_RO
384 set data_section ER_RW
385 pass "maint info sections"
386 }
387 -re "Exec file:\r\n.*break($EXEEXT)?., file type.*$gdb_prompt $" {
388 pass "maint info sections"
389 }
390 }
391
392 # Test for new option: maint info sections <section name>
393 # If you don't have a .text section, this will require tweaking.
394
395 gdb_test_multiple "maint info sections $text_section" \
396 "maint info sections .text" {
397 -re ".* \\.bss .*$gdb_prompt $" {
398 fail "maint info sections .text"
399 }
400 -re ".* $data_section .*$gdb_prompt $" {
401 fail "maint info sections .text"
402 }
403 -re ".* $text_section .*$gdb_prompt $" {
404 pass "maint info sections .text"
405 }
406 }
407
408 # Test for new option: CODE section flag
409 # If your data section is tagged CODE, xfail this test.
410
411 gdb_test_multiple "maint info sections CODE" "maint info sections CODE" {
412 -re ".* $data_section .*$gdb_prompt $" { fail "maint info sections CODE" }
413 -re ".* $text_section .*$gdb_prompt $" { pass "maint info sections CODE" }
414 }
415
416 # Test for new option: DATA section flag
417 # If your text section is tagged DATA, xfail this test.
418 #
419 # The "maint info sections DATA" test is marked for XFAIL on Cygwin,
420 # because Windows has text sections marked DATA.
421 setup_xfail "*-*-*cygwin*"
422
423 gdb_test_multiple "maint info sections DATA" "maint info sections DATA" {
424 -re ".* $text_section .*$gdb_prompt $" { fail "maint info sections DATA" }
425 -re ".* $data_section .*$gdb_prompt $" { pass "maint info sections DATA" }
426 -re ".* .rodata .*$gdb_prompt $" { pass "maint info sections DATA" }
427 }
428
429 set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
430
431 gdb_test_multiple "maint info breakpoints" "maint info breakpoints" {
432 -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:$bp_location6 inf 1\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $" {
433 pass "maint info breakpoints"
434 }
435 -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:$bp_location6 sspace 1\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 $" {
436 pass "maint info breakpoints (with shlib events)"
437 }
438 }
439
440 gdb_test "maint print" \
441 "\"maintenance print\" must be followed by the name of a print command\\.\r\nList.*unambiguous\\..*" \
442 "maint print w/o args"
443
444 gdb_test "maint info" \
445 "\"maintenance info\" must be followed by the name of an info command\\.\r\nList.*unambiguous\\..*" \
446 "maint info w/o args"
447
448 gdb_test "maint" \
449 "\"maintenance\" must be followed by the name of a maintenance command\\.\r\nList.*unambiguous\\..*" \
450 "maint w/o args"
451
452 set timeout $oldtimeout
453
454 #============test help on maint commands
455
456 gdb_test "help maint" \
457 "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../ObjC demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*(maintenance dump-me.*)?maintenance info.*maintenance internal-error.*maintenance print.*maintenance set.*maintenance show.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*"
458
459 gdb_test "help maint check-symtabs" \
460 "Check consistency of psymtabs and symtabs\\..*"
461
462 gdb_test "help maint space" \
463 "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\\..*"
464
465 gdb_test "help maint time" \
466 "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\\..*"
467
468 gdb_test "help maint demangle" \
469 "Demangle a C\\+\\+/ObjC mangled name\\.\r\nCall internal GDB demangler routine to demangle a C\\+\\+ link name\r\nand prints the result\\..*"
470
471 gdb_test "help maint dump-me" \
472 "Get fatal error; make debugger dump its core\\.\r\nGDB sets its handling of SIGQUIT back to SIG_DFL and then sends\r\nitself a SIGQUIT signal\\..*"
473
474 gdb_test "help maint internal-error" \
475 "Give GDB an internal error\\.\r\nCause GDB to behave as if an internal error was detected\\..*"
476
477 gdb_test "help maint internal-warning" \
478 "Give GDB an internal warning\\.\r\nCause GDB to behave as if an internal warning was reported\\..*"
479
480 gdb_test "help maint print statistics" \
481 "Print statistics about internal gdb state\\..*"
482
483 gdb_test "help maint print dummy-frames" \
484 "Print the contents of the internal dummy-frame stack."
485
486 gdb_test "help maint print objfiles" \
487 "Print dump of current object file definitions\\..*"
488
489 gdb_test "help maint print psymbols" \
490 "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\\..*"
491
492 gdb_test "help maint print msymbols" \
493 "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\\..*"
494
495 gdb_test "help maint print symbols" \
496 "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\\..*"
497
498 gdb_test "help maint print type" \
499 "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\\..*"
500
501 if [istarget "hppa*-*-*"] {
502 gdb_test "help maint print unwind" \
503 "Print unwind table entry at given address\\..*"
504 }
505
506 gdb_test "help maint info sections" \
507 "List the BFD sections of the exec and core files\\..*"
508
509 gdb_test "help maint info breakpoints" \
510 "Status of all breakpoints, or breakpoint number NUMBER.*"
511
512
513 #send_gdb "help maint info breakpoints\n"
514 #expect {
515 # -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 $"\
516 # { pass "help maint info breakpoints" }
517 # -re ".*$gdb_prompt $" { fail "help maint info breakpoints" }
518 # timeout { fail "(timeout) help maint info breakpoints" }
519 # }
520
521 gdb_test "help maint info" \
522 "Commands for showing internal info about the program being debugged.*unambiguous\\..*"
523
524 test_prefix_command_help {"maint print" "maintenance print"} {
525 "Maintenance command for printing GDB internal state\\.\[\r\n\]+"
526 }
527
528 test_prefix_command_help {"maint" "maintenance"} {
529 "Commands for use by GDB maintainers\\.\[\r\n\]+"
530 "Includes commands to dump specific internal GDB structures in\[\r\n\]+"
531 "a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+"
532 "to test internal functions such as the C\\+\\+/ObjC demangler, etc\\.\[\r\n\]+"
533 }
534
535 #set oldtimeout $timeout
536 #set timeout [expr $timeout + 300]
537
538 gdb_test_multiple "maint dump-me" "maint dump-me" {
539 -re "Should GDB dump core.*\\(y or n\\) $" {
540 gdb_test "n" ".*" "maint dump-me"
541 }
542 }
543
544 send_gdb "maint internal-error\n"
545 gdb_expect {
546 -re "A problem internal to GDB has been detected" {
547 pass "maint internal-error"
548 if [gdb_internal_error_resync] {
549 pass "internal-error resync"
550 } else {
551 fail "internal-error resync"
552 }
553 }
554 -re ".*$gdb_prompt $" {
555 fail "maint internal-error"
556 untested "internal-error resync"
557 }
558 timeout {
559 fail "maint internal-error (timeout)"
560 untested "internal-error resync"
561 }
562 }
563
564 #set timeout $oldtimeout
565
566
567 gdb_exit
568 return 0