pax_global_header00006660000000000000000000000064114633412600014512gustar00rootroot0000000000000052 comment=b5bfc8596ac77e16112636ee3746e2f5b0076d6d zshdb-0.05+git20101031/000077500000000000000000000000001146334126000141375ustar00rootroot00000000000000zshdb-0.05+git20101031/.gitignore000066400000000000000000000003071146334126000161270ustar00rootroot00000000000000/*.tar.bz2 /*.tar.gz /*~ /Makefile /Makefile /Makefile.in /aclocal.m4 /autom4te.cache /bug /config.log /config.status /configure /dbg-trace.sh /elisp-comp /install-sh /missing /zshdb COPYING INSTALL zshdb-0.05+git20101031/AUTHORS000066400000000000000000000004011146334126000152020ustar00rootroot00000000000000R. Bernstein (rocky@gnu.org) Kate Ward is the author of shunit2 used in unit testing Stéphane Chazelas is the author of getopts_long.sh for GNU long options processing Nikolaj Schumacher is the author of elk-test.el used in GNU Emacs testing zshdb-0.05+git20101031/ChangeLog000066400000000000000000002161561146334126000157240ustar00rootroot000000000000002010-10-25 rocky * ChangeLog, command/set_sub/Makefile.am: Forgot to add a listsize to distribution 2010-10-25 rocky * command/list.sh, command/set.sh, command/set_sub/Makefile.am, command/set_sub/annotate.sh, command/set_sub/args.sh, command/set_sub/autolist.sh, command/set_sub/history.sh, command/set_sub/linetrace.sh, command/set_sub/linewidth.sh, command/set_sub/listsize.sh, command/set_sub/showcommand.sh, command/set_sub/trace-commands.sh, command/show.sh, lib/gdb.sh, lib/list.sh, test/data/setshow.right: Move pretty much the rest of the set subcommands to the set_sub directory. Go over code to be more regular. 2010-10-25 rocky * lib/filecache.sh: test-delete Was giving an warning in cygwin's zsh. Fix that. Sync with bashdb. 2010-10-24 rocky * NEWS: What's up. 2010-10-24 rocky * command/set_sub/Makefile.am: Listed wrong subdirectory. 2010-10-24 rocky * ChangeLog, command/show_sub/Makefile.am, lib/Makefile.am, test/data/Makefile.am: More build administrivia. 2010-10-24 rocky * ChangeLog, command/Makefile.am, command/set.sh, command/set_sub/Makefile.am: Build Administrivia. 2010-10-24 rocky * command/set.sh, command/set_sub/.gitignore, command/set_sub/Makefile.am, command/set_sub/annotate.sh, command/set_sub/editing.sh, command/set_sub/history.sh, command/show.sh, command/show_sub/Makefile.am, command/show_sub/editing.sh, command/show_sub/history.sh, configure.ac, dbg-opts.sh, lib/file.sh, lib/processor.sh, test/unit/test-dbg-opts.sh.in, test/unit/test-file.sh.in: Move more show subcommand code into a show-subcommand directory. 2010-10-23 rocky * command/show.sh, command/show_sub/editing.sh, lib/setshow.sh: Synch with bashb. A couple of bugs found/fixed. 2010-10-23 rocky * command/frame.sh, command/set.sh, command/show.sh, command/show_sub/debugging.sh, command/where.sh, lib/setshow.sh, test/data/setshow.right, test/unit/.gitignore, test/unit/test-setshow.sh.in: More show DRY-ness. Forgot to add lib/setshow and unit test for that previously. 2010-10-23 rocky * command/examine.sh, command/info_sub/files.sh, command/run.sh, command/set.sh, command/show.sh, command/show_sub/debugging.sh, command/stepping.sh, command/tracefn.sh, configure.ac, dbg-opts.sh, dbg-pre.sh, lib/file.sh, lib/filecache.sh, lib/fns.sh, lib/frame.sh, lib/gdb.sh, lib/help.sh, lib/hook.sh, lib/processor.sh, test/unit/Makefile.am, test/unit/test-dbg-opts.sh.in, test/unit/test-file.sh.in, test/unit/test-frame.sh.in: DRY set/show code and help of some of these. 2010-10-23 rocky * README: Update README to show how to change source code to call the debugger 2010-10-22 rocky * lib/help.sh, lib/processor.sh: Remove debug output on runnign hook, and change min abbrev on "show directory" "show dir" because we now have "show different". 2010-10-22 rocky * command/set.sh, command/show.sh, test/data/action.right, test/data/delete.right, test/data/next.right, test/data/setshow.right, test/data/skip.right, test/data/step.right, test/data/subshell.right: Echo show subcommand after running an on/off set command. 2010-10-22 rocky * lib/help.sh: A small "show autolist" bug fixed. 2010-10-22 rocky * lib/help.sh: "show help" for directories was missing. 2010-10-22 rocky * NEWS, command/set.sh, command/show.sh, lib/help.sh, lib/processor.sh, test/data/setshow.right: Add set/show autolist. Add more general cmdloop hook mechanism. 2010-10-11 rocky * test/unit/test-filecache.sh.in, test/unit/test-get-sourceline.sh.in: Small changes. 2010-10-11 rocky * command/info_sub/files.sh, configure.ac, lib/filecache.sh, test/example/dir with spaces/bug.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-filecache.sh.in, test/unit/test-get-sourceline.sh.in: Make sure we can debug filenames whose path has a space one of its directory names. That was the case before but we've added a test and did made changes to make more compatible with bash. filecache.sh: silence zmodload message. 2010-09-16 rocky * ChangeLog, lib/file.sh, lib/filecache.sh: Set cdir properly. More-specific internal-error messages. (Keeping in synch with bashdb). 2010-07-30 R. Bernstein * command/info.sh, command/info_sub/brkpts.sh, command/info_sub/files.sh, command/info_sub/line.sh, command/info_sub/program.sh, command/info_sub/source.sh, command/info_sub/variables.sh, command/info_sub/warranty.sh, command/show.sh, command/show_sub/alias.sh, command/show_sub/copying.sh, command/show_sub/editing.sh: bashdb -> zshdb 2010-07-30 R. Bernstein * configure.ac, dbg-pre.sh: Smallish things to help keep in synch with zshdb. 2010-07-10 rocky * command/show.sh, command/show_sub/.gitignore, command/show_sub/Makefile.am, command/show_sub/alias.sh, command/show_sub/copying.sh, command/show_sub/debugging.sh: Move more "show" subcommands into a "show subcommand" directory. 2010-07-10 rocky * command/Makefile.am, command/break.sh, command/info.sh, command/info_sub/.gitignore, command/info_sub/Makefile.am, command/info_sub/brkpts.sh, command/info_sub/files.sh, command/info_sub/line.sh, command/info_sub/program.sh, command/info_sub/source.sh, command/info_sub/variables.sh, command/info_sub/warranty.sh, command/show.sh, command/show_sub/.gitignore, command/show_sub/Makefile.am, command/show_sub/alias.sh, configure.ac, lib/gdb.sh, lib/processor.sh, test/data/enable.right: Move "info" subcommands for into its own folder. Start the same with "show" subcommands. "info program" now show command next up. 2010-07-08 rocky * dbg-main.sh: use ~ for debugger startup of $HOME is not set. 2010-07-06 R. Bernstein * command/down.sh, command/frame.sh, command/up.sh, command/where.sh, lib/frame.sh, test/data/frame.right, test/unit/test-frame.sh.in: DRY frame code to move common location printing to adjust_frame. 2010-07-06 R. Bernstein * command/Makefile.am, command/down.sh, command/frame.sh, command/up.sh: Split off debugger "up" and "down" commands. Update help text. 2010-07-01 rocky * lib/frame.sh: Even better ksh conformance. 2010-07-01 rocky Merge branch 'master' of github.com:rocky/zshdb 2010-07-01 rocky * lib/frame.sh: local -> typeset -l for better ksh conformity. 2010-06-21 R. Bernstein * command/action.sh, command/kill.sh, lib/action.sh, test/data/action.cmd, test/data/action.right: Fix prompt on deleting all actions. Test it and better checks. 2010-06-21 R. Bernstein * lib/hook.sh: Closer synchronization with bashdb. 2010-06-21 R. Bernstein * command/action.sh, lib/action.sh, test/unit/test-action.sh.in: Small improvements and changes to keep in sync with bashdb. 2010-06-20 R. Bernstein * NEWS: What's up 2010-06-20 rocky * ChangeLog, configure.ac: Update version number 2010-06-20 rocky * command/Makefile.am, command/action.sh, command/alias.sh, configure.ac, dbg-opts.sh, lib/action.sh, lib/hook.sh, lib/processor.sh, test/data/action.cmd, test/data/action.right, test/data/brkpt1.right, test/integration/.gitignore, test/integration/Makefile.am, test/integration/test-action.in, test/unit/test-action.sh.in: Actton command is now implemented sort of as it is in bash. 2010-06-20 rocky * lib/action.sh, test/unit/test-action.sh.in: Add function arg validation on _Dbg_do_clear_action 2010-06-20 rocky * lib/action.sh, test/unit/test-action.sh.in: More work on implementing action. Much more work to go. 2010-06-20 rocky * lib/break.sh: Add another use of _Dbg_is_int. 2010-06-20 rocky * lib/action.sh, lib/break.sh, test/unit/test-break.sh.in, test/unit/test-validate.sh.in: Small improvments like validiating in params and comment fixes. 2010-06-20 rocky * lib/action.sh, test/unit/test-action.sh.in: Bang more on action. More bugs found, more tests added. 2010-06-20 rocky * configure.ac, lib/Makefile.am, lib/action.sh, lib/fns.sh, lib/validate.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-action.sh.in, test/unit/test-examine.sh.in, test/unit/test-fns.sh.in, test/unit/test-validate.sh.in: input validation routines split off from fns.sh. Start action testing. 2010-06-19 rocky * lib/Makefile.am: One more file. 2010-06-19 rocky * lib/action.sh, lib/fns.sh, test/unit/test-fns.sh.in: Start action. test parse_linespec. 2010-06-18 rocky * lib/hook.sh: filename vs. full_filename - this time for sure! 2010-06-18 rocky * lib/hook.sh: Code inspection reveal what smells like a bug. fullname -> full_filename and filename -> full_filename. 2010-06-16 rocky * lib/frame.sh, lib/list.sh: Small changes to keep in sync with bashdb and possible a bug fix due to a variable name typo. 2010-06-16 rocky * lib/break.sh: Indentation style is default shell now 2010-06-16 rocky * test/unit/test-filecache.sh.in: Load possibly used file in unit test 2010-06-16 rocky * lib/file.sh: Cosmetic changes 2010-06-16 rocky * lib/filecache.sh: Comment spelling typo 2010-06-16 rocky * lib/filecache.sh, test/integration/test-brkpt1: filecache.sh: variable _Dbg_bogus_file was not initialized. test-brkpt1: file is derived. 2010-02-12 rocky * doc/Makefile.am: Perhaps a better clean target 2010-02-12 rocky * ChangeLog, doc/Makefile.am, test/Makefile.am: make distcheck (building outside of source tree) should now work. 2010-01-02 rocky * command/break.sh: Fix bug in running a simple "break" command. 2010-01-02 rocky * test/integration/.gitignore, test/integration/test-bug-args, test/integration/test-bug-errexit, test/integration/test-bug-ksharrays, test/integration/test-bugIFS, test/integration/test-condition, test/integration/test-delete, test/integration/test-enable, test/integration/test-examine, test/integration/test-frame, test/integration/test-list, test/integration/test-next, test/integration/test-opts, test/integration/test-restart, test/integration/test-setshow, test/integration/test-skip, test/integration/test-step, test/integration/test-subshell, test/integration/test-tbreak: command/break.sh: unnecessary guard test but keeps in sync with kshdb. test/integration/test-*: these are auto generated. 2009-12-22 rocky Merge branch 'master' of git@github.com:rocky/zshdb 2009-12-22 rocky * configure.ac, test/integration/Makefile.am, test/integration/check-common.sh.in, test/integration/test-brkpt1, test/integration/test-brkpt1.in, test/integration/test-bug-args, test/integration/test-bug-args.in, test/integration/test-bug-errexit, test/integration/test-bug-errexit.in, test/integration/test-bug-ksharrays, test/integration/test-bug-ksharrays.in, test/integration/test-bugIFS, test/integration/test-bugIFS.in, test/integration/test-condition, test/integration/test-condition.in, test/integration/test-delete, test/integration/test-delete.in, test/integration/test-enable, test/integration/test-enable.in, test/integration/test-examine, test/integration/test-examine.in, test/integration/test-frame, test/integration/test-frame.in, test/integration/test-list, test/integration/test-list.in, test/integration/test-next, test/integration/test-next.in, test/integration/test-opts, test/integration/test-opts.in, test/integration/test-restart, test/integration/test-restart.in, test/integration/test-setshow, test/integration/test-setshow.in, test/integration/test-skip, test/integration/test-skip.in, test/integration/test-step, test/integration/test-step.in, test/integration/test-subshell, test/integration/test-subshell.in, test/integration/test-tbreak, test/integration/test-tbreak.in: test/integration/*: Set zsh in integration tests to the same zsh as the debugger uses. configure.ac: test and use a GNU-like sed. 2009-12-18 rocky Merge branch 'master' of git@github.com:rocky/zshdb 2009-12-18 Rocky Bernstein (VCDImager Developer) * autogen.sh, test/zsh/ok4zshdb.sh: Solairis configuration fixes 2009-10-27 rocky * ChangeLog, NEWS, configure.ac: Get ready for release 0.04. 2009-10-23 R. Bernstein * NEWS: NEWS preening 2009-10-23 rocky Merge branch 'master' of git@github.com:rocky/zshdb 2009-10-23 rocky * ChangeLog, NEWS, configure.ac, test/unit/test-file.sh.in: Get ready for release 2009-10-23 R. Bernstein * dbg-main.sh, emacs/zshdb.el: dbg-main.sh: Change another debugger variable to be prefaced with _Dbg_ zshdb.el: Remove compile warnings. 2009-09-24 rocky * command/break.sh: Misplaced quotes. 2009-09-21 R. Bernstein * command/break.sh, lib/break.sh, lib/filecache.sh, lib/fns.sh, test/data/file with spaces.cmd, test/data/file with spaces.right, test/example/file with spaces.sh, test/integration/check-common.sh.in, test/integration/test-file-with-spaces: Handling of files with embedded blanks works better. More filename quoting in "info break" Still one bug in _Dbg_glob_filename remains. 2009-09-21 rocky * test/unit/test-file.sh.in: Some more (better?) file globbing tests 2009-09-20 rocky * command/info.sh, command/list.sh, command/run.sh, dbg-pre.sh, lib/filecache.sh, lib/fns.sh, zshdb.in: Better tolerance for files with embedded blanks. Not perfect yet though. Need to redo parse_linespec. 2009-09-20 rocky * command/break.sh, lib/file.sh, lib/filecache.sh, lib/fns.sh, lib/list.sh, test/data/list.right: Make sure to quote filenames in argment passing so as to be able to handle files with embedded blanks. Keep in sync with kshdb and bashdb. 2009-08-21 R. Bernstein * NEWS, dbg-opts.sh: Small changes to dbg-opts to Keep in sync with bashdb and kshdb 2009-07-04 R. Bernstein * configure.ac: Get ready for 0.03 release 2009-07-04 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2009-06-30 rocky Merge branch 'master' of git@github.com:rocky/zshdb 2009-06-30 rocky * configure.ac, test/integration/Makefile.am, test/integration/test-brkpt1.in, test/integration/test-bug-args.in, test/integration/test-bug-errexit.in, test/integration/test-bug-ksharrays.in, test/integration/test-bugIFS.in, test/integration/test-condition.in, test/integration/test-delete.in, test/integration/test-enable.in, test/integration/test-examine.in, test/integration/test-frame.in, test/integration/test-list.in, test/integration/test-next.in, test/integration/test-opts.in, test/integration/test-restart.in, test/integration/test-setshow.in, test/integration/test-skip.in, test/integration/test-step.in, test/integration/test-subshell.in, test/integration/test-tbreak.in: Need to add name of shell into integration tests. "make check" doesn't seem to have a provision for this. 2009-06-30 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2009-06-30 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2009-06-30 R. Bernstein * ChangeLog, NEWS: Remove in preparation for release on July 4th. 2009-06-24 rocky * test/zsh/ok4zshdb.sh: Remove (erroneous) Debian lintian error. 2009-06-23 R. Bernstein * command/break.sh, lib/processor.sh: Wrong condition test for breakpoint number parsing. 2009-06-23 R. Bernstein * command/condition.sh, test/data/condition.right: Now that we added condition, why not go over it to make it better (and more correct). 2009-06-23 R. Bernstein * command/Makefile.am, command/condition.sh, lib/break.sh, lib/processor.sh, test/data/Makefile.am, test/data/brkpt1.cmd, test/data/brkpt1.right, test/data/condition.cmd, test/data/condition.right, test/data/lopts.right, test/integration/Makefile.am, test/integration/test-condition: Add "condition" command and integration test. Correct option output. 2009-06-22 R. Bernstein * doc/zshdb-man.pod: Small doc changes. 2009-06-22 R. Bernstein * doc/Makefile.am: Administrivia - More common and general wrt other debuggers 2009-06-22 R. Bernstein * doc/zshdb-man.pod: Minor doc change 2009-06-22 R. Bernstein * ChangeLog, Makefile.am, configure.ac, dbg-opts.sh, doc/.gitignore, doc/Makefile.am, test/example/dbg-test2.sh: Start adding doc. In particular start with a manual page. 2009-06-22 R. Bernstein * doc/.gitignore, doc/Makefile.am, doc/zshdb-man.pod: Start writing documentation. In particular, a manual page. 2009-06-19 R. Bernstein * README: Revise as appropriate 2009-06-19 rocky * dbg-main.sh, lib/processor.sh: Add _Dbg_DEBUGGER_LEVEL in advance of "debug" command. 2009-06-18 rocky * dbg-pre.sh: See previous commit 2009-06-18 rocky * command/info.sh, dbg-pre.sh, lib/hook.sh, lib/save-restore.sh: Clean up code with respect to setting current breakpoint number 2009-06-18 rocky * test/data/enable.cmd, test/data/enable.right: Add "info program" check 2009-06-18 rocky * lib/hook.sh: More precise breakpoint reason in "info program" 2009-06-15 rocky * test/integration/check-common.sh.in: Make sure srcdir is set in integration tests 2009-06-15 rocky * lib/msg.sh: Typo: while ; -> while : 2009-06-14 rocky * dbg-main.sh, dbg-opts.sh: Deal with tty weirdness. Probably this won't be the last of it. Update copyright. 2009-06-14 rocky * command/kill.sh, lib/msg.sh, lib/processor.sh, lib/save-restore.sh: Add debugger kill command. Add library routine confirm() to prompt before doing dangerous commands like "kill". 2009-06-14 rocky * configure.ac, test/integration/Makefile.am, test/integration/test-restart, test/unit/test-filecache.sh.in: In 0.03git territory now. Make "make distcheck" work. 2009-06-13 R. Bernstein * configure.ac, test/unit/Makefile.am, test/unit/test-examine.sh.in: Add unit test for examine. 2009-06-13 R. Bernstein * configure.ac, lib/msg.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-break.sh.in, test/unit/test-msg.sh.in: Add test/unit/msg of lib/msg and fix bugs in the latter. Other small bugs fixed and some alignment with kshdb. 2009-06-11 R. Bernstein * lib/break.sh, lib/msg.sh, lib/processor.sh, test/data/setshow.right: break.sh: Start using function form to match ksh processor.sh, msg.sh: use common undefined-command routine. 2008-12-12 R. Bernstein * command/frame.sh, lib/help.sh: Update help for frame and set inferior-tty 2008-12-12 R. Bernstein * lib/tty.sh: Clarify use of redirection on open and close. 2008-12-11 R. Bernstein * command/source.sh, lib/tty.sh: Small changes 2008-12-11 R. Bernstein * lib/processor.sh, lib/tty.sh, test/unit/test-tty.sh.in: Yet another iteration of dealing with inferior ttys. 2008-12-11 R. Bernstein * lib/tty.sh: tty-testing code along the lines suggested by David Korn. 2008-12-10 R. Bernstein * lib/tty.sh, test/unit/test-tty.sh.in: Use the terminal test suggested by Stéphane Chazelas 2008-12-10 R. Bernstein * lib/msg.sh, lib/tty.sh: No space around <> to be ksh compatible 2008-12-09 R. Bernstein * lib/tty.sh: Possibly better for redirecting stdin/stdout 2008-12-08 R. Bernstein * command/set.sh, configure.ac, dbg-main.sh, dbg-opts.sh, lib/Makefile.am, lib/help.sh, lib/tty.sh, test/data/lopts.right, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-tty.sh.in: Stab at set-inferior-tty. Output redirection is okay, but input redirection doesn't work. 2008-11-17 R. Bernstein * .gitignore: Administrivia 2008-11-15 R. Bernstein * ChangeLog, Makefile.am, NEWS: Makefile.am: create ChangeLog. More preparation for 0.02 release. 2008-11-15 R. Bernstein * command/continue.sh, command/where.sh, lib/fns.sh: Sync with kshdb. 2008-11-15 R. Bernstein * command/break.sh, command/disable.sh, command/edit.sh, command/examine.sh, command/help.sh, configure.ac: Synch up with bashdb. Get ready for release. 2008-11-08 R. Bernstein * lib/break.sh: Sync with bashdb. 2008-11-06 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2008-11-06 R. Bernstein * command/info.sh: Fix "info args" bug 2008-11-06 R. Bernstein * command/break.sh, command/continue.sh, lib/break.sh, lib/hook.sh: Minor tweaks. Synch with kshdb. 2008-11-06 R. Bernstein * lib/break.sh, test/unit/test-break.sh.in: Minor tweaks 2008-11-06 R. Bernstein * configure.ac: Hey, we're in 0.02 territory now. 2008-11-06 R. Bernstein * lib/break.sh, test/unit/test-break.sh.in: More breakpoint tests added; more breakpoint bugs fixed 2008-11-05 R. Bernstein * lib/break.sh, test/data/enable.right, test/unit/test-break.sh.in: More tests of breakpoint code, more bugs found. 2008-11-04 R. Bernstein * lib/break.sh, test/unit/test-break.sh.in: More break set/unset tests 2008-11-04 R. Bernstein * configure.ac, dbg-opts.sh, lib/break.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-break.sh.in: Bugs in clearing breakpoint by file/line. Add a breakpoint unit test. 2008-11-02 R. Bernstein * emacs/zshdb.el, lib/break.sh: Add more parameter checking; journal more. Mostly minor changes. 2008-10-30 R. Bernstein * dbg-opts.sh: Minor comment typo 2008-10-30 R. Bernstein * test/data/frame.right: Line number plox 2008-10-30 R. Bernstein * command/show.sh, configure.ac, dbg-opts.sh, dbg-pre.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-pre.sh.in, zshdb.in: Fix bugs in --version and "show version" 2008-10-27 R. Bernstein * configure.ac: Release 0.01 2008-10-25 R. Bernstein * Makefile.am: Create distribution tar.bz2 as well as tar.gz 2008-10-21 R. Bernstein * test/zsh/ok4zshdb.sh: Use dev2 2008-10-20 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2008-10-18 R. Bernstein * dbg-pre.sh: bashdb sync 2008-10-18 R. Bernstein * configure.ac: Correct Emacs disabling 2008-10-17 R. Bernstein * test/example/Makefile.am: Add restart files 2008-10-17 R. Bernstein * test/data/Makefile.am: Add restart files 2008-10-15 R. Bernstein * Makefile.am: Make more like kshdb and bashdb. 2008-10-14 R. Bernstein * test/unit/test-fns.sh.in: Reinstate a double-quote test 2008-10-14 R. Bernstein * configure.ac: Require Emacs 22 or better 2008-10-14 R. Bernstein * dbg-pre.sh, test/data/restart.cmd, test/data/restart.right, test/data/restart2.cmd, test/example/restart.sh, test/integration/Makefile.am, test/integration/test-restart: Add restart regression test. 2008-10-13 R. Bernstein * dbg-opts.sh: print -> echo 2008-10-13 R. Bernstein * dbg-opts.sh, test/data/lopts.right: Usage typo. 2008-10-13 R. Bernstein * test/data/frame.right: Sync up 2008-10-13 R. Bernstein I hate failed merges 2008-10-13 R. Bernstein * test/data/frame.right, zshdb.in: Sync with other debuggers 2008-10-13 R. Bernstein * dbg-opts.sh, lib/hook.sh, test/data/frame.right, test/data/lopts.right, zshdb.in: Add --command or -c option. 2008-10-10 R. Bernstein * test/data/frame.right, test/unit/shunit2, test/unit/test-filecache.sh.in, test/zsh/ok4zshdb.sh: Bump zsh verseion test. Update shunit2 to latest code. Add unit test for _Dbg_check_line. 2008-10-10 R. Bernstein * lib/break.sh, test/data/frame.right: Synch with kshdb - minor changes. 2008-10-09 R. Bernstein * lib/fns.sh, test/data/frame.right: Fix list bug when frames are moved. 2008-10-09 R. Bernstein * lib/fns.sh: Minor changes 2008-10-09 R. Bernstein * command/list.sh, lib/break.sh, lib/filecache.sh, lib/fns.sh, test/data/list.right, zshdb.in: Remove temporary default testing.sh script. Some other minor changes. 2008-10-09 R. Bernstein * command/tracefn.sh, lib/fns.sh, test/unit/test-fns.sh.in: Lame attempt at tracing aliases. 2008-10-08 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2008-10-08 R. Bernstein * README: Update README 2008-10-08 R. Bernstein * command/eval.sh, command/info.sh, lib/info.sh: Small "info var" bugs. 2008-10-08 R. Bernstein * lib/processor.sh, test/data/Makefile.am, test/data/frame.right, test/data/subshell.cmd, test/data/subshell.right, test/example/Makefile.am, test/example/subshell.sh, test/integration/Makefile.am, test/integration/test-subshell: Add subshell test. Fix bug in saving commands on history only after subshell return. 2008-10-02 R. Bernstein * lib/filecache.sh, lib/help.sh, lib/save-restore.sh: Code sync with kshdb 2008-10-02 R. Bernstein * test/data/frame.right: Administrivia 2008-10-02 R. Bernstein * command/set.sh, test/example/hanoi.sh.in: Small bugfixes 2008-10-01 R. Bernstein * dbg-opts.sh: Better handling of erroneous options. 2008-10-01 R. Bernstein * command/run.sh, dbg-opts.sh, dbg-pre.sh: Add exports to some global debugger variables that need it 2008-10-01 R. Bernstein * command/quit.sh, command/return.sh, lib/dbg-call.sh, lib/hook.sh, lib/processor.sh, zshdb.in: Document quit and return commands better. Small cleanups. 2008-10-01 R. Bernstein * test/data/frame.right: Administrivia - the cost of doing tests this way. 2008-10-01 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2008-10-01 R. Bernstein * command/Makefile.am, command/return.sh, lib/hook.sh, lib/journal.sh, lib/processor.sh, lib/save-restore.sh, test/data/frame.right, zshdb.in: Add gdb-like "return" statement. Deal with history slightly better. Other small bug fixes and tweaks. 2008-09-30 R. Bernstein * dbg-opts.sh, dbg-pre.sh, zshdb.in: Cross debugger fixes and other small things 2008-09-30 R. Bernstein * lib/processor.sh, test/example/subshell.sh: Fix bug in not exporting file descriptor used in eval/print output. Thanks to Peter Stephenson for focusing my attention on the problem 2008-09-29 R. Bernstein * Makefile.am, dbg-opts.sh: Minor changes. 2008-09-29 R. Bernstein * test/unit/test-dbg-opts.sh.in: Test of no options. 2008-09-29 R. Bernstein * AUTHORS, Makefile.am, THANKS, configure.ac, dbg-main.sh, dbg-opts.sh, dbg-pre.sh, getopt-test.sh, getopts_long.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/shunit2, test/unit/test-columns.sh.in, test/unit/test-dbg-opts.sh.in: Convert options processing to getopts_long by Stéphane Chazelas. Thanks Stéphane! 2008-09-28 R. Bernstein * command/eval.sh, configure.ac, lib/processor.sh: Minor small bug fixes and tweaks. 2008-09-27 R. Bernstein * test/example/hanoi.sh.in, test/integration/test-frame, test/integration/test-opts: Skip some integration tests when building outside of source. 2008-09-27 R. Bernstein * command/Makefile.am, test/integration/test-opts, test/unit/shunit2, test/unit/test-filecache.sh.in: Fixes for build outside of source tree. 2008-09-27 R. Bernstein * test/unit/shunit2, test/unit/test-filecache.sh.in: Start to add descriptions to asserts. Update shunit2. 2008-09-26 R. Bernstein * test/unit/test-alias.sh.in, test/unit/test-columns.sh.in, test/unit/test-file.sh.in, test/unit/test-filecache.sh.in, test/unit/test-fns.sh.in, test/unit/test-frame.sh.in, test/unit/test-journal.sh.in, test/unit/test-run.sh.in, test/unit/test-save-restore.sh.in, test/unit/test-sort.sh.in: Facilitate build outside of source tree as per observation of Clint Adams. 2008-09-26 R. Bernstein * configure.ac: Remove test for long options processing; zshdb uses zparseopt. Thanks to Clint Adams. 2008-09-26 R. Bernstein * Makefile.am, configure.ac, dbg-trace.sh.in, lib/hook.sh: Don't run Emacs testing if no Emacs (Clint Adams). Remove stray debugging print. 2008-09-26 R. Bernstein * lib/hook.sh, test/example/subshell.sh: Start subshell testing. 2008-09-25 R. Bernstein * lib/help.sh: Add "show commands" to help show and tweak text a little. 2008-09-25 R. Bernstein * test/data/lopts.right: Clean up help text 2008-09-25 R. Bernstein * dbg-opts.sh: Clean up help text. 2008-09-25 R. Bernstein * configure.ac, test/zsh/Makefile.am, test/zsh/ok4zshdb.sh, test/zsh/ok4zshdb2.sh, test/zsh/ok4zshdb3.sh: More stringent zsh test and correct --with-zsh option. 2008-09-25 R. Bernstein * lib/list.sh: Edit of wrong file. 2008-09-25 R. Bernstein * command/list.sh, lib/list.sh, lib/processor.sh, test/data/list.cmd, test/data/list.right, test/integration/test-setshow: Small "list" command fixes. 2008-09-25 R. Bernstein * command/list.sh, lib/frame.sh, lib/list.sh, lib/processor.sh, test/data/Makefile.am, test/data/list.cmd, test/data/list.right, test/integration/Makefile.am, test/integration/test-list: Work on list command and add integration test. 2008-09-24 R. Bernstein * command/quit.sh, command/run.sh, lib/hook.sh, lib/save-restore.sh: Regularize variables names. 2008-09-24 R. Bernstein * command/quit.sh, command/run.sh, lib/hook.sh, lib/save-restore.sh: Work on quit and restart in the face of being inside a subshell. 2008-09-24 R. Bernstein * command/eval.sh, lib/journal.sh, lib/msg.sh, lib/processor.sh, lib/save-restore.sh, test/unit/test-fns.sh.in, test/unit/test-save-restore.sh.in, zshdb.in: Get journaled values back into parent shells. eval sets return code properly and we output errors to debugger terminal 2008-09-24 R. Bernstein * lib/gdb.sh, lib/msg.sh: Debugger output should go to debugger file descriptor output not debugged program output. Not perfect here, but more correct. 2008-09-24 R. Bernstein * command/set.sh, dbg-opts.sh, lib/processor.sh, test/data/setshow.right: Work on "annotate" mode. 2008-09-24 R. Bernstein * lib/fns.sh: Simplify (and is probably more correct) 2008-09-23 R. Bernstein * command/info.sh, command/show.sh, lib/info.sh: More minor changes 2008-09-23 R. Bernstein * lib/gdb.sh, lib/help.sh: Minor changes 2008-09-22 R. Bernstein * command/set.sh, dbg-trace.sh.in, lib/frame.sh, lib/gdb.sh, lib/hist.sh, lib/hook.sh, lib/processor.sh, lib/save-restore.sh, test/data/frame.right, zshdb.in: Go back to non-interactive from the start. Reduce debugger global/local pollution. 2008-09-22 R. Bernstein * command/help.sh, command/info.sh, command/show.sh, lib/fns.sh, lib/list.sh, lib/processor.sh: Small changes 2008-09-22 R. Bernstein * command/info.sh: DRY. 2008-09-22 R. Bernstein * command/show.sh, lib/list.sh, test/data/setshow.right: Minor changes. 2008-09-21 R. Bernstein * command/set.sh, command/show.sh, lib/hist.sh: Work on saving history to a file. 2008-09-21 R. Bernstein * command/info.sh, command/list.sh, dbg-main.sh, dbg-opts.sh, lib/list.sh, lib/processor.sh, test/integration/check-common.sh.in, test/integration/lopts.tests, test/integration/sopts.tests: .zshdbrc works now (with one bug). Move option variables to _Dbg_ space. Add --no-init to tests 2008-09-20 R. Bernstein * lib/save-restore.sh, test/data/Makefile.am, test/data/bug-ksharrays.cmd, test/data/bug-ksharrays.right, test/example/Makefile.am, test/example/bug-ksharrays.sh, test/integration/Makefile.am, test/integration/test-bug-ksharrays: Bug in restoring ksharray option inside debugger "eval". 2008-09-20 R. Bernstein * command/help.sh: DRY 2008-09-20 R. Bernstein * command/show.sh, lib/Makefile.am, lib/columns.sh, lib/list.sh, test/unit/test-columns.sh.in: Fix bug in columnize. Remove hoakiness in working around that bug. 2008-09-20 R. Bernstein * command/info.sh, command/list.sh, lib/columns.sh, lib/fns.sh, lib/hist.sh, lib/hook.sh, lib/info.sh, lib/list.sh, lib/save-restore.sh: Add lots of "info var" attributes and place "info fun" under that. More with "info source" 2008-09-20 R. Bernstein * command/show.sh, dbg-main.sh, lib/hist.sh, lib/hook.sh, lib/processor.sh, test/data/setshow.right, zshdb.in: Bang on debugger history. 2008-09-20 R. Bernstein * lib/filecache.sh, lib/fns.sh: Add patterns "info functions" 2008-09-20 R. Bernstein * lib/filecache.sh: DRY filecache.sh code 2008-09-20 R. Bernstein * lib/filecache.sh: Take into account last line w/o carriage return 2008-09-19 R. Bernstein * command/info.sh, command/list.sh, command/tracefn.sh, dbg-opts.sh, lib/fns.sh, lib/info.sh: Add "info functions" via "typeset -fp". Redo trace via va "typeset -ft". 2008-09-19 R. Bernstein * lib/hook.sh, test/integration/test-examine, test/unit/test-filecache.sh.in: More of the same. emulation save/restore. A testing bug fixed. 2008-09-19 R. Bernstein * lib/frame.sh, lib/hook.sh: Attempt again to deal with breakage caused by emulation. I don't understand what's going on but this seems to help. 2008-09-19 R. Bernstein * lib/frame.sh: ksharrays seems to get unset. Punt for now. 2008-09-19 R. Bernstein * lib/filecache.sh, test/data/brkpt1.right, test/unit/test-filecache.sh.in: Read in blank lines in file correctly. Thanks to Peter Stephenson and Bart Schaefer. 2008-09-19 R. Bernstein * command/list.sh, lib/frame.sh, lib/hook.sh, lib/list.sh, test/unit/test-journal.sh.in: Variable name consistency 2008-09-18 R. Bernstein * command/list.sh, lib/filecache.sh, lib/frame.sh, lib/list.sh, lib/processor.sh, test/unit/test-filecache.sh.in, test/unit/test-frame.sh.in: Remove some bugs in the "list" command. 2008-09-18 R. Bernstein * command/Makefile.am, command/list.sh, lib/Makefile.am, lib/filecache.sh, lib/list.sh, lib/processor.sh: Start "list" command. 2008-09-18 R. Bernstein * command/info.sh, dbg-main.sh, lib/Makefile.am, lib/filecache.sh, lib/hist.sh, lib/processor.sh, test/data/brkpt1.cmd, test/data/brkpt1.right, test/unit/test-filecache.sh.in: Save file lines. Therefore we now check if breakpoint line numbers are beyond the end of file. Thanks to Bart Schaefer. 2008-09-17 R. Bernstein * command/info.sh, command/set.sh, command/show.sh, dbg-main.sh, lib/file.sh, lib/filecache.sh, lib/hook.sh, lib/save-restore.sh, test/data/frame.right, test/data/setshow.right: "info files" shows list of files seen. Some work towards saving history. Generalize .zshdbrc vi _Dbg_debugger_name. 2008-09-17 R. Bernstein * command/break.sh, lib/file.sh, lib/filecache.sh, lib/save-restore.sh, zshdb.in: Bugs: in setting cwd which changes unqualified file names (but that had its own additional bug); setting condition (not used yet even if it is a bug). Use newer PS4 %x:%I which has bugs of its own which I need to report. 2008-09-17 R. Bernstein * lib/save-restore.sh: Minor cleanup. 2008-09-17 R. Bernstein * lib/hook.sh, lib/save-restore.sh, test/unit/test-save-restore.sh.in: save/restore environment cleanup. 2008-09-17 R. Bernstein * command/show.sh, lib/fns.sh, lib/frame.sh, lib/hook.sh, lib/processor.sh, lib/save-restore.sh, test/unit/test-save-restore.sh.in: Need to save options to "set" as well as "unset". Some slight cleanup here as well. 2008-09-16 R. Bernstein * lib/hook.sh, lib/save-restore.sh, test/data/Makefile.am, test/data/examine.cmd, test/data/examine.right, test/example/Makefile.am, test/example/exam.sh, test/integration/Makefile.am, test/integration/test-examine: Yet another option save/restore bug quashed (for now). Add "examine" command integration test. 2008-09-16 R. Bernstein * test/integration/check-common.sh.in, test/integration/sopts.tests, test/unit/test-columns.sh.in, test/unit/test-file.sh.in, test/unit/test-filecache.sh.in, test/unit/test-frame.sh.in, test/unit/test-journal.sh.in, test/unit/test-save-restore.sh.in, test/unit/test-sort.sh.in: Change internal PS4 setting to %x:%I. 2008-09-16 R. Bernstein * lib/hook.sh, lib/save-restore.sh: Possibly more towards a correct hook to save/restore ksharrays and opts. 2008-09-16 R. Bernstein * command/examine.sh, test/data/frame.right, test/data/lopts.right, test/integration/Makefile.am, test/integration/test-opts, test/integration/test-setshow, zshdb.in: Misc bugs and tweaks. zshdb.in: start out with initial zsh defaults. examine.sh: fake variables better. test/integration: correct test testing; add "test" and "test-integraiton" targets" 2008-09-15 R. Bernstein * lib/hook.sh, lib/save-restore.sh, test/unit/Makefile.am, test/unit/test-save-restore.sh.in: Fix bugs in saving and restoring the user settings (more) properly. 2008-09-15 R. Bernstein * test/data/Makefile.am, test/data/tbreak.cmd, test/data/tbreak.right, test/integration/Makefile.am, test/integration/test-tbreak: Add temporary break and integration test. 2008-09-15 R. Bernstein * lib/fns.sh: Use return code on declare -p. Thanks Peter! 2008-09-14 R. Bernstein * command/Makefile.am, command/examine.sh, lib/fns.sh: Small "examine" bug fixes. 2008-09-13 R. Bernstein * command/examine.sh, lib/fns.sh, lib/processor.sh, test/data/setshow.right, test/unit/test-fns.sh.in: Add examine command and defined function. Needs a little more work in edge casess though. 2008-09-13 R. Bernstein * command/break.sh, command/continue.sh, lib/break.sh, lib/hook.sh, lib/processor.sh: Add one-time breakpoint tbreak and handle one-time on "continue" as well. 2008-09-13 R. Bernstein * lib/hook.sh: Clean up hook code: add common routine, remove hacky cleanup2. 2008-09-12 R. Bernstein * command/break.sh, lib/break.sh, lib/hook.sh, test/data/Makefile.am, test/data/delete.right, test/data/enable.cmd, test/data/enable.right, test/integration/Makefile.am, test/integration/test-enable: Integration test added for enable and disable. Bugs found and fixed. 2008-09-12 R. Bernstein * command/break.sh, lib/break.sh, lib/hook.sh, test/data/delete.right: Enable/disable now do something. (Tests needed) Show breakpoint number before stopping and counts in "info break". 2008-09-11 R. Bernstein * command/Makefile.am, command/disable.sh, command/enable.sh, lib/break.sh, lib/gdb.sh, lib/hook.sh, lib/processor.sh, lib/save-restore.sh: Add enable/disable commands. More facist about setting needed zsh options. 2008-09-11 R. Bernstein * lib/filecache.sh, lib/frame.sh, lib/gdb.sh: Some bug fixing or bug avoidance. 2008-09-11 R. Bernstein * command/source.sh, lib/gdb.sh, lib/processor.sh, lib/save-restore.sh: Better way to make use of command reading and testing for interactive terminals . Thanks to Bart Schaefer. 2008-09-11 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2008-09-11 R. Bernstein * command/source.sh, lib/processor.sh: Use vared for more flexible debugger command handling and editing. 2008-09-10 R. Bernstein * test/data/Makefile.am, test/data/delete.cmd, test/data/delete.right, test/example/stepping.sh, test/integration/Makefile.am, test/integration/test-delete: delete (breakpoint) integration test. 2008-09-10 R. Bernstein * command/delete.sh, lib/break.sh, lib/msg.sh, lib/processor.sh, test/data/brkpt1.right, test/data/lopts.right, test/data/sopts.right: Add delete (breakpoint) command. 2008-09-09 R. Bernstein * command/break.sh, command/info.sh, lib/fns.sh, lib/frame.sh, lib/processor.sh, test/data/Makefile.am, test/data/brkpt1.cmd, test/data/brkpt1.right, test/example/Makefile.am, test/example/dbg-test1.sh, test/example/dbg-test1.sub, test/integration/Makefile.am, test/integration/check-common.sh.in, test/integration/test-brkpt1: First breakpoint regression test for the meager code we have. Lots of little bug fixes and more idiomatic usage. 2008-09-09 R. Bernstein * command/info.sh, command/show.sh, configure.ac, lib/Makefile.am, lib/sort.sh, test/data/setshow.cmd, test/data/setshow.right, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-sort.sh.in: Columnize info and show subcommand lists on error output. Add list sorting routine. 2008-09-08 R. Bernstein * command/Makefile.am, command/help.sh, command/info.sh, command/run.sh, lib/Makefile.am, lib/help.sh, lib/info.sh, lib/processor.sh: Start "info" command. 2008-09-08 R. Bernstein * configure.ac, lib/break.sh, lib/journal.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-frame.sh.in, test/unit/test-journal.sh.in, test/unit/test-save-restore.sh.in: Add a basic journal test. 2008-09-06 R. Bernstein * command/break.sh, command/continue.sh, dbg-pre.sh, lib/file.sh, lib/frame.sh, lib/journal.sh, test/unit/test-file.sh.in, test/unit/test-filecache.sh.in: Add full-blown continue command. A number of other small bug fixes. 2008-09-06 R. Bernstein * command/help.sh, command/set.sh, command/show.sh, lib/gdb.sh, lib/help.sh, lib/journal.sh, test/data/setshow.cmd, test/data/setshow.right: Add command to set and show line width (set/show width). Some other minor fixes. 2008-09-05 R. Bernstein * README, command/run.sh, dbg-opts.sh, dbg-pre.sh, lib/fns.sh, lib/hook.sh, lib/journal.sh, lib/processor.sh, test/data/setshow.right, test/integration/Makefile.am, test/unit/shunit2, test/unit/test-file.sh.in, test/unit/test-filecache.sh.in, test/unit/test-fns.sh.in, testing.sh: Use ZSH subshell in journaling and the prompt display. 2008-09-05 R. Bernstein * lib/gdb.sh, lib/hook.sh, test/data/bug-args.right, test/data/bug-errexit.right, test/data/bugIFS.right, test/data/frame.right, test/data/lopts.right, test/data/next.right, test/data/setshow.right, test/data/skip.right, test/data/sopts.right, test/data/step.right: Print command via ZSH_DEBUG_CMD with location. Thanks yet again to Peter Stephenson. 2008-09-05 R. Bernstein * test/data/Makefile.am, test/example/Makefile.am, test/integration/Makefile.am: More administrivia: make "make dist" work. 2008-09-05 R. Bernstein * Makefile.am: Administrivia 2008-09-05 R. Bernstein * command/break.sh, command/set.sh, getopt-test.sh, lib/break.sh, lib/filecache.sh, lib/frame.sh, lib/hook.sh: Used by configure to see if getopt works 2008-09-04 R. Bernstein * command/Makefile.am, lib/Makefile.am: Administrivia. 2008-09-04 R. Bernstein * command/break.sh, configure.ac, lib/break.sh, lib/file.sh, lib/filecache.sh, lib/gdb.sh, lib/msg.sh, lib/processor.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-file.sh.in, test/unit/test-filecache.sh.in: More progress towards adding breakpoints. More code towards gathering file information. Still need code in processor.sh to check/stop at breakpoints and code to read in file lines. 2008-09-04 R. Bernstein * test/data/Makefile.am, test/data/skip.cmd, test/data/skip.right, test/integration/Makefile.am, test/integration/test-skip: Add skip integration test. 2008-09-03 R. Bernstein * configure.ac, lib/file.sh, lib/fns.sh, lib/processor.sh, test/data/frame.right, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-file.sh.in, zshdb.in: Fill in more of the file routines. Much more work is needed. 2008-09-02 R. Bernstein I hate failed merges 2008-09-02 R. Bernstein * command/tracefn.sh, lib/columns.sh, lib/gdb.sh, test/data/bug-errexit.right, test/data/frame.right, test/data/next.right, test/unit/test-frame.sh.in: Better stack traces thanks to changes in zsh by Peter Stephenson. Some zshdb bugs in this area fixed. 2008-09-02 R. Bernstein * command/help.sh, command/show.sh, lib/columns.sh, test/unit/test-columns.sh.in: Columnize "show aliases" 2008-08-31 R. Bernstein * configure.ac, dbg-main.sh, dbg-pre.sh, dbg-trace.sh.in, lib/frame.sh, lib/processor.sh, test/data/frame.right, test/zsh/ok4zshdb.sh, zshdb.in: Make more portable across shells. Check zsh version. Some small code reorganization. 2008-08-30 R. Bernstein * lib/Makefile.am: Include columns.sh when installing and making distribution. 2008-08-30 R. Bernstein * command/help.sh, command/stepping.sh, configure.ac, lib/columns.sh, lib/help.sh, lib/hook.sh, test/example/Makefile.am, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-columns.sh.in: Better handling of column output. Administrivia. 2008-08-30 R. Bernstein * test/data/next.cmd, test/data/next.right, test/example/nexting.sh, test/integration/test-next: Add integration test for "next", "n+", "n-" 2008-08-30 R. Bernstein * test/integration/Makefile.am: Add integration test for next 2008-08-30 R. Bernstein * README, command/stepping.sh: Revise README for what's up. Remove a debug statement. 2008-08-30 R. Bernstein * command/help.sh, command/stepping.sh, lib/alias.sh, lib/dbg-call.sh, lib/frame.sh, lib/hook.sh, lib/processor.sh, lib/save-restore.sh, test/data/Makefile.am, test/integration/Makefile.am, zshdb.in: Add next, next-, next+ commands: stepping over functions. Reduce verbosity on set -x tracing. 2008-08-29 R. Bernstein * test/data/bug-errexit.cmd, test/data/bug-errexit.right, test/example/bug-errexit.sh, test/integration/test-bug-errexit: Add integration test for "set -o errexit" and "set -u". 2008-08-28 R. Bernstein * command/continue.sh, lib/processor.sh: entering debugger loop kills prior step ignore counts 2008-08-28 R. Bernstein * test/example/stepping.sh: Small things 2008-08-27 R. Bernstein * command/stepping.sh, lib/hook.sh: Minor 2008-08-27 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2008-08-27 R. Bernstein * command/stepping.sh, lib/processor.sh: DRY step integration test 2008-08-27 R. Bernstein * test/data/step.cmd, test/data/step.right, test/example/stepping.sh, test/integration/Makefile.am, test/integration/test-step: Add step, step+, step- and set/show force integration test. 2008-08-27 R. Bernstein * test/integration/Makefile.am: setshow.tests no longer needed 2008-08-27 R. Bernstein * test/integration/check-common.sh.in, test/integration/test-bug-args, test/integration/test-bugIFS, test/integration/test-frame, test/integration/test-setshow: Dry regression tests 2008-08-27 R. Bernstein * test/integration/setshow.tests: Dry integration tests more. 2008-08-26 R. Bernstein * command/stepping.sh: Typo 2008-08-26 R. Bernstein * lib/hook.sh, test/data/frame.cmd, test/data/frame.right, test/data/setshow.right: Correct regression tests and make test-frame less debugger specific. 2008-08-26 R. Bernstein Merge branch 'master' of git@github.com:rocky/zshdb 2008-08-26 R. Bernstein * command/stepping.sh: I hate conflicted merges 2008-08-26 R. Bernstein * command/set.sh, command/show.sh, command/stepping.sh, dbg-pre.sh, lib/frame.sh, lib/help.sh, lib/hook.sh, lib/processor.sh, zshdb.in: Start "set/show force" step+ and step-. Frame regression test is broken which probably means this is broken. 2008-08-26 R. Bernstein * command/run.sh, lib/run.sh: Bang on restart a bit. 2008-08-25 R. Bernstein * lib/frame.sh, test/data/frame.right: Reset frame position every time debugger is entered. 2008-08-24 R. Bernstein * command/alias.sh, command/continue.sh, command/edit.sh, command/frame.sh, command/quit.sh, command/run.sh, command/source.sh, dbg-main.sh, dbg-opts.sh, dbg-trace.sh.in, lib/processor.sh, test/data/bug-args.right, test/data/bugIFS.right, test/data/frame.right, test/data/lopts.right, test/data/setshow.right, test/data/sopts.right: Remove bogusity in handling stacked input descriptors. Bang on help text some more. 2008-08-23 R. Bernstein * test/data/bug-args.right, test/data/frame.right, test/example/bug-args.sh, test/example/hanoi.sh.in: Small stuff 2008-08-23 R. Bernstein * README, command/eval.sh, test/integration/check-common.sh.in: Minor changes. 2008-08-23 R. Bernstein * .gitignore, Makefile.am, configure.ac, dbg-trace.sh.in, emacs/.gitignore, emacs/Makefile.am, emacs/dbg-test.el.in, emacs/zshdb-test.el.in, test/example/settrace.sh, zshdb-trace.in: Infrstructure more generic and common with other *shdb debuggers 2008-08-23 R. Bernstein * lib/Makefile.am, lib/hook.sh, lib/processor.sh, lib/sig.sh: sig.sh -> hook.sh. 2008-08-23 R. Bernstein * .gitignore, command/show.sh, configure.ac, lib/dbg-call.sh, lib/frame.sh, lib/help.sh, lib/save-restore.sh, test/data/frame.right, test/data/settrace.cmd, test/data/settrace.right, test/example/settrace.sh, test/unit/test-save-restore.sh.in, zshdb-trace.in, zshdb.in: Add ability to hard-code calls to the debugger from inside a script: source zshdb-trace and call _Dbg_debugger. 2008-08-23 R. Bernstein * command/stepping.sh, lib/sig.sh: Remove some of my bugs in handling skip. 2008-08-22 R. Bernstein * command/stepping.sh, lib/frame.sh, lib/processor.sh, lib/sig.sh, test/data/frame.cmd, test/data/frame.right, test/example/hanoi.sh.in, test/unit/test-fns.sh.in, test/unit/test-frame.sh.in, zshdb.in: Add skip command. This time, for sure! Add stack saving routine. 2008-08-22 R. Bernstein * test/integration/Makefile.am, test/integration/test-frame: Add an integration test for frame motion. Yay! 2008-08-22 R. Bernstein * command/set.sh, configure.ac, dbg-opts.sh, lib/gdb.sh, lib/processor.sh, lib/sig.sh, test/data/frame.cmd, test/data/frame.right, test/data/setshow.right, test/example/.gitignore, test/example/Makefile.am, test/example/hanoi.sh.in, test/integration/check-common.sh.in, test/integration/test-frame, test/unit/.gitignore, test/unit/test-alias.sh.in, test/unit/test-frame.sh.in: Handle "set linetrace on/off". Closer to having frame integration test working. 2008-08-22 R. Bernstein * lib/frame.sh, test/unit/test-frame.sh.in: Small potatoes 2008-08-21 R. Bernstein * command/frame.sh, command/help.sh, configure.ac, lib/frame.sh, lib/sig.sh, test/unit/Makefile.am: More stringent checking of frame. More bugs found. Show aliases on command help (this time, for sure!) 2008-08-21 R. Bernstein * lib/gdb.sh: Another stack frame bug. It's really time to port over some unit tests... 2008-08-21 R. Bernstein * command/frame.sh: Update help 2008-08-21 R. Bernstein * command/where.sh, lib/frame.sh: Fix frame adjustment. We're now using zero origin. 2008-08-21 R. Bernstein * dbg-opts.sh: Comment annotate for now. 2008-08-21 R. Bernstein * command/help.sh, command/stepping.sh, lib/alias.sh, lib/processor.sh, lib/save-restore.sh, test/unit/test-alias.sh.in, testing.sh, zshdb.in: Show aliases in help for a command. 2008-08-20 R. Bernstein * command/help.sh, command/show.sh, lib/help.sh: More compatible with kshdb 2008-08-20 R. Bernstein * AUTHORS, README, command/alias.sh, command/help.sh, command/set.sh, command/show.sh, command/stepping.sh, dbg-opts.sh, lib/help.sh, lib/msg.sh, lib/processor.sh, lib/sig.sh, test/data/Makefile.am, test/data/bug-args.cmd, test/data/bug-args.right, test/data/bugIFS.cmd, test/data/bugIFS.right, test/data/lopts.right, test/data/quit.cmd, test/data/setshow.cmd, test/data/setshow.right, test/data/sopts.right, test/example/dbg-test2.sh, test/integration/Makefile.am, test/integration/setshow.tests, test/integration/test-setshow: Add more set/show things and an integration test for these. 2008-08-20 R. Bernstein * lib/Makefile.am: Add file to make "make install work" 2008-08-20 R. Bernstein * command/Makefile.am, command/alias.sh, command/edit.sh, command/frame.sh, command/help.sh, command/set.sh, command/show.sh, command/source.sh, lib/help.sh, lib/processor.sh: Add set and show commands. Check parameter counts on more functions. 2008-08-19 R. Bernstein * command/alias.sh, command/help.sh, lib/alias.sh, lib/help.sh, test/.gitignore, test/data/lopts.right, test/data/quit.cmd, test/data/sopts.right, test/example/dbg-test1.sh, test/integration/Makefile.am, test/integration/check-common.sh.in, test/integration/lopts.tests, test/integration/sopts.tests, test/integration/test-opts: Add option integration test. Remove some zshisms 2008-08-19 R. Bernstein * test/unit/test-alias.sh.in, test/unit/test-save-restore.sh.in, testing.sh: More stringent alias and save/restore unit tests. testing.sh has an example of something which changes when shwordsplit is used. 2008-08-18 R. Bernstein * command/continue.sh, command/edit.sh, command/frame.sh, command/help.sh, command/run.sh, lib/fns.sh, lib/frame.sh, lib/gdb.sh, lib/processor.sh, lib/run.sh, lib/save-restore.sh: _Dbg_adjust_frame -> _Dbg_frame_adjust aliases for more commands. Add some linespec routines _Dbg_frame_line -> _Dbg_frame_lineno. 2008-08-18 R. Bernstein * command/edit.sh: Add edit command which pulls in some linespec stuff and adds _Dbg_frame_file and _Dbg_frame_line. Regularize names a little adjust_frame -> frame_adjust. We now save and restore shwordsplit. Be better about checkin parameters. 2008-08-17 R. Bernstein * command/frame.sh, command/run.sh, command/stepping.sh, dbg-main.sh, dbg-pre.sh, lib/processor.sh: More bashdb/kshdb alignment. 2008-08-16 R. Bernstein * command/source.sh: local->typeset. 2008-08-16 R. Bernstein * configure.ac, test/integration/check-common.sh.in, test/unit/test-alias.sh.in, test/unit/test-fns.sh.in, test/unit/test-run.sh.in, zshdb.in: ZSH_PROG -> SH_PROG 2008-08-15 R. Bernstein * command/alias.sh, command/continue.sh, command/eval.sh, command/frame.sh, command/help.sh, command/quit.sh, command/run.sh, command/source.sh, command/stepping.sh, command/tracefn.sh, command/where.sh, lib/help.sh, lib/processor.sh: More regularization of function names add_help -> help_add. Use aliases in more commands. 2008-08-14 R. Bernstein * command/alias.sh, command/help.sh, command/quit.sh, command/run.sh, command/stepping.sh, command/where.sh, lib/alias.sh, lib/processor.sh, test/unit/test-alias.sh.in: Regularize alias command names add_alias -> alias_add, remove_alias -> alias_remove, etc. 2008-08-14 R. Bernstein * acinclude.m4, command/eval.sh, configure.ac: More zsh and ksh compatible. 2008-08-13 R. Bernstein * command/help.sh, command/stepping.sh, lib/alias.sh, lib/processor.sh, lib/sig.sh, test/zsh/ok4zshdb.sh: Should work now from current zsh without any additional patching. Turn 's', 'n', and 'next' to command aliases of step. 2008-08-13 R. Bernstein * command/tracefn.sh: declare, local => typeset for ksh compatiblity. 2008-08-12 R. Bernstein * lib/.gitignore, lib/save-restore.sh: Break off save/restore routines 2008-08-12 R. Bernstein * command/continue.sh, command/help.sh, command/quit.sh, command/run.sh, command/source.sh, command/stepping.sh, command/tracefn.sh, command/where.sh, lib/processor.sh, test/integration/.gitignore: Tidy help text a little. 2008-08-12 R. Bernstein * command/where.sh, lib/frame.sh, lib/gdb.sh, lib/processor.sh, lib/sig.sh: Fix some stack-handling bugs and clean up code a little. 2008-08-11 R. Bernstein * command/where.sh, lib/frame.sh: Slightly more bash and ksh compatible. 2008-08-11 R. Bernstein * command/where.sh, configure.ac, lib/.gitignore, lib/fns.sh, lib/frame.sh, lib/gdb.sh, lib/set-d-vars.sh, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-fns.sh.in, test/unit/test-save-restore.sh.in, testing.sh, zshdb.in: Force bash- and ksh-comptable indexing. Either way, we have to force a specific ordering since it can change arbitrarily in the debugged program. 2008-08-11 R. Bernstein * dbg-opts.sh, lib/Makefile.am, lib/fns.sh, lib/msg.sh, zshdb.in: Move message routines to its own file. 2008-08-10 R. Bernstein * command/frame.sh, command/quit.sh, command/run.sh, command/where.sh, configure.ac, lib/alias.sh, lib/frame.sh, lib/processor.sh, lib/run.sh, test/unit/Makefile.am: Add help for quit command and put it in the list of commands. local->typeset to be more compatible with kshdb. 2008-08-10 R. Bernstein * command/alias.sh, command/frame.sh, command/run.sh, command/stepping.sh, command/where.sh, dbg-main.sh, lib/Makefile.am, lib/alias.sh, lib/fns.sh, lib/frame.sh, lib/gdb.sh, lib/help.sh, lib/processor.sh, lib/sig.sh, lib/stack.sh: add_help->_Dbg_add_help and a number of other small typos and cleanups. 2008-08-09 R. Bernstein * configure.ac: I'm too clever for my own good. Use $srcdir for $srcdir, not $ac_srcdir. 2008-08-09 R. Bernstein * README, configure.ac, test/Makefile.am, test/zsh/.gitignore, test/zsh/Makefile.am, test/zsh/README, test/zsh/ok4zshdb.sh, test/zsh/ok4zshdb1.sh, test/zsh/ok4zshdb2.sh, test/zsh/trap-bug1.sh: Test for a zshdb-compatible zsh. 2008-08-09 R. Bernstein * Makefile.am, command/Makefile.am, configure.ac, lib/Makefile.am, test/Makefile.am, test/data/.gitignore, test/data/Makefile.am, test/example/.gitignore, test/example/Makefile.am, test/integration/Makefile.am, test/integration/check-common.sh.in, test/integration/test-bug-args, test/integration/test-bugIFS, test/unit/test-alias.sh.in, test/unit/test-fns.sh.in, test/unit/test-run.sh.in: "make distcheck" now works. 2008-08-09 R. Bernstein * Makefile.am, README, autogen.sh, command/stepping.sh, dbg-opts.sh, lib/processor.sh, zshdb.in: Disable skip command. get configured libdir set properly on zshdb start-up. 2008-08-09 R. Bernstein * THANKS: Prepration for initial zsh-workers announcement. 2008-08-09 R. Bernstein * .gitignore: The bane of version control 2008-08-09 R. Bernstein * zshdb: zshdb is derived from zshdb.in 2008-08-09 R. Bernstein * test/integration/test-bug-args: Add 2nd integration test. Argument evaluation. 2008-08-09 R. Bernstein * Makefile.am, configure.ac, test/data/bug-args.cmd, test/data/bug-args.right, test/example/bug-args.sh, test/integration/Makefile.am, test/integration/test-bugIFS: Add 2nd integration test. Argument evaluation. 2008-08-08 R. Bernstein * ChangeLog: . 2008-08-08 R. Bernstein * command/eval.sh: We're not bash here. 2008-08-08 R. Bernstein * .gitignore: The usual 2008-08-08 R. Bernstein * autogen.sh: Remove tracing shmutz. 2008-08-08 R. Bernstein * AUTHORS, ChangeLog, NEWS, README, autogen.sh: Fill in some automess stuff. First github commit! 2008-08-08 R. Bernstein * test/integration/test-bugIFS: Add the integration test 2008-08-08 R. Bernstein * configure.ac, test/data/bugIFS.right, test/integration/check-common.sh.in, test/unit/test-fns.sh.in, zshdb: My first integration test passes! 2008-08-08 R. Bernstein * dbg-pre.sh, test/integration/check-common.sh.in, zshdb, zshdb.in: Closer to working integration test. Command parsing is still a problem. 2008-08-08 R. Bernstein * command/eval.sh, command/where.sh, configure.ac, dbg-main.sh, dbg-opts.sh, lib/fns.sh, lib/sig.sh, test/Makefile.am, test/data/.gitignore, test/data/bugIFS.cmd, test/data/bugIFS.right, test/example/bugIFS.sh, test/example/dbg-test1.sh, test/integration/.gitignore, test/integration/Makefile.am, test/integration/check-common.sh.in, zshdb, zshdb.in: Closer to getting integration tests working. In the process some bugs discovered: count handling in the "where" command. Saving/restoring IFS on debugger entry. Give a better error message if dbg-main.sh is not found. 2008-08-07 R. Bernstein * dbg-opts.sh, lib/gdb.sh: Add basename option 2008-08-07 R. Bernstein * dbg-main.sh, dbg-opts.sh, dbg-pre.sh: Add --nx option. Reorg dbg-pre.sh to hopefully be more logical. 2008-08-07 R. Bernstein * dbg-main.sh, dbg-opts.sh, dbg-pre.sh, init.inc, zshdb, zshdb.in: Remove init.inc by merging with dbg-pre.sh. Add quiet option and show version. 2008-08-07 R. Bernstein * Makefile.am, command/Makefile.am, command/alias.cmd, command/alias.sh, command/continue.cmd, command/continue.sh, command/eval.cmd, command/eval.sh, command/frame.cmd, command/frame.sh, command/help.cmd, command/help.sh, command/quit.cmd, command/quit.sh, command/run.cmd, command/run.sh, command/source.sh, command/stepping.cmd, command/stepping.sh, command/tracefn.cmd, command/tracefn.sh, command/where.cmd, command/where.sh, dbg-main.sh, dbg-opts.sh, dbg-pre.inc, dbg-pre.sh, lib/Makefile.am, lib/alias.inc, lib/alias.sh, lib/file.sh, lib/fns.inc, lib/fns.sh, lib/gdb.inc, lib/gdb.sh, lib/help.inc, lib/help.sh, lib/journal.inc, lib/journal.sh, lib/processor.inc, lib/processor.sh, lib/run.inc, lib/run.sh, lib/set-d-vars.inc, lib/set-d-vars.sh, lib/sig.inc, lib/sig.sh, lib/stack.inc, lib/stack.sh, main.inc, opts.inc, test/unit/.gitignore, test/unit/test-alias.sh.in, test/unit/test-fns.sh.in, test/unit/test-run.sh.in, zshdb, zshdb.in: Work usage help and add -x --command option. remove .cmd and .inc prefixes in favor of the more normal .sh 2008-08-06 R. Bernstein * command/alias.cmd, command/continue.cmd, command/eval.cmd, command/frame.cmd, command/quit.cmd, command/run.cmd, command/stepping.cmd, command/where.cmd, configure.ac, lib/alias.inc, lib/processor.inc, lib/run.inc, test/unit/.gitignore, test/unit/Makefile.am, test/unit/test-alias.sh.in, test/unit/test-fns.sh.in, zshdb, zshdb.in: Get "source" command running! add_alias -> _Dbg_add_alias; same with remove_alias. More _Dbg_not_running tests. A number of other cleanups too. 2008-08-06 R. Bernstein * command/Makefile.am: add Makefile.am 2008-08-06 R. Bernstein * lib/sig.inc, test/unit/test-alias.sh, test/unit/test-fns.sh: remove derived files 2008-08-06 R. Bernstein * lib/sig.inc: Remove derived files 2008-08-06 R. Bernstein * command/Makefile.am, command/continue.cmd, command/down.cmd, command/eval.cmd, command/frame.cmd, command/help.cmd, command/print.cmd, command/skip.cmd, command/step.cmd, command/stepping.cmd, command/trace.cmd, command/tracefn.cmd, command/untrace.cmd, command/up.cmd, configure.ac, emacs/zshdb.el, lib/help.inc, lib/run.inc, main.inc, test/unit/test-alias.sh, test/unit/test-alias.sh.in, test/unit/test-fns.sh, test/unit/test-fns.sh.in, zshdb, zshdb.in: Figure out list of commands from help message. This means we can now combine small related commands. Add substitutions via autoconf. 2008-08-05 R. Bernstein * .gitignore, command/.gitignore, command/Makefile.am, emacs/.gitignore, lib/.gitignore, lib/Makefile.am, test/.gitignore, test/unit/.gitignore: More housekeeping. 2008-08-05 R. Bernstein * opts.inc: Housekeeping. 2008-08-05 R. Bernstein * Makefile.am, command/print.cmd, configure.ac, dbg-pre.inc, lib/fns.inc, lib/set-d-vars.inc, pre.inc, zshdb: print.cmd, fns.inc, lib/set-d-vars.inc: fix problem in quoting zshdb, dbg-pre.inc: handle -L --libdir option. configure, Makefile.am: more automess. 2008-08-05 R. Bernstein * .gitignore, Makefile.am, configure.ac, emacs/.gitignore, emacs/Makefile.am, emacs/zshdb-test.el.in, test/unit/.gitignore: More automess. 2008-08-05 R. Bernstein * Makefile.am, configure.ac, test/.gitignore, test/Makefile.am, test/unit/.gitignore, test/unit/Makefile.am, zshdb, zshtrace.sh: Start automess. 2008-08-05 R. Bernstein * .gitignore: Start automess. 2008-08-05 R. Bernstein * command/skip.cmd, command/step.cmd, lib/fns.inc, lib/processor.inc, lib/sig.inc, pre.inc: Add skip command. zsh patching does not seem to have worked though. 2008-08-04 R. Bernstein * .gitignore, command/.gitignore, command/eval.cmd, command/print.cmd, init.inc, lib/.gitignore, lib/help.inc, lib/set-d-vars.inc, lib/sig.inc, pre.inc, zshtrace.sh: Get $? working. 2008-08-04 R. Bernstein * command/eval.cmd, command/print.cmd, command/run.cmd, command/trace.cmd, command/untrace.cmd, lib/processor.inc, lib/run.inc, main.inc, zshtrace.sh: print/eval.cmd: restore IFS and PS4 Add trace/untrace commands. Yay! Make run/restart work. 2008-08-04 R. Bernstein * command/down.cmd, command/frame.cmd, command/up.cmd, lib/stack.inc, zshtrace.sh: Fix for 0 origin stack display 2008-08-04 R. Bernstein * init.inc, lib/fns.inc, test/unit/shunit2, test/unit/test-alias.sh, test/unit/test-fns.sh, zshtrace.sh: Loop debugger 2008-08-03 R. Bernstein * lib/set-d-vars.inc: We do have _Dbg_set_dol_q 2008-08-03 R. Bernstein * command/continue.cmd, command/help.cmd, command/step.cmd, init.inc, lib/alias.inc, lib/journal.inc, lib/processor.inc, lib/set-d-vars.inc, lib/sig.inc: Not sure. 2008-08-03 R. Bernstein * lib/processor.inc: Add stepping. 2008-08-03 R. Bernstein * command/continue.cmd: Continue command. 2008-08-03 R. Bernstein * command/step.cmd, lib/journal.inc: Add stepping. 2008-08-02 R. Bernstein * testing.sh, zshtrace.sh: Small bug in script parameter handling. 2008-08-02 R. Bernstein * command/alias.cmd, command/down.cmd, command/eval.cmd, command/frame.cmd, command/help.cmd, command/print.cmd, command/run.cmd, command/up.cmd, command/where.cmd, init.inc, lib/alias.inc, lib/fns.inc, lib/gdb.inc, lib/processor.inc, lib/set-d-vars.inc, lib/sig.inc, lib/stack.inc, main.inc, test/unit/test-fns.sh, zshtrace.sh: Some work on getting argument passing right 2008-08-02 R. Bernstein * command/run.cmd: Add run command. Start on getting zshtrace.sh to pass a real command name. 2008-08-02 R. Bernstein * dbg-fns.inc, dbg-gdb.inc, dbg-init.inc, dbg-main.inc, dbg-processor.inc, dbg-set-d-vars.inc, dbg-sig.inc, dbg-stack.inc, init.inc, lib/alias.inc, lib/fns.inc, lib/gdb.inc, lib/processor.inc, lib/set-d-vars.inc, lib/sig.inc, lib/stack.inc, main.inc, test/unit/test-alias.sh: Create lib directory and move files there. Add help. 2008-08-01 R. Bernstein * command/alias.cmd, command/backtrace.cmd, command/help.cmd, command/print.cmd, command/quit.cmd, command/up.cmd, command/where.cmd, dbg-processor.inc, dbg-set-d-vars.inc, dbg-sig.inc, emacs/elk-test.el, emacs/zshdb-test.el.in, emacs/zshdb.el, testing.sh, zshtrace.sh: Attempt full substitution in print and eval. Add alias command. Add alias for "bt". Add emacs. 2008-07-30 R. Bernstein * command/eval.cmd, command/print.cmd, dbg-set-d-vars.inc, dbg-sig.inc, testing.sh, zshtrace.sh: Set to run DEBUG trap before command, not after. 2008-07-29 R. Bernstein * command/eval.cmd, command/print.cmd, dbg-fns.inc, dbg-init.inc, dbg-processor.inc, dbg-set-d-vars.inc, dbg-sig.inc, testing.sh: First stab at print and eval commands. Causes weird execution stepping when used though. 2008-07-28 R. Bernstein * command/backtrace.cmd, command/down.cmd, command/frame.cmd, command/up.cmd, dbg-fns.inc, dbg-init.inc, dbg-main.inc, dbg-processor.inc, dbg-stack.inc, zshtrace.sh: Add some frame motion commands. 2008-07-27 R. Bernstein * command/backtrace.cmd, dbg-fns.inc, dbg-init.inc, dbg-processor.inc, dbg-sig.inc, dbg-stack.inc, zshtrace.sh: Add where command. Fill in more of the files from bashdb. 2008-07-26 R. Bernstein * command/quit.cmd, dbg-fns.inc, dbg-gdb.inc, dbg-processor.inc, dbg-stack.inc, test/unit/shunit2, test/unit/test-fns.sh, zshtrace.sh: Close to a more working debugger skeleton. 2008-07-26 R. Bernstein * Start zsh debugger zshdb-0.05+git20101031/Makefile.am000066400000000000000000000024631146334126000162000ustar00rootroot00000000000000# Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. AUTOMAKE_OPTIONS = dist-bzip2 SUBDIRS = command doc lib test pkgdata_DATA = \ dbg-pre.sh \ dbg-main.sh \ dbg-opts.sh \ dbg-trace.sh \ getopts_long.sh # Set up the install target bin_SCRIPTS = zshdb EXTRA_DIST = $(pkgdata_DATA) THANKS # cvs2cl MAINTAINERCLEANFILES = ChangeLog test: check # Unit testing check-unit: test-unit test-unit: cd test/unit && make check phony = check test-unit check-unit if MAINTAINER_MODE CL = ChangeLog ChangeLog: git log --pretty --numstat --summary | $(GIT2CL) > $@ ACLOCAL_AMFLAGS=-I . endif .PHONY: $(CL) test zshdb-0.05+git20101031/NEWS000066400000000000000000000017541146334126000146450ustar00rootroot00000000000000Version 0.05 2010-10-27 - Add debugger "action" command - Add debugger set/show autolist - Fix bugs when file contained spaces in a directory portion of the path - "Set force" depricated. Use "set different". - Code reorganization to support subcommands (set/show/info) and allow for growth - Other bug fixes Version 0.04 2009-10-27 Halala ngosuku lokuzalwa - Better tolerance for files with embedded blanks. Make sure to quote parameters in argument passing. - Add "set force", "step+", and "step-", "next+", and "next-" commands. - Preface more variable names with _Dbg_. - Remove Emacs compile warnings Version 0.03 2009-07-04 - add debugger "kill" command - add debugger "condition" command - add set-inferior tty and tty testing code changes - add manual page; help doc improvements - more and better unit/integration tests - works on Solaris Version 0.02 2008-11-17 - Fix bugs: in breakpoints, "info args", "show version" and --version Version 0.01 2008-10-27 First public release zshdb-0.05+git20101031/README000066400000000000000000000055401146334126000150230ustar00rootroot000000000000000. INTRODUCTION This is a port and cleanup of my bash debugger bashdb (http://bashdb.sf.net). The command syntax generally follows that of the GNU debugger gdb. However this debugger depends on a number bug fixes and of debugging support features that are neither part of the POSIX 1003.1 standard and are not in current "stable" zsh releases. In particular, the "functrace" function should always report filenames and absolute line numbers. Also both "functrace" and "funcstack" should include source'd files in their arrays. 1. SETUP To get the code, install git and run in a zsh shell: git-clone git://github.com/rocky/zshdb.git cd zshdb ./autogen.sh # Add configure options. See ./configure --help If you've got a suitable zsh installed, then make && make test To try on a real program such as perhaps /etc/zsh/zshrc: ./zshdb /etc/zsh/zshrc # substitute .../zshrc with your favorite zsh script To modify source code to call the debugger inside the program: source path-to-zshdb/zshdb/dbg-trace.sh # work, work, work. _Dbg_debugger # start debugging here Above, the directory _path-to_zshdb_ should be replaced with the directory that dbg-trace.sh is located in. This can also be from the source code directory zshdb or from the directory dbg-trac.sh gets installed directory. The "souce" command needs to be done only once somewhere in the code prior to using _Dbg_debugger. If you are happy and "make test" above worked, install via: sudo make install and uninstall with sudo make uninstall # ;-) See INSTALL for generic configure installation instructions. 2. WHAT'S HERE, WHAT'S NOT and WHY NOT What's missing falls into a two categories: * Stuff that can be ported in a straightforward way from bashdb * Stuff that needs additional zsh support Of the things which can be ported in a straight-forward way, however some of them I want to revise and simplify. In some cases, the fact that zsh has associative arrays simplifies code. On other cases, the code I wrote needs refactoring and better modularization. Writing documentation is important, but an extensive guide will have to wait. For now one can consult the reference guide that comes with bashdb: http://bashdb.sf.net/bashdb.html There is some minimal help to get a list of commands and some help for each. 3. WHAT'S NOT HERE YET IN DETAIL 3.a) Showing frame arguments This can done with or without support from zsh, albeit faster with help from zsh. Changing scope when changing frames however has to be done with zsh support. 3.b) Setting $0 3.c) other stuff including... signal handling, debugger commands: debug file handle history pwd signal tty watch None of this is rocket science. Should be pretty straight-forward to add. 4. WHAT MAY NEED MORE WORK AND SUPPORT FROM ZSH 4.a) stopping points that can be used for breakpoint zshdb-0.05+git20101031/THANKS000066400000000000000000000003601146334126000150510ustar00rootroot00000000000000Thanks to Peter Stephenson for the adding necessary support to zsh needed to get this off the ground and make debugging possible. Thanks to Kate Ward, Stéphane Chazelas and Nikolaj Schumacher for programs used in conjunction with zshdb. zshdb-0.05+git20101031/acinclude.m4000066400000000000000000000004221146334126000163260ustar00rootroot00000000000000AC_DEFUN([AC_SUBST_DIR], [ ifelse($2,,,$1="$2") $1=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$1"\" )` AC_SUBST($1) ]) zshdb-0.05+git20101031/autogen.sh000077500000000000000000000002241146334126000161360ustar00rootroot00000000000000#!/bin/zsh autoreconf -i && \ autoconf && { echo "Running configure with --enable-maintainer-mode $@" ./configure --enable-maintainer-mode $@ } zshdb-0.05+git20101031/command/000077500000000000000000000000001146334126000155555ustar00rootroot00000000000000zshdb-0.05+git20101031/command/.gitignore000066400000000000000000000000311146334126000175370ustar00rootroot00000000000000/*~ Makefile Makefile.in zshdb-0.05+git20101031/command/Makefile.am000066400000000000000000000010561146334126000176130ustar00rootroot00000000000000SUBDIRS = info_sub set_sub show_sub pkgdatadir = ${datadir}/@PACKAGE@/command pkgdata_DATA = \ action.sh \ alias.sh \ break.sh \ condition.sh \ continue.sh \ delete.sh \ disable.sh \ down.sh \ edit.sh \ enable.sh \ eval.sh \ examine.sh \ frame.sh \ help.sh \ info.sh \ list.sh \ quit.sh \ return.sh \ run.sh \ set.sh \ show.sh \ source.sh \ stepping.sh \ up.sh \ tracefn.sh \ where.sh EXTRA_DIST = $(pkgdata_DATA) zshdb-0.05+git20101031/command/action.sh000066400000000000000000000111121146334126000173620ustar00rootroot00000000000000# -*- shell-script -*- # action.sh - Perldb action debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add action \ 'action LINESPEC COMMAND -- run COMMAND when LINESPEC is hit Use "A" to remove all actions and "L" to get a list of the actions in effect.' # Add action at given line number of the current file. $1 is the # line number or _Dbg_frame_last_lineno if omitted. $2 is a # condition to test for whether to stop. _Dbg_do_action() { if (( $# == 0 )) ; then _Dbg_list_action return 0 fi if (( $# == 1 )) ; then typeset n=$_Dbg_frame_last_lineno else typeset n=$1 shift fi typeset stmt="$*" typeset filename typeset -i line_number typeset full_filename _Dbg_linespec_setup $n if [[ -n $full_filename ]] ; then if (( $line_number == 0 )) ; then _Dbg_msg "There is no line 0 to set action at." else _Dbg_check_line $line_number "$full_filename" (( $? == 0 )) && \ _Dbg_set_action "$full_filename" "$line_number" "$stmt" fi else _Dbg_file_not_read_in $filename fi return 0 } _Dbg_alias_add 'a' 'action' # delete action at given file:line number. If no file is given use the # current file. 0 is returned on success, nonzero on error. _Dbg_do_clear_action() { (( $# > 1 )) && return 1 typeset -r n=${1:-$_Dbg_frame_last_lineno} typeset filename typeset -i line_number typeset full_filename _Dbg_linespec_setup $n if [[ -n $full_filename ]] ; then if (( $line_number == 0 )) ; then _Dbg_msg "There is no line 0 to clear action at." else _Dbg_check_line $line_number "$full_filename" (( $? == 0 )) && \ _Dbg_unset_action "$full_filename" "$line_number" if [[ $? == 0 ]] ; then _Dbg_msg "Removed action." return 0 else _Dbg_errmsg "Didn't find any actions to remove at $n." fi fi else _Dbg_file_not_read_in $filename fi return 1 } # Routine to a delete actions by entry numbers. _Dbg_do_action_delete() { typeset -r to_go=$@ typeset -i i typeset -i found=0 for del in $to_go ; do case $del in [0-9]* ) _Dbg_delete_action_entry $del ((found += $?)) ;; * ) _Dbg_msg "Invalid entry number skipped: $del" esac done [[ $found != 0 ]] && _Dbg_msg "Removed $found action(s)." return $found } # delete action at given file:line number. If no file is given # use the current file. 0 is returned on success, nonzero on error. _Dbg_do_clear_action() { (( $# > 1 )) && return 1 typeset -r n=${1:-$_Dbg_frame_last_lineno} typeset filename typeset -i line_number typeset full_filename _Dbg_linespec_setup $n if [[ -n $full_filename ]] ; then if (( $line_number == 0 )) ; then _Dbg_msg "There is no line 0 to clear action at." else _Dbg_check_line $line_number "$full_filename" (( $? == 0 )) && \ _Dbg_unset_action "$full_filename" "$line_number" if [[ $? == 0 ]] ; then _Dbg_msg "Removed action." return 0 else _Dbg_errmsg "Didn't find any actions to remove at $n." fi fi else _Dbg_file_not_read_in $filename fi return 1 } # clear all actions _Dbg_do_clear_all_actions() { (( $# != 0 )) && return 1 if ((_Dbg_action_count == 0)); then _Dbg_errmsg "No actions to delete." return 1 fi typeset -l _Dbg_response _Dbg_confirm "Delete all actions? (y/N): " 'N' if [[ $_Dbg_response != 'y' ]] ; then _Dbg_msg "Delete not done - not confirmed." return 1 fi _Dbg_write_journal_eval "_Dbg_action_count=0" _Dbg_write_journal_eval "_Dbg_action_enable=()" _Dbg_write_journal_eval "_Dbg_action_line=()" _Dbg_write_journal_eval "_Dbg_action_file=()" _Dbg_write_journal_eval "_Dbg_action_stmt=()" _Dbg_write_journal_eval "_Dbg_action_file2action=()" _Dbg_write_journal_eval "_Dbg_action_file2linenos=()" return 0 } zshdb-0.05+git20101031/command/alias.sh000066400000000000000000000026271146334126000172110ustar00rootroot00000000000000# -*- shell-script -*- # alias.sh - gdb-like "alias" debugger command # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add alias \ 'alias NAME DEBUGGER-COMMAND -- Make NAME be an alias for DEBUGGER-COMMAND. Use "unalias" to remove an alias and "show aliases" to get a list the aliases in effect.' _Dbg_do_alias() { if (($# != 2)) ; then _Dbg_errmsg "Got $# parameter(s), but need 2." return 1 fi _Dbg_alias_add $1 $2 return 0 } _Dbg_help_add unalias \ 'unalias NAME -- Remove debugger command alias NAME. Use "show aliases" to get a list the aliases in effect.' _Dbg_do_unalias() { if (($# != 1)) ; then _Dbg_errmsg "Got $# parameters, but need 1." fi _Dbg_alias_remove $1 } zshdb-0.05+git20101031/command/break.sh000066400000000000000000000062231146334126000172000ustar00rootroot00000000000000# -*- shell-script -*- # Copyright (C) 2008, 2009 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add break \ 'break [LOCSPEC] -- Set a breakpoint at LOCSPEC. If no location specification is given, use the current line. Multiple breakpoints at one place are permitted, and useful if conditional. See also "tbreak" and "continue".' _Dbg_help_add tbreak \ 'tbreak [LOCSPEC] -- Set a one-time breakpoint at LOCSPEC. Like "break" except the breakpoint is only temporary, so it will be deleted when hit. Equivalent to "break" followed by using "delete" on the breakpoint number. If no location specification is given, use the current line.' # Add breakpoint(s) at given line number of the current file. $1 is # the line number or _curline if omitted. $2 is a condition to test # for whether to stop. _Dbg_do_break() { typeset -i is_temp=$1 (( $# > 0 )) && shift typeset linespec if (( $# > 0 )) ; then linespec="$1" else _Dbg_frame_lineno; linespec=$_Dbg_frame_lineno fi (( $# > 0 )) && shift typeset condition=${1:-''} if [[ "$linespec" == 'if' ]]; then _Dbg_frame_lineno; linespec=$_Dbg_frame_lineno elif [[ -z $condition ]] ; then condition=1 elif [[ $condition == 'if' ]] ; then shift condition="$*" fi [[ -z $condition ]] && condition=1 typeset filename typeset -i line_number typeset full_filename _Dbg_linespec_setup "$linespec" if [[ -n "$full_filename" ]] ; then if (( line_number == 0 )) ; then _Dbg_errmsg 'There is no line 0 to break at.' else _Dbg_check_line $line_number "$full_filename" (( $? == 0 )) && \ _Dbg_set_brkpt "$full_filename" "$line_number" $is_temp "$condition" fi else _Dbg_file_not_read_in "$filename" fi } # delete brkpt(s) at given file:line numbers. If no file is given # use the current file. _Dbg_do_clear_brkpt() { typeset -r n=${1:-$_curline} typeset filename typeset -i line_number typeset full_filename _Dbg_linespec_setup $n if [[ -n $full_filename ]] ; then if (( $line_number == 0 )) ; then _Dbg_msg "There is no line 0 to clear." else _Dbg_check_line $line_number "$full_filename" if (( $? == 0 )) ; then _Dbg_unset_brkpt "$full_filename" "$line_number" typeset -r found=$? if [[ $found != 0 ]] ; then _Dbg_msg "Removed $found breakpoint(s)." else _Dbg_msg "Didn't find any breakpoints to remove at $n." fi fi fi else _Dbg_file_not_read_in "$filename" fi } _Dbg_alias_add b break zshdb-0.05+git20101031/command/condition.sh000066400000000000000000000033771146334126000201110ustar00rootroot00000000000000# -*- shell-script -*- # condition.sh - gdb-like "condition" debugger command # # Copyright (C) 2009 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add condition \ "condition N COND -- Break only if COND is true in breakpoint number N. N is an integer and COND is an expression to be evaluated whenever breakpoint N is reached." # Set a condition for a given breakpoint $1 is a breakpoint number # $2 is a condition. If not given, set "unconditional" or 1. # returns 0 if success or 1 if fail. function _Dbg_do_condition { if (( $# < 1 )) ; then _Dbg_errmsg 'condition: Argument required (breakpoint number).' return 1 fi typeset -r n=$1 shift typeset condition="$@" if [[ $n != [0-9]* ]]; then _Dbg_errmsg "condition: Bad breakpoint number: $n" return 1 fi if [[ -z ${_Dbg_brkpt_file[$n]} ]] ; then _Dbg_errmsg "condition: Breakpoint entry $n is not set. Condition not changed." return 1 fi if [[ -z $condition ]] ; then condition=1 _Dbg_msg "Breakpoint $n now unconditional." fi _Dbg_brkpt_cond[$n]="$condition" return 0 } zshdb-0.05+git20101031/command/continue.sh000066400000000000000000000035261146334126000177430ustar00rootroot00000000000000# -*- shell-script -*- # continue.sh - gdb-like "continue" debugger command # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add continue \ 'continue [LOC | - ] -- Continue script execution. If not LOC or - is given, continue until the next breakpoint or the end of program is reached. If - is given, then debugging will be turned off after continuing causing your program to run at full speed. If LOC is given, a temporary breakpoint is set at the location.' function _Dbg_do_continue { _Dbg_not_running && return 1 (( $# == 0 )) && return 0 typeset filename typeset -i line_number typeset full_filename if [[ $1 == '-' ]] ; then _Dbg_restore_debug_trap=0 return 0 fi _Dbg_linespec_setup "$1" if [[ -n "$full_filename" ]] ; then if (( line_number == 0 )) ; then _Dbg_errmsg 'There is no line 0 to continue at.' else _Dbg_check_line $line_number "$full_filename" (( $? == 0 )) && \ _Dbg_set_brkpt "$full_filename" "$line_number" 1 1 return 0 fi else _Dbg_file_not_read_in "$filename" fi return 1 } _Dbg_alias_add 'c' 'continue' _Dbg_alias_add 'cont' 'continue' zshdb-0.05+git20101031/command/delete.sh000066400000000000000000000030051146334126000173510ustar00rootroot00000000000000# -*- shell-script -*- # delete.sh - gdb-like "delete" debugger command # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add delete \ "delete {BRKPT-NUM}... -- Delete the breakpoint entry or entries. With no BRKPT-NUM, delete all breakpoints." # Routine to a delete breakpoint/watchpoint by entry numbers. _Dbg_do_delete() { typeset to_go; to_go=$@ typeset -i i typeset -i tot_found=0 for del in $to_go ; do case $del in # $_watch_pat ) # _Dbg_delete_watch_entry ${del:0:${#del}-1} # ;; [0-9]* ) _Dbg_delete_brkpt_entry $del typeset -i found=$? (( found > 0 )) && ((tot_found+=found)) ;; * ) _Dbg_errmsg "Invalid entry number skipped: $del" esac done (( tot_found != 0 )) && _Dbg_msg "Removed $tot_found breakpoint(s)." return $tot_found } zshdb-0.05+git20101031/command/disable.sh000066400000000000000000000020051146334126000175110ustar00rootroot00000000000000# -*- shell-script -*- # disable.sh - gdb-like "disable" debugger command # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add disable \ 'disable {n}... -- Disable breakpoint entry/entries.' # Disable breakpoint(s)/watchpoint(s) by entry number(s). _Dbg_do_disable() { _Dbg_enable_disable 0 'disabled' $@ } zshdb-0.05+git20101031/command/display.sh000066400000000000000000000031431146334126000175570ustar00rootroot00000000000000# -*- shell-script -*- # display.sh - gdb-like "(un)display" and list display debugger commands # # Copyright (C) 2002, 2003, 2006, 2007, 2008, 2009, 2010 # Rocky Bernstein rocky@gnu.org # # This program 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. # # This program 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 this Program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place, Suite 330, Boston, # MA 02111 USA. _Dbg_help_add display \ "display [STMT] Evalute STMT each time the debugger is stopped. If STMT is omitted, evaluate all of the display statements that are active. In contrast, 'info display' shows the display statements without evaluating them. Examples: display echo \$x # show the current value of x each time debugger stops display # evaluate all display statements See also 'undisplay' and 'info display'." # Set display command or list all current display expressions _Dbg_do_display() { if (( 0 == $# )); then _Dbg_eval_all_display else local -i n=_Dbg_disp_max++ _Dbg_disp_exp[$n]="$@" _Dbg_disp_enable[$n]=1 _Dbg_printf '%2d: %s' $n "${_Dbg_disp_exp[$n]}" fi } zshdb-0.05+git20101031/command/down.sh000066400000000000000000000024151146334126000170620ustar00rootroot00000000000000# -*- shell-script -*- # down.sh - gdb-like "down" debugger command # # Copyright (C) 2010 Rocky Bernstein # rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. # Move default values down $1 or one in the stack. # Move default values up $1 or one in the stack. _Dbg_help_add down \ 'down [COUNT] Move the current frame down in the stack trace (to an newer frame). 0 is the most recent frame. If COUNT is omitted, use 1. COUNT can be any arithmetic expression. See also "up" and "frame".' function _Dbg_do_down { _Dbg_not_running && return 1 typeset -il count=${1:-1} _Dbg_frame_adjust $count -1 return 0 } zshdb-0.05+git20101031/command/edit.sh000066400000000000000000000033041146334126000170360ustar00rootroot00000000000000# -*- shell-script -*- # edit.sh - Debugger Edit routine # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. #================ VARIABLE INITIALIZATIONS ====================# _Dbg_help_add edit \ "edit [LOCATION] -- Edit specified file at LOCATION. If LOCATION is not given, use the current location. Uses EDITOR environment variable contents as editor (or ex as default). Assumes the editor positions at a file using options +linenumber filename." _Dbg_do_edit() { if (($# > 2)) ; then _Dbg_errmsg "got $# parameters, but need 0 or 1." return 2 fi typeset editor=${EDITOR:-ex} typeset -i line_number if (( $# == 0 )) ; then _Dbg_frame_lineno line_number=$? _Dbg_frame_file ((0 != $?)) && return 3 ((line_number<=0)) && return 4 full_filename="$_Dbg_frame_filename" else _Dbg_linespec_setup "$1" fi if [[ ! -r $full_filename ]] ; then _Dbg_errmsg "File $full_filename is not readable" fi $editor +$line_number $full_filename } _Dbg_alias_add 'ed' 'edit' zshdb-0.05+git20101031/command/enable.sh000066400000000000000000000017751146334126000173510ustar00rootroot00000000000000# -*- shell-script -*- # enable.sh - gdb-like "enable" debugger command # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add enable \ 'enable {N}... -- Enable breakpoint entry/entries.' # Enable breakpoint(s)/watchpoint(s) by entry number(s). _Dbg_do_enable() { _Dbg_enable_disable 1 'enabled' $@ } zshdb-0.05+git20101031/command/eval.sh000066400000000000000000000037331146334126000170460ustar00rootroot00000000000000# -*- shell-script -*- # Eval and Print commands. # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. # temp file for internal eval'd commands typeset _Dbg_evalfile=$(_Dbg_tempname eval) _Dbg_help_add eval \ 'eval CMD -- Run eval on CMD. CMD is a string sent to special shell builtin eval. See also print.' _Dbg_do_eval() { print ". ${_Dbg_libdir}/lib/set-d-vars.sh" > $_Dbg_evalfile print "$@" >> $_Dbg_evalfile print '_Dbg_rc=$?' >> $_Dbg_evalfile typeset -i _Dbg_rc if [[ -t $_Dbg_fdi ]] ; then _Dbg_set_dol_q $_Dbg_debugged_exit_code . $_Dbg_evalfile >&${_Dbg_fdi} else _Dbg_set_dol_q $_Dbg_debugged_exit_code . $_Dbg_evalfile fi # We've reset some variables like IFS and PS4 to make eval look # like they were before debugger entry - so reset them now. _Dbg_set_debugger_internal return $_Dbg_rc } _Dbg_alias_add 'e' 'eval' # The arguments in the last "print" command. typeset _Dbg_last_print_args='' _Dbg_help_add print \ 'print EXPRESSION -- Print EXPRESSION. EXPRESSION is a string like you would put in a print statement. See also eval.' _Dbg_do_print() { typeset _Dbg_expr=${@:-"$_Dbg_last_print_args"} typeset dq_expr dq_expr=$(_Dbg_esc_dq "$_Dbg_expr") _Dbg_do_eval _Dbg_msg "$_Dbg_expr" } _Dbg_alias_add 'p' 'print' zshdb-0.05+git20101031/command/examine.sh000066400000000000000000000035261146334126000175450ustar00rootroot00000000000000# -*- shell-script -*- # examine.sh: Examine debugger command. # # Copyright (C) 2008, 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add 'examine' \ "examine EXPR -- Print value of an expression via \'typeset', \`let' and failing these, eval. Single variables and arithmetic expressions do not need leading $ for their value is to be substituted. However if neither these, variables need $ to have their value substituted." function _Dbg_do_examine { typeset _Dbg_expr; _Dbg_expr=${@:-"$_Dbg_last_x_args"} typeset _Dbg_result if [[ -z $_Dbg_expr ]] then _Dbg_msg "$_Dbg_expr" elif _Dbg_defined $_Dbg_expr ; then _Dbg_result=$(typeset -p $_Dbg_expr) _Dbg_msg "$_Dbg_result" elif _Dbg_is_function "$_Dbg_expr" $_Dbg_set_debugging; then _Dbg_result=$(typeset -f $_Dbg_expr) _Dbg_msg "$_Dbg_result" else typeset -i _Dbg_rc . ${_Dbg_libdir}/lib/set-d-vars.sh eval let _Dbg_result=$_Dbg_expr 2>/dev/null; _Dbg_rc=$? _Dbg_set_debugger_internal if (( $_Dbg_rc != 0 )) ; then _Dbg_do_print "$_Dbg_expr" else _Dbg_msg "$_Dbg_result" fi fi _Dbg_last_x_args="$_Dbg_x_args" } _Dbg_alias_add 'x' 'examine' zshdb-0.05+git20101031/command/frame.sh000066400000000000000000000023261146334126000172060ustar00rootroot00000000000000# -*- shell-script -*- # frame.sh - gdb-like "frame" debugger commands # # Copyright (C) 2008, 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add frame \ 'frame [FRAME-NUMBER]. Change the current frame to frame FRAME-NUMBER if specified, or the most-recent frame, 0, if no frame number specified. A negative number indicates the position from the other or least-recently-entered end. So "frame -1" moves to the oldest frame. ' _Dbg_do_frame() { _Dbg_not_running && return 1 typeset -i pos=${1:-0} _Dbg_frame_adjust $pos 0 } zshdb-0.05+git20101031/command/help.sh000066400000000000000000000044071146334126000170460ustar00rootroot00000000000000# -*- shell-script -*- # help.sh - gdb-like "help" debugger command # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add help \ 'help -- Print list of commands.' typeset -i _Dbg_help_cols=8 _Dbg_do_help() { if ((0 == $#)) ; then _Dbg_msg 'Available commands:' typeset -a commands unsetopt ksharrays commands=(${(ki)_Dbg_command_help}) typeset -a list list=(${commands[@]}) setopt ksharrays _Dbg_list_columns _Dbg_msg '' _Dbg_msg 'Readline command line editing (emacs/vi mode) is available.' _Dbg_msg 'Type "help" followed by command name for full documentation.' return 0 else typeset dbg_cmd="$1" if [[ -n ${_Dbg_command_help[$dbg_cmd]} ]] ; then _Dbg_msg "${_Dbg_command_help[$dbg_cmd]}" else typeset expanded_alias; _Dbg_alias_expand $dbg_cmd dbg_cmd="$expanded_alias" if [[ -n ${_Dbg_command_help[$dbg_cmd]} ]] ; then _Dbg_msg "${_Dbg_command_help[$dbg_cmd]}" else case $dbg_cmd in i | in | inf | info ) _Dbg_info_help $2 ;; sh | sho | show ) _Dbg_help_show $2 ;; se | set ) _Dbg_help_set $2 ;; * ) _Dbg_errmsg "Undefined command: \"$dbg_cmd\". Try \"help\"." return 1 ;; esac fi fi aliases_found='' _Dbg_alias_find_aliased "$dbg_cmd" if [[ -n $aliases_found ]] ; then _Dbg_msg '' _Dbg_msg "Aliases for $dbg_cmd: $aliases_found" fi return 0 fi } _Dbg_alias_add '?' help _Dbg_alias_add 'h' help zshdb-0.05+git20101031/command/info.sh000066400000000000000000000063361146334126000170540ustar00rootroot00000000000000# -*- shell-script -*- # info.sh - gdb-like "info" debugger commands # # Copyright (C) 2008, 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. # Print info args. Like GDB's "info args" # $1 is an additional offset correction - this routine is called from two # different places and one routine has one more additional call on top. # This code assumes the's debugger version of # bash where FUNCNAME is an array, not a variable. _Dbg_help_add info '' typeset -a _Dbg_info_subcmds _Dbg_info_subcmds=( breakpoints files line program source stack variables ) # Load in "info" subcommands for _Dbg_file in ${_Dbg_libdir}/command/info_sub/*.sh ; do source $_Dbg_file done _Dbg_do_info() { if (($# > 0)) ; then typeset info_cmd=$1 shift case $info_cmd in # a | ar | arg | args ) # _Dbg_do_info_args 3 # return 0 # ;; b | br | bre | brea | 'break' | breakp | breakpo | breakpoints ) # b | br | bre | brea | 'break' | breakp | breakpo | breakpoints | \ # w | wa | wat | watc | 'watch' | watchp | watchpo | watchpoints ) _Dbg_do_info_brkpts $@ # _Dbg_list_watch $@ return 0 ;; d | di | dis| disp | displ | displa | display ) _Dbg_do_info_display $@ return ;; file| files ) _Dbg_do_info_files return $? ;; # h | ha | han | hand | handl | handle | \ # si | sig | sign | signa | signal | signals ) # _Dbg_info_signals # return # ;; l | li | lin | line ) _Dbg_do_info_line return $? ;; p | pr | pro | prog | progr | progra | program ) _Dbg_do_info_program return $? ;; so | sou | sourc | source ) _Dbg_do_info_source return $? ;; st | sta | stac | stack ) _Dbg_do_backtrace 1 $@ return $? ;; # te | ter | term | termi | termin | termina | terminal | tt | tty ) # _Dbg_msg "tty: $_Dbg_tty" # return; # ;; v | va | var | vari | varia | variab | variabl | variable | variables ) _Dbg_do_info_variables $@ return $? ;; w | wa | war | warr | warra | warran | warrant | warranty ) _Dbg_do_info_warranty return $? ;; *) _Dbg_errmsg "Unknown info subcommand: $info_cmd" msg=_Dbg_errmsg esac else msg=_Dbg_msg fi $msg "Info subcommands are:" typeset -a list; list=(${_Dbg_info_subcmds[@]}) _Dbg_list_columns ' ' $msg return 1 } _Dbg_alias_add 'i' info zshdb-0.05+git20101031/command/info_sub/000077500000000000000000000000001146334126000173615ustar00rootroot00000000000000zshdb-0.05+git20101031/command/info_sub/.gitignore000066400000000000000000000000331146334126000213450ustar00rootroot00000000000000/*~ /Makefile /Makefile.in zshdb-0.05+git20101031/command/info_sub/Makefile.am000066400000000000000000000002741146334126000214200ustar00rootroot00000000000000pkgdatadir = ${datadir}/@PACKAGE@/command/info_sub pkgdata_DATA = \ brkpts.sh \ files.sh \ program.sh \ variables.sh \ warranty.sh EXTRA_DIST = $(pkgdata_DATA) zshdb-0.05+git20101031/command/info_sub/brkpts.sh000066400000000000000000000046541146334126000212330ustar00rootroot00000000000000# -*- shell-script -*- # gdb-like "info program" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. # list breakpoints and break condition. # If $1 is given just list those associated for that line. _Dbg_do_info_brkpts() { if (( $# != 0 )) ; then typeset brkpt_num='' if [[ $brkpt_num != [0-9]* ]] ; then _Dbg_errmsg "Bad breakpoint number $brkpt_num." elif [[ -z ${_Dbg_brkpt_file[$brkpt_num]} ]] ; then _Dbg_errmsg "Breakpoint entry $brkpt_num is not set." else typeset -r -i i=$brkpt_num typeset source_file=${_Dbg_brkpt_file[$i]} source_file=$(_Dbg_adjust_filename "$source_file") _Dbg_msg "Num Type Disp Enb What" _Dbg_printf "%-3d breakpoint %-4s %-3s %s:%s" $i \ ${_Dbg_keep[${_Dbg_brkpt_onetime[$i]}]} \ ${_Dbg_yn[${_Dbg_brkpt_enable[$i]}]} \ "$source_file" ${_Dbg_brkpt_line[$i]} if [[ ${_Dbg_brkpt_cond[$i]} != '1' ]] ; then _Dbg_printf "\tstop only if %s" "${_Dbg_brkpt_cond[$i]}" fi _Dbg_print_brkpt_count $i return 0 fi return 1 fi if (( _Dbg_brkpt_count > 0 )); then typeset -i i _Dbg_msg "Num Type Disp Enb What" for (( i=1; i <= _Dbg_brkpt_max ; i++ )) ; do source_file="${_Dbg_brkpt_file[$i]}" if [[ -n ${_Dbg_brkpt_line[$i]} ]] ; then source_file=$(_Dbg_adjust_filename "$source_file") _Dbg_printf "%-3d breakpoint %-4s %-3s %s:%d" $i \ ${_Dbg_keep[${_Dbg_brkpt_onetime[$i]}]} \ ${_Dbg_yn[${_Dbg_brkpt_enable[$i]}]} \ "$source_file" ${_Dbg_brkpt_line[$i]} if [[ ${_Dbg_brkpt_cond[$i]} != '1' ]] ; then _Dbg_printf "\tstop only if %s" "${_Dbg_brkpt_cond[$i]}" fi _Dbg_print_brkpt_count $i fi done else _Dbg_errmsg 'No breakpoints have been set.' fi } zshdb-0.05+git20101031/command/info_sub/display.sh000066400000000000000000000024551146334126000213700ustar00rootroot00000000000000# -*- shell-script -*- # gdb-like "info display" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # This program 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. # # This program 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 this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place, Suite 330, Boston, # MA 02111 USA. # List display command(s) _Dbg_do_info_display() { if [ ${#_Dbg_disp_exp[@]} != 0 ]; then local i=0 j _Dbg_msg "Auto-display statements now in effect:" _Dbg_msg "Num Enb Expression " for (( i=0; i < _Dbg_disp_max; i++ )) ; do if [ -n "${_Dbg_disp_exp[$i]}" ] ;then _Dbg_printf '%-3d %3d %s' \ $i ${_Dbg_disp_enable[$i]} "${_Dbg_disp_exp[$i]}" fi done else _Dbg_msg "No display expressions have been set." fi return 0 } zshdb-0.05+git20101031/command/info_sub/files.sh000066400000000000000000000024641146334126000210250ustar00rootroot00000000000000# -*- shell-script -*- # gdb-like "info files" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_do_info_files() { _Dbg_msg "Source files which we have recorded info about:" unsetopt ksharrays for file in "${(ki)_Dbg_file2canonic}" ; do typeset -i lines=$(_Dbg_get_maxline "$file") typeset canonic_file canonic_file="${_Dbg_file2canonic[$file]}" if (( _Dbg_set_basename )) ; then # Do the same with canonic_file ? file="${file##*/}" canonic_file="${canonic_file##*/}" fi _Dbg_msg " ${file}: ${canonic_file}, $lines lines" done setopt ksharrays return 0 } zshdb-0.05+git20101031/command/info_sub/line.sh000066400000000000000000000020251146334126000206430ustar00rootroot00000000000000# -*- shell-script -*- # gdb-like "info line" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_do_info_line() { if (( ! _Dbg_running )) ; then _Dbg_errmsg 'No line number information available.' return 1 fi _Dbg_msg "Line $_Dbg_frame_last_lineno of \"$_Dbg_frame_last_filename\"" return 0 } zshdb-0.05+git20101031/command/info_sub/program.sh000066400000000000000000000022131146334126000213620ustar00rootroot00000000000000# -*- shell-script -*- # gdb-like "info program" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_do_info_program() { if (( _Dbg_running )) ; then _Dbg_msg 'Program stopped.' if [[ -n $_Dbg_stop_reason ]] ; then _Dbg_msg "It stopped ${_Dbg_stop_reason}." fi _Dbg_msg "Next statement to be run is:" _Dbg_print_command else _Dbg_errmsg 'The program being debugged is not being run.' return 1 fi return 0 } zshdb-0.05+git20101031/command/info_sub/source.sh000066400000000000000000000023011146334126000212110ustar00rootroot00000000000000# -*- shell-script -*- # gdb-like "info source" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_do_info_source() { if (( ! _Dbg_running )) ; then _Dbg_errmsg 'No program not running.' return 1 fi _Dbg_msg "Current script file is $_Dbg_frame_last_filename" _Dbg_msg "Located in ${_Dbg_file2canonic[$_Dbg_frame_last_filename]}" typeset -i max_line max_line=$(_Dbg_get_maxline $_Dbg_frame_last_filename) _Dbg_msg "Contains $max_line lines." return 0 } zshdb-0.05+git20101031/command/info_sub/variables.sh000066400000000000000000000041161146334126000216670ustar00rootroot00000000000000# -*- shell-script -*- # "info variables" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. typeset _Dbg_info_var_attrs="array, export, fixed, float, function, hash, integer, or readonly" _Dbg_do_info_variables() { if (($# > 0)) ; then typeset kind="$1" shift case "$kind" in a | ar | arr | arra | array ) _Dbg_do_list_typeset_attr '+a' $* return 0 ;; e | ex | exp | expor | export ) _Dbg_do_list_typeset_attr '+x' $* return 0 ;; fu|fun|func|funct|functi|functio|function ) _Dbg_do_list_typeset_attr '+f' $* return 0 ;; fi|fix|fixe|fixed ) _Dbg_do_list_typeset_attr '+F' $* return 0 ;; fl|flo|floa|float ) _Dbg_do_list_typeset_attr '+E' $* return 0 ;; # g | gl | glo | glob | globa | global ) # _Dbg_do_list_globals # return 0 # ;; h | ha | has | hash ) _Dbg_do_list_typeset_attr '+A' $* return 0 ;; i | in | int| inte | integ | intege | integer ) _Dbg_do_list_typeset_attr '+i' $* return 0 ;; # l | lo | loc | loca | local | locals ) # _Dbg_do_list_locals # return 0 # ;; r | re | rea| read | reado | readon | readonl | readonly ) _Dbg_do_list_typeset_attr '+r' $* return 0 ;; * ) _Dbg_errmsg "Don't know how to list variable type: $kind" esac fi _Dbg_errmsg "Need to specify a variable class which is one of: " _Dbg_errmsg "$_Dbg_info_var_attrs" return 1 } zshdb-0.05+git20101031/command/info_sub/warranty.sh000066400000000000000000000041201146334126000215610ustar00rootroot00000000000000# -*- shell-script -*- # gdb-like "info warranty" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_do_info_warranty() { _Dbg_msg " NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. " return 0 } zshdb-0.05+git20101031/command/kill.sh000066400000000000000000000034461146334126000170530ustar00rootroot00000000000000# -*- shell-script -*- # kill.sh - gdb-like "kill" debugger command # # Copyright (C) 2009 Rocky Bernstein rocky@gnu.org # # kshdb 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. # # kshdb 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 kshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add kill \ "kill [SIGNAL] -- Kill execution of program being debugged. If given, SIGNAL should be start with a '-', .e.g. -KILL or -9, and that signal is used in the kill command. On \*nix systems the command \"kill -l\" sometimes will give a list of signal names and numbers. The signal is sent to process \$\$ (which is $$ right now). Also similar is the \"signal\" command." function _Dbg_do_kill { if (($# > 1)); then _Dbg_errmsg "Got $# parameters, but need 0 or 1." return 1 fi typeset _Dbg_prompt_output=${_Dbg_tty:-/dev/null} typeset signal='-9' (($# == 1)) && signal="$1" if [[ ${signal[0]} != '-' ]] ; then _Dbg_errmsg "Kill signal ($signal} should start with a '-'" return 1 fi typeset -l _Dbg_response _Dbg_confirm "Send kill signal ${signal} which may terminate the debugger? (y/N): " 'N' if [[ $_Dbg_response = 'y' ]] ; then kill $signal $$ else _Dbg_msg "Kill not done - not confirmed." fi return 0 } zshdb-0.05+git20101031/command/list.sh000066400000000000000000000060161146334126000170670ustar00rootroot00000000000000# -*- shell-script -*- # list.sh - Some listing commands # # Copyright (C) 2008, 2009 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add list \ 'list [LOC|.|-] [COUNT] -- List COUNT lines of a script starting from LOC START is the starting location or dot (.) for current file and line. Subsequent list commands continue from the last line listed. Frame switching however resets the line to dot. If COUNT is omitted, use the setting LISTSIZE. Use "set listsize" to change this setting.' # l [start|.|-] [cnt] List cnt lines from line start. _Dbg_do_list() { typeset first_arg if (( $# == 0 )) ; then if ((_Dbg_listline < 0 )) ; then first_arg='.' else first_arg=$_Dbg_listline fi else first_arg="$1" shift fi typeset count=${1:-$_Dbg_set_listsize} if [[ $first_arg == '.' ]] ; then first_arg=$_Dbg_frame_last_lineno elif [[ $first_arg == '-' ]] ; then typeset -i start_line if ((_Dbg_listline < 0 )) ; then ((start_line=_Dbg_frame_last_lineno-_Dbg_set_listsize)) else ((start_line=_Dbg_listline-2*_Dbg_set_listsize)) fi if (( start_line <= 0 )) ; then ((count=count+start_line-1)) start_line=1 fi first_arg=$start_line fi typeset filename typeset -i line_number typeset full_filename _Dbg_linespec_setup $first_arg if [[ -n $full_filename ]] ; then (( $line_number == 0 )) && line_number=1 _Dbg_check_line $line_number "$full_filename" (( $? == 0 )) && \ _Dbg_list "$full_filename" "$line_number" $count return $? else _Dbg_file_not_read_in "$filename" return 1 fi } # _Dbg_do_list_globals() { # (($# != 0)) && return 1 # list=(${(k)parameters[(R)*^local*]}) # typeset -i rc=$? # (( $rc != 0 )) && return $rc # _Dbg_list_columns # return $? # } # _Dbg_do_list_locals() { # (($# != 0)) && return 1 # list=(${(k)parameters[(R)*local*]}) # typeset -i rc=$? # (( $rc != 0 )) && return $rc # _Dbg_list_columns # return $? # } # List in column form variables having attribute $1. # A grep pattern can be given in $2. ! indicates negation. _Dbg_do_list_typeset_attr() { (($# == 0)) && return 1 typeset attr="$1"; shift typeset -a list list=( $(_Dbg_get_typeset_attr "$attr" $*) ) typeset -i rc=$? (( $rc != 0 )) && return $rc _Dbg_list_columns return $? } _Dbg_alias_add l list zshdb-0.05+git20101031/command/quit.sh000066400000000000000000000046221146334126000170770ustar00rootroot00000000000000# -*- shell-script -*- # quit.sh - gdb-like "quit" debugger command # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add quit \ 'quit [EXIT-CODE [SHELL-LEVELS]] -- Quit the debugger. The program being debugged is aborted. If EXIT-CODE is given that will be the exit return code. If SHELL-LEVELS then up to that many nested shells are quit. However to be effective, the last of those shells should have been run under the debugger. See also "finish", "return" and "restart".' function _Dbg_do_quit { typeset -i return_code=${1:-$_Dbg_program_exit_code} typeset -i desired_quit_levels=${2:-0} if [[ $desired_quit_levels != [0-9]* ]] ; then _Dbg_errmsg "Argument ($desired_quit_levels) should be a number or nothing." return 0 fi if (( desired_quit_levels == 0 \ || desired_quit_levels > ZSH_SUBSHELL+1)) ; then ((desired_quit_levels=ZSH_SUBSHELL+1)) fi ((_Dbg_QUIT_LEVELS+=desired_quit_levels)) # Reduce the number of recorded levels that we need to leave by # if _Dbg_QUIT_LEVELS is greater than 0. ((_Dbg_QUIT_LEVELS--)) ## write this to the next level up can read it. _Dbg_write_journal "_Dbg_QUIT_LEVELS=$_Dbg_QUIT_LEVELS" _Dbg_write_journal "_Dbg_step_ignore=$_Dbg_step_ignore" # Reset signal handlers to their default but only if # we are not in a subshell. if (( ZSH_SUBSHELL == 0 )) ; then # If we were told to restart from deep down, restart instead of quit. if [ -n "$_Dbg_RESTART_COMMAND" ] ; then _Dbg_erase_journals _Dbg_save_state exec $_Dbg_RESTART_COMMAND fi _Dbg_cleanup fi # And just when you thought we'd never get around to it... exit $return_code } _Dbg_alias_add q quit _Dbg_alias_add exit quit zshdb-0.05+git20101031/command/return.sh000066400000000000000000000026371146334126000174400ustar00rootroot00000000000000# -*- shell-script -*- # return command. # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_help_add return \ 'return [RETURN-VALUE] -- Force an immediate return from a function. The remainder of function will not be executed. If RETURN-VALUE is given, it should be an integer and will be the return value passed back as $?. See also "finish", "quit", and "run." ' # Return value when a return is taken. typeset -i _Dbg_return_rc=0 _Dbg_do_return() { set -x rc=${1:-0} if [[ $_Dbg_return_rc == [0-9]* ]] ; then _Dbg_return_rc=$rc else _Dbg_errmsg "Argument ($rc) should be a number or nothing." _Dbg_skip_ignore=0 return 0 fi _Dbg_write_journal_eval "_Dbg_step_ignore=1" return 255 } zshdb-0.05+git20101031/command/run.sh000066400000000000000000000047361146334126000167270ustar00rootroot00000000000000# -*- shell-script -*- # run command. # # Copyright (C) 2008, 2009 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. # Restart script in same way with saved arguments (probably the same # ones as we were given before). _Dbg_help_add run \ 'run [args] -- Attempt to restart the program.' _Dbg_do_run() { typeset script_args typeset exec_cmd if (( $# == 0 )) ; then script_args=${_Dbg_script_args[@]} typeset SH_RUN_CMDLINE; _Dbg_run_cmdline if [[ -n $SH_RUN_CMDLINE ]] ; then exec_cmd="$SH_RUN_CMDLINE"; else exec_cmd="$_Dbg_script_file" [[ -n $script_args ]] && exec_cmd+=" $script_args" fi else exec_cmd="$_Dbg_script_file" script_args=$@ [[ -n $script_args ]] && exec_cmd+=" $script_args" fi if (( !_Dbg_script )); then # if [[ $_cur_source_file == $_Dbg_bogus_file ]] ; then # script_args="--debugger -c \"$SH_EXECUTION_STRING\"" # exec_cmd="$SH_RUN_CMDLINE --debugger -c \"$SH_EXECUTION_STRING\""; # else # exec_cmd="$SH_RUN_CMDLINE --debugger $_Dbg_orig_0 $script_args"; # fi : fi if (( _Dbg_set_basename )) ; then _Dbg_msg "Restarting with: $script_args" else _Dbg_msg "Restarting with: $exec_cmd" fi # If we are in a subshell we need to get out of those levels # first before we restart. The strategy is to write into persistent # storage the restart command, and issue a "quit." The quit should # discover the restart at the last minute and issue the restart. if (( ZSH_SUBSHELL > 0 )) ; then _Dbg_msg "Note you are in a subshell. We will need to leave that first." _Dbg_write_journal "_Dbg_RESTART_COMMAND=\"$exec_cmd\"" _Dbg_do_quit 0 fi _Dbg_save_state builtin cd $_Dbg_init_cwd _Dbg_cleanup eval "exec $exec_cmd" } _Dbg_alias_add R run _Dbg_alias_add restart run zshdb-0.05+git20101031/command/set.sh000066400000000000000000000063551146334126000167150ustar00rootroot00000000000000# -*- shell-script -*- # set.sh - debugger settings # # Copyright (C) 2008, 2010 Rocky Bernstein rocky@gnu.org # # This program 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. # # This program 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 this program; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. # Sets whether or not to display command to be executed in debugger prompt. # If yes, always show. If auto, show only if the same line is to be run # but the command is different. typeset -i _Dbg_set_linewidth; _Dbg_set_linewidth=${COLUMNS:-80} typeset -i _Dbg_linetrace_expand=0 # expand variables in linetrace output typeset _Dbg_linetrace_delay=1 # sleep after linetrace typeset -i _Dbg_set_autoeval=0 # Evaluate unrecognized commands? typeset -i _Dbg_set_listsize=10 # How many lines in a listing? _Dbg_help_add set '' # Help routine is elsewhere # Load in "show" subcommands for _Dbg_file in ${_Dbg_libdir}/command/set_sub/*.sh ; do source $_Dbg_file done _Dbg_do_set() { typeset set_cmd=$1 typeset rc if [[ $set_cmd == '' ]] ; then _Dbg_msg "Argument required (expression to compute)." return; fi shift case $set_cmd in ar | arg | args ) _Dbg_do_set_args $@ ;; an | ann | anno | annot | annota | annotat | annotate ) _Dbg_do_set_annotate $@ ;; autoe | autoev | autoeva | autoeval ) _Dbg_set_onoff "$1" 'autoeval' ;; autol | autoli | autolis | autolist ) _Dbg_do_set_autolist $@ ;; b | ba | bas | base | basen | basena | basenam | basename ) _Dbg_set_onoff "$1" 'basename' ;; de|deb|debu|debug|debugg|debugger|debuggi|debuggin|debugging ) _Dbg_set_onoff "$1" 'debugging' ;; e | ed | edi | edit | editi | editin | editing ) _Dbg_do_set_editing $@ ;; force | dif | diff | differ | different ) _Dbg_set_onoff "$1" 'different' ;; hi|his|hist|histo|histor|history) _Dbg_do_set_history $@ ;; inferior-tty ) _Dbg_set_tty $@ ;; lin | line | linet | linetr | linetra | linetrac | linetrace ) _Dbg_do_set_linetrace $@ ;; li | lis | list | lists | listsi | listsiz | listsize ) _Dbg_do_set_listsize $@ ;; lo | log | logg | loggi | loggin | logging ) _Dbg_cmd_set_logging $@ ;; p | pr | pro | prom | promp | prompt ) _Dbg_prompt_str="$1" ;; sho|show|showc|showco|showcom|showcomm|showcomma|showcomman|showcommand ) _Dbg_set_showcommand $@ ;; t|tr|tra|trac|trace|trace-|trace-c|trace-co|trace-com|trace-comm|trace-comma|trace-comman|trace-command|trace-commands ) _Dbg_do_set_trace_commands $@ ;; w | wi | wid | width ) _Dbg_do_set_linewidth "$1" ;; *) _Dbg_undefined_cmd "set" "$set_cmd" return 1 esac return $? } zshdb-0.05+git20101031/command/set_sub/000077500000000000000000000000001146334126000172215ustar00rootroot00000000000000zshdb-0.05+git20101031/command/set_sub/.gitignore000066400000000000000000000000341146334126000212060ustar00rootroot00000000000000/*~ /Makefile /Makefile.in zshdb-0.05+git20101031/command/set_sub/Makefile.am000066400000000000000000000004231146334126000212540ustar00rootroot00000000000000pkgdatadir = ${datadir}/@PACKAGE@/command/set_sub pkgdata_DATA = \ annotate.sh \ autolist.sh \ args.sh \ editing.sh \ history.sh \ linetrace.sh \ linewidth.sh \ listsize.sh \ showcommand.sh \ trace-commands.sh EXTRA_DIST = $(pkgdata_DATA) zshdb-0.05+git20101031/command/set_sub/annotate.sh000066400000000000000000000023431146334126000213700ustar00rootroot00000000000000# -*- shell-script -*- # "set annotate" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # This program 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. # # This program 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 this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place, Suite 330, Boston, # MA 02111 USA. _Dbg_do_set_annotate() { if (( $# == 0 )) ; then _Dbg_msg "Argument required (an integer to set 'annotate' to.)." elif [[ "$1" == [0-9]* ]] ; then if (( $1 > 3 || $1 < 0)); then _Dbg_msg "Annotation level must be between 0 and 3. Got: ${1}." else _Dbg_write_journal_eval "_Dbg_set_annotate=$1" fi else _Dbg_errmsg "Integer argument expected; got: $1" return 1 fi return 0 } zshdb-0.05+git20101031/command/set_sub/args.sh000066400000000000000000000022121146334126000205060ustar00rootroot00000000000000# -*- shell-script -*- # "set args" debugger command # # Copyright (C) 2010 Rocky Bernstein rocky@gnu.org # # This program 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. # # This program 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 this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place, Suite 330, Boston, # MA 02111 USA. _Dbg_do_set_args() { # We use the loop below rather than _Dbg_set_args="(@)" because # we want to preserve embedded blanks in the arguments. _Dbg_script_args=() typeset -i i typeset -i n=$# for (( i=0; i 0 )) ; i++ )) ; do typeset prefix='##' (( i == _Dbg_stack_pos)) && prefix='->' prefix+="$i " if ((i!=0)) ; then prefix+="${_Dbg_func_stack[i-1]} called from" else prefix+='in' fi _Dbg_print_frame "$i" "$prefix" ((count--)) done return 0 } _Dbg_alias_add bt where _Dbg_alias_add T where _Dbg_alias_add backtrace where zshdb-0.05+git20101031/configure.ac000066400000000000000000000151511146334126000164300ustar00rootroot00000000000000dnl Configure script for Shell debugger define(DEBUGGER, zshdb) define(POSIXSHELL, zsh) AC_INIT([zshdb],[0.06.git],[rocky@gnu.org]) AM_PATH_LISPDIR AM_MAINTAINER_MODE AM_INIT_AUTOMAKE([no-define]) AC_CONFIG_SRCDIR(DEBUGGER.in) if test x$srcdir = x ; then srcdir=$ac_pwd fi # List of output variables produced by this configure script # AC_SUBST(DIFF) AC_SUBST(DIFF_OPTS) # We need a GNU sed and the below allows us to use @SED@ in # the integration tests programs. AC_PROG_SED ## --with-zsh can be used to tell the zshdb script and the regression ## test which bash to run. It can be omitted too in which case we'll ## look for a zsh binary. AC_ARG_WITH(POSIXSHELL, AC_HELP_STRING([--with-POSIXSHELL], [location of POSIXSHELL program]), SH_PROG=$withval) if test "$SH_PROG" = "yes" || test "$SH_PROG" = "no" || test -z "$SH_PROG" then AC_PATH_PROG(SH_PROG, zsh, no) fi if test "$SH_PROG" = no; then AC_MSG_ERROR([I didn't find the] POSIXSHELL [executable.\ You might want to use the] --with-POSIXSHELL [option.]) fi AC_MSG_CHECKING([Checking whether $SH_PROG is compatible with DEBUGGER]) if ! (cd ${srcdir}/test/zsh && $SH_PROG ./ok4zshdb.sh) ; then AC_MSG_RESULT([no dice :-(]) AC_MSG_ERROR([You might want to retry with another POSIXSHELL using the --with-POSIXSHELL option.]) else AC_MSG_RESULT(yes!) fi dnl We use a diff in regression testing AC_PATH_PROG(DIFF, diff, no) DIFF_OPTS= if test "$DIFF" = no ; then AC_PATH_PROG(DIFF, cmp, no) else dnl Try for GNU diff options. # MSDOG output uses \r\n rather than \n in tests for diff_opt in -w --unified ; do if $DIFF $diff_opt . . > /dev/null 2>&1; then AC_MSG_RESULT([adding $diff_opt to diff in regression tests]) DIFF_OPTS="$DIFF_OPTS $diff_opt" fi done fi # Get the fully expanded name of pkgdatadir. This is used in zshdb.in # and dbg-main.sh.in and for installing debugger files. pkgdatadir=$datadir/DEBUGGER AC_SUBST_DIR(PKGDATADIR, $pkgdatadir) AM_MISSING_PROG(GIT2CL, git2cl, $missing_dir) AC_PROG_LN_S AC_PATH_PROG(RM, rm, true) AC_CONFIG_FILES([ \ Makefile \ command/Makefile \ command/info_sub/Makefile \ command/set_sub/Makefile \ command/show_sub/Makefile \ doc/Makefile \ dbg-trace.sh \ lib/Makefile \ test/Makefile \ test/data/Makefile \ test/example/Makefile \ test/integration/Makefile \ test/integration/check-common.sh \ test/unit/Makefile \ test/zsh/Makefile \ ]) AC_CONFIG_FILES(DEBUGGER, [chmod +x DEBUGGER]) AC_CONFIG_FILES([test/example/hanoi.sh], [chmod +x test/example/hanoi.sh]) AC_CONFIG_FILES([test/example/restart.sh], [chmod +x test/example/restart.sh]) AC_CONFIG_FILES([test/integration/test-action], [chmod +x test/integration/test-action]) AC_CONFIG_FILES([test/integration/test-brkpt1], [chmod +x test/integration/test-brkpt1]) AC_CONFIG_FILES([test/integration/test-bug-args], [chmod +x test/integration/test-bug-args]) AC_CONFIG_FILES([test/integration/test-bug-errexit], [chmod +x test/integration/test-bug-errexit]) AC_CONFIG_FILES([test/integration/test-bugIFS], [chmod +x test/integration/test-bugIFS]) AC_CONFIG_FILES([test/integration/test-bug-ksharrays], [chmod +x test/integration/test-bug-ksharrays]) AC_CONFIG_FILES([test/integration/test-condition], [chmod +x test/integration/test-condition]) AC_CONFIG_FILES([test/integration/test-delete], [chmod +x test/integration/test-delete]) AC_CONFIG_FILES([test/integration/test-display], [chmod +x test/integration/test-display]) AC_CONFIG_FILES([test/integration/test-enable], [chmod +x test/integration/test-enable]) AC_CONFIG_FILES([test/integration/test-examine], [chmod +x test/integration/test-examine]) AC_CONFIG_FILES([test/integration/test-frame], [chmod +x test/integration/test-frame]) AC_CONFIG_FILES([test/integration/test-list], [chmod +x test/integration/test-list]) AC_CONFIG_FILES([test/integration/test-next], [chmod +x test/integration/test-next]) AC_CONFIG_FILES([test/integration/test-opts], [chmod +x test/integration/test-opts]) AC_CONFIG_FILES([test/integration/test-restart], [chmod +x test/integration/test-restart]) AC_CONFIG_FILES([test/integration/test-setshow], [chmod +x test/integration/test-setshow]) AC_CONFIG_FILES([test/integration/test-skip], [chmod +x test/integration/test-skip]) AC_CONFIG_FILES([test/integration/test-step], [chmod +x test/integration/test-step]) AC_CONFIG_FILES([test/integration/test-subshell], [chmod +x test/integration/test-subshell]) AC_CONFIG_FILES([test/integration/test-tbreak], [chmod +x test/integration/test-tbreak]) AC_CONFIG_FILES([test/unit/test-action.sh], [chmod +x test/unit/test-action.sh]) AC_CONFIG_FILES([test/unit/test-alias.sh], [chmod +x test/unit/test-alias.sh]) AC_CONFIG_FILES([test/unit/test-break.sh], [chmod +x test/unit/test-break.sh]) AC_CONFIG_FILES([test/unit/test-columns.sh], [chmod +x test/unit/test-columns.sh]) AC_CONFIG_FILES([test/unit/test-dbg-opts.sh], [chmod +x test/unit/test-dbg-opts.sh]) AC_CONFIG_FILES([test/unit/test-examine.sh], [chmod +x test/unit/test-examine.sh]) AC_CONFIG_FILES([test/unit/test-file.sh], [chmod +x test/unit/test-file.sh]) AC_CONFIG_FILES([test/unit/test-filecache.sh], [chmod +x test/unit/test-filecache.sh]) AC_CONFIG_FILES([test/unit/test-get-sourceline.sh], [chmod +x test/unit/test-get-sourceline.sh]) AC_CONFIG_FILES([test/unit/test-fns.sh], [chmod +x test/unit/test-fns.sh]) AC_CONFIG_FILES([test/unit/test-frame.sh], [chmod +x test/unit/test-frame.sh]) AC_CONFIG_FILES([test/unit/test-journal.sh], [chmod +x test/unit/test-journal.sh]) AC_CONFIG_FILES([test/unit/test-msg.sh], [chmod +x test/unit/test-msg.sh]) AC_CONFIG_FILES([test/unit/test-pre.sh], [chmod +x test/unit/test-pre.sh]) AC_CONFIG_FILES([test/unit/test-run.sh], [chmod +x test/unit/test-run.sh]) AC_CONFIG_FILES([test/unit/test-save-restore.sh], [chmod +x test/unit/test-save-restore.sh]) AC_CONFIG_FILES([test/unit/test-setshow.sh], [chmod +x test/unit/test-setshow.sh]) AC_CONFIG_FILES([test/unit/test-sort.sh], [chmod +x test/unit/test-sort.sh]) AC_CONFIG_FILES([test/unit/test-tty.sh], [chmod +x test/unit/test-tty.sh]) AC_CONFIG_FILES([test/unit/test-validate.sh], [chmod +x test/unit/test-validate.sh]) AC_OUTPUT zshdb-0.05+git20101031/dbg-main.sh000077500000000000000000000040031146334126000161510ustar00rootroot00000000000000# -*- shell-script -*- # Copyright (C) 2008, 2009, 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. # Stuff common to zshdb and zshdb-trace. Include the rest of options # processing. Also includes things which have to come before other includes . ${_Dbg_libdir}/dbg-pre.sh # All debugger lib code has to come before debugger command code. typeset _Dbg_file for _Dbg_file in ${_Dbg_libdir}/lib/*.sh ; do source $_Dbg_file done for _Dbg_file in ${_Dbg_libdir}/command/*.sh ; do source $_Dbg_file done unsetopt localtraps set -o DEBUG_BEFORE_CMD # Have we already specified where to read debugger input from? if [[ -n "$DBG_INPUT" ]] ; then _Dbg_do_source "$DBG_INPUT" _Dbg_no_init=1 fi # Run the user's debugger startup file typeset _Dbg_startup_cmdfile=${HOME:-~}/.${_Dbg_debugger_name}rc if [[ -z $_Dbg_o_nx && -r $_Dbg_startup_cmdfile ]] ; then _Dbg_do_source $_Dbg_startup_cmdfile fi # _Dbg_DEBUGGER_LEVEL is the number of times we are nested inside a debugger # by virtue of running "debug" for example. if [[ -z "${_Dbg_DEBUGGER_LEVEL}" ]] ; then typeset -ix _Dbg_DEBUGGER_LEVEL=1 fi if ((Dbg_history_save)) ; then history -ap "$_Dbg_histfile" fi if [[ -z "$_Dbg_tty" ]]; then _Dbg_tty=$(tty) [[ $_Dbg_tty == 'not a tty' ]] && unset _Dbg_tty fi [[ -n "$_Dbg_tty" ]] && _Dbg_do_set inferior-tty $_Dbg_tty zshdb-0.05+git20101031/dbg-opts.sh000066400000000000000000000123761146334126000162230ustar00rootroot00000000000000# -*- shell-script -*- # dbg-opts.sh - zshdb command options processing. The bane of programming. # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. _Dbg_usage() { printf "Usage: ${_Dbg_pname} [OPTIONS] Runs $_Dbg_shell_name under a debugger. options: -h | --help Print this help. -q | --quiet Do not print introductory and quiet messages. -A | --annotate LEVEL Set the annotation level. -B | --basename Show basename only on source file listings. (Needed in regression tests) -L | --library DIRECTORY Set the directory location of library helper file: $_Dbg_main -c | --command STRING Run STRING instead of a script file -n | --nx | --no-init Don't run initialization files. -t | --tty DEV Run using device for your programs standard input and output -T | --tempdir DIRECTORY Use DIRECTORY to store temporary files in -V | --version Print the debugger version number. -x | --eval-command CMDFILE Execute debugger commands from CMDFILE. " exit 100 } _Dbg_show_version() { printf "There is absolutely no warranty for $_Dbg_debugger_name. Type \"show warranty\" for details. " exit 101 } # Script arguments before adulteration by _Dbg_parse_opts typeset -ax _Dbg_orig_script_args _Dbg_orig_script_args=($@) # The following globals are set by _Dbg_parse_opts. Any values set are # the default values. typeset -ax _Dbg_script_args # Use gdb-style annotate? typeset -i _Dbg_set_annotate=0 # Simulate set -x? typeset -i _Dbg_linetrace=0 typeset -i _Dbg_set_basename=0 typeset -i _Dbg_o_nx=0 typeset -i _Dbg_o_linetrace=0 typeset _Dbg_tty='' # $_Dbg_tmpdir could have been set by the top-level debugger script. [[ -z $_Dbg_tmpdir ]] && typeset _Dbg_tmpdir=/tmp _Dbg_parse_options() { . ${_Dbg_libdir}/getopts_long.sh typeset -i _Dbg_o_quiet=0 typeset -i _Dbg_o_version=0 while getopts_long A:Bc:x:hL:nqTt:V opt \ annotate required_argument \ basename no_argument \ command required_argument \ eval-command required_argument \ cmdfile required_argument \ help no_argument \ library required_argument \ no-init no_argument \ nx no_argument \ quiet no_argument \ tempdir required_argument \ tty required_argument \ version no_argument \ '' "$@" do case "$opt" in A | annotate ) _Dbg_o_annotate=$OPTLARG;; B | basename ) _Dbg_set_basename=1 ;; c | command ) _Dbg_EXECUTION_STRING="$OPTLARG" ;; h | help ) _Dbg_usage ;; L | library ) ;; V | version ) _Dbg_o_version=1 ;; n | nx | no-init ) _Dbg_o_nx=1 ;; q | quiet ) _Dbg_o_quiet=1 ;; t | tty) _Dbg_tty=$OPTLARG ;; tempdir) _Dbg_tmpdir=$OPTLARG ;; x | eval-command ) DBG_INPUT=$OPTLARG ;; '?' ) # Path taken on a bad option echo >&2 'Use -h or --help to see options.' exit 2 ;; * ) echo "Unknown option $opt. Use -h or --help to see options." >&2 exit 2 ;; esac done shift "$(($OPTLIND - 1))" if (( _Dbg_o_version )) ; then _Dbg_do_show_version exit 0 elif (( ! _Dbg_o_quiet )); then echo "$_Dbg_shell_name Shell Debugger, release $_Dbg_release" printf ' Copyright 2008, 2009, 2010 Rocky Bernstein This is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. ' fi (( _Dbg_o_version )) && _Dbg_show_version if [[ -n $_Dbg_o_annotate ]] ; then if [[ ${_Dbg_o_annotate} == [0-9]* ]] ; then _Dbg_set_annotate=$_Dbg_o_annotate if (( _Dbg_set_annotate > 3 || _Dbg_set_annotate < 0)); then print "Annotation level must be less between 0 and 3. Got: $_Dbg_set_annotate." >&2 print "Setting Annotation level to 0." >&2 _Dbg_set_annotate=0 fi else print "Annotate option should be an integer, got ${_Dbg_o_annotate}." >&2 print "Setting annotation level to 0." >&2 fi fi unset _Dbg_o_annotate _Dbg_o_version _Dbg_o_quiet _Dbg_script_args=("$@") } # Stand-alone Testing. if [[ -n "$_Dbg_dbg_opts_test" ]] ; then OPTLIND=1 _Dbg_libdir='.' [[ -n $_Dbg_input ]] && typeset -p _Dbg_input _Dbg_parse_options "$@" typeset -p _Dbg_set_annotate typeset -p _Dbg_linetrace typeset -p _Dbg_set_basename fi zshdb-0.05+git20101031/dbg-pre.sh000066400000000000000000000102571146334126000160200ustar00rootroot00000000000000# -*- shell-script -*- # dbg-pre.sh - Code common to zshdb and zshdb-trace that has to run first # # Copyright (C) 2008, 2009, 2010 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. # Here we put definitions common to both the script debugger and # dbg-trace.sh. In contrast to other routines, this code is sourced # early -- before most of the debugger script is run. # Note: initializations which are mostly used in only one sub-part # (e.g. variables for break/watch/actions) are in the corresponding # file: either in lib or (less good) command. # Are we using a debugger-enabled shell? If not let's stop right here. typeset old_setopt="$-" # is-at-least messes up in some situations so we have to not use it for now. # typeset -fuz is-at-least # Same as "functions -u -z" but better documented. # if ! is-at-least 4.3.6-dev-0 ; then # print "Sorry, your $_Dbg_shell_name just isn't modern enough." 2>&1 # print "We need 4.3.6-dev-0 or greater." 2>&1 # exit 30 # fi # is-at-least does an emulate -L zsh # emulate -L ksh # Will be set to 1 if the top-level call is a debugger. typeset -i _Dbg_script=0 # This function is overwritten by when lib/fns.sh gets loaded _Dbg_msg() { echo $* } # Used by "show version" as well as --version _Dbg_do_show_version() { _Dbg_msg "$_Dbg_debugger_name, release $_Dbg_release" } # Expand filename given as $1. # we echo the expanded name or return $1 unchanged if a bad filename. # Return is 0 if good or 1 if bad. # File globbing is handled. # Note we don't check that the file exists, just that the format is # valid; we do check that we can "search" the directory implied in the # filename. function _Dbg_expand_filename { typeset -r filename="$1" # Break out basename and dirname typeset basename="${filename##*/}" typeset -x dirname="${filename%/*}" # No slash given in filename? Then use . for dirname [[ $dirname == $basename ]] && [[ $filename != '/' ]] && dirname='.' # Dirname is ''? Then use / for dirname dirname=${dirname:-/} # Handle tilde expansion in dirname dirname=$(echo $dirname) typeset long_path [[ $basename == '.' ]] && basename='' if long_path=$( (cd "$dirname" ; pwd) 2>/dev/null ) ; then if [[ "$long_path" == '/' ]] ; then echo "/$basename" else echo "$long_path/$basename" fi return 0 else echo $filename return 1 fi } # Create temporary file based on $1 # file $1 _Dbg_tempname() { echo "$_Dbg_tmpdir/${_Dbg_debugger_name}$1$$" } # Process command-line options . ${_Dbg_libdir}/dbg-opts.sh OPTLIND=1 _Dbg_parse_options "$@" if [[ ! -d $_Dbg_tmpdir ]] && [[ ! -w $_Dbg_tmpdir ]] ; then echo "${_Dbg_pname}: cannot write to temp directory $_Dbg_tmpdir." >&2 echo "${_Dbg_pname}: Use -T try directory location." >&2 exit 1 fi # Save the initial working directory so we can reset it on a restart. typeset -x _Dbg_init_cwd=$PWD typeset -i _Dbg_running=1 # True we are not finished running the program typeset -i _Dbg_brkpt_num=0 # If nonzero, the breakpoint number that we # are currently stopped at. # Sets whether or not to display command before executing it. typeset _Dbg_set_trace_commands='off' # Known normal IFS consisting of a space, tab and newline typeset -x _Dbg_space_IFS=' ' # Number of statements to run before entering the debugger. Is used # intially to get out of sourced dbg-main.inc script and in top-level # debugger script to not stop in remaining debugger statements before # the sourcing the script to be debugged. typeset -i _Dbg_step_ignore=1 zshdb-0.05+git20101031/dbg-trace.sh.in000066400000000000000000000045361146334126000167400ustar00rootroot00000000000000# -*- shell-script -*- # This program needs to be SOURCE'd and is not called as an executable # # Copyright (C) 2008 Rocky Bernstein rocky@gnu.org # # zshdb 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. # # zshdb 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 zshdb; see the file COPYING. If not, write to the Free Software # Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. typeset _Dbg_trace_old_set_opts _Dbg_trace_old_set_opts=$- set +u # Name we refer to ourselves by typeset _Dbg_debugger_name='@PACKAGE@' # The shell we are configured to run under. typeset _Dbg_shell='@SH_PROG@' # The short shell name. Helps keep code common in bash, zsh, and ksh debuggers. # Equivalent to typeset _Dbg_shell_name=${_Dbg_shell##*/} # Original $0. Note we can't set this in an include. typeset _Dbg_orig_0=$0 # Equivalent to basename $0; the short program name typeset _Dbg_pname=${0##*/} ## Stuff set by autoconf/configure ### typeset prefix=@prefix@ typeset _Dbg_libdir=@PKGDATADIR@ ### [[ ! -d $_Dbg_libdir ]] && _Dbg_libdir='.' # Parse just the libdir option typeset -a libdir zparseopts -a libdir -E L: -library: if (( ${#libdir} > 0 )) ; then typeset -a lib_opts; eval "lib_opts=($libdir)" if [[ ! -d ${lib_opts[2]} ]] ; then print "${lib_opts[2]} is not a directory" exit 1 fi _Dbg_libdir=${lib_opts[2]} unset lib_opts fi # Pull in the rest of the debugger code. typeset _Dbg_main="$_Dbg_libdir/dbg-main.sh" if [[ ! -r $_Dbg_main ]] ; then print "${_Dbg_pname}: Can't read debugger library file '${_Dbg_main}'." print "${_Dbg_pname}: Perhaps @PACKAGE@ is installed wrong (if its installed)." >&2 print "${_Dbg_pname}: Try running @PACKAGE@ using -L (with a different directory)." >&2 print "${_Dbg_pname}: Run @PACKAGE@ --help for a list and explanation of options." >&2 exit 1 fi . ${_Dbg_libdir}/dbg-main.sh set -${_Dbg_trace_old_set_opts} unset _Dbg_trace_old_set_opts zshdb-0.05+git20101031/doc/000077500000000000000000000000001146334126000147045ustar00rootroot00000000000000zshdb-0.05+git20101031/doc/.gitignore000066400000000000000000000000451146334126000166730ustar00rootroot00000000000000/Makefile /Makefile.in /zshdb.1 /*~ zshdb-0.05+git20101031/doc/Makefile.am000066400000000000000000000004401146334126000167360ustar00rootroot00000000000000EXT=1 man1_MANS = @PACKAGE@.$(EXT) EXTRA_DIST = $(man1_MANS) @PACKAGE@-man.pod all: $(INFO_DEPS) $(man1_MANS) html $(man1_MANS): @PACKAGE@-man.pod pod2man --name=@PACKAGE@ --release=$(PACKAGE_VERSION) --section=$(EXT) $(srcdir)/@PACKAGE@-man.pod >$@ MOSTLYCLEANFILES = $(man1_MANS) zshdb-0.05+git20101031/doc/zshdb-man.pod000066400000000000000000000127521146334126000173020ustar00rootroot00000000000000=pod =head1 NAME zshdb - zsh debugger =head1 SYNOPSIS B [I] [--] I [I