📄 dbg-help.inc
字号:
# dbg-help.inc - Bourne Again Shell Debugger Help Routines# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007# Rocky Bernstein rockyb@users.sourceforge.net## Bash is free software; you can redistribute it and/or modify it under# the terms of the GNU General Public License as published by the Free# Software Foundation; either version 2, or (at your option) any later# version.## Bash is distributed in the hope that it will be useful, but WITHOUT ANY# WARRANTY; without even the implied warranty of MERCHANTABILITY or# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License# for more details.# # You should have received a copy of the GNU General Public License along# with Bash; see the file COPYING. If not, write to the Free Software# Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.typeset -r _Dbg_set_cmds="args annotate basename debugger editing linetrace listsize prompt showcommand trace-commands"typeset -r _Dbg_show_cmds="args annotate basename debugger commands copying debugger directories linetrace listsize prompt trace-commands warranty"# print help command _Dbg_do_help() { local -r db_cmd=$1 if [[ -n "$db_cmd" ]] ; then case $db_cmd in !! | sh | she | shell ) _Dbg_msg \"!! cmd [args] Execute shell \"cmd\" \"args\". Alias: shell." return ;; '#' ) _Dbg_msg \"# Comment - ignore line. Maybe useful in command scripts." return ;; . ) _Dbg_msg \". List current window of lines." return ;; / ) _Dbg_msg \"/pat/ Search forward for pat. Trailing / is optional. Long command name: search or forward." return ;; '?'/ ) _Dbg_msg \"?pat? Search backward for pat. Trailing ? is optional. Long command name: rev or reverse" return ;; - ) _Dbg_msg \"- List previous window of lines." return ;; A ) _Dbg_msg \"A Delete all actions" return ;; D | deleteall ) _Dbg_msg \"D Delete all breakpoints" return ;; H ) _Dbg_msg \"H [from [to]] List debugger history. If no arguments given list all history.H -count If a single postive integer is given, then list starting from ![-]num:p that number. If a single negative integer is given list that many history items. If second argument is given then list down to that history number. An alternate form is !n:p or !-n:p where n is an integer. If a minus sign is used, you go back num from the end rather than specify an absolute history number" return ;; L ) _Dbg_msg \"L List all breakpoints." return ;; R | re | res | rest | resta | restar | restart | ru | run ) _Dbg_msg \"R [args] Attempt to restart the program. The source code is reread and breakpoint information is lost. The command arguments used on the last invocation are used if args is empty. If arguments were given, they are passed to the program. If running via the bashdb script and you want to change arguments you also need to include those arguments to the bashdb script. Long command name: restart. Alias: run." return ;; S ) _Dbg_msg \"S [[!]pattern] List subroutine names [not] matching bash pattern. If no pattern is given, all subroutines are listed. (The pattern is *)." return ;; T | wh | whe | wher | where | bt| back | backtrace ) _Dbg_msg \"T [n] Stack trace of calling functions or sourced files, line numbers, and files. If n is given, list only n lines. Long command name: where or backtrace." return ;; a ) _Dbg_msg \"a [linespec] stmt Perform stmt on reaching linespec." return ;; b | br | bre | brea | break ) _Dbg_msg \"b [linespec] Break on linespec. If no argument is given, us the current line. Long command name: break." return ;; c | cont | conti |contin |continu | continue ) _Dbg_msg \"c [linespec] Continue execution until the next breakpoint or end of program or linespec. Long command name: continue." return ;; cd ) _Dbg_msg \"cd [DIR] Set working directory to DIR for debugger and programbeing debugged. Tilde expansion, variable and filename expansion isperformed on DIR. If no directory is given, we print out thecurrent directory which is really the same things as running 'pwd'.Note that gdb is a little different in that it peforms tilde expansionbut not filename or variable expansion and the directory argument isnot optional as it is here." return ;; cond | condi |condit |conditi | conditio | condition ) _Dbg_msg \"cond N COND Specify breakpoint number N to break only if COND is true.N is an integer and COND is an expression to be evaluated whenever breakpoint N is reached. Long command name: condition." return ;; d | cl | cle | clea | clea | clear ) _Dbg_msg \"cl [linespec] Clear breakpoint at specified line-spec. If no line given, use the current line. All breakpoints in that line are cleared. Long command name: clear." return ;; de | del | dele | delet | delete ) _Dbg_msg \"d {num}.. Delete the breakpoint entry or entries. Long command name: delete." return ;; deb | debu | debug ) _Dbg_msg \"deb [script] Set up [script] for debugging. If no script is given, take the script name from the command to be executed. Long command name: debug." return ;; di | dis | disa | disab | disabl | disable ) _Dbg_msg \"di {n}... Disable breakpoint entry/entries. Long command name: disable." return ;; disp | displ | displa | display ) _Dbg_msg \"disp {n} Set display expression or list all display expressions. Long command name: display." return ;; do | dow | down ) _Dbg_msg \"down [count] Set file location for printing down the call stack by count. If count is omitted use 1." return ;; e | ev | eva ) _Dbg_msg \"e bash-cmd Evaluate a bash command by sourcing it in a subshell. Long command name: eval." return ;; en | ena | enab | enabl | enable ) _Dbg_msg \"en {n}... Enable breakpoint entry/entries. Long command name: enable." return ;; r | fin| fini | finis | finish ) _Dbg_msg \"r Execute until the current function or source file returns. Long command name: finish." return ;; fil| file ) _Dbg_msg \"file filename Use script file filename whenever the current source file is encountered by the debugger." return ;; ha | han | hand | handl | handle ) _Dbg_msg \"ha sig {stop|nostop|stack|nostack|print|noprint} Specify how to handle a signal. Args are signals and actions to apply to those signals. Symbolic signals (e.g. SIGSEGV) are recommended but numeric signals are allowed too. Recognized actions include \"stop\", \"nostop\", \"print\", and \"noprint\". Stop means reenter debugger if this signal happens. Print means print a message if this signal happens. Long command name: handle." return ;; hi | his | hist | histo | histor | history ) _Dbg_msg \"hi n Rerun a debugger command from the debugger history. See also![-]n H to list the history. An alternname form is !n or !-n. If the minus sign is used you going back n from the end rather than specifying an absolute history number. Long command name: history." return ;; i | in | inf | info ) _Dbg_info_help $2 return ;; k | ki | kil | kill ) _Dbg_msg \"kill Kill execution of program being debugged." return ;; l | li | lis | list ) _Dbg_msg \"l linespec List window lines starting at linespec.l min incr List incr lines starting at 'min' linespec.l List next window of lines.l . Same as above. Long command name: list." return ;; lo | loa | load ) _Dbg_msg \"load file Load in a Bash source file so it can be used in breakpoints and listing." return ;; n | ne | nex | next ) _Dbg_msg \"n [count] Single steps possibly skipping execution into subroutine calls and sourced files. Performed [count] times default is 1 time. Long command name: next." return ;; p | pr | pri | prin | print ) _Dbg_msg \"p string Print value of a substituted string via \`echo'. A variable should have leading $ if its value is to be substituted. Long command name: print." return ;; q | qu | qui | quit ) _Dbg_msg \"q [expr] [n] Terminate execution of the program with return code expr. If expr is missing, use 0. If n is given then we terminate only that many subshells or nested shells. Long name: quit." return ;; ret | retu | retur | return ) _Dbg_msg \"ret Skip completion of this function or sourced file. Long name: return." return ;; se | set ) _Dbg_help_set $2 return ;; s | st | ste | step ) _Dbg_msg \"s [count] Single steps possibly executing into subroutine calls and sourced files. Performed [count] times default is 1 time." return ;; sh | sho | show ) _Dbg_help_show $2 return ;; si | sig | sign | signa | signal ) _Dbg_msg \"signal {signam|signum} Send the specified signal to the program." return ;; sk | ski | skip ) _Dbg_msg \"sk [count] Skip (don't run) the next [count] command(s) to be executed. Long command name: skip." return ;; so | sou | sour | sourc | source ) _Dbg_msg \"source file Read in debugger command file." return ;; t | to | tog | togg | toggl | toggle ) _Dbg_msg \"t | toggle Toggle line-execution tracing. Long command name: toggle." return ;; tb | tbr | tbre | tbrea | tbreak ) _Dbg_msg \"tb [linespec] Set a one-time break on linespec. If no argument is given, us the current line. Long command name: tbreak." return ;;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -