Skip to content

Commit 30edf60

Browse files
authored
First batch of doc cleanups (#21)
* First batch of doc cleanups * zsh{,db} -> bash{,db} and other doc fixes * zsh{,db} -> bash{,db} and other doc fixes * Gratuituous change to get readthe docs to reread?
1 parent 2790544 commit 30edf60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2640
-4525
lines changed

.readthedocs.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.12"
12+
# You can also specify other tool versions:
13+
# nodejs: "20"
14+
# rust: "1.70"
15+
# golang: "1.20"
16+
17+
# Build documentation in the "docs/" directory with Sphinx
18+
sphinx:
19+
configuration: docs/conf.py
20+
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
21+
# builder: "dirhtml"
22+
# Fail on all warnings to avoid broken references
23+
# fail_on_warning: true
24+
25+
# Optionally build your docs in additional formats such as PDF and ePub
26+
# formats:
27+
# - pdf
28+
# - epub
29+
30+
# Optional but recommended, declare the Python requirements required
31+
# to build your documentation
32+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
33+
# python:
34+
# install:
35+
# - requirements: docs/requirements.txt
36+
#

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Build Status Circle](https://circleci.com/gh/rocky/bashdb.svg?&style=shield)](https://circleci.com/gh/rocky/bashdb)
22

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

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

command/break.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ See also:
3434
"tbreak" and "continue"'
3535

3636
_Dbg_help_add tbreak \
37-
'**tbreak* [*loc-spec*]
37+
'**tbreak** [ *location* ] [**if** *condition*]
3838
3939
Set a one-time breakpoint at *loc-spec*.
4040

command/condition.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- shell-script -*-
22
# condition.sh - gdb-like "condition" debugger command
33
#
4-
# Copyright (C) 2002-2006, 2008, 2009, 2011, 2016, 2019
4+
# Copyright (C) 2002-2006, 2008, 2009, 2011, 2016, 2019, 2024
55
# Rocky Bernstein rocky@gnu.org
66
#
77
# This program is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@ _Dbg_help_add condition \
2424
2525
Break only if *bash-cond* is true in breakpoint number *bp_number*.
2626
27-
*bp_number* is an integer and *cond* is an zsh expression to be evaluated whenever
27+
*bp_number* is an integer and *cond* is an bash expression to be evaluated whenever
2828
breakpoint *bp_number* is reached.
2929
3030
Examples:

command/next.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@
2424
# but the command is different.
2525

2626
_Dbg_help_add next \
27-
"**next** [*count*]
27+
"**next** [ **+** | **-** ] [ *count* ]
2828
29-
Single step an statement skipping functions. This is sometimes called
29+
Step one statement ignoring steps into function calls at this level. This is sometimes called
3030
'step over' or 'step through'.
3131
32-
If *count* is given, stepping occurs that many times before
33-
stopping. Otherwise *count* is one. *count* an be an arithmetic
34-
expression.
32+
With an integer argument, perform ``next`` that many times.
33+
34+
A suffix of ``+`` on the command or an alias to the command forces to
35+
move to another line, while a suffix of ``-`` does the opposite and
36+
disables the requiring a move to a new line. If no suffix is given,
37+
the debugger setting 'different-line' determines this behavior.
3538
3639
Functions and source'd files are not traced. This is in contrast to
3740
**step**.

command/skip.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# -*- shell-script -*-
22
# gdb-like "skip" (step over) commmand.
33
#
4-
# Copyright (C) 2010, 2011, 2017 Rocky Bernstein <rocky@gnu.org>
4+
# Copyright (C) 2010, 2011, 2017, 2024
5+
# Rocky Bernstein <rocky@gnu.org>
56
#
67
# This program is free software; you can redistribute it and/or
78
# modify it under the terms of the GNU General Public License as
@@ -45,7 +46,7 @@ See http://lists.gnu.org/archive/html/bug-bash/2017-04/msg00004.html
4546
See also:
4647
---------
4748
48-
**next** and **step**.
49+
**next**, **step**, and **continue**.
4950
"
5051

5152
_Dbg_do_skip() {

command/step.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- shell-script -*-
22
# step.sh - Debugger step ("step into") commmand.
33
#
4-
# Copyright (C) 2006, 2008, 2009, 2010, 2015
4+
# Copyright (C) 2006, 2008, 2009, 2010, 2015,
55
# 2024 Rocky Bernstein rocky@gnu.org
66
#
77
# This program is free software; you can redistribute it and/or
@@ -27,10 +27,9 @@
2727
typeset -i _Dbg_set_different=0
2828

2929
_Dbg_help_add step \
30-
"**step** [*count*]
31-
32-
Single step an statement. This is sometimes called 'step into'.
30+
"**step** [ **+** | **-** [ *count* ]]
3331
32+
Single step a statement. This is sometimes called 'step into'.
3433
3534
If *count* is given, stepping occurs that many times before
3635
stopping. Otherwise *count* is one. *count* an be an arithmetic
@@ -44,12 +43,19 @@ into.
4443
4544
If suffix \"-\" is added, the different line aspect of \"step+\" does not occur.
4645
47-
With no suffix is given, the behavior is dicted by the setting of **set force**.
46+
With no suffix is given, the behavior is dictated by the setting of **set different**.
47+
48+
Examples:
49+
---------
50+
51+
step # step 1
52+
step 1 # same as above
53+
step 5/5+0 # same as above
4854
4955
See also:
5056
---------
5157
52-
**next**, **skip**, and **set force**." 1
58+
**next**, **skip**, **continue**, and **set different**." 1
5359

5460

5561
# Step command

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*~
2+
/.python-version
3+
/_build

docs/Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Minimal makefile for Sphinx documentation
2+
# We use "remake" target comments
3+
#
4+
5+
# You can set these variables from the command line.
6+
SPHINXOPTS =
7+
SPHINXBUILD = python -msphinx
8+
SPHINXPROJ = bashdb
9+
SOURCEDIR = .
10+
BUILDDIR = _build
11+
12+
# Put "help" first so that "make" without argument is like "make help".
13+
#: Give sphinx build help
14+
help:
15+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
16+
17+
.PHONY: help docs all
18+
19+
# Catch-all target: route all unknown targets to Sphinx using the new
20+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
21+
%:
22+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
23+
24+
#: build HTML documentation; Set $O can be for $SPHINXOPTS
25+
all docs: Makefile
26+
$(MAKE) html

docs/commands.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Command Reference
2+
*****************
3+
4+
Following *gdb*, we classify commands into categories. Note though
5+
that some commands, like `quit`, and `restart`, are in different categories
6+
and some categories are new, like `set`, `show`, and `info`.
7+
8+
.. toctree::
9+
:maxdepth: 1
10+
11+
commands/breakpoints
12+
commands/data
13+
commands/files
14+
commands/info
15+
commands/running
16+
commands/set
17+
commands/stack
18+
commands/show
19+
commands/support

docs/commands/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Whatever it is you want to do, it should be handled by the
2+
# by the main (parent) Makefile. So reissue make from there.
3+
.PHONY: html
4+
5+
html:
6+
$(MAKE) -C .. $@
7+
8+
%: html
9+
$(MAKE) -C .. $@

docs/commands/breakpoints.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Breakpoints
2+
===========
3+
4+
Making the program stop at certain points
5+
6+
A *breakpoint* can make your program stop at that point. You can set
7+
breakpoints with the break command and its variants. You can specify
8+
the place where your program should stop by file and line number or by
9+
function name.
10+
11+
The debugger assigns a number to each breakpoint when you create it;
12+
these numbers are successive integers starting with 1. In many of the
13+
commands for controlling various features of breakpoints you use this
14+
number. Each breakpoint may be enabled or disabled; if disabled, it
15+
has no effect on your program until you enable it again.
16+
17+
The debugger allows you to set any number of breakpoints at the same
18+
place in your program. There is nothing unusual about this because
19+
different breakpoints can have different conditions associated with
20+
them.
21+
22+
The simplest sort of breakpoint breaks every time your program reaches
23+
a specified place. You can also specify a condition for a
24+
breakpoint. A condition is just a Boolean expression in your
25+
programming language. A breakpoint with a condition evaluates the
26+
expression each time your program reaches it, and your program stops
27+
only if the condition is true.
28+
29+
This is the converse of using assertions for program validation; in
30+
that situation, you want to stop when the assertion is violated-that
31+
is, when the condition is false.
32+
33+
Break conditions can have side effects, and may even call functions in
34+
your program. This can be useful, for example, to activate functions
35+
that log program progress, or to use your own print functions to
36+
format special data structures. The effects are completely predictable
37+
unless there is another enabled breakpoint at the same address. (In
38+
that case, pydb might see the other breakpoint first and stop your
39+
program without checking the condition of this one.) Note that
40+
breakpoint commands are usually more convenient and flexible than
41+
break conditions for the purpose of performing side effects when a
42+
breakpoint is reached.
43+
44+
Break conditions can be specified when a breakpoint is set, by adding
45+
a comma in the arguments to the break command. They can also be
46+
changed at any time with the :ref:`condition <condition>` command.
47+
48+
.. toctree::
49+
:maxdepth: 1
50+
51+
breakpoints/break
52+
breakpoints/condition
53+
breakpoints/delete
54+
breakpoints/disable
55+
breakpoints/enable
56+
breakpoints/tbreak

docs/commands/breakpoints/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Whatever it is you want to do, it should be handled by the
2+
# by the main (parent) Makefile. So reissue make from there.
3+
.PHONY: html
4+
5+
html:
6+
$(MAKE) -C ../.. $@
7+
8+
%: html
9+
$(MAKE) -C ../.. $@

docs/commands/breakpoints/break.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. index:: break
2+
.. _break:
3+
4+
Set a Breakpoint (break)
5+
------------------------
6+
7+
**break** [*loc-spec*]
8+
9+
Set a breakpoint at loc-spec.
10+
11+
If no location specification is given, use the current line.
12+
13+
Multiple breakpoints at one place are permitted, and useful if conditional.
14+
15+
Examples:
16+
+++++++++
17+
18+
::
19+
20+
break # Break where we are current stopped at
21+
break 10 # Break on line 10 of the file we are
22+
# currently stopped at
23+
break /etc/profile:10 # Break on line 45 of os.path
24+
25+
.. seealso::
26+
27+
:ref:`tbreak <tbreak>`, :ref:`condition <condition>`, :ref:`delete <delete>`, :ref:`disable <disable>` and :ref:`continue <continue>`.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. index:: condition
2+
.. _condition:
3+
4+
Add Condition to a Breakpoint (condition)
5+
-----------------------------------------
6+
7+
**condition** *bp_number* *condition*
8+
9+
*bp_number* is a breakpoint number. *condition* is a bash expression
10+
which must evaluate to *True* before the breakpoint is honored. If
11+
*condition* is absent, any existing condition is removed; i.e., the
12+
breakpoint is made unconditional.
13+
14+
Examples:
15+
+++++++++
16+
17+
::
18+
19+
condition 5 x > 10 # Breakpoint 5 now has condition x > 10
20+
condition 5 # Remove above condition
21+
22+
.. seealso::
23+
24+
:ref:`break <break>`, :ref:`tbreak <tbreak>`.

docs/commands/breakpoints/delete.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. index:: delete
2+
.. _delete:
3+
4+
Remove Breakpoints (delete)
5+
---------------------------
6+
7+
**delete** [*bpnumber* [*bpnumber*...]]
8+
9+
Delete some breakpoints.
10+
11+
Arguments are breakpoint numbers with spaces in between. To delete
12+
all breakpoints, give no argument. Without
13+
arguments, clear all breaks (but first ask confirmation).

docs/commands/breakpoints/disable.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. index:: disable
2+
.. _disable:
3+
4+
Disable breakpoints (disable)
5+
-----------------------------
6+
7+
**disable** *bpnumber* [*bpnumber* ...]
8+
9+
Disables the breakpoints given as a space separated list of breakpoint
10+
numbers. See also `info break` to get a list.
11+
12+
.. seealso::
13+
14+
:ref:`enable <enable>`

docs/commands/breakpoints/enable.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. index:: enable
2+
.. _enable:
3+
4+
Enable Breakpoints (enable)
5+
---------------------------
6+
7+
**enable** *bpnumber* [*bpnumber* ...]
8+
9+
Enables the breakpoints given as a space separated list of breakpoint
10+
numbers. See also `info break` to get a list.
11+
12+
.. seealso::
13+
14+
:ref:`disable <disable>`, :ref:`tbreak <tbreak>`

0 commit comments

Comments
 (0)