Comments (23)
Some changes that might help (updated):
bash-debug-0.2.2.vsix.zip
Please test via "install from vsix" option and give feedback:
from vscode-bash-debug.
Any help please? Still looking for a solution
from vscode-bash-debug.
Sorry for late response:
- why there is space between dots?
. ./file2.sh
- try :
source ./file2.sh
or
source ../file2.sh
depending the file location
from vscode-bash-debug.
Hi, thanks for answering. I'm really new to bash and I'm a bit lost with it. Anyway, the first "." of . ./file2.sh
is similar to source (I don't know the difference and source ./file2.sh
doesn't works neither). And I cannot replace because I have to maintain bash scripts of thousands lines that are using that "." not the example itself.
The thing is that . ./file2.sh
actually works but the debugger won't stop at break points leading me to dismiss the tool for working until the problem is solved.
from vscode-bash-debug.
You are correct, dot works as well...
Which version of bashdb/bash do you have? (I successfully tried on 4.4.0-94 and also build 91 + bash 4.4.19)
You could try installing newest bashdb:
#67
from vscode-bash-debug.
I'm using
bash: GNU bash, versión 4.4.19(1)-release (x86_64-pc-linux-gnu)
bashdb: bashdb, release 4.4-0.94
We're using the same or am I wrong?
from vscode-bash-debug.
Yes, we are using the same - this is interesting ...
Are you able to provide some snapshots + exact reproduction steps. Screen record would be ok as well. Can there be some issues with accessing the "sourced" file?
from vscode-bash-debug.
The steps are:
- Click 'Debug' -> 'Start Debugging'
- Press F5 (Continue)
- The script finishes and the result is printed:
As I allready said it stops at the first breakpoint placed at a1.sh line 3 (echo hello) but it doesn't at the second a2.sh line 3 (echo world).
I suppose that if there were problems accesing the file it wouldn't work with absolute path neither, maybe I'm wrong with that.
from vscode-bash-debug.
OK, so the reason is now obvious. When setting breakpoint source path when debugging, it does not accept paths with spaces nor slashes "-".
I am talking "load" and "break" commands from http://bashdb.sourceforge.net/bashdb.html.
Unfortunately wrapping path in " or ' or ` does not seem to help when i change code of extension... Need to investigate more...
Please use path without "-" to verify this finding.
Just to keep as evidence, the failing call in different flavours:
** Expecting one filename parameter, Got 3.
bashdb<24> load "/mnt/c/Users/[aaa]/Documents/src/vscode-bash debug/tes-t me/test.sh"
** Expecting one filename parameter, Got 3.
bashdb<25> load '/mnt/c/Users/[aaa]/Documents/src/vscode-bash debug/tes-t me/test.sh'
** Expecting one filename parameter, Got 3.
bashdb<26> load `/mnt/c/Users/[aaa]/Documents/src/vscode-bash debug/tes-t me/test.sh`
** Expecting one filename parameter, Got 3.
bashdb<27> load `/mnt/c/Users/[aaa]/Documents/src/vscode-bash\ debug/tes-t\ me/test.sh`
** Expecting one filename parameter, Got 3.
bashdb<28> load (/mnt/c/Users/[aaa]/Documents/src/vscode-bash debug/tes-t me/test.sh)
** Expecting one filename parameter, Got 3.
(https://sourceforge.net/p/bashdb/code/ci/release-4.4-0.94/tree/command/load.sh) (line 30)
bashdb<13> load "/mnt/c/Users/[aaa]/Documents/src/vscode-bash-debug/tes-tme/aaa.sh"
File loaded.
bashdb<14> info files
Source files which we have recorded info about:
/mnt/c/Users/[aaa]/Documents/src/vscode-bash-debug/tes-tme/test.sh: /mnt/c/Users/[aaa]/Documents/src/vscode-bash-debug/tes-tme/test.sh, 1 lines
bashdb<15> break /mnt/c/Users/[aaa]/Documents/src/vscode-bash-debug/tes-tme/aaa.sh:3
** File "" not found in read-in files.
** See 'info files' for a list of known files and
** 'load' to read in a file.
from vscode-bash-debug.
Issue reported:
https://sourceforge.net/p/bashdb/bugs/54/
from vscode-bash-debug.
I've changed the path name from "/home/adrian/test-shell" to "/home/adrian/testshell" and still having the same issue, it stops at the first break point but ignores the second.
There must be something else.
from vscode-bash-debug.
Please attach debug console output, when launch.json configuration has :
"showDebugOutput": true,
from vscode-bash-debug.
This is the console output:
(/home/adrian/testshell/a1.sh:3):
3: echo hello
21518
############################################################
delete <>
** Undefined command "yes". Try "help".
File /home/adrian/testshell/a1.sh loaded.
</home/adrian/testshell/a1.sh:3>
Breakpoint 1 set in file /home/adrian/testshell/a1.sh, line 3.
</home/adrian/testshell/a1.sh:5>
Breakpoint 2 set in file /home/adrian/testshell/a1.sh, line 5.
############################################################
delete <>
** Undefined command "yes". Try "help".
File /home/adrian/testshell/a2.sh loaded.
</home/adrian/testshell/a2.sh:3>
Breakpoint 3 set in file /home/adrian/testshell/a2.sh, line 3.
############################################################
backtrace
->0 in file /home/adrian/testshell/a1.sh' at line 3 ##1 source("/home/adrian/testshell/a1.sh") called from file
/usr/bin/bashdb' at line 99
##2 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-11391", "--", "/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 0 ############################################################ backtrace ->0 in file
/home/adrian/testshell/a1.sh' at line 3
##1 source("/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 99 ##2 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-11391", "--", "/home/adrian/testshell/a1.sh") called from file
/usr/bin/bashdb' at line 0
############################################################
Program stopped.
It stopped after being stepped.
Next statement to be run is:
echo hello
<$PWD>
/home/adrian/testshell
<$EUID>
1000
<$#>
1
<$0>
/usr/bin/bashdb
<$->
hBET
############################################################
continue
hello
Breakpoint 2 hit (1 times).
(/home/adrian/testshell/a1.sh:5):
5: . ./a2.sh
############################################################
backtrace
->0 in file /home/adrian/testshell/a1.sh' at line 5 ##1 source("/home/adrian/testshell/a1.sh") called from file
/usr/bin/bashdb' at line 99
##2 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-11391", "--", "/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 0 ############################################################ backtrace ->0 in file
/home/adrian/testshell/a1.sh' at line 5
##1 source("/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 99 ##2 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-11391", "--", "/home/adrian/testshell/a1.sh") called from file
/usr/bin/bashdb' at line 0
############################################################
continue
Breakpoint 3 hit (1 times).
(/home/adrian/testshell/a2.sh:3):
3: echo 'world'
############################################################
backtrace
->0 in file ./a2.sh' at line 3 ##1 source("./a2.sh") called from file
/home/adrian/testshell/a1.sh' at line 5
##2 source("/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 99 ##3 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-11391", "--", "/home/adrian/testshell/a1.sh") called from file
/usr/bin/bashdb' at line 0
############################################################
backtrace
->0 in file ./a2.sh' at line 3 ##1 source("./a2.sh") called from file
/home/adrian/testshell/a1.sh' at line 5
##2 source("/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 99 ##3 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-11391", "--", "/home/adrian/testshell/a1.sh") called from file
/usr/bin/bashdb' at line 0
############################################################
Program stopped.
It stopped at breakpoint 3.
Next statement to be run is:
echo 'world'
<$PWD>
/home/adrian/testshell
<$EUID>
1000
<$#>
1
<$0>
/usr/bin/bashdb
<$->
hBET
############################################################
continue
world
Debugged program terminated normally. Use q to quit or R to restart.
bash: línea 18: 21520 Terminado (killed) "cat" "/tmp/vscode-bash-debug-fifo-11391" 1>&3 (dir ahora: ~)
bash: línea 18: 21521 Terminado (killed) "cat"
21522 | "bashdb" --quiet --tty "/tmp/vscode-bash-debug-fifo-11391" -- "/home/adrian/testshell/a1.sh"
from vscode-bash-debug.
Hmm, this is weird. Bashdb actually stops, and "continue" is sent by debugger:
Breakpoint 3 hit (1 times).
(/home/adrian/testshell/a2.sh:3):
3: echo 'world'
############################################################
backtrace
->0 in file ./a2.sh' at line 3 ##1 source("./a2.sh") called from file/home/adrian/testshell/a1.sh' at line 5
##2 source("/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 99 ##3 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-11391", "--", "/home/adrian/testshell/a1.sh") called from file/usr/bin/bashdb' at line 0
############################################################
backtrace
->0 in file ./a2.sh' at line 3 ##1 source("./a2.sh") called from file/home/adrian/testshell/a1.sh' at line 5
##2 source("/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 99 ##3 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-11391", "--", "/home/adrian/testshell/a1.sh") called from file/usr/bin/bashdb' at line 0
############################################################
Program stopped.
It stopped at breakpoint 3.
Can you see callstack when debugger stops and console shows:
->0 in file ./a2.sh' at line 3
?
from vscode-bash-debug.
Yes, I've noticed that bashdb actually stops at the breakpoint and it seems that vs-code sends a "continue" instruction even if I'm running the option "Debug step by step".
Here's the callstack output:
->0 in file ./a2.sh' at line 3 (Unknown origin:3) ##1 source("./a2.sh") called from file
/home/adrian/testshell/a1.sh' at line 5 (/home/adrian/testshell/a1.sh:5)
##2 source("/home/adrian/testshell/a1.sh") called from file /usr/bin/bashdb' at line 99 (/usr/bin/bashdb:99) ##3 main("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-13145", "--", "/home/adrian/testshell/a1.sh") called from file
/usr/bin/bashdb' at line 0 (/usr/bin/bashdb:0)
I'm wondering... could it be an error with using $0 internally?
I got these vars at the watch list:
$PWD=/home/adrian/testshell
$0=/usr/bin/bashdb
from vscode-bash-debug.
I am a bit confused, since continue can only be sent by vscode to extension, there is no other path for that.
So it seems that vscode calls the extension's callback containing "continue" by itself, without any user action?
Are you using mouse to click the debugger buttons or "F5"/"F10"/"F11" ?
from vscode-bash-debug.
I'm using F5 most of the time or the "play like" arrow:
Anyway, every time I'm testing, I try every button or F* key.
from vscode-bash-debug.
What is the platform/system and VS code version?
I mean everything looks ok from debug session point of view, so we need to look for problem higher in stack...
from vscode-bash-debug.
SO: Ubuntu 18.04.1 LTS
VScode: 1.26.1
If you need any other info let me know :)
from vscode-bash-debug.
I installed Ubuntu on VM, i think i am able to reproduce the problem:
Notice that the uppermost element in callstack is grayed out, which means that relative path './a2.sh' is not working in linux. Seems that vscode working dir is different on linux. I will try to find a solution, possibly try to recover full path.
from vscode-bash-debug.
Preparing for release, here is test version:
https://github.com/rogalmic/vscode-bash-debug/releases/download/untagged-eccd51e3096d87c7b498/bash-debug-0.2.2.vsix
from vscode-bash-debug.
Some changes that might help (updated):
bash-debug-0.2.2.vsix.zipPlease test via "install from vsix" option and give feedback:
Sorry for the late reply, I've been on a trip and had no time. The vsix is working like a miracle!
Really... really thank you a lot for all your help and patience rogalmic.
from vscode-bash-debug.
I should thank you for patience :). Anyway, now the changes are released.
For spaces to work in script path, bashdb upgrade will be needed, after it's next release (those scripts can also be updated manually with code fixes in /usr/share/bashdb/* ).
from vscode-bash-debug.
Related Issues (20)
- No Debug Terminal appears when starting debug HOT 2
- Cryptographic Failure via escaped character
- Add variables to "VARIABLES" panel automatically. HOT 10
- Wrong command passed to wsl integrated terminal HOT 2
- TypeError: Cannot read properties of undefined (reading 'on') HOT 4
- Debugger times out while the Bash shell is still going through the initialization HOT 1
- Extension appears to be missing `npm-which`? HOT 1
- cwd does not exist error when attempting to launch debugger HOT 1
- debugger stops when a file is sourced and never returns
- Every time a script has a "read" command the debugger got stuck and nothing is displayed in the debug console HOT 2
- BASH_REMATCH fails
- "Stop Debugger" crashes VSCode irrespective of program being debugged
- Debugger does not stop at breakpoints when relative path to script contains spaces
- examine.sh: line 71: typeset: $var0: not found HOT 1
- When starting debugger, debug console shows "stty: standard input: Inappropriate ioctl for device" HOT 2
- Bashdb doesn't stop in breakpoints in VSCode when using WSL Ubuntu in Windows HOT 3
- setting text variables ending with numeral fails
- Passing empty arguments in launch config don't get recognized
- Support hierarchical display of array values
- 🦄
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-bash-debug.