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