📄 default.exp
字号:
gdb_test "set print address" "" "set print address"#test set print arraygdb_test "set print array" "" "set print array"#test set print asm-demanglegdb_test "set print asm-demangle" "" "set print asm-demangle"#test set print demanglegdb_test "set print demangle" "" "set print demangle"#test set print elementsgdb_test "set print elements" "Argument required .integer to set it to.*" "set print elements"#test set print objectgdb_test "set print object" "" "set print object"#test set print prettygdb_test "set print pretty" "" "set print pretty"#test set print sevenbit-stringsgdb_test "set print sevenbit-strings" "" "set print sevenbit-strings"#test set print uniongdb_test "set print union" "" "set print union"#test set print vtblgdb_test "set print vtbl" "" "set print vtbl"# FIXME -- need a test for "set prompt"#test set radixgdb_test "set radix" "Input and output radices now set to decimal 10, hex a, octal 12.*" "set radix"#test set symbol-reloadinggdb_test "set symbol-reloading" "" "set symbol-reloading"#test set variablegdb_test "set variable" "Argument required .expression to compute.*" "set variable"#test set verbosegdb_test "set verbose" "" "set verbose"#test set widthgdb_test "set width" "Argument required .integer to set it to.*" "set width"#test set write# This is only supported on targets which use exec.o.gdb_test "set write" "" "set write"#test setgdb_test "set" "Argument required .expression to compute.*" "set"#test shell echo Hi dad!gdb_test "shell echo Hi dad!" "Hi dad!" "shell echo Hi dad!"#test show annotategdb_test "show annotate" "Annotation_level is 0." "show annotate"#test show argsgdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args"#test show check "c" abbreviationgdb_test "show c" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"#test show check "ch" abbreviationgdb_test "show ch" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation"#test show checkgdb_test "show check" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\"." "show check"#test show check rangegdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range"#test show check typegdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type"#test show commandsgdb_test "show commands" "" "show commands"#test show complaintsgdb_test "show complaints" "Max number of complaints about incorrect symbols is 0." "show complaints"#test show confirmgdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm"#test show conveniencegdb_test "show convenience" "No debugger convenience variables now defined.(\[^\r\n\]*\[\r\n\])+Convenience variables have names starting with \".\";(\[^\r\n\]*\[\r\n\])+use \"set\" as in \"set .foo = 5\" to define them." "show convenience"#test show directoriesgdb_test "show directories" "Source directories searched: .cdir:.cwd" "show directories"#test show editinggdb_test "show editing" "Editing of command lines as they are typed is o\[a-z\]*." "show editing"#test show heightgdb_test "show height" "Number of lines gdb thinks are in a page is.*" "show height"#test show history expansiongdb_test "show history expansion" "History expansion on command input is o\[a-z\]*.*" "show history expansion"#test show history filenamegdb_test "show history filename" "The filename in which to record the command history is.*.gdb_history.*" "show history filename"#test show history savegdb_test "show history save" "Saving of the history record on exit is on." "show history save"#test show history sizegdb_test "show history size" "The size of the command history is.*" "show history size"#test show historygdb_test "show history" "expansion: *History expansion on command input is o(\[^\r\n\]*\[\r\n\])+filename: *The filename in which to record the command history is.*.gdb_history(\[^\r\n\]*\[\r\n\])+save: *Saving of the history record on exit is o(\[^\r\n\]*\[\r\n\])+size: * The size of the command history is.*" "show history"#test show languagegdb_test "show language" "The current source language is \"auto; currently c\"." "show language"#test show listsizegdb_test "show listsize" "Number of source lines gdb will list by default is 10." "show listsize"#test show print "p" abbreviationgdb_test "show p" ".*" "show p"#test show print "pr" abbreviationgdb_test "show pr" ".*" "show pr"#test show printgdb_test "show print" "" "show print"#test show pathsgdb_test "show paths" "Executable and object file path:.*" "show paths"#test show print addressgdb_test "show print address" "Printing of addresses is on." "show print address"#test show print arraygdb_test "show print array" "Prettyprinting of arrays is on." "show print array"#test show print asm-demanglegdb_test "show print asm-demangle" "Demangling of C\[+\]+/ObjC names in disassembly listings is on." "show print asm-demangle"#test show print demanglegdb_test "show print demangle" "Demangling of encoded C\[+\]+/ObjC names when displaying symbols is on." "show print demangle"#test show print elementsgdb_test "show print elements" "Limit on string chars or array elements to print is 200." "show print elements"#test show print objectgdb_test "show print object" "Printing of object's derived type based on vtable info is on." "show print object"#test show print prettygdb_test "show print pretty" "Prettyprinting of structures is on." "show print pretty"#test show print sevenbit-stringsgdb_test "show print sevenbit-strings" "Printing of 8-bit characters in strings as .nnn is on." "show print sevenbit-strings"#test show print uniongdb_test "show print union" "Printing of unions interior to structures is on." "show print union"#test show print vtblgdb_test "show print vtbl" "Printing of C\[+\]+ virtual function tables is on." "show print vtbl"#test show prompt# In the FAIL case, can't just look for $gdb_prompt because that will match# the output, rather than the prompt. So look for $gdb_prompt at the start# of a line.gdb_test "show prompt" "Gdb's prompt is \"$gdb_prompt \".*" "show prompt"#test show radixgdb_test "show radix" "Input and output radices set to decimal 10, hex a, octal 12." "show radix"#test show symbol-reloadinggdb_test "show symbol-reloading" "Dynamic symbol table reloading multiple times in one run is on." "show symbol-reloading"#test show usergdb_test "show user" "" "show user"#test show valuesgdb_test "show values" "" "show values"#test show verbosegdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"#test show versiongdb_test "show version" "GNU gdb \[0-9\.\]*(\[^\r\n\]*\[\r\n\])+Copyright \[0-9\]* Free Software Foundation, Inc(\[^\r\n\]*\[\r\n\])+GDB is free software, covered by the GNU General Public License, and you are(\[^\r\n\]*\[\r\n\])+welcome to change it and/or distribute copies of it under certain conditions(\[^\r\n\]*\[\r\n\])+Type \"show copying\" to see the conditions(\[^\r\n\]*\[\r\n\])+There is absolutely no warranty for GDB. Type \"show warranty\" for details(\[^\r\n\]*\[\r\n\])+This GDB was configured as .*|GDB is free software and you are welcome to distribute copies of it(\[^\r\n\]*\[\r\n\])+ under certain conditions; type \"show copying\" to see the conditions.(\[^\r\n\]*\[\r\n\])+There is absolutely no warranty for GDB; type \"show warranty\" for details.(\[^\r\n\]*\[\r\n\])+GDB.*Copyright \[0-9\]* Free Software Foundation, Inc.*" "show version"#test show widthgdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"#test show write# This is only supported on targets which use exec.o.gdb_test "show write" "Writing into executable and core files is o.*" "show write"#test showgdb_test "show" "confirm: *Whether to confirm potentially dangerous operations is on.(\[^\r\n\]*\[\r\n\])+history filename: *The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+history save: *Saving of the history record on exit is on.(\[^\r\n\]*\[\r\n\])+history size: *The size of the command history is(\[^\r\n\]*\[\r\n\])+listsize: *Number of source lines gdb will list by default is 10(\[^\r\n]*\[\r\n\])+print elements: *Limit on string chars or array elements to print is 200..*" "show"#test stepi "si" abbreviationgdb_test "si" "The program is not being run." "stepi \"si\" abbreviation"#test stepigdb_test "stepi" "The program is not being run." "stepi"#test signalgdb_test "signal" "The program is not being run." "signal"#test sourcegdb_test "source" "source command requires pathname of file to source..*|No such file or directory.*" "source"#test step "s" abbreviationgdb_test "s" "The program is not being run." "step \"s\" abbreviation #2"#test stepgdb_test "step" "The program is not being run." "step #2"#test symbol-filegdb_test "symbol-file" "" "symbol-file"#test target childgdb_test "target child" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"child\". *Try \"help target\".*" "target child"#test target procfsgdb_test "target procfs" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"procfs\". *Try \"help target\".*" "target procfs"#test target coresend_gdb "target core\n"gdb_expect { -re "No core file specified..*$gdb_prompt $" { pass "target core" } -re ".*A program is being debugged already. Kill it. .y or n.*$" { send_gdb "n\n" if $verbose>1 then { send_user "\t\tDidn't kill program being debugged\n" } gdb_expect -re "$gdb_prompt $" { } pass "target core" } -re "Undefined target command: \"core\". Try \"help target\"..*$gdb_prompt $" { pass "target core" } -re ".*$gdb_prompt $" { fail "target core" } timeout { fail "(timeout) target core" }}#test target execsend_gdb "target exec\n"gdb_expect { -re "No executable file now..*$gdb_prompt $"\ { pass "target exec" } -re ".*A program is being debugged already. Kill it. .y or n.*$" { send_gdb "n\n" if $verbose>1 then { send_user "\t\tDidn't kill program being debugged\n" } gdb_expect -re "$gdb_prompt $" { } pass "target exec" } -re ".*$gdb_prompt $" { fail "target exec" } timeout { fail "(timeout) target exec" } }#test target remoteif ![istarget "*-*-udi*"] then { send_gdb "target remote\n" gdb_expect { -re "To open a remote debug connection, you need to specify what.*serial.*device is attached to the remote system.*.e.g. .*$gdb_prompt $"\ { pass "target remote" } -re ".*A program is being debugged already. Kill it. .y or n.*$" { send_gdb "n\n" if $verbose>1 then { send_user "\t\tDidn't kill program being debugged\n" } gdb_expect -re "$gdb_prompt $" { } pass "target remote" } -re ".*$gdb_prompt $" { fail "target remote" } timeout { fail "(timeout) target remote" } }}#test targetgdb_test "target" "Argument required .target name.*" "target"#test tbreakgdb_test "tbreak" "No default breakpoint address now." "tbreak"#test ttygdb_test "tty" "Argument required .terminal name for running target process.*" "tty"#test until "u" abbreviationgdb_test "u" "The program is not running." "until \"u\" abbreviation"#test untilgdb_test "until" "The program is not running." "until"#test undisplay# FIXME -- need to dump full output to detailed logsend_gdb "undisplay\n"gdb_expect { -re "Delete all auto-display expressions.*y or n. $" { send_gdb "y\n" gdb_expect { -re "$gdb_prompt $" { pass "undisplay prompt" } timeout { fail "(timeout) (timeout) undisplay prompt" } } } timeout { fail "(timeout) (timeout) undisplay prompt" }}#test unset environmentsend_gdb "unset environment\n"gdb_expect { -re "Delete all environment variables?.*y or n. $" { send_gdb "y\n" gdb_expect { -re "$gdb_prompt $" { pass "unset environmentprompt" } timeout { fail "(timeout) (timeout) unset environment prompt" } } } timeout { fail "(timeout) (timeout) unset environment prompt" }}#test unsetgdb_test "unset" "\"unset\" must be followed by the name of an unset subcommand.(\[^\r\n\]*\[\r\n\])+List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by unset subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "unset"#test up#test up-silentlygdb_test "up-silently" "No stack." "up-silently"#test watchgdb_test "watch" "Argument required .expression to compute.*" "watch"#test whatisgdb_test "whatis" "The history is empty." "whatis"#test wheregdb_test "where" "No stack." "where"#test x#The case in which it prints a number is for vxgdb.send_gdb "x\n"gdb_expect { -re "0x0:.*Cannot access memory at address 0x0..*$gdb_prompt $" { pass "x" } -re "0x0:.*Error accessing memory address 0x0:.*$gdb_prompt $" { pass "x" } -re ".*$gdb_prompt $" { fail "x" } timeout { fail "(timeout) x" }}gdb_exit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -