bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debian: bash --debugger doesn't start the debugger


From: Nicholas Bamber
Subject: Debian: bash --debugger doesn't start the debugger
Date: Mon, 12 Oct 2015 21:16:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0

My investigations indicate that it is still true that as per Debian bug report (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403304) --debugger does NOT start the debugger UNLESS the debugged script has a $1. For example

/bin/bash --debugger --  ~/scripts/ex1.sh

will just run the script but

/bin/bash --debugger --  ~/scripts/ex1.sh  XXX

will enter the debugger. To comment on the other prior information on the Debian bug report:

1. The upstream bashdb developer is correct that checking "strings `which bash` | grep bashdb" is a good test for whether bash will find bashdb-main.inc, but this is not relevant to Debian becase this is set correctly in Debian's case. 2. If you take an upstream tarball of bash and compile it then even the extra $1 will not make the debugger run under that bash, unless you link the upsteram location of '/usr/local/share/bashdb' to the Debian value of /usr/share/bashdb.

In other words the other commenters were correct but had not got to the root issue. The root issue is appears to be this line in shell.c in the bash code:

if (debugging_mode && locally_skip_execution == 0 && running_setuid == 0 && dollar_vars[1])
    start_debugger ();

I enclose a patch that I believe would address this, and suggest it is an upstream bash issue.

Attachment: bashdb_fix.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]