.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "zshdb 1" .TH zshdb 1 2024-03-30 1.1.4dev "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME zshdb \- zsh debugger .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBzshdb\fR [\fIoptions\fR] [\-\-] \fIscript-name\fR [\fIscript options\fR] .PP \&\fBzshdb\fR [\fIoptions\fR] \-c \fIexecution-string\fR .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`zshdb\*(C'\fR is a zsh script to which arranges for another zsh script to be debugged. The debugger has a similar command interface as \f(CWgdb(1)\fR. .PP If you used zshdb script and need to pass options to the script to be debugged, add \f(CW\*(C`\-\-\*(C'\fR before the script name. That will tell zshdb not to try to process any further options. .SH OPTIONS .IX Header "OPTIONS" .IP "\-h | \-\-help" 4 .IX Item "-h | --help" Print a usage message on standard error and exit with a return code of 100. .Sp .IP "\-A | \-\-annotation \fIlevel\fR" 4 .IX Item "-A | --annotation level" Sets to output additional stack and status information which allows front-ends such as emacs to track what's going on without polling. .Sp This is needed in for regression testing. Using this option is equivalent to issuing: .Sp .Vb 1 \& set annotation LEVEL .Ve .Sp inside the debugger. .IP "\-B | \-\-basename" 4 .IX Item "-B | --basename" In places where a filename appears in debugger output give just the basename only. This is needed in for regression testing. Using this option is equivalent to issuing: .Sp .Vb 1 \& set basename on .Ve .Sp inside the debugger. .Sp .IP "\-n | \-\-nx | \-\-no\-init" 4 .IX Item "-n | --nx | --no-init" Normally the debugger will read debugger commands in \f(CW\*(C`~/.zshdbinit\*(C'\fR if that file exists before accepting user interaction. \&\f(CW\*(C`.zshdbinit\*(C'\fR is analogus to Perl's \f(CW\*(C`.perldb\*(C'\fR or GNU gdb's \&\f(CW\*(C`.gdbinit\*(C'\fR: a user might want to create such a debugger profile to add various user-specific customizations. .Sp Using the \f(CW\*(C`\-n\*(C'\fR option this initialization file will not be read. This is useful in regression testing or in tracking down a problem with one's \f(CW\*(C`.zshdbinit\*(C'\fR profile. .Sp .IP "\-c | \-\-command \fIcommand-string\fR" 4 .IX Item "-c | --command command-string" Instead of specifying the name of a script file, one can give an execution string that is to be debugged. Use this option to do that. .Sp .IP "\-q | \-\-quiet" 4 .IX Item "-q | --quiet" Do not print introductory version and copyright information. This is again useful in regression testing where we don't want to include a changeable copyright date in the regression-test matching. .Sp .IP "\-x | \-\-eval\-command \fIdebugger-cmdfile\fR" 4 .IX Item "-x | --eval-command debugger-cmdfile" Run the debugger commands \fIdebugger-cmdfile\fR before accepting user input. These commands are read however after any \f(CW\*(C`.zshdbinit\*(C'\fR commands. Again this is useful running regression-testing debug scripts. .Sp .IP "\-L | \-\-library \fIdebugger-library\fR" 4 .IX Item "-L | --library debugger-library" The debugger needs to source or include a number of functions and these reside in a library. If this option is not given the default location of library is relative to the installed zshdb script: \f(CW\*(C`../lib/zshdb\*(C'\fR. .Sp .IP "\-T | \-\-tempdir \fItemporary-file-directory\fR" 4 .IX Item "-T | --tempdir temporary-file-directory" The debugger needs to make use of some temporary filesystem storage to save persistent information across a subshell return or in order to evaluate an expression. The default directory is \f(CW\*(C`/tmp\*(C'\fR but you can use this option to set the directory where debugger temporary files will be created. .Sp .IP "\-t | \-\-tty \fItty-name\fR" 4 .IX Item "-t | --tty tty-name" Debugger output usually goes to a terminal rather than stdout or stdin which the debugged program may use. Determination of the tty or pseudo-tty is normally done automatically. However if you want to control where the debugger output goes, use this option. .Sp .IP "\-V | \-\-version" 4 .IX Item "-V | --version" Show version number and no-warranty and exit with return code 1. .SH BUGS .IX Header "BUGS" The way this script arranges debugging to occur is by including (or actually "source"\-ing) some debug-support code and then sourcing the given script or command string. .PP One problem with sourcing a debugged script is that the program name stored in \f(CW$0\fR will not be the name of the script to be debugged. The debugged script will appear in a call stack not as the top item but as the item below \f(CW\*(C`zshdb\*(C'\fR. .PP The \f(CW\*(C`zshdb\*(C'\fR script option assume a version of zsh with debugging support, zsh 4.3.6\-dev\-2 or later. .PP The debugger slows things down a little because the debugger has to intercept every statement and check to see if some action is to be taken. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP \(bu 4 \- Until a full manual is written, this manual for a similar bash debugger may give some guidance. The two debuggers have similar command interfaces (and code). .IP \(bu 4 \- the homepage for the project for the family of debugger, zshdb, bashdb. .SH AUTHOR .IX Header "AUTHOR" The current version is maintained (or not) by Rocky Bernstein. .SH COPYRIGHT .IX Header "COPYRIGHT" .Vb 5 \& Copyright (C) 2009 Rocky Bernstein \& 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 of the License, 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; if not, write to the Free Software \& Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111\-1307 USA .Ve