Menu

Tree [69de4e] bash-5.11-logging-patches /
 History

HTTPS access


File Date Author Commit
 command 2023-05-07 rocky rocky [69de4e] get set logging working + test
 data 2011-03-03 rocky rocky [3ffc78] Work on 'shell' command more. Sync with zshdb.
 doc 2020-05-18 rocky rocky [e89032] Revise instruction on how to update.
 htdocs 2020-05-18 rocky rocky [66ed82] Revise docs to mention VSCode & JetBrains plugins
 init 2023-01-05 rocky rocky [890536] Preface more locals with _Dbg_
 lib 2023-05-07 rocky rocky [69de4e] get set logging working + test
 rpm 2017-04-30 rocky rocky [7b2cfa] Update test results ..
 test 2023-05-07 rocky rocky [69de4e] get set logging working + test
 .gitignore 2021-01-30 rocky rocky [321df1] Better 5.1 tolerance
 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.0 2006-01-02 rockyb rockyb [59451c] Initial revision
 INSTALL 2016-03-12 rocky rocky [bd3f52] We don't do bash 3.0 anymore.
 Makefile.am 2020-05-18 rocky rocky [0cafe2] Add Joachim Ansorg to THANKS, THANKS -> THANKS.md
 NEWS.md 2019-12-10 rocky rocky [626fdf] Get ready for release 5.0-1.1.12
 README-git.md 2017-04-30 rocky rocky [7b2cfa] Update test results ..
 README.md 2014-12-14 rocky rocky [5d96ba] Make "make distcheck" work
 THANKS.md 2020-05-18 rocky rocky [0cafe2] Add Joachim Ansorg to THANKS, THANKS -> THANKS.md
 TODO 2010-10-29 rocky rocky [ae9799] Update TODO. Remove zshdb from header comment.
 acinclude.m4 2017-08-04 rocky rocky [e7d58e] configure respects --prefix again
 autogen.sh 2016-03-12 rocky rocky [c07e39] Build adminstrivia fixed bug [#38]
 bashdb-main.inc.in 2017-08-22 rocky rocky [3cff3e] Another small bug
 bashdb-part2.sh 2018-09-30 rocky rocky [ede04e] More rogalmic's changes...
 bashdb-trace.in 2019-09-02 rocky rocky [f2f889] Update for bash 5.0
 bashdb.in 2019-11-06 rocky rocky [9e0f27] Set $0 in 'eval' and 'shell' commands
 check-prefix.sh 2017-08-23 rocky rocky [8b96ae] Better shell script for setting/checking prefix
 compute-prefix.sh 2017-08-27 rocky rocky [33a429] Misc small bugs
 configure.ac 2023-05-07 rocky rocky [69de4e] get set logging working + test
 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 2018-09-30 rocky rocky [ede04e] More rogalmic's changes...
 getopts_long.sh 2019-11-08 rocky rocky [8c9b78] Lots of administrivia:
 ltmain.sh 2016-12-03 rocky rocky [e68d03] bash 4.4 fixes and...
 make-check-filter.pl 2014-12-14 rocky rocky [5d96ba] Make "make distcheck" work
 make-check-filter.rb 2014-12-14 rocky rocky [3e307d] Get ready for 0.91 release.
 set-d-vars.sh 2019-11-08 rocky rocky [8c9b78] Lots of administrivia:

Read Me

Here we have a debugger (the debugger?) for Bash 3.0 and higher.

The command syntax generally follows that of the
zsh debugger trepanning debuggers
and, more generally, GNU debugger gdb.

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.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.