I am running bashdb 3.1.0.8 and bash 3.2. When I do
bash --debugger -c 'echo hello; hello world'
I see the command is run to completion without stopping.
I tested "bash --debug script" on a bash script and the same thing happened (the script ran to the end without stopping), while running "bashdb myscript" I got the expected behavior: bashdb stops at the first line waiting for my input. How do I get the same behavior using bash --debug? My script uses $0 so that is why I prefer to use bash --debugger. thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The most likely cause of the problem is that
bash can't find the debugger files. To see if this is what is happening.
See where bash thinks the debugger file is located:
I am running bashdb 3.1.0.8 and bash 3.2. When I do
bash --debugger -c 'echo hello; hello world'
I see the command is run to completion without stopping.
I tested "bash --debug script" on a bash script and the same thing happened (the script ran to the end without stopping), while running "bashdb myscript" I got the expected behavior: bashdb stops at the first line waiting for my input. How do I get the same behavior using bash --debug? My script uses $0 so that is why I prefer to use bash --debugger. thanks.
The most likely cause of the problem is that
bash can't find the debugger files. To see if this is what is happening.
See where bash thinks the debugger file is located:
$ strings /bin/bash | grep bashdb-main.inc
/usr/local/share/bashdb/bashdb-main.inc
Then make sure that file (usually a symbolic link) is pointing to the
right place:
$ head /usr/local/share/bashdb/bashdb-main.inc
bashdb is a bit fragile. I tried the form
bash --debugger -c ...
in current CVS sources and that is broken. But giving a script
shouldn't be. It will probably be fixed by the next release.
The next release will also have a routine to set $0 via a built-in
command. So that should give another way to deal with this.
Just tried the commands you suggested:
$ strings /bin/bash | grep bashdb-main.inc
/usr/local/share/bashdb/bashdb-main.inc
$ ls -l /usr/local/share/bashdb
ls: cannot access /usr/local/share/bashdb: No such file or directory
So it seems like the that is the cause of the problem. Then I found this page
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403304
I followed the suggestion but with minor modifications:
mkdir /usr/loca/share/bashdb
ln -s /usr/share/bashdb/dbg-main.inc /usr/local/share/bashdb/bashdb-main.inc
and the problem was solved.
Thanks for your help!