Tree [3900a7] master /
History



File Date Author Commit
builtin 2011-05-05 rocky rocky [83f76b] Have to back off on aggressiveness of readc cle...
command 2013-05-28 rocky rocky [a42b90] gcd.sh: who wrote this code?
data 2011-03-03 rocky rocky [3ffc78] Work on 'shell' command more. Sync with zshdb.
doc 2014-01-10 rocky rocky [c05ee9] Add README.md that is used in the Files section...
htdocs 2012-11-10 rocky rocky [4a9c42] Merge branch 'master' of ssh://bashdb.git.sourc...
init 2012-11-10 rocky rocky [9dc5a2] Allow STDIN to be used instead of a tty. Useful...
lib 2013-05-28 rocky rocky [a42b90] gcd.sh: who wrote this code?
test 2014-02-27 R. Bernstein R. Bernstein [3900a7] Rework tests to work around bash 4.3
.cvsignore 2008-11-17 rockyb rockyb [d49b5d] Administrivia
.gitignore 2013-04-04 rocky rocky [66dd83] Towards getting bash 4.3 to work. lib/display.s...
AUTHORS 2011-03-03 rocky rocky [44a1a7] Don't show $? in display. Sync with zshdb.
CHANGES 2006-01-02 rockyb rockyb [59451c] Initial revision
COPYING 2006-01-02 rockyb rockyb [59451c] Initial revision
ChangeLog 2011-11-20 rocky rocky [f24699] Add pointer to Rod Smith's outline manual of th...
ChangeLog.0 2006-01-02 rockyb rockyb [59451c] Initial revision
INSTALL 2011-10-05 rocky rocky [07258a] --with-bash-src is no longer needed for readarr...
Makefile.am 2013-09-25 rocky rocky [558b37] For reasons I don't understand, "make dist" doe...
NEWS 2013-01-29 rocky rocky [250d5e] Update NEWS
README 2010-01-10 rocky rocky [4de35c] README: Revise instructions for how to call deb...
README.CVS 2006-01-02 rockyb rockyb [59451c] Initial revision
THANKS 2010-11-25 rocky rocky [0ab54c] Update what's gone on.
TODO 2010-11-23 rocky rocky [f01dd9] Merge branch 'bash-4.1' of ssh://bashdb.git.sou...
acinclude.m4 2006-01-03 rockyb rockyb [88c36b] dbg-file.inc: reinstate [[ for [. Add \ one oth...
autogen.sh 2013-03-25 rocky rocky [cc3956] autogen.sh: deal with libtool.
bashdb-main.inc.in 2010-11-29 rocky rocky [4a3119] Had broken bash ---debugger and was showing ban...
bashdb-part2.sh 2011-05-04 rocky rocky [c0977a] Start to add debugger command completion.
bashdb-trace.in 2012-01-27 R. Bernstein R. Bernstein [c9580f] bashdb-trace.in: Error out in loading bashdb-tr...
bashdb.in 2011-05-04 rocky rocky [c0977a] Start to add debugger command completion.
check-prefix.sh 2013-09-24 rocky rocky [352f75] Merge branch 'master' of ssh://git.code.sf.net/...
compute-prefix.sh 2013-03-25 rocky rocky [cc3956] autogen.sh: deal with libtool.
configure.ac 2014-02-27 R. Bernstein R. Bernstein [3900a7] Rework tests to work around bash 4.3
cvs2cl_header 2006-01-02 rockyb rockyb [59451c] Initial revision
cvs2cl_usermap 2007-10-14 rockyb rockyb [e0a10f] test/*: bashdb added another line
dbg-main.sh 2011-05-01 rocky rocky [8ffdad] Improve require. Reorganize code so that initia...
dbg-set-d-vars.inc 2008-08-04 rockyb rockyb [93d99e] journal code split off into its own file. Renam...
getopts_long.sh 2011-02-09 rocky rocky [bdfe14] Merge branch 'bash-4.1' of ssh://bashdb.git.sou...
ltmain.sh 2013-03-25 rocky rocky [cc3956] autogen.sh: deal with libtool.
make-check-filter.rb 2012-11-10 rocky rocky [9dc5a2] Allow STDIN to be used instead of a tty. Useful...

Read Me

Here we have a gdb-like debugger for Bash 3.0 and higher.

There are 3 ways to get into the debugger. If bash (with debugger
support enabled which is the default) is installed and the debugger
are *both* installed properly. Then:

   bash --debugger -- bash-script-name script-arg1 script-arg2...

If bash isn't installed in a way that will find bashdb, then:

   bashdb [bashdb-opts] -- bash-script-name script-arg1 script-arg2...

The downside here is that $0 will be "bashdb" not
bash-script-name. Also call stack will show the invocation to bashdb.

Finally, to invoke the debugger from the script

  # my script
  # work, work, work, ...

  # Load debugger support
  source <bashdb-installation>/bashdb-trace -L <bashdb-installation>
  # work, work, work or not...
  _Dbg_debugger; :   # Calls the debugger at the line below
  stop_here

An advantage of the above is that there is no overhead up until you
invoke the debugger. Typically for large bash programs like
configuration scripts, this is a big win.

IMPORTANT NOTE IF YOU USE THE ABOVE TO DEBUG CONFIGURE SCRIPTS...

stdin is closed by configure early on. This causes the debugger to quit. 
You can get around this invoking a command script that sets debugger
up input and output. Run tty to figure out what the terminal tty is set to.
  $ tty
  /dev/pts/3
  $ 

Above it came out to /dev/pts/3. Let's go with that. Put the folliwng 
in a file say /tmp/bashdb-configure

  source /dev/pts/3
  tty /dev/pts/3

Now arrange to read that configuration file using the -x or --eval-command
switch:

  source <bashdb-installation>/bashdb-trace -L <bashdb-installation> -x /tmp/bashdb-configure

- - -

See INSTALL for generic GNU configure installation instructions.