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