-re "\"maintenance space\" takes a numeric argument\\..*$gdb_prompt $"\
{ pass "maint space" }
-re ".*$gdb_prompt $" { fail "maint space" }
timeout { fail "(timeout) maint space" }
}
send_gdb "maint space 1\n"
gdb_expect {
-re "Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
{ pass "maint space 1" }
-re ".*$gdb_prompt $" { fail "maint space 1" }
timeout { fail "(timeout) maint space 1" }
}
send_gdb "maint time\n"
gdb_expect {
-re "\"maintenance time\" takes a numeric argument\\..*Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
{ pass "maint time" }
-re ".*$gdb_prompt $" { fail "maint time" }
timeout { fail "(timeout) maint time" }
}
send_gdb "maint time 1\n"
gdb_expect {
-re "Command execution time: $decimal.*Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
{ pass "maint time 1" }
-re ".*$gdb_prompt $" { fail "maint time 1" }
timeout { fail "(timeout) maint time 1" }
}
send_gdb "maint time 0\n"
gdb_expect {
-re "Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
{ pass "maint time 0" }
-re ".*$gdb_prompt $" { fail "maint time 0" }
timeout { fail "(timeout) maint time 0" }
}
send_gdb "maint space 0\n"
gdb_expect {
-re "maint space 0\r\n$gdb_prompt $"\
{ pass "maint space 0" }
-re ".*$gdb_prompt $" { fail "maint space 0" }
timeout { fail "(timeout) maint space 0" }
}
send_gdb "maint demangle\n"
gdb_expect {
-re "\"maintenance demangle\" takes an argument to demangle\\..*$gdb_prompt $"\
{ pass "maint demangle" }
-re ".*$gdb_prompt $" { fail "maint demangle" }
timeout { fail "(timeout) maint demangle" }
}
send_gdb "maint demangle main\n"
gdb_expect {
-re "Can't demangle \"main\".*$gdb_prompt $"\
{ pass "maint demangle" }
-re ".*$gdb_prompt $" { fail "maint demangle" }
timeout { fail "(timeout) maint demangle" }
}
send_gdb "maint print statistics\n"
gdb_expect {
-re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\
-re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance internal-error.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
timeout { fail "(timeout) help maint check-symtabs" }
}
send_gdb "help maint space\n"
gdb_expect {
-re "Set the display of space usage\\.\r\nIf nonzero, will cause the execution space for each command to be\r\ndisplayed, following the command's output\\..*$gdb_prompt $"\
{ pass "help maint space" }
-re ".*$gdb_prompt $" { fail "help maint space" }
timeout { fail "(timeout) help maint space" }
}
send_gdb "help maint time\n"
gdb_expect {
-re "Set the display of time usage\\.\r\nIf nonzero, will cause the execution time for each command to be\r\ndisplayed, following the command's output\\..*$gdb_prompt $"\
{ pass "help maint time" }
-re ".*$gdb_prompt $" { fail "help maint time" }
timeout { fail "(timeout) help maint time" }
}
send_gdb "help maint demangle\n"
gdb_expect {
-re "Demangle a C\\+\\+ mangled name\\.\r\nCall internal GDB demangler routine to demangle a C\\+\\+ link name\r\nand prints the result\\..*$gdb_prompt $"\
-re "Get fatal error; make debugger dump its core\\.\r\nGDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\r\nitself a SIGQUIT signal\\..*$gdb_prompt $"\
timeout { fail "(timeout) help maint print objfiles" }
}
send_gdb "help maint print psymbols\n"
gdb_expect {
-re "Print dump of current partial symbol definitions\\.\r\nEntries in the partial symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's partial symbols\\..*$gdb_prompt $"\
timeout { fail "(timeout) help maint print psymbols" }
}
send_gdb "help maint print msymbols\n"
gdb_expect {
-re "Print dump of current minimal symbol definitions\\.\r\nEntries in the minimal symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's minimal symbols\\..*$gdb_prompt $"\
timeout { fail "(timeout) help maint print msymbols" }
}
send_gdb "help maint print symbols\n"
gdb_expect {
-re "Print dump of current symbol definitions\\.\r\nEntries in the full symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's symbols\\..*$gdb_prompt $"\
timeout { fail "(timeout) help maint print symbols" }
}
send_gdb "help maint print type\n"
gdb_expect {
-re "Print a type chain for a given symbol\\.\r\nFor each node in a type chain, print the raw data for each member of\r\nthe type structure, and the interpretation of the data\\..*$gdb_prompt $"\
-re "List the BFD sections of the exec and core files\\..*$gdb_prompt $"\
{ pass "help maint info sections" }
-re ".*$gdb_prompt $" { fail "help maint info sections" }
timeout { fail "(timeout) help maint info sections" }
}
send_gdb "help maint info breakpoints\n"
gdb_expect {
-re "Status of all breakpoints, or breakpoint number NUMBER.*$gdb_prompt $" { pass "help maint info breakpoints" }
-re ".*$gdb_prompt $" { fail "help maint info breakpoints" }
timeout { fail "(timeout) help maint info breakpoints" }
}
#send_gdb "help maint info breakpoints\n"
#expect {
# -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 $"\
# timeout { fail "(timeout) help maint info breakpoints" }
# }
send_gdb "help maint info\n"
gdb_expect {
-re "Commands for showing internal info about the program being debugged.*unambiguous\\..*$gdb_prompt $"\
{ pass "help maint info" }
-re ".*$gdb_prompt $" { fail "help maint info" }
timeout { fail "(timeout) help maint info" }
}
send_gdb "help maint print\n"
gdb_expect {
-re "Maintenance command for printing GDB internal state\\.\[\r\n\]+List of maintenance print subcommands:\[\r\n\]+maintenance print msymbols -- Print dump of current minimal symbol definitions.*maintenance print objfiles -- Print dump of current object file definitions.*maintenance print psymbols -- Print dump of current partial symbol definitions.*maintenance print statistics -- Print statistics about internal gdb state.*maintenance print symbols -- Print dump of current symbol definitions.*maintenance print type -- Print a type chain for a given symbol.*Type .help maintenance print. followed by maintenance print subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
{ pass "help maint print" }
-re ".*$gdb_prompt $" { fail "help maint print" }
timeout { fail "(timeout) help maint print" }
}
send_gdb "help maint\n"
gdb_expect {
-re "Commands for use by GDB maintainers\\.\[\r\n\]+Includes commands to dump specific internal GDB structures in\[\r\n\]+a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+to test internal functions such as the C\\+\\+ demangler, etc\\..*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\