* gdb.base/maint.exp (maint print statistics): Increase timeout for
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / maint.exp
CommitLineData
4c38e0a4 1# Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2009, 2010
6aba47ca 2# Free Software Foundation, Inc.
c906108c
SS
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
e22f8b7c 6# the Free Software Foundation; either version 3 of the License, or
c906108c 7# (at your option) any later version.
e22f8b7c 8#
c906108c
SS
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.
e22f8b7c 13#
c906108c 14# You should have received a copy of the GNU General Public License
e22f8b7c 15# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 16
c906108c
SS
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
4f337972
AC
26#maintenance set -- Set GDB internal variables used by the GDB maintainer
27#maintenance show -- Show GDB internal variables used by the GDB maintainer
c906108c
SS
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
7be570e7 33#maintenance internal-error -- Give GDB an internal error.
c906108c 34#
00905d52 35#maintenance print dummy-frames -- Print the dummy frame stack
c906108c
SS
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
51if $tracelevel then {
52 strace $tracelevel
53 }
54
55global usestubs
56
57#
58# test running programs
59#
c906108c
SS
60
61set testfile "break"
62set srcfile ${testfile}.c
a1dea79a 63set srcfile1 ${testfile}1.c
c906108c 64set binfile ${objdir}/${subdir}/${testfile}
a1dea79a 65
fc91c6c2 66if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
b60f0898
JB
67 untested maint.exp
68 return -1
a1dea79a
FF
69}
70
fc91c6c2 71if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
b60f0898
JB
72 untested maint.exp
73 return -1
a1dea79a
FF
74}
75
fc91c6c2 76if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
b60f0898
JB
77 untested maint.exp
78 return -1
c906108c
SS
79}
80
81
82gdb_exit
83gdb_start
84gdb_reinitialize_dir $srcdir/$subdir
85gdb_load ${binfile}
86
87if ![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.
65731a6b 94gdb_test_no_output "set height 0"
c906108c 95
c906108c
SS
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
a0b3c4fd
JM
103# guo: on linux this command output is huge. for some reason splitting up
104# the regexp checks works.
105#
c906108c
SS
106send_gdb "maint check-symtabs\n"
107gdb_expect {
65731a6b
MS
108 -re "^maint check-symtabs" {
109 gdb_expect {
110 -re "$gdb_prompt $" {
111 pass "maint check-symtabs"
a0b3c4fd 112 }
65731a6b 113 timeout { fail "(timeout) maint check-symtabs" }
a0b3c4fd 114 }
65731a6b
MS
115 }
116 -re ".*$gdb_prompt $" { fail "maint check-symtabs" }
117 timeout { fail "(timeout) maint check-symtabs" }
118}
c906108c 119
65731a6b
MS
120gdb_test "maint space" \
121 "\"maintenance space\" takes a numeric argument\\."
c906108c 122
65731a6b
MS
123gdb_test "maint space 1" \
124 "Space used: $decimal \\(\\+$decimal for this command\\)"
c906108c 125
65731a6b
MS
126gdb_test "maint time" \
127 "\"maintenance time\" takes a numeric argument\\..*Space used: $decimal \\(\\+$decimal for this command\\)"
c906108c 128
65731a6b
MS
129gdb_test "maint time 1" \
130 "Command execution time: $decimal.*Space used: $decimal \\(\\+$decimal for this command\\)"
c906108c 131
65731a6b
MS
132gdb_test "maint time 0" \
133 "Space used: $decimal \\(\\+$decimal for this command\\)"
c906108c 134
65731a6b 135gdb_test_no_output "maint space 0"
c906108c 136
65731a6b
MS
137gdb_test "maint demangle" \
138 "\"maintenance demangle\" takes an argument to demangle\\."
c906108c 139
65731a6b 140gdb_test "maint demangle main" "Can't demangle \"main\""
c906108c 141
c906108c 142
c906108c 143
dbdfa66c
CV
144# The timeout value is raised, because printing all the symbols and
145# statistical information about Cygwin and Windows libraries takes a lot
f4704706
DE
146# of time. This has been noticed on some linux systems too, so just raise
147# the timeout globally.
148set oldtimeout $timeout
149set timeout [expr $timeout + 500]
c906108c 150
55b7ce7f
UW
151send_gdb "maint print statistics\n"
152gdb_expect {
153 -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" {
154 gdb_expect {
155 -re "$gdb_prompt $" {
156 pass "maint print statistics"
157 }
158 timeout { fail "(timeout) maint print statistics" }
159 }
65731a6b 160 }
55b7ce7f
UW
161 -re ".*$gdb_prompt $" { fail "maint print statistics" }
162 timeout { fail "(timeout) maint print statistics" }
65731a6b 163}
c906108c 164
f4704706
DE
165set timeout $oldtimeout
166
00905d52 167# There aren't any ...
27d3a1a2 168gdb_test_no_output "maint print dummy-frames"
00905d52 169
c906108c 170send_gdb "maint print objfiles\n"
adf40b2e 171
c906108c 172# To avoid timeouts, we avoid expects with many .* patterns that match
adf40b2e
JM
173# many lines. Instead, we keep track of which milestones we've seen
174# in the output, and stop when we've seen all of them.
175
176set header 0
177set psymtabs 0
178set symtabs 0
179set keep_looking 1
180
181while {$keep_looking} {
182 gdb_expect {
183
03dd63aa 184 -re ".*Object file.*break($EXEEXT)?: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
adf40b2e
JM
185 -re ".*Psymtabs:\[\r\t \]+\n" { set psymtabs 1 }
186 -re ".*Symtabs:\[\r\t \]+\n" { set symtabs 1 }
187
188 -re ".*$gdb_prompt $" {
189 set keep_looking 0
190 }
191 timeout {
192 fail "(timeout) maint print objfiles"
193 set keep_looking 0
194 }
195 }
c906108c 196}
adf40b2e
JM
197
198proc maint_pass_if {val name} {
199 if $val { pass $name } else { fail $name }
c906108c
SS
200}
201
adf40b2e
JM
202maint_pass_if $header "maint print objfiles: header"
203maint_pass_if $psymtabs "maint print objfiles: psymtabs"
204maint_pass_if $symtabs "maint print objfiles: symtabs"
205
65731a6b
MS
206gdb_test "maint print psymbols" \
207 "print-psymbols takes an output file name and optional symbol file name" \
208 "maint print psymbols w/o args"
209
210
c906108c 211
3bcbaac5 212send_gdb "maint print psymbols psymbols_output ${srcdir}/${subdir}/${srcfile}\n"
c906108c 213gdb_expect {
65731a6b
MS
214 -re "^maint print psymbols psymbols_output \[^\n\]*\r\n$gdb_prompt $" {
215 send_gdb "shell ls psymbols_output\n"
216 gdb_expect {
217 -re "psymbols_output\r\n$gdb_prompt $" {
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 1"
227 }
228 -re ".*main. .., function, $hex.*$gdb_prompt $" {
229 pass "maint print psymbols 2"
230 }
231 -re ".*$gdb_prompt $" { fail "maint print psymbols" }
232 timeout { fail "(timeout) maint print psymbols" }
233 }
f6978de9 234 gdb_test "shell rm -f psymbols_output" ".*"
65731a6b
MS
235 }
236 -re ".*$gdb_prompt $" { fail "maint print psymbols" }
237 timeout { fail "(timeout) maint print psymbols" }
238 }
239 }
240 -re ".*$gdb_prompt $" { fail "maint print psymbols" }
241 timeout { fail "(timeout) maint print psymbols" }
242}
c906108c 243
65731a6b
MS
244gdb_test "maint print msymbols" \
245 "print-msymbols takes an output file name and optional symbol file name" \
246 "maint print msymbols w/o args"
c906108c 247
c906108c 248
3bcbaac5 249send_gdb "maint print msymbols msymbols_output ${binfile}\n"
c906108c 250gdb_expect {
65731a6b
MS
251 -re "^maint print msymbols msymbols_output \[^\n\]*\r\n$gdb_prompt $" {
252 send_gdb "shell ls msymbols_output\n"
253 gdb_expect {
254 -re "msymbols_output\r\n$gdb_prompt $" {
255 send_gdb "shell grep factorial msymbols_output\n"
256 gdb_expect {
efd11a33 257 -re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex \\.?factorial.*$gdb_prompt $" {
65731a6b
MS
258 pass "maint print msymbols"
259 }
260 -re ".*$gdb_prompt $" { fail "maint print msymbols" }
261 timeout { fail "(timeout) maint print msymbols" }
262 }
f6978de9 263 gdb_test "shell rm -f msymbols_output" ".*"
65731a6b
MS
264 }
265 -re ".*$gdb_prompt $" { fail "maint print msymbols" }
266 timeout { fail "(timeout) maint print msymbols" }
267 }
268 }
269 -re ".*$gdb_prompt $" { fail "maint print msymbols" }
270 timeout { fail "(timeout) maint print msymbols" }
271}
c906108c 272
dbdfa66c
CV
273# Check that maint print msymbols allows relative pathnames
274set mydir [pwd]
65731a6b
MS
275gdb_test "cd ${objdir}" \
276 "Working directory [string_to_regexp ${objdir}]\..*" \
277 "cd to objdir"
278
dbdfa66c
CV
279gdb_test_multiple "maint print msymbols msymbols_output2 ${subdir}/${testfile}" "maint print msymbols" {
280 -re "^maint print msymbols msymbols_output2 \[^\n\]*\r\n$gdb_prompt $" {
281 gdb_test_multiple "shell ls msymbols_output2" "maint print msymbols" {
282 -re "msymbols_output2\r\n$gdb_prompt $" {
283 gdb_test_multiple "shell grep factorial msymbols_output2" "maint print msymbols" {
efd11a33 284 -re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex \\.?factorial.*$gdb_prompt $" {
dbdfa66c
CV
285 pass "maint print msymbols"
286 }
287 -re ".*$gdb_prompt $" {
288 fail "maint print msymbols"
289 }
290 timeout {
291 fail "(timeout) maint print msymbols"
292 }
293 }
f6978de9 294 gdb_test "shell rm -f msymbols_output2" ".*"
dbdfa66c
CV
295 }
296 -re ".*$gdb_prompt $" {
297 fail "maint print msymbols"
298 }
299 timeout {
300 fail "(timeout) maint print msymbols"
301 }
302 }
303 }
304 -re ".*$gdb_prompt $" {
305 fail "maint print msymbols"
306 }
307 timeout {
308 fail "(timeout) maint print msymbols"
309 }
310}
65731a6b
MS
311gdb_test "cd ${mydir}" \
312 "Working directory [string_to_regexp ${mydir}]\..*" \
313 "cd to mydir"
314
315gdb_test "maint print symbols" \
316 "Arguments missing: an output file name and an optional symbol file name" \
317 "maint print symbols w/o args"
c906108c 318
c906108c 319
3bcbaac5
DJ
320# Request symbols for one particular source file so that we don't try to
321# dump the symbol information for the entire C library - over 500MB nowadays
322# for GNU libc.
adf40b2e 323
3bcbaac5 324send_gdb "maint print symbols symbols_output ${srcdir}/${subdir}/${srcfile}\n"
c906108c 325gdb_expect {
65731a6b
MS
326 -re "^maint print symbols symbols_output \[^\n\]*\r\n$gdb_prompt $" {
327 send_gdb "shell ls symbols_output\n"
328 gdb_expect {
329 -re "symbols_output\r\n$gdb_prompt $" {
330 # See comments for `maint print psymbols'.
331 send_gdb "shell grep 'main(.*block' symbols_output\n"
332 gdb_expect {
333 -re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $" {
334 pass "maint print symbols"
335 }
336 -re ".*$gdb_prompt $" { fail "maint print symbols" }
337 timeout { fail "(timeout) maint print symbols" }
338 }
f6978de9 339 gdb_test "shell rm -f symbols_output" ".*"
65731a6b
MS
340 }
341 -re ".*$gdb_prompt $" { fail "maint print symbols" }
342 timeout { fail "(timeout) maint print symbols" }
343 }
344 }
345 -re ".*$gdb_prompt $" { fail "maint print symbols" }
346 timeout { fail "(timeout) maint print symbols" }
347}
c906108c 348
b4ba55a1
JB
349set msg "maint print type"
350gdb_test_multiple "maint print type argc" $msg {
351 -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 $" {
352 pass $msg
353 }
354}
c906108c 355
a0b3c4fd
JM
356if [istarget "hppa*-*-11*"] {
357 setup_xfail hppa*-*-*11* CLLbs14860
65731a6b
MS
358 gdb_test_multiple "maint print unwind &main" "maint print unwind" {
359 -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 $" {
360 pass "maint print unwind"
361 }
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\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n$gdb_prompt $" {
363 xfail "maint print unwind"
364 }
a0b3c4fd
JM
365 }
366}
c906108c
SS
367
368set oldtimeout $timeout
369set timeout [expr $timeout + 300]
370
371# It'd be nice to check for every possible section. However, that's
372# problematic, since the relative ordering wanders from release to
373# release of the compilers. Instead, we'll just check for two
374# sections which appear to always come out in the same relative
375# order. (If that changes, then we should just check for one
376# section.)
377#
378# And by the way: This testpoint will break for PA64, where a.out's
379# are ELF files.
293e2f9e
DJ
380
381# Standard GNU names.
382set text_section ".text"
383set data_section ".data"
384
65731a6b
MS
385gdb_test_multiple "maint info sections" "maint info sections" {
386 -re "Exec file:\r\n.*break($EXEEXT)?., file type.*ER_RO.*$gdb_prompt $" {
387 # Looks like RealView which uses different section names.
388 set text_section ER_RO
389 set data_section ER_RW
390 pass "maint info sections"
391 }
392 -re "Exec file:\r\n.*break($EXEEXT)?., file type.*$gdb_prompt $" {
393 pass "maint info sections"
394 }
395}
c906108c 396
8ddad156
MS
397# Test for new option: maint info sections <section name>
398# If you don't have a .text section, this will require tweaking.
65731a6b
MS
399
400gdb_test_multiple "maint info sections $text_section" \
401 "maint info sections .text" {
402 -re ".* \\.bss .*$gdb_prompt $" {
403 fail "maint info sections .text"
404 }
405 -re ".* $data_section .*$gdb_prompt $" {
406 fail "maint info sections .text"
407 }
408 -re ".* $text_section .*$gdb_prompt $" {
409 pass "maint info sections .text"
410 }
411 }
8ddad156
MS
412
413# Test for new option: CODE section flag
414# If your data section is tagged CODE, xfail this test.
65731a6b
MS
415
416gdb_test_multiple "maint info sections CODE" "maint info sections CODE" {
293e2f9e
DJ
417 -re ".* $data_section .*$gdb_prompt $" { fail "maint info sections CODE" }
418 -re ".* $text_section .*$gdb_prompt $" { pass "maint info sections CODE" }
8ddad156
MS
419}
420
421# Test for new option: DATA section flag
422# If your text section is tagged DATA, xfail this test.
dbdfa66c
CV
423#
424# The "maint info sections DATA" test is marked for XFAIL on Cygwin,
425# because Windows has text sections marked DATA.
426setup_xfail "*-*-*cygwin*"
65731a6b
MS
427
428gdb_test_multiple "maint info sections DATA" "maint info sections DATA" {
293e2f9e
DJ
429 -re ".* $text_section .*$gdb_prompt $" { fail "maint info sections DATA" }
430 -re ".* $data_section .*$gdb_prompt $" { pass "maint info sections DATA" }
759f0f0b 431 -re ".* .rodata .*$gdb_prompt $" { pass "maint info sections DATA" }
8ddad156
MS
432}
433
a1dea79a
FF
434set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
435
65731a6b
MS
436gdb_test_multiple "maint info breakpoints" "maint info breakpoints" {
437 -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 $" {
438 pass "maint info breakpoints"
439 }
440 -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 $" {
441 pass "maint info breakpoints (with shlib events)"
442 }
c906108c
SS
443}
444
65731a6b
MS
445gdb_test "maint print" \
446 "\"maintenance print\" must be followed by the name of a print command\\.\r\nList.*unambiguous\\..*" \
447 "maint print w/o args"
c906108c 448
65731a6b
MS
449gdb_test "maint info" \
450 "\"maintenance info\" must be followed by the name of an info command\\.\r\nList.*unambiguous\\..*" \
451 "maint info w/o args"
c906108c 452
65731a6b
MS
453gdb_test "maint" \
454 "\"maintenance\" must be followed by the name of a maintenance command\\.\r\nList.*unambiguous\\..*" \
455 "maint w/o args"
c906108c
SS
456
457set timeout $oldtimeout
458
459#============test help on maint commands
460
65731a6b
MS
461gdb_test "help maint" \
462 "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\\..*"
c906108c 463
65731a6b
MS
464gdb_test "help maint check-symtabs" \
465 "Check consistency of psymtabs and symtabs\\..*"
c906108c 466
65731a6b
MS
467gdb_test "help maint space" \
468 "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\\..*"
c906108c 469
65731a6b
MS
470gdb_test "help maint time" \
471 "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\\..*"
c906108c 472
65731a6b
MS
473gdb_test "help maint demangle" \
474 "Demangle a C\\+\\+/ObjC mangled name\\.\r\nCall internal GDB demangler routine to demangle a C\\+\\+ link name\r\nand prints the result\\..*"
c906108c 475
65731a6b
MS
476gdb_test "help maint dump-me" \
477 "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\\..*"
c906108c 478
65731a6b
MS
479gdb_test "help maint internal-error" \
480 "Give GDB an internal error\\.\r\nCause GDB to behave as if an internal error was detected\\..*"
7be570e7 481
65731a6b
MS
482gdb_test "help maint internal-warning" \
483 "Give GDB an internal warning\\.\r\nCause GDB to behave as if an internal warning was reported\\..*"
dec43320 484
65731a6b
MS
485gdb_test "help maint print statistics" \
486 "Print statistics about internal gdb state\\..*"
c906108c 487
00905d52
AC
488gdb_test "help maint print dummy-frames" \
489 "Print the contents of the internal dummy-frame stack."
490
65731a6b
MS
491gdb_test "help maint print objfiles" \
492 "Print dump of current object file definitions\\..*"
c906108c 493
65731a6b
MS
494gdb_test "help maint print psymbols" \
495 "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\\..*"
c906108c 496
65731a6b
MS
497gdb_test "help maint print msymbols" \
498 "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\\..*"
c906108c 499
65731a6b
MS
500gdb_test "help maint print symbols" \
501 "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\\..*"
c906108c 502
65731a6b
MS
503gdb_test "help maint print type" \
504 "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\\..*"
c906108c 505
a0b3c4fd 506if [istarget "hppa*-*-*"] {
65731a6b
MS
507 gdb_test "help maint print unwind" \
508 "Print unwind table entry at given address\\..*"
a0b3c4fd 509}
c906108c 510
65731a6b
MS
511gdb_test "help maint info sections" \
512 "List the BFD sections of the exec and core files\\..*"
c906108c 513
65731a6b
MS
514gdb_test "help maint info breakpoints" \
515 "Status of all breakpoints, or breakpoint number NUMBER.*"
c906108c 516
c906108c
SS
517
518#send_gdb "help maint info breakpoints\n"
519#expect {
520# -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 $"\
521# { pass "help maint info breakpoints" }
522# -re ".*$gdb_prompt $" { fail "help maint info breakpoints" }
523# timeout { fail "(timeout) help maint info breakpoints" }
524# }
525
65731a6b
MS
526gdb_test "help maint info" \
527 "Commands for showing internal info about the program being debugged.*unambiguous\\..*"
c906108c 528
d8295fe9
VP
529test_prefix_command_help {"maint print" "maintenance print"} {
530 "Maintenance command for printing GDB internal state\\.\[\r\n\]+"
531}
c906108c 532
d8295fe9
VP
533test_prefix_command_help {"maint" "maintenance"} {
534 "Commands for use by GDB maintainers\\.\[\r\n\]+"
535 "Includes commands to dump specific internal GDB structures in\[\r\n\]+"
536 "a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+"
537 "to test internal functions such as the C\\+\\+/ObjC demangler, etc\\.\[\r\n\]+"
538}
c906108c
SS
539
540#set oldtimeout $timeout
541#set timeout [expr $timeout + 300]
542
65731a6b
MS
543gdb_test_multiple "maint dump-me" "maint dump-me" {
544 -re "Should GDB dump core.*\\(y or n\\) $" {
545 gdb_test "n" ".*" "maint dump-me"
546 }
547}
c906108c 548
7be570e7 549send_gdb "maint internal-error\n"
039cf96d
AC
550gdb_expect {
551 -re "A problem internal to GDB has been detected" {
552 pass "maint internal-error"
553 if [gdb_internal_error_resync] {
554 pass "internal-error resync"
555 } else {
556 fail "internal-error resync"
7be570e7
JM
557 }
558 }
559 -re ".*$gdb_prompt $" {
560 fail "maint internal-error"
039cf96d 561 untested "internal-error resync"
7be570e7
JM
562 }
563 timeout {
039cf96d
AC
564 fail "maint internal-error (timeout)"
565 untested "internal-error resync"
7be570e7
JM
566 }
567}
568
c906108c
SS
569#set timeout $oldtimeout
570
571
572gdb_exit
573return 0
This page took 1.206817 seconds and 4 git commands to generate.