📄 maint.exp
字号:
} -re ".*$gdb_prompt $" { fail "maint print symbols" } timeout { fail "(timeout) maint print symbols" } } } -re ".*$gdb_prompt $" { fail "maint print symbols" } timeout { fail "(timeout) maint print symbols" } }set timeout $old_timeoutsend_gdb "maint print type argc\n"gdb_expect { -re "type node $hex\r\nname .int. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength 4\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\ { pass "maint print type" } -re ".*$gdb_prompt $" { fail "maint print type" } timeout { fail "(timeout) maint print type" } }if [istarget "hppa*-*-11*"] { setup_xfail hppa*-*-*11* CLLbs14860 send "maint print unwind &main\n" expect { -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 $"\ { pass "maint print unwind" } -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 $"\ { xfail "maint print unwind" } -re ".*$gdb_prompt $" { xfail "maint info unwind" } timeout { fail "(timeout) maint print unwind" } }}set oldtimeout $timeoutset timeout [expr $timeout + 300]# It'd be nice to check for every possible section. However, that's# problematic, since the relative ordering wanders from release to# release of the compilers. Instead, we'll just check for two# sections which appear to always come out in the same relative# order. (If that changes, then we should just check for one# section.)## And by the way: This testpoint will break for PA64, where a.out's# are ELF files.#send_gdb "maint info sections\n"gdb_expect { -re "Exec file:\r\n.*break., file type.*$gdb_prompt $"\ { pass "maint info sections" } -re ".*$gdb_prompt $" { fail "maint info sections" } timeout { fail "(timeout) maint info sections" } }send_gdb "maint info breakpoints\n"gdb_expect { -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:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\ { pass "maint info breakpoints" } -re ".*$gdb_prompt $" { fail "maint info breakpoints" } timeout { fail "(timeout) maint info breakpoints" }}# Try it again, and check for shlib event info. Not supported everywhere.if {! ([istarget "hppa*-*-hpux*"] || [istarget "*-*-linux*"] || [istarget "*-*-solaris*"])} then { setup_xfail "*-*-*"}send_gdb "maint info breakpoints\n"gdb_expect { -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:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\ { pass "maint info breakpoints" } -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:75\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 $"\ { pass "maint info breakpoints: shlib events" } -re ".*$gdb_prompt $" { fail "maint info breakpoints: shlib events" } timeout { fail "(timeout) maint info breakpoints: shlib events" }}send_gdb "maint print\n"gdb_expect { -re "\"maintenance print\" must be followed by the name of a print command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\ { pass "maint print w/o args" } -re ".*$gdb_prompt $" { fail "maint print w/o args" } timeout { fail "(timeout) maint print w/o args" } }send_gdb "maint info\n"gdb_expect { -re "\"maintenance info\" must be followed by the name of an info command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\ { pass "maint info w/o args" } -re ".*$gdb_prompt $" { fail "maint info w/o args" } timeout { fail "(timeout) maint info w/o args" } }send_gdb "maint\n"gdb_expect { -re "\"maintenance\" must be followed by the name of a maintenance command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\ { pass "maint w/o args" } -re ".*$gdb_prompt $" { fail "maint w/o args" } timeout { fail "(timeout) maint w/o args" } }set timeout $oldtimeout#============test help on maint commandssend_gdb "help maint\n"gdb_expect { -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 $"\ { pass "help maint" } -re ".*$gdb_prompt $" { fail "help maint" } timeout { fail "(timeout) help maint" } }send_gdb "help maint check-symtabs\n"gdb_expect { -re "Check consistency of psymtabs and symtabs\\..*$gdb_prompt $"\ { pass "help maint check-symtabs" } -re ".*$gdb_prompt $" { fail "help maint check-symtabs" } 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 $"\ { pass "help maint demangle" } -re ".*$gdb_prompt $" { fail "help maint demangle" } timeout { fail "(timeout) help maint demangle" } }send_gdb "help maint dump-me\n"gdb_expect { -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 $"\ { pass "help maint dump-me" } -re ".*$gdb_prompt $" { fail "help maint dump-me" } timeout { fail "(timeout) help maint dump-me" } }send_gdb "help maint internal-error\n"gdb_expect { -re "Give GDB an internal error\\.\r\nCause GDB to behave as if an internal error was detected\\..*$gdb_prompt $"\ { pass "help maint internal-error" } -re ".*$gdb_prompt $" { fail "help maint internal-error" } timeout { fail "(timeout) help maint internal-error" } }send_gdb "help maint print statistics\n"gdb_expect { -re "Print statistics about internal gdb state\\..*$gdb_prompt $"\ { pass "help maint print statistics" } -re ".*$gdb_prompt $" { fail "help maint print statistics" } timeout { fail "(timeout) help maint print statistics" } }send_gdb "help maint print objfiles\n"gdb_expect { -re "Print dump of current object file definitions\\..*$gdb_prompt $"\ { pass "help maint print objfiles" } -re ".*$gdb_prompt $" { fail "help maint print objfiles" } 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 $"\ { pass "help maint print psymbols" } -re ".*$gdb_prompt $" { fail "help maint print psymbols" } 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 $"\ { pass "help maint print msymbols" } -re ".*$gdb_prompt $" { fail "help maint print msymbols" } 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 $"\ { pass "help maint print symbols" } -re ".*$gdb_prompt $" { fail "help maint print symbols" } 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 $"\ { pass "help maint print type" } -re ".*$gdb_prompt $" { fail "help maint print type" } timeout { fail "(timeout) help maint print type" } }if [istarget "hppa*-*-*"] { send_gdb "help maint print unwind\n" gdb_expect { -re "Print unwind table entry at given address\\..*$gdb_prompt $"\ { pass "help maint print unwind" } -re ".*$gdb_prompt $" { fail "help maint print unwind" } timeout { fail "(timeout) help maint print unwind" } }}send_gdb "help maint info sections\n"gdb_expect { -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 $"\# { 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\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 $"\ { pass "help maint" } -re ".*$gdb_prompt $" { fail "help maint" } timeout { fail "(timeout) help maint" } }#set oldtimeout $timeout#set timeout [expr $timeout + 300]send_gdb "maint dump-me\n"gdb_expect { -re "Should GDB dump core.*\\(y or n\\) $"\ { send_gdb "n\n" gdb_expect { -re ".*$gdb_prompt $" { pass "maint dump-me" } timeout { fail "(timeout) maint dump-me" } } } -re ".*$gdb_prompt $" { fail "maint dump-me" } timeout { fail "(timeout) maint dump-me" } }send_gdb "maint internal-error\n"gdb_expect { -re "Continue this debugging session.*\\(y or n\\) $" { send_gdb "y\n" gdb_expect { -re "Create a core file.*\\(y or n\\) $" { send_gdb "n\n" gdb_expect { -re ".*$gdb_prompt $" { pass "maint internal-error" } timeout { fail "(timeout) maint internal-error" } } } -re ".*$gdb_prompt $" { fail "maint internal-error" } timeout { fail "(timeout) maint internal-error" } } } -re ".*$gdb_prompt $" { fail "maint internal-error" } timeout { fail "(timeout) maint internal-error" }}#set timeout $oldtimeoutgdb_exitreturn 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -