イメージ 1

http://bashdb.sourceforge.net/

BASH with Debugger and Improved Debug Support and Error Handling
--
The Bash Debugger Project contains patched sources to BASH that enable better debugging support as well as improved error reporting. In addition, this project contains the most comprehensive source-code debugger for bash that has been written.

Since this project maintains as an open CVS development and encourages developers and ideas, the space could be also be used springboard for other experiments and additions to BASH. If you are interesting in contributing to this project, please contact rocky@panix.com.

--
例)Red Hat Enterprise Linux AS 3 Update 5 に含まれている bashdb の例

# bashdb
-bash: bashdb: command not found
# find / -name bashdb
/usr/share/doc/bash-2.05b/bashdb
/usr/share/doc/bash-2.05b/bashdb/bashdb
# alias bashdb=/usr/share/doc/bash-2.05b/bashdb/bashdb
# bashdb
Bash Debugger version 1.2.4
bashdb: Usage: bashdb filename
# bashdb MyScript.sh
Bash Debugger version 1.2.4
Reading Source from file: MyScript.sh
Stopped at line 4
MyScript.sh:4 >unset JAVA_HOME CLASSPATH JFLAGS
bashdb> ?
bashdb commands:
break N set breakpoint at line N
break list breakpoints & break condition
condition foo set break condition to foo
condition clear break condition
delete N clear breakpoint at line N
delete clear all breakpoints
display EXP   eval  uate and display EXP for each debug step
display show a list of display expressions
undisplay N remove display expression N
list N M display all lines of script between N and M
list N display 5 lines of script either side of line N
list display 5 lines if script either side of current line
continue continue execution upto next breakpoint
next [N] execute [N] statements (default 1)
print expr prints the value of an expression
trace toggle execution trace on/off
ftrace [-u] func make the debugger step into function FUNC
(-u turns off tracing FUNC)
help print this menu
! string passes string to a shell
quit quit
bashdb>