Recursively debugging using "debug" doesn't preserve cli args
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- bash
- Domain
- cli
Research direction
Reproduce the issue with the provided git hook setup and the recursive "debug" command. Start by tracing how the recursive bashdb invocation is built, then verify that --tty /dev/tty and --tty_in /dev/tty are preserved so /tmp/otherscript enters the debugger instead of quitting.
Written by the indexing model from the issue text.
Description
I was debugging a bash script whose stdin and stdout were not my tty (a git hook, to be precise), and passed --tty /dev/tty --tty_in /dev/tty which worked great to be able to debug that initial script.
However, that script ran some other scripts, and attempting to recursively step into those with the default "debug" command didn't work because that sub-invocation of bashdb didn't preserve the --tty and --tty_in arguments.
To reproduce the problem:
# Create a minimal git repo
git init myrepo
cd myrepo
touch foo ; git add foo ; git commit -m foo foo
# Set up the hook scripts:
cat <<EOF > .git/hooks/post-checkout
bashdb --tty /dev/tty --tty_in /dev/tty /tmp/somescript
EOF
chmod +x .git/hooks/post-checkout
echo "/tmp/otherscript" > /tmp/somescript
echo "echo end of somescript" >> /tmp/somescript
echo "echo in otherscript" > /tmp/otherscript
echo "echo another line" >> /tmp/otherscript
chmod +x /tmp/*script
git checkout HEAD # Trigger the hook
Then enter debug on the /tmp/otherscript line, and notice that you don't end up debugging it, the inner bashdb immediately quits with "That's all, folks..."
I'm guessing that many of the other cli args should be preserved to sub-bashdb invocations as well.
- Dominant language
- Shell
- Stars
- 98
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Trepan-Debuggers/bashdb
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Trepan-Debuggers/bashdb#63 · 4 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Trepan-Debuggers/bashdb#32 · 1 comment ·
All issues in Trepan-Debuggers/bashdb
Similar issues
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
catppuccin/kde#152 ·
-
update-request
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
msys2/MINGW-packages#32008 ·
Maintainers usually reply within 1 day
-
bot-found bug priority: P3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
madenvel/KalinkaPlayer#179 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100