Tree [7ff9df] master release-4.3-0.9 /
History



File Date Author Commit
builtin 2011-05-05 rocky rocky [83f76b] Have to back off on aggressiveness of readc cle...
command 3 days ago rocky rocky [b533ef] tilde expansion reinstated, some embedded blank...
data 2011-03-03 rocky rocky [3ffc78] Work on 'shell' command more. Sync with zshdb.
doc 3 days ago rocky rocky [b533ef] tilde expansion reinstated, some embedded blank...
htdocs 2012-11-10 rocky rocky [4a9c42] Merge branch 'master' of ssh://bashdb.git.sourc...
init 3 days ago rocky rocky [cac900] Update copyright. Skip sig test on freebsd
lib 3 days ago rocky rocky [bf3f8f] More portable handling of assignment statement ...
test 3 days ago rocky rocky [92212d] Some OS's don't have seq installed
.cvsignore 2008-11-17 rockyb rockyb [d49b5d] Administrivia
.gitignore 3 days ago rocky rocky [b533ef] tilde expansion reinstated, some embedded blank...
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 14 hours ago rocky rocky [7ff9df] Release 4.3-0.9 - this time, for sure!
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 3 days ago rocky rocky [c04d7e] Add "compute-prefix.sh" program
NEWS 14 hours ago rocky rocky [7ff9df] Release 4.3-0.9 - this time, for sure!
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 14 hours ago rocky rocky [7ff9df] Release 4.3-0.9 - this time, for sure!
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.