Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Trepan-Debuggers/bashdb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fd7e748fefff578c4b44d5bd2b0f55ecf69596b8
Choose a base ref
..
head repository: Trepan-Debuggers/bashdb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b80efe082581ec278a017ad76d27083958ba4119
Choose a head ref
65 changes: 65 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: 2.1
jobs:
build:
working_directory: ~/rocky/bashdb
parallelism: 1
shell: /bin/bash --login
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
docker:
- image: cimg/base:2024.01
steps:
# Machine Setup
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
- checkout
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
# In many cases you can simplify this from what is generated here.
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
# Checkout
# This would typically go in either a build or a build-and-test job when using workflows
# This is based on your 1.0 configuration file or project settings
- run: sudo apt -y update
- run: sudo apt -y install autoconf automake texinfo
- run: sh ./autogen.sh
# Dependencies
# This would typically go in either a build or a build-and-test job when using workflows
# Restore the dependency cache
- restore_cache:
keys:
# This branch if available
- v2-dependencies-{{ .Branch }}-
# Default branch if not
- v2-dependencies-master-
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
- v2-dependencies-
# Save dependency cache
- save_cache:
key: v2-dependencies-{{ .Branch }}-{{ epoch }}
paths:
# This is a broad list of cache paths to include many possible development environments
# You can probably delete some of these entries
- vendor/bundle
- ~/virtualenvs
- ~/.m2
- ~/.ivy2
- ~/.bundle
- ~/.go_workspace
- ~/.gradle
- ~/.cache/bower
# Test
# This would typically be a build job when using workflows, possibly combined with build
# This is based on your 1.0 configuration file or project settings
- run: CIRCLECI=1 make check
# Teardown
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
# Save test results
- store_test_results:
path: /tmp/circleci-test-results
# Save artifacts
- store_artifacts:
path: /tmp/circleci-artifacts
- store_artifacts:
path: /tmp/circleci-test-results
27 changes: 27 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "bashdb CI"
on:
push:

jobs:
linux:
name: "Linux"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Packages
shell: bash
run: |+
sudo apt -y update
sudo apt -y install autoconf automake texinfo
- name: Configure
shell: bash
run: sh ./autogen.sh

- name: Test
shell: bash
env:
VERBOSE: 1
run: make -e -j3 check
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Here we have a debugger (*the* debugger?) for Bash 3.0 and higher.
[![Build Status Circle](https://circleci.com/gh/rocky/bashdb.svg?&style=shield)](https://circleci.com/gh/rocky/bashdb)

The command syntax generally follows that of the
[zsh debugger ](https://github.com/rocky/zshdb) trepanning debuggers
and, more generally, GNU debugger *gdb*.
[![Packaging status](https://repology.org/badge/vertical-allrepos/zshdb.svg)](https://repology.org/project/zshdb/versions)

There are 3 ways to get into the debugger. If bash (with debugger
support enabled which is the default) is installed and the debugger
are *both* installed properly. Then:
Here, we have a debugger for Bash 5.2 and higher.

Other branches in this repository support earlier versions of Bash. For example, use branch 4.1 for Bash version 4.1.

The command syntax generally follows that of the [zsh debugger ](https://github.com/rocky/zshdb), trepanning debuggers and, more generally, GNU debugger *gdb*.

There are 3 ways to get into the debugger. If bash (with debugger support enabled which is the default) is installed and the debugger are *both* installed properly. Then:

```
bash --debugger -- bash-script-name script-arg1 script-arg2...
@@ -66,7 +68,5 @@ switch:
```

* [manual page](http://bashdb.sourceforge.net/bashdb-man.html)
* [tree-structured reference manual](http://www.rodericksmith.plus.com/outlines/manuals/bashdbOutline.html)
* [tree-structured reference manual](http://www.rodericksmith.plus.com/outlines/manuals/bashdbOutline.html)

See *INSTALL* for generic GNU configure installation instructions.
2 changes: 1 addition & 1 deletion acinclude.m4
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ dnl Allow choosing the package name to avoid clashes with
dnl bash if beeing installed side-by-side
AC_ARG_VAR(
ALT_PACKAGE_NAME,
AC_HELP_STRING([],[alternate packagename to use (default is "$1")])
AS_HELP_STRING([],[alternate packagename to use (default is "$1")])
)
if test -z "${ALT_PACKAGE_NAME}"; then
ALT_PACKAGE_NAME="$PACKAGE_NAME"
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script.

define(DEBUGGER, bashdb)
define(POSIXSHELL, bash)
define(OK_BASH_VERS, 5.1)
define(OK_BASH_VERS, 5.2)
define(relstatus, 1.1.2)

AC_INIT([bashdb],[OK_BASH_VERS-relstatus],[https://sourceforge.net/p/bashdb/bugs/new/])
28 changes: 14 additions & 14 deletions test/data/bug-loc.right
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
(bug-loc.sh:5):
5: dirname=${BASH_SOURCE%/*} # equivalent to dirname($0)
5: dirname=${BASH_SOURCE%/*} # equivalent to dirname($0)
+# Test to see that we read in files that mentioned in breakpoints
+# but we don't step into.
+step
+step
(bug-loc.sh:6):
6: source ${dirname}/library.sh
+step
6: source ${dirname}/library.sh
+step
(bug-loc.sh:7):
7: echo 'script line 7'
+step
7: echo 'script line 7'
+step
script line 7
(bug-loc.sh:8):
8: library-function
+step
8: library-function
+step
(library.sh:1):
1: library-function() {
+step
1: library-function() {
+step
(library.sh:2):
2: echo 'library line 2 in library-function'
+step
2:  echo 'library line 2 in library-function'
+step
library line 2 in library-function
(bug-loc.sh:11):
11: echo 'script line 11'
+quit
11: echo 'script line 11'
+quit
bashdb: That's all, folks...
2 changes: 0 additions & 2 deletions test/data/settrace.right
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
(settrace.sh:6):
6: _Dbg_debugger; :
+# Test set_trace call.
+where
->0 in file `settrace.sh' at line 6
2 changes: 1 addition & 1 deletion test/example/bug-loc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Bug is that file cache highlight isn't updated when when
# Bug is that file cache highlight isn't updated when
# it is already cached so it continues to refer to a line in the source'd file
# rather than file it was source'd from (here it is this file).
dirname=${BASH_SOURCE%/*} # equivalent to dirname($0)
2 changes: 1 addition & 1 deletion test/example/settrace.sh
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ else
cmdfile=${top_srcdir}/test/data/settrace.cmd
fi

source ${top_builddir}/bashdb-trace -q --no-init -L $top_srcdir -B -x $cmdfile
source ${top_builddir}/bashdb-trace -q --no-init --no-highlight -L $top_srcdir -B -x $cmdfile
typeset -i max=1
init
hanoi $max 'a' 'b' 'c'
16 changes: 15 additions & 1 deletion test/integration/test-bug-loc
Original file line number Diff line number Diff line change
@@ -10,7 +10,21 @@ debugged_script="$top_srcdir/test/example/bug-loc.sh"

if ( pygmentize --version || pygmentize -V ) 2>/dev/null 1>/dev/null ; then
run_debugger_opts="-B -q --no-init --highlight=light"
run_test_check $TEST_NAME $TEST_NAME $debugged_script
(cd $srcdir && run_debugger "$debugged_script" 2>&1 >"$TEST_FILE" </dev/null)

# We're removing highlighted lines because Pygments is often changing the highlighting
/usr/bin/grep -v -E "^[0-9]+:"$'\t' "$TEST_FILE" >"${TEST_FILTERED_FILE}"
/usr/bin/grep -v -E "^[0-9]+:"$'\t' "$RIGHT_FILE" >"${RIGHT_FILTERED_FILE}"

check_output "$TEST_FILTERED_FILE" "$RIGHT_FILTERED_FILE"
rc=$?
if ((0 == rc)) ; then
rm -f $TEST_FILTERED_FILE
rm -f $RIGHT_FILTERED_FILE
fi

# Return code tells testing mechanism whether passed or not.
exit $rc
else
exit 77
fi
3 changes: 2 additions & 1 deletion test/integration/test-settrace.in
Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@ debugged_script="$top_builddir/test/example/settrace.sh"

@GREP@ -v "run term-highlight. Setting forced off" $TEST_FILE | \
@GREP@ -v "Syntax highlight in source listings is off.$" | \
@SED@ -e "s:main(.*) called from file \`settrace.sh' at line 0:main() called from file \`settrace.sh' at line 0:" \
@SED@ -e "s:main(.*) called from file \`settrace.sh' at line 0:main() called from file \`settrace.sh' at line 0:" | \
tail -n +3 \
>${FILTERED_TEST_FILE}

check_output $FILTERED_TEST_FILE $RIGHT_FILE
3 changes: 3 additions & 0 deletions test/unit/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*~
/*.trs
/*.log
/Makefile
/Makefile.in
/require_me.sh
@@ -19,6 +21,7 @@
/test-io.sh
/test-lib-eval.sh
/test-lib-list.sh
/test-logging.sh
/test-msg.sh
/test-pre.sh
/test-require.sh
49 changes: 37 additions & 12 deletions test/unit/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
COMBINED_TESTS = $(wildcard test-*.sh)
tests_sources = $(notdir $(COMBINED_TESTS:=.in))

# Don't forget to add the *.in files of new tests to configure.ac in the root folder
TESTS = test-action.sh \
test-alias.sh \
test-bashdb-trace.sh \
test-break.sh \
test-cmd-complete.sh \
test-cmd-eval.sh \
test-cmd-info-variables.sh \
test-columns.sh \
test-filecache.sh \
test-file.sh \
test-fns.sh \
test-frame.sh \
test-get-sourceline.sh \
test-io.sh \
test-lib-eval.sh \
test-lib-list.sh \
test-logging.sh \
test-msg.sh \
test-pre.sh \
test-require.sh \
test-run.sh \
test-save-restore.sh \
test-sort.sh \
test-validate.sh

tests_sources = $(notdir $(TESTS:=.in))

abs_srcdir=@abs_srcdir@
abs_builddir=@abs_builddir@

TESTS_ENVIRONMENT = \
srcdir="$(abs_srcdir)" \
builddir="$(abs_builddir)"
AM_TESTS_ENVIRONMENT = \
srcdir="$(abs_srcdir)"; \
builddir="$(abs_builddir)"; \
export srcdir builddir;
LOG_COMPILER = $(SH_PROG)
AM_LOG_FLAGS = $(abs_srcdir)/shunit2 \
$(abs_srcdir)/helper.sh $(abs_srcdir)/mock-cmd.sh \
$(abs_srcdir)/require_me.sh

EXTRA_DIST = \
helper.sh \
mock-cmd.sh \
require_me.sh \
require_me.sh.in $(COMBINED_TESTS) shunit2 $(tests_sources)
require_me.sh.in $(TESTS) shunit2 $(tests_sources)

test: check
test-unit: check

check: $(COMBINED_TESTS)
$(SH_PROG) $(abs_srcdir)/shunit2 \
$(abs_srcdir)/helper.sh $(abs_srcdir)/mock-cmd.sh \
$(abs_srcdir)/require_me.sh \
$(COMBINED_TESTS)

MOSTLYCLEANFILES = *.orig *.rej
15 changes: 8 additions & 7 deletions test/unit/test-cmd-info-variables.sh.in
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@ test_cmd_info_variables()
fi
done

assertEquals "1" "$found"
assertEquals "0" "$too_permissive"
assertEquals "Filtering with -i must show integer variables" "1" "$found"
assertEquals "Filtering with -i must hide non-integer variables" "0" "$too_permissive"

found=0
too_permissive=0
@@ -27,16 +27,17 @@ test_cmd_info_variables()
fi
done

assertEquals "1" "$found"
assertEquals "0" "$too_permissive"
assertEquals "Filtering with -x must show exported variables" "1" "$found"
assertEquals "Filtering with -x must hide unexported variables" "0" "$too_permissive"
# FIXME try -x -i, and no options. try invalid opts
}

if [ '/src/external-vcs/sourceforge/bashdb' = '' ] ; then
echo "Something is wrong: abs_top_srcdir is not set."
abs_top_srcdir=@abs_top_srcdir@
if [ ! -d $abs_top_scrdir ] ; then
>&2 echo "Something is wrong in configuation: abs_top_srcdir is not set properly."
exit 1
fi
abs_top_srcdir=/src/external-vcs/sourceforge/bashdb

# Make sure $abs_top_src has a trailing slash
abs_top_srcdir=${abs_top_srcdir%%/}/
. ${abs_top_srcdir}test/unit/helper.sh