Skip to content

Commit

Permalink
zsh{,db} -> bash{,db} and other doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Feb 15, 2024
1 parent 24e290c commit 61bcfd1
Show file tree
Hide file tree
Showing 51 changed files with 250 additions and 257 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status Circle](https://circleci.com/gh/rocky/bashdb.svg?&style=shield)](https://circleci.com/gh/rocky/bashdb)

[![Packaging status](https://repology.org/badge/vertical-allrepos/zshdb.svg)](https://repology.org/project/zshdb/versions)
[![Packaging status](https://repology.org/badge/vertical-allrepos/bashdb.svg)](https://repology.org/project/bashdb/versions)

Here, we have a debugger for Bash 5.2 and higher.

Expand Down
2 changes: 1 addition & 1 deletion command/break.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ See also:
"tbreak" and "continue"'

_Dbg_help_add tbreak \
'**tbreak* [*loc-spec*]
'**tbreak** [ *location* ] [**if** *condition*]
Set a one-time breakpoint at *loc-spec*.
Expand Down
4 changes: 2 additions & 2 deletions command/condition.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- shell-script -*-
# condition.sh - gdb-like "condition" debugger command
#
# Copyright (C) 2002-2006, 2008, 2009, 2011, 2016, 2019
# Copyright (C) 2002-2006, 2008, 2009, 2011, 2016, 2019, 2024
# Rocky Bernstein [email protected]
#
# This program is free software; you can redistribute it and/or
Expand All @@ -24,7 +24,7 @@ _Dbg_help_add condition \
Break only if *bash-cond* is true in breakpoint number *bp_number*.
*bp_number* is an integer and *cond* is an zsh expression to be evaluated whenever
*bp_number* is an integer and *cond* is an bash expression to be evaluated whenever
breakpoint *bp_number* is reached.
Examples:
Expand Down
4 changes: 1 addition & 3 deletions command/next.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ _Dbg_help_add next \
Step one statement ignoring steps into function calls at this level. This is sometimes called
'step over' or 'step through'.
With an integer argument, perform ``next`` that many times. However if
an exception occurs at this level, or we *return*, *yield* or the
thread changes, we stop regardless of count.
With an integer argument, perform ``next`` that many times.
A suffix of ``+`` on the command or an alias to the command forces to
move to another line, while a suffix of ``-`` does the opposite and
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = zshdb
SPHINXPROJ = bashdb
SOURCEDIR = .
BUILDDIR = _build

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/breakpoints/condition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Add Condition to a Breakpoint (condition)

**condition** *bp_number* *condition*

*bp_number* is a breakpoint number. *condition* is a zsh expression
*bp_number* is a breakpoint number. *condition* is a bash expression
which must evaluate to *True* before the breakpoint is honored. If
*condition* is absent, any existing condition is removed; i.e., the
breakpoint is made unconditional.
Expand Down
11 changes: 4 additions & 7 deletions docs/commands/breakpoints/tbreak.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ Set a Temporary Breakpoint (tbreak)
With a line number argument, set a break there in the current file.
With a function name, set a break at first executable line of that
function. Without argument, set a breakpoint at current location. If
a second argument is `if`, subequent arguments given an expression
a second argument is `if`, subsequent arguments given an expression
which must evaluate to true before the breakpoint is honored.

The location line number may be prefixed with a filename or module
name and a colon. Files is searched for using *sys.path*, and the `.py`
suffix may be omitted in the file name.
name and a colon.

Examples:
+++++++++
Expand All @@ -23,10 +22,8 @@ Examples:

tbreak # Break where we are current stopped at
tbreak 10 # Break on line 10 of the file we are currently stopped at
tbreak os.path.join # Break in function os.path.join
tbreak os.path:45 # Break on line 45 of os.path
tbreak myfile.py:45 # Break on line 45 of myfile.py
tbreak myfile:45 # Same as above.
tbreak /etc/profile:10 # Break on line 10 of /etc/default
tbreak myfile:45 # Use relative file name

.. seealso::

Expand Down
29 changes: 15 additions & 14 deletions docs/commands/data/display.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
.. index:: display
.. _display:

Set a Display Expression (`display`)
------------------------------------
Set a Display Expression (``display``)
--------------------------------------

**display** [ *format* ] *expression*
**display** [*stmt*]

Print value of expression *expression* each time the program stops.
*format* may be used before *expression* and may be one of `/c` for
char, `/x` for hex, `/o` for octal, `/f` for float or `/s` for string.
Evaluate *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.

For now, display expressions are only evaluated when in the same
code as the frame that was in effect when the display expression
was set. This is a departure from gdb and we may allow for more
flexibility in the future to specify whether this should be the
case or not.
Examples:
+++++++++

::

display echo $x # show the current value of x each time debugger stops
display # evaluate all display statements

With no argument, evaluate and display all currently requested
auto-display expressions.

.. seealso::

:ref:`undisplay <undisplay>` to cancel display requests previously made.
:ref:`undisplay <undisplay>` to cancel display requests previously made, and
`info display <info_display>`.
4 changes: 2 additions & 2 deletions docs/commands/data/eval.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. index:: eval
.. _eval:

Evaluate a Zsh Expression (`eval`)
----------------------------------
Evaluate a Bash Expression (``eval``)
-------------------------------------

**eval** *cmd*

Expand Down
8 changes: 4 additions & 4 deletions docs/commands/data/examine.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. index:: examine
.. _examine:

Print the value of an expression (`examine`)
--------------------------------------------
Print the value of an expression (``examine``)
----------------------------------------------

**examine** *expr1*

Expand All @@ -12,8 +12,8 @@ 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.

In contrast to normal zsh expressions, expressions should not have
blanks which would cause zsh to see them as different tokens.
In contrast to normal bash expressions, expressions should not have
blanks which would cause bash to see them as different tokens.

Examples:
+++++++++
Expand Down
8 changes: 4 additions & 4 deletions docs/commands/data/load.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. index:: load
.. _load:

Read in a Zsh Script (`load`)
-----------------------------
Read in a Bash Script (``load``)
---------------------------------

**load** *zsh-script*
**load** *bash-script*

Read in lines of a *zsh-script*.
Read in lines of a *bash-script*.

.. seealso::

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/info/breakpoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Example:

::

zshdb<4> info breakpoints
bashdb<4> info breakpoints
Num Type Disp Enb What
1 breakpoint keep n /etc/profile:8
2 breakpoint keep y /etc/profile:10
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/info/line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Example:

::

zshdb<1> info line
bashdb<1> info line
Line 4 of "/etc/profile"

.. seealso::
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/info/program.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Example:

::

zshdb<1> info program
bashdb<1> info program
Program stopped.
It stopped after being stepped.
Next statement to be run is:
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/info/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Info Source

**info source**

Information about the current zsh script file.
Information about the current bash script file.

Example:
++++++++

::

zshdb<1> info source
bashdb<1> info source
Current script file is /etc/profile
Located in /etc/profile
Contains 27 lines.
Expand Down
31 changes: 15 additions & 16 deletions docs/commands/info/variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@
Info Variables
----------------

**info variables** [*property*]
**info variables [**-i**|**--integer**][**-r**|**--readonly**][**-x**|**--exports**][**-a**|**--indexed**][**-A*|**--associative**][**-t**|**--trace**][**-p**|**--properties**]

list global and static variable names.
list global and local variable names.

Variable lists by property.
*property* is an abbreviation of one of:
Options:

-i | --exports restricted to integer variables
-r | --readonly restricted to read-only variables
-x | --exports restricted to exported variables
-a | --indexed restricted to indexed array variables
-A | --associative restricted to associative array variables
-t | --trace restricted to traced variables
-p | --properties display properties of variables as printed by declare -p

* arrays,
* exports,
* fixed,
* floats,
* functions,
* hash,
* integers, or
* readonly

Examples:
+++++++++

::

info variables # show all variables
info variables readonly # show only read-only variables
info variables integer # show only integer variables
info variables functions # show only functions
info variables # show all variables
info variables -p # show all variables with their properties
info variables -r # show only read-only variables
info variables -i # show only integer variables
8 changes: 4 additions & 4 deletions docs/commands/running/debug.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. index:: debug
.. _debug:

Recursive Debugging (`debug`)
-----------------------------
Recursive Debugging (``debug``)
-------------------------------

**debug** [*zsh-script* [*args*...]]
**debug** [*bash-script* [*args*...]]

Recursively debug into *zsh-script*.
Recursively debug into *bash-script*.

If *script* is not given, take the script name from the command that
is about to be executed. Note that when the nested debug finished, you
Expand Down
6 changes: 3 additions & 3 deletions docs/commands/running/kill.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
index:: kill
.. index:: kill
.. _kill:

Send Kill Signal (`kill`)
-------------------------
Send Kill Signal (``kill``)
---------------------------

**kill** [ *signal-number* ]

Expand Down
11 changes: 5 additions & 6 deletions docs/commands/running/next.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
.. index:: next
.. _next:

Step Over (`next`)
------------------
Step Over (``next``)
--------------------

**next** [ **+** | **-** ] [ *count* ]

Step one statement ignoring steps into function calls at this level.
Step one statement ignoring steps into function calls at this level. This is sometimes called
'step over' or 'step through'.

With an integer argument, perform ``next`` that many times. However if
an exception occurs at this level, or we *return*, *yield* or the
thread changes, we stop regardless of count.
With an integer argument, perform ``next`` that many times.

A suffix of ``+`` on the command or an alias to the command forces to
move to another line, while a suffix of ``-`` does the opposite and
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/running/skip.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. index:: skip
.. _skip:

Skip over statement (`skip`)
----------------------------
Skip over statement (``skip``)
------------------------------

**skip** [ *count* ]

Expand Down
8 changes: 4 additions & 4 deletions docs/commands/set/autoeval.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Auto-Evaluation of Unrecognized Debugger Commands (`set auto eval`)
Evaluate unrecognized debugger commands.

Often inside the debugger, one would like to be able to run arbitrary
zsh commands without having to preface expressions with
bash commands without having to preface expressions with
``print`` or ``eval``. Setting *autoeval* on will cause unrecognized
debugger commands to be *eval*'d as a zsh expression.
debugger commands to be *eval*'d as a bash expression.

Note that if this is set, on error the message shown on type a bad
debugger command changes from:
Expand All @@ -20,11 +20,11 @@ debugger command changes from:

Undefined command: "fdafds". Try "help".

to something more zsh-eval-specific such as:
to something more bash-eval-specific such as:

::

/tmp/zshdb_eval_26397:2: command not found: fdafds
/tmp/bashdb_eval_26397:2: command not found: fdafds


.. seealso::
Expand Down
Loading

0 comments on commit 61bcfd1

Please sign in to comment.