Skip to content
This repository

Debugger for zsh (at least 4.3.6-dev-2)

branch: master
Octocat-spinner-32 command msg.sh: fix bug in sectioning command. Use more sectioning commands d… May 25, 2013
Octocat-spinner-32 data Sync with bashdb March 01, 2011
Octocat-spinner-32 doc Perhaps a better clean target February 12, 2010
Octocat-spinner-32 lib msg.sh: fix bug in sectioning command. Use more sectioning commands d… May 25, 2013
Octocat-spinner-32 test Merge branch 'master' of github.com:rocky/zshdb May 28, 2013
Octocat-spinner-32 .gitignore Make README be a copy of README.md in autogen.sh to make configure happy June 12, 2013
Octocat-spinner-32 .travis.yml Try again for travis June 12, 2013
Octocat-spinner-32 AUTHORS Forgot to install display and undisplay March 02, 2011
Octocat-spinner-32 ChangeLog Untabify some files. Sync with bashdb. Get ready for release 0.08. May 17, 2011
Octocat-spinner-32 Makefile.am Convert README to markdown June 12, 2013
Octocat-spinner-32 NEWS Follow gdb better. alias 'u' for 'up' removed. August 25, 2012
Octocat-spinner-32 README.md Ouch - that's too loud. June 14, 2013
Octocat-spinner-32 THANKS Convert options processing to getopts_long by Stéphane Chazelas. Than… September 29, 2008
Octocat-spinner-32 acinclude.m4 More zsh and ksh compatible. August 14, 2008
Octocat-spinner-32 autogen.sh Fix up autogen.sh - 2nd take June 12, 2013
Octocat-spinner-32 configure.ac Administrivia: test-eval.sh.in -> test-lib-eval.sh.in. test-fns.sh: R… May 27, 2011
Octocat-spinner-32 dbg-main.sh Fix bug in sourcing startup profile. Fix bug in "print" Workaround ty… March 27, 2011
Octocat-spinner-32 dbg-opts.sh msg.sh: fix bug in sectioning command. Use more sectioning commands d… May 25, 2013
Octocat-spinner-32 dbg-pre.sh A separator in the tempfiles looks a little nicer February 27, 2011
Octocat-spinner-32 dbg-trace.sh.in Fix sourcing dbg-trace.sh March 14, 2011
Octocat-spinner-32 getopts_long.sh Add --highlight and --no-highlight options. Update getopts_long.sh February 07, 2011
Octocat-spinner-32 testing.sh Use ZSH subshell in journaling and the prompt display. September 05, 2008
Octocat-spinner-32 zshdb.in Test for pygmentize with --highlight. zshdb.in - one more error outpu… May 17, 2011
README.md

Build Status

Introduction

This is a port and cleanup of my bash debugger bashdb.

The command syntax generally follows that of the GNU debugger gdb.

However this debugger depends on a number of 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.

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-trace.sh gets installed directory. The "source" 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.

What's here, What's not, and Why not?

What's missing falls into 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.

What's not here in more detail

Showing frame arguments

This can be 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.

Setting $0

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.

What may need more work and support from zsh

Stopping points that can be used for breakpoint

Author

Rocky Bernstein rocky@gnu.org
endorse

Something went wrong with that request. Please try again.