rogalmic / vscode-bash-debug Goto Github PK
View Code? Open in Web Editor NEWBash shell debugger extension for VSCode (based on bashdb)
License: MIT License
Bash shell debugger extension for VSCode (based on bashdb)
License: MIT License
Hallo,
I have noticed that when I add a Variable to the Watch Window the Debugger is not able to resolve this Variable when I restart the Debugger and the Debugging will not be started.
My concrete use case:
1.) Start Debugger
2.) Add Variable to Watch Window -> no problem, variable value will be resolved
3.) continue debugging (some steps)
4.) restart the debugger -> debugger can't resolve variable and does not start debugging
In the Watch window appears the following error message:
TypeError: Cannot read property 'stdin' of undefined
at BashDebugSession.evaluateRequest (/home/brosche/.vscode/extensions/rogalmic.bash-debug-0.0.5/out/bashDebug.js:319:29)
at BashDebugSession.DebugSession.dispatchRequest (/home/brosche/.vscode/extensions/rogalmic.bash-debug-0.0.5/node_modules/vscode-debugadapter/lib/debugSession.js:424:22)
at BashDebugSession.ProtocolServer._handleData (/home/brosche/.vscode/extensions/rogalmic.bash-debug-0.0.5/node_modules/vscode-debugadapter/lib/protocol.js:104:38)
at Socket.<anonymous> (/home/brosche/.vscode/extensions/rogalmic.bash-debug-0.0.5/node_modules/vscode-debugadapter/lib/protocol.js:24:60)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:543:20)
OS: MAC OSX 10.12.6
vs code version: Version 1.17.2 (1.17.2)
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Bash-Debug (select script from list of sh files)",
"type": "bashdb",
"request": "launch",
"scriptPath": "${command:SelectScriptName}",
"commandLineArguments": "",
"windows": {
"bashPath": "C:\\Windows\\sysnative\\bash.exe"
},
"linux": {
"bashPath": "bash"
},
"osx": {
"bashPath": "bash"
}
}
]
}
Script used
#!/usr/bin/env bash
export NICE_VAR=10
export ANOTHER_VAR=20
for i in {0..25..5}
do
export NICE_VAR=$((NICE_VAR + i))
echo $NICE_VAR
done
for ((i=1;i<=25;i+=1))
do
export ANOTHER_VAR=$((ANOTHER_VAR+i))
echo $ANOTHER_VAR
done
if [ $ANOTHER_VAR -gt $NICE_VAR ]
then
echo "ANOTHER bigger than nice"
else
echo "Nice is bigger or equal"
fi
Steps to reproduce.
Script with errors
#!/usr/bin/env bash
export NICE_VAR=10
expor ANOTHER_VAR=20
for i {0..25..5}
do
export NICE_VAR=$((NICE_VAR + i))
echo $NICE_VAR
done
for i in {0..25..5}
do
export NICE_VAR=$((NICE_VAR + i))
echo $NICE_VAR
done
for ((i=1;i<=25;i+=1))
do
export ANOTHER_VAR=$((ANOTHER_VAR+i))
echo $ANOTHER_VAR
done
if [ $ANOTHER_VAR -gt $NICE_VAR ]
then
echo "ANOTHER bigger than nice"
else
echo "Nice is bigger or equal"
fi
I can not install the application on code-server
https://github.com/cdr/code-server
During installation, the error "Unable to install because, the extension 'rogalmic.bash-debug' compatible with current version '1.33.1' of VS Code is not found."
Version of bash-debug: 0.3.3
c:\> where bash
C:\Windows\System32\bash.exe
# executed from msys2 bash:
c:\> c:\msys64\msys2_shell.cmd -mingw64 -defterm -here -no-start
$ where bash
C:\msys64\usr\bin\bash.exe
C:\Windows\System32\bash.exe
c:\> code --version
1.30.1
dea8705087adb1b5e5ae1d9123278e178656186a
x64
# executed from msys2 bash:
c:\> c:\msys64\msys2_shell.cmd -mingw64 -defterm -here -no-start
$ bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --
version; done'
MINGW64_NT-10.0 superputte 2.11.1(0.329/5/3) 2018-09-10 14:19 x86_64 Msys
---
/usr/bin/bash
/bin/bash
/c/Windows/System32/bash
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
---
which: no bashdb in (/home/henrik/usr/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
bash: bashdb: command not found
---
/usr/bin/cat
/bin/cat
cat (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund and Richard M. Stallman.
---
/usr/bin/mkfifo
/bin/mkfifo
mkfifo (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
---
/usr/bin/pkill
/bin/pkill
pkill from procps-ng 3.3.12
N/A
Is it possible to use msys2 bash as an alternative to wsl.exe? wsl (ubuntu 18.04) works fine but I would like to debug some scripts under msys2.
Hi,
When I click debug, I expect the debugger to stop at my breakpoint like other IDEs.
I noticed that I need to write something in launch.json to run my debugging session.
What is the correct syntax that I should write in launch.json to debug my file?
Regards,
I get this error:
Bash Debug: 0.3.5
Configurations in launch.json
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (type in script name)",
"cwd": "${workspaceFolder}",
"program": "${command:AskForScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (select script from list of sh files)",
"cwd": "${workspaceFolder}",
"program": "${command:SelectScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (hardcoded script name)",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/path/to/script.sh",
"args": []
},
settings.json
{
"python.pythonPath": "C:\\ProgramData\\Anaconda3\\python.exe",
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
}
Issue Type: Bug
Installed Bash debug as per instructions and the scrolling blue bar nver stops rolling and I get no co controll of the code.
Extension version: 0.3.4
VS Code version: Code 1.33.1 (51b0b28134d51361cf996d2f0a1c698247aeabd8, 2019-04-11T08:20:22.771Z)
OS version: Linux x64 3.10.0-957.10.1.el7.x86_64
Item | Value |
---|---|
CPUs | Intel(R) Xeon(R) CPU E7-8890 v3 @ 2.50GHz (32 x 2493) |
GPU Status | 2d_canvas: disabled_software checker_imaging: disabled_off flash_3d: disabled_software flash_stage3d: disabled_software flash_stage3d_baseline: disabled_software gpu_compositing: disabled_software multiple_raster_threads: disabled_off native_gpu_memory_buffers: disabled_software rasterization: disabled_software surface_synchronization: disabled_off video_decode: disabled_software webgl: disabled_off webgl2: disabled_off |
Load (avg) | 1, 1, 1 |
Memory (System) | 30.49GB (9.33GB free) |
Process Argv | |
Screen Reader | no |
VM | 0% |
OS: Mac OS X 10.13.6
Bash version: GNU bash, version 4.4.23(1)-release (x86_64-apple-darwin17.5.0)
bashdb 4.4-0.94
FAIL: test-bug-set-e
bashdb: cannot read program to debug: /Users/dcooper/Downloads/bashdb-4.4-0.94/test/example/bug-set-e.sh.
--- /Users/dcooper/Downloads/bashdb-4.4-0.94/test/integration/bug-set-e.check 2018-08-10 10:40:36.000000000 -0500
+++ /Users/dcooper/Downloads/bashdb-4.4-0.94/test/data/bug-set-e.right 2017-07-31 23:43:16.000000000 -0500
@@ -1 +1,18 @@
-INVESTIGATE EXIT FAILURE: [1 => exit (1)]
+(bug-set-e.sh:2):
+2: x=1
++# Debugger test to see that set -e is respected and we can step through it
++step
+(bug-set-e.sh:4):
+4: set -e
++step
+(bug-set-e.sh:6):
+6: echo hi
++step
+hi
+(bug-set-e.sh:7):
+7: (( 1 / 0))
++step
+(bug-set-e.sh:1):
+1: #!/bin/bash
++quit
+bashdb: That's all, folks...
FAIL test-bug-set-e (exit status: 1)
Running on MacOS, receive stty: stdin isn't a terminal
❯ bashdb --version
bashdb, release 4.4-0.94
where bash
# if `code` not found on macOS, follow the instructions in:
# https://code.visualstudio.com/docs/setup/mac
code --version
bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
❯ ci --version
1.24.0-insider
92754223624dcbe9aca0e5ca3ba8a53808b122b6
x64
Paste here outputs in DEBUG CONSOLE (ctrl+shift+D or command+shift+D) with "showDebugOutput": true
and "trace": true
in launch.json
.
Your launch.json
may looks like:
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (select script from list of sh files)",
"cwd": "${workspaceFolder}",
"program": "${command:SelectScriptName}",
"args": []
},
Hi, I'm having an issue with vscode-bash-debug, maybe it's just a matter of misconfiguration but I don't know were to go and I'll appreciate help. Having the following scripts:
#file1.sh
#!/bin/bash
echo 'hello'
. ./file2.sh
#file2.sh
#!/bin/bash
echo 'world'
The debugger isn't able to debug file2.sh. But changing '. ./file2.sh' to '/absolute/path/file2.sh' works fine.
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (hardcoded script name)",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/file1.sh",
"showDebugOutput": true,
"trace": true,
"args": []
}
]
}
Seems that bashdb is missing from 18.04 repo.
Best way to workaround is to compile newest bashdb 4.4-0.94.
wget https://netix.dl.sourceforge.net/project/bashdb/bashdb/4.4-0.94/bashdb-4.4-0.94.tar.gz
tar -xvfz bashdb-*.tar.gz
cd bashdb-*
./configure
make
sudo make install
I get a popup that says:
"Debug adapter process has terminated unexpectedly"
The debug console also says:
"bash: line 17: bashdb: command not found"
I've reproduced this error on Ubuntu 14 and 16 using VS Code 1.7.1 and 1.7.2.
CHANGELOG.md @ tag/v0.1.0 reads "Bugfix release v0.0.8".
Perhaps it causes contradictive information in the installation window of Bash Debug ("0.0.8" is "Bugfix release v0.1.0").
In addition to the details for issue, please provide us Executables information and Debug output unless you have confidence that they don't help us.
Version of bash-debug: 0.2.3 by @rogalmic on #83
Output of following commands (on windows, execute them in Command Prompt or PowerShell):
$ which bash
/bin/bash
# if `code` not found on macOS, follow the instructions in:
# https://code.visualstudio.com/docs/setup/mac
$ code --version
1.26.1
493869ee8e8a846b0855873886fc79d480d342de
x64
$ bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
Linux hostname 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 19:00:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
---
/bin/bash
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
---
bash: bashdb: command not found
---
/bin/cat
cat (GNU coreutils) 8.28
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund and Richard M. Stallman.
---
/usr/bin/mkfifo
mkfifo (GNU coreutils) 8.28
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
---
/usr/bin/pkill
pkill from procps-ng 3.3.12
Paste here outputs in DEBUG CONSOLE (ctrl+shift+D or command+shift+D) with "showDebugOutput": true
and "trace": true
in launch.json
.
Your launch.json
may looks like:
{
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash Debug",
"program": "${workspaceFolder}/src/foo.sh",
"showDebugOutput": true,
"trace": true
}
]
}
@rogalmic I installed the build you published in #83 and I ran into a couple of issues. I didn't want to add them to the PR in the event I'm doing something wrong.
I'm unable to see any local variables when debugging a script. Nearly any script will do:
#!/bin/bash
foo="BAR"
echo "${foo}"
Results in only 2 local variables:
$PWD: /home/some/path
$? #_Dbg_last_bash_command: 0 # foo="BAR"
I never see $foo
in this list.
Debug Output:
19:02:44 PM, 9/4/2018
From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"bashdb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConditionalBreakpoints":false,"supportsConfigurationDoneRequest":false,"supportsEvaluateForHovers":true,"supportsStepBack":false,"supportsSetVariable":false}}
From client: launch({"type":"bashdb","request":"launch","name":"Bash-Debug (simplest configuration)","program":"/home/some/path/test.sh","showDebugOutput":true,"trace":true,"args":[],"cwd":"/home/some/path","pathBash":"bash","pathBashdb":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","pathBashdbLib":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir","pathCat":"cat","pathMkfifo":"mkfifo","pathPkill":"pkill","__sessionId":"495df958-5936-4d7f-a660-97fd46fc00aa"})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(/home/some/path/test.sh:2):\n2:\tfoo=\"BAR\"\n"}}
(/home/some/path/test.sh:2):
2: foo="BAR"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Debug environment: bash_ver=4.4.19(1)-release, bashdb_ver=4.4-0.94-mod, program=/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb, args=\n"}}
Debug environment: bash_ver=4.4.19(1)-release, bashdb_ver=4.4-0.94-mod, program=/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb, args=
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"7428\n"}}
7428
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
To client: {"seq":0,"type":"response","request_seq":2,"command":"launch","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Sending InitializedEvent"}}
To client: {"seq":0,"type":"event","event":"initialized"}
From client: setBreakpoints({"source":{"name":"test.sh","path":"/home/some/path/test.sh"},"lines":[2],"breakpoints":[{"line":2}],"sourceModified":false})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Sending StoppedEvent"}}
To client: {"seq":0,"type":"event","event":"stopped","body":{"reason":"break","threadId":42}}
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":4,"command":"threads","success":true,"body":{"threads":[{"id":42,"name":"Bash thread"}]}}
From client: stackTrace({"threadId":42,"startFrame":0,"levels":20})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"File /home/some/path/test.sh loaded.\n"}}
File /home/some/path/test.sh loaded.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"break </home/some/path/test.sh:2> \n"}}
break </home/some/path/test.sh:2>
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Breakpoint 1 set in file /home/some/path/test.sh, line 2.\n"}}
Breakpoint 1 set in file /home/some/path/test.sh, line 2.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Source files which we have recorded info about:\n"}}
Source files which we have recorded info about:
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":" /home/some/path/test.sh: /home/some/path/test.sh, 3 lines\n"}}
/home/some/path/test.sh: /home/some/path/test.sh, 3 lines
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"\u001b[1mNum Type Disp Enb What\u001b[0m\n"}}
Num Type Disp Enb What
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"1 breakpoint keep y /home/some/path/test.sh:2"}}
1 breakpoint keep y /home/some/path/test.sh:2
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"\n"}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
To client: {"seq":0,"type":"response","request_seq":3,"command":"setBreakpoints","success":true,"body":{"breakpoints":[]}}
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":6,"command":"threads","success":true,"body":{"threads":[{"id":42,"name":"Bash thread"}]}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"backtrace\n"}}
backtrace
From client: stackTrace({"threadId":42,"startFrame":0,"levels":20})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"->0 in file `/home/some/path/test.sh' at line 2\n"}}
->0 in file `/home/some/path/test.sh' at line 2
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"##1 source"}}
##1 source
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(\"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100\n"}}
("/home/some/path/test.sh") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"##2 main"}}
##2 main
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-12679\", \"--library\", \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\", \"--\", \"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0\n"}}
("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-12679", "--library", "/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir", "--", "/home/some/path/test.sh") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Execution breaks at '->0 in file `/home/some/path/test.sh' at line 2'\n"}}
To client: {"seq":0,"type":"response","request_seq":5,"command":"stackTrace","success":true,"body":{"stackFrames":[{"id":0,"source":{"name":"test.sh","path":"/home/some/path/test.sh","sourceReference":0,"adapterData":"bash-adapter-data"},"line":2,"column":0,"name":"->0 in file `/home/some/path/test.sh' at line 2"},{"id":1,"source":{"name":"bashdb","path":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":100,"column":0,"name":"##1 source(\"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100"},{"id":2,"source":{"name":"bashdb","path":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":0,"column":0,"name":"##2 main(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-12679\", \"--library\", \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\", \"--\", \"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0"}],"totalFrames":4}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"backtrace\n"}}
backtrace
From client: scopes({"frameId":0})
To client: {"seq":0,"type":"response","request_seq":8,"command":"scopes","success":true,"body":{"scopes":[{"name":"Local","variablesReference":19,"expensive":false}]}}
From client: variables({"variablesReference":19})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"->0 in file `/home/some/path/test.sh' at line 2\n"}}
->0 in file `/home/some/path/test.sh' at line 2
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"##1 source"}}
##1 source
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(\"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100\n"}}
("/home/some/path/test.sh") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"##2 main"}}
##2 main
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-12679\", \"--library\", \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\", \"--\", \"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0\n"}}
("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-12679", "--library", "/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir", "--", "/home/some/path/test.sh") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Execution breaks at '->0 in file `/home/some/path/test.sh' at line 2'\n"}}
To client: {"seq":0,"type":"response","request_seq":7,"command":"stackTrace","success":true,"body":{"stackFrames":[{"id":0,"source":{"name":"test.sh","path":"/home/some/path/test.sh","sourceReference":0,"adapterData":"bash-adapter-data"},"line":2,"column":0,"name":"->0 in file `/home/some/path/test.sh' at line 2"},{"id":1,"source":{"name":"bashdb","path":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":100,"column":0,"name":"##1 source(\"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100"},{"id":2,"source":{"name":"bashdb","path":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":0,"column":0,"name":"##2 main(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-12679\", \"--library\", \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\", \"--\", \"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0"}],"totalFrames":4}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Program stopped.\n"}}
Program stopped.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"It stopped after being stepped.\nNext statement to be run is:\n\tfoo=\"BAR\"\n"}}
It stopped after being stepped.
Next statement to be run is:
foo="BAR"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":" <$PWD> \n"}}
<$PWD>
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"/home/some/path\n"}}
/home/some/path
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":" <$? # $_Dbg_last_bash_command> \n"}}
<$? # $_Dbg_last_bash_command>
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"0 # . \"$_Dbg_script_file\"\n"}}
0 # . "$_Dbg_script_file"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
To client: {"seq":0,"type":"response","request_seq":9,"command":"variables","success":true,"body":{"variables":[{"name":"$PWD","type":"string","value":"/home/some/path","variablesReference":0},{"name":"$? # $_Dbg_last_bash_command","type":"string","value":"0 # . \"$_Dbg_script_file\"","variablesReference":0}]}}
From client: stepIn({"threadId":42})
To client: {"seq":0,"type":"response","request_seq":10,"command":"stepIn","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"step\n"}}
step
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(/home/some/path/test.sh:3):\n3:\techo \"${foo}\"\n"}}
(/home/some/path/test.sh:3):
3: echo "${foo}"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Sending StoppedEvent"}}
To client: {"seq":0,"type":"event","event":"stopped","body":{"reason":"break","threadId":42}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":11,"command":"threads","success":true,"body":{"threads":[{"id":42,"name":"Bash thread"}]}}
From client: stackTrace({"threadId":42,"startFrame":0,"levels":20})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"backtrace\n"}}
backtrace
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"->0 in file `/home/some/path/test.sh' at line 3\n"}}
->0 in file `/home/some/path/test.sh' at line 3
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"##1 source"}}
##1 source
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(\"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100\n"}}
("/home/some/path/test.sh") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"##2 main"}}
##2 main
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-12679\", \"--library\", \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\", \"--\", \"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0\n"}}
("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-12679", "--library", "/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir", "--", "/home/some/path/test.sh") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0
From client: stackTrace({"threadId":42,"startFrame":0,"levels":20})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Execution breaks at '->0 in file `/home/some/path/test.sh' at line 3'\n"}}
To client: {"seq":0,"type":"response","request_seq":12,"command":"stackTrace","success":true,"body":{"stackFrames":[{"id":0,"source":{"name":"test.sh","path":"/home/some/path/test.sh","sourceReference":0,"adapterData":"bash-adapter-data"},"line":3,"column":0,"name":"->0 in file `/home/some/path/test.sh' at line 3"},{"id":1,"source":{"name":"bashdb","path":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":100,"column":0,"name":"##1 source(\"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100"},{"id":2,"source":{"name":"bashdb","path":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":0,"column":0,"name":"##2 main(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-12679\", \"--library\", \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\", \"--\", \"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0"}],"totalFrames":4}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"backtrace\n"}}
backtrace
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"->0 in file `/home/some/path/test.sh' at line 3\n"}}
->0 in file `/home/some/path/test.sh' at line 3
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"##1 source"}}
##1 source
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(\"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100\n"}}
("/home/some/path/test.sh") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"##2 main"}}
##2 main
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-12679\", \"--library\", \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\", \"--\", \"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0\n"}}
("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-12679", "--library", "/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir", "--", "/home/some/path/test.sh") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Execution breaks at '->0 in file `/home/some/path/test.sh' at line 3'\n"}}
To client: {"seq":0,"type":"response","request_seq":13,"command":"stackTrace","success":true,"body":{"stackFrames":[{"id":0,"source":{"name":"test.sh","path":"/home/some/path/test.sh","sourceReference":0,"adapterData":"bash-adapter-data"},"line":3,"column":0,"name":"->0 in file `/home/some/path/test.sh' at line 3"},{"id":1,"source":{"name":"bashdb","path":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":100,"column":0,"name":"##1 source(\"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 100"},{"id":2,"source":{"name":"bashdb","path":"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":0,"column":0,"name":"##2 main(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-12679\", \"--library\", \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\", \"--\", \"/home/some/path/test.sh\") called from file `/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb' at line 0"}],"totalFrames":4}}
From client: scopes({"frameId":0})
To client: {"seq":0,"type":"response","request_seq":14,"command":"scopes","success":true,"body":{"scopes":[{"name":"Local","variablesReference":46,"expensive":false}]}}
From client: variables({"variablesReference":46})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Program stopped.\n"}}
Program stopped.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"It stopped after being stepped.\nNext statement to be run is:\n\techo \"${foo}\"\n"}}
It stopped after being stepped.
Next statement to be run is:
echo "${foo}"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":" <$PWD> \n"}}
<$PWD>
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"/home/some/path\n"}}
/home/some/path
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":" <$? # $_Dbg_last_bash_command> \n"}}
<$? # $_Dbg_last_bash_command>
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"0 # foo=\"BAR\"\n"}}
0 # foo="BAR"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"############################################################\n"}}
############################################################
To client: {"seq":0,"type":"response","request_seq":15,"command":"variables","success":true,"body":{"variables":[{"name":"$PWD","type":"string","value":"/home/some/path","variablesReference":0},{"name":"$? # $_Dbg_last_bash_command","type":"string","value":"0 # foo=\"BAR\"","variablesReference":0}]}}
I also noticed that if I wrap my bash script in a main function the debugger will open the bashdb
script and crash resulting in the following output:
/home/some/path/test.sh: line 9: syntax error near unexpected token `1'
/home/some/path/test.sh: line 9: ` sleep(1)'
bash: line 18: 5009 Killed "cat" "/tmp/vscode-bash-debug-fifo-19120" 1>&3 (wd: ~)
bash: line 18: 5010 Killed "cat"
5011 | "/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb" --quiet --tty "/tmp/vscode-bash-debug-fifo-19120" --library "/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir" -- "/home/some/path/test.sh"
Debug Output:
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"bash: line 18: 6754 Killed \"cat\" \"/tmp/vscode-bash-debug-fifo-17148\" 1>&3 (wd: ~)\nbash: line 18: 6755 Killed \"cat\"\n 6756 | \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb\" --quiet --tty \"/tmp/vscode-bash-debug-fifo-17148\" --library \"/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir\" -- \"/home/some/Documents/Fantag/conditional-mono-repo/test.sh\"\n"}}
bash: line 18: 6754 Killed "cat" "/tmp/vscode-bash-debug-fifo-17148" 1>&3 (wd: ~)
bash: line 18: 6755 Killed "cat"
6756 | "/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir/bashdb" --quiet --tty "/tmp/vscode-bash-debug-fifo-17148" --library "/home/some/.vscode/extensions/rogalmic.bash-debug-0.2.3/bashdb_dir" -- "/home/some/Documents/Fantag/conditional-mono-repo/test.sh"
To client: {"seq":0,"type":"response","request_seq":11,"command":"disconnect","success":true}
Referring to this :
https://stackoverflow.com/questions/43147394/bash-bash-rematch-empty
Visual Studio Code Version : 1.35.1
Bash Debug Version : 0.3.5
Bash Version : version 4.4.19(1)-release
Windows 10 64bit WSL Ubuntu 18.04 LTS
Just wondering if this is a known issue or will be supported / fixed in the future?
Thanks
You mention that the extension works with some hacks on Bash On Windows, but I could not get it work. Can you describe how to do it?
Does this extension do anything Windows specific when initially setting up launch.json
?
I'm having an issue on both macOS and Ubuntu 16.04. Both systems have the latest version of vscode, the latest extension version and pre-reqs installed.
When I follow the steps listed under Usage:
Instead of displaying a menu as shown in the video, it opens launch.json
containing the code below. Note: launch.json
did not exist prior to this.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": "extension.bash-debug.provideInitialConfigurations"
}
If I manually populate launch.json
with contents from this repo the debugger works. Obviously this doesn't scale, as it required manually populating it for every project and changing it for different debugging options.
I see troubles (hangs of debugger) with relatively small and trivial scripts
for example:
https://gist.github.com/belonesox/5bf3b1cbc3f1ae3b8ca26cf0e6168184
(1000 lines of comments).
raw bashdb works OK with it.
May be some hardcoded limits?
I wish to debug enourmous generated "configure" scripts (≈30K lines, ≈700K).
After installing the plugin im getting errors in my launch.json when trying to use the bash debugger, is there a default configuration I can use?
When debugging bash scripts, we currently have that $0
evaluates to usr/bin/bashdb
.
In order to solve this, what about using the --debugger
option of bash? See the Description section of http://bashdb.sourceforge.net/bashdb-man.html
I am trying to use this plugin to debug a script that checks moves and deletes files. i have a test dir resembling the operational server. this project is located in a git dir and most paths used in the script are relative paths. this plugin wants to run my script in /home/$USER (this is confirmed by the pwd variable)
i would like to run it in /home/$USER/git/ProjectDir. how can i force this to happen? do i set this in launch.json?
I can't seem to debug my bash script that needs certain environment variables. Is it supported?
I have scriptA.sh
that calls scriptB.sh
via simple execution - right now the debugger executes ./scriptB.sh
as a single line of code and I cannot debug it.
Is there a way to "step into" scriptB.sh
?
thx
In the main README we can read that we can't use set -e
(aka set -errexit
) in bash scripts.
BTW, latest avaialble bashdb does support scripts with this flag.
So, what about adding a note to this in the README?
In addition to the details for issue, please provide us Executables information and Debug output unless you have confidence that they don't help us.
Version of bash-debug: (can be checked in: ctrl+shift+X or command+shift+X -> INSTALLED: Bash Debug)
Output of following commands (on windows, execute them in Command Prompt or PowerShell):
where bash
# if `code` not found on macOS, follow the instructions in:
# https://code.visualstudio.com/docs/setup/mac
code --version
bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
Paste here outputs in DEBUG CONSOLE (ctrl+shift+D or command+shift+D) with "showDebugOutput": true
and "trace": true
in launch.json
.
Your launch.json
may looks like:
{
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash Debug",
"program": "${workspaceFolder}/src/foo.sh",
"showDebugOutput": true,
"trace": true
}
]
}
Details goes here.
for example, i have a bash script in /some/dir/bash.sh
when i run the script, i always cd to /some/dir and the pwd command generate /some/dir
however in vscode, the pwd command generate '/' which is not exptected
When starts debug it hangs and nothing happens it keeps loading I think is related to new debugger subsession on code 1.33
works perfect in 1.30
Version of bash-debug: 0.3.2
Version of Code:
1.28.2
7f3ce96ff4729c91352ae6def877e59c561f4850
x64
Executing the second command:
Linux vbox 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
---
/bin/bash
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
---
bash: bashdb: command not found
---
/bin/cat
cat (GNU coreutils) 8.28
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund and Richard M. Stallman.
---
/usr/bin/mkfifo
mkfifo (GNU coreutils) 8.28
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
---
/usr/bin/pkill
pkill from procps-ng 3.3.12
## Details
I'm trying to debug a simple script but as soon as I start the debugging, there is an error message:
Debug adapter process has terminated unexpectedly (read ECONNRESET)
It looks to me as if bashdb isn't found. But isn't that supposed to be included in the extension ?
The website says: _A bash debugger GUI frontend based on awesome bashdb scripts (bashdb now included in package)._
Hi, I am using:
Linux Mint 19 / Ubuntu 18.04
VS Code Insiders (daily release)
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
bashdb, release 4.3–0.91
When I start debugging I get this error:
/bin/bash: symbol lookup error: /usr/share/bashdb/builtin/set0: undefined symbol: sh_xfree
hello, we have a environment run in the docker container.
we need to debug the shell script in the docker container via vscode in host machine.
can this extension debug scripts in the docker container?
there is no script selection popuo menu to select the file
in the debug output
bash: line 16: ${command.SelectScriptName}: bad substitution
cat: stdout: Broken pipe
Is there a way to run script with root privileges with configuration option or somekind of workaround. I tried to put "sudo" in launch.json but with no luck.
Version of bash-debug: 0.3.3
Output of following commands (on windows, execute them in Command Prompt or PowerShell):
where bash
/usr/local/bin/bash
/bin/bash
code --version
1.29.1
bc24f98b5f70467bc689abf41cc5550ca637088e
x64
bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
Darwin MFINKM011001.local 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:31 PST 2018; root:xnu-4903.231.4~1/RELEASE_X86_64 x86_64
---
/usr/local/bin/bash
/bin/bash
GNU bash, version 4.4.23(1)-release (x86_64-apple-darwin18.0.0)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
---
/usr/local/bin/bashdb
/Users/mfink//.vscode/extensions/rogalmic.bash-debug-0.3.3/bashdb_dir/bashdb
bashdb, release 4.4-0.94
---
/bin/cat
cat: illegal option -- -
usage: cat [-benstuv] [file ...]
---
/usr/bin/mkfifo
mkfifo: illegal option -- -
usage: mkfifo [-m mode] fifoname ...
---
/usr/bin/pkill
pkill: illegal option -- -
usage: pkill [-signal] [-ILfilnovx] [-F pidfile] [-G gid]
[-P ppid] [-U uid] [-g pgrp]
[-t tty] [-u euid] pattern ...
Paste here outputs in DEBUG CONSOLE (ctrl+shift+D or command+shift+D) with "showDebugOutput": true
and "trace": true
in launch.json
.
Your launch.json
may looks like:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}",
"pathBash": "/usr/local/bin/bash",
"trace": true,
"terminalKind": "debugConsole",
"showDebugOutput": true
}
]
I'm new to 'Bash Debug' in VS Code and wanted to fist of all say thanks for the extension! This is great. This could be a total n00b question but when I launch in debug, the only variables I see are
Thanks in advance!
Windows Version: 10.0.15063 - 1703 (Creators Update)
Version of bash-debug: 0.3.2
WSL bash.exe Version: 10.0.15063.0
WSL bash version: 4.3.48(1)-release
WSL bashdb version: bashdb, release 4.3-0.91
WSL Distro: Ubuntu 16.04.5 LTS (should be the default)
Output of following commands (on windows, execute them in Command Prompt or PowerShell):
where bash
C:\Users\asaf.levy>where bash
C:\Windows\System32\bash.exe
code --version
C:\Users\asaf.levy>code --version
1.27.2
f46c4c469d6e6d8c46f268d1553c5dc4b475840f
x64
bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
C:\Users\asaf.levy>bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
Linux AsafL-T450 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
---
/bin/bash
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
---
/usr/bin/bashdb
bashdb, release 4.3-0.91
---
/bin/cat
cat (GNU coreutils) 8.25
Written by Torbjörn Granlund and Richard M. Stallman.
---
/usr/bin/mkfifo
mkfifo (GNU coreutils) 8.25
Written by David MacKenzie.
---
/usr/bin/pkill
pkill from procps-ng 3.3.10
NOTE: I allowed myself to remove all the Licensing text lines (for readability)
No debug output is given, only the message box error.
My launch.json
looks like:
{
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (hardcoded script name)",
"cwd": "${workspaceFolder}",
"trace": true,
"showDebugOutput": true,
"program": "${workspaceFolder}/ssm-cleanup.sh",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (select script from list of sh files)",
"cwd": "${workspaceFolder}",
"trace": true,
"showDebugOutput": true,
"program": "${command:SelectScriptName}",
"pathBash": "C:\\Windows\\System32\\bash.exe",
"args": []
}
]
}
After the latest updates, Debugging bash in vscode on windows 10 ontop the wsl has stopped working,
Probably due this commit: 3bbc0e8 which made it into 0.3.1+
Screenshots:
default config
override config
launch.json + terminal showing bash
before that debugging worked flawlessly (apart the known limitation),
now I see some changes have been made and a new argument\property called 'pathBash' is added,
but I couldn't find documentation about it..
Bash.exe is 100% in Windows's PATH, as it resides in it's default location, and works when openning from cmd.exe, or from vscode..
Also, Attempting to manually set the 'launch property' 'pathBash' to the actual location on my version on windows, which is the old path ("C:\Windows\System32\bash.exe" - with double \ in launch json) Fails.
Tried the different launch configuration options as well, no luck..
so Bash Debug extension is broken on older windows 10, where it worked before
For now my only workaround is to use the older vsix before the changes (v0.2.2 as it seems like)
Hello,
I am having an Unmached "
on a very simple helloworld script. My configs:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (type in script name)",
"cwd": "${workspaceFolder}",
"program": "${command:AskForScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (select script from list of sh files)",
"cwd": "${workspaceFolder}",
"program": "${command:SelectScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (hardcoded script name)",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/path/to/script.sh",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}"
}
]
}
Starting the debugger on Windows, the bash app given in pathBash
cannot be found:
pathBash
pointing to c:/cygwin/bin/bash.exe
, see launch.json
further downWindows Subsystem for Linux
not installedError: bash not found. (pathBash: <path/to/bash>)
... hours later:
process.platform == "win32"
) the use of WSL Bash
is currently mandatory and pathBash
is not used.Separately, a feature request brought by others as well:
bash
could be used, too!Many thanks!
launch.json
:
{
"version": "0.3.4",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}",
"pathBash": "C:\\cygwin\\bin\\bash.exe",
"showDebugOutput": true,
"terminalKind": "integrated"
}
]
}
In addition to the details for issue, please provide us Executables information and Debug output unless you have confidence that they don't help us.
cd . ; bash -c "cd "/Users/xxx/Sync/VSCode"; while [[ ! -p "/tmp/vscode-bash-debug-fifo-17631" ]]; do sleep 0.25; done; "/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/bashdb" --quiet --tty "/tmp/vscode-bash-debug-fifo-17631" --tty_in "/tmp/vscode-bash-debug-fifo-17631_in" --library "/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir" -- "/Users/xxx/Sync/VSCode/bash/network.sh" "
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/init/require.sh: line 49: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/action.sh: line 42: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/action.sh: line 45: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/alias.sh: line 19: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/break.sh: line 59: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/break.sh: line 62: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/cmd-hooks.sh: line 1: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/filecache.sh: line 24: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/filecache.sh: line 28: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/filecache.sh: line 32: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/help.sh: line 23: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/help.sh: line 31: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/processor.sh: line 26: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/Users/xxx/.vscode-insiders/extensions/rogalmic.bash-debug-0.3.0/bashdb_dir/lib/processor.sh: line 62: exec: {_Dbg_fdi}: not found
Version of bash-debug: (can be checked in: ctrl+shift+X or command+shift+X -> INSTALLED: Bash Debug)
0.3.0
Output of following commands (on windows, execute them in Command Prompt or PowerShell):
where bash
# if `code` not found on macOS, follow the instructions in:
# https://code.visualstudio.com/docs/setup/mac
code --version
bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
Darwin EW-MB-0115.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
EW-MB-0115:svenvogel root# bash --version
GNU bash, version 4.4.19(1)-release (x86_64-apple-darwin17.3.0)
Paste here outputs in DEBUG CONSOLE (ctrl+shift+D or command+shift+D) with "showDebugOutput": true
and "trace": true
in launch.json
.
Your launch.json
may looks like:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (type in script name)",
"cwd": "${workspaceFolder}",
"program": "${command:AskForScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (select script from list of sh files)",
"cwd": "${workspaceFolder}",
"program": "${command:SelectScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (hardcoded script name)",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/path/to/script.sh",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}"
}
]
}
Details goes here.
WINDOWS10 1903
Version of bash-debug: 0.3.2
WSL bash.exe Version: 10.0.15063.0
WSL bash version: 4.3.48(1)-release
WSL bashdb version: bashdb, release 4.3-0.91
WSL Distro: Ubuntu 18.04 LTS
Output of following commands (on windows, execute them in Command Prompt or PowerShell):
where bash
bash: /bin/bash /etc/bash.bashrc /mnt/c/Windows/system32/bash.exe /usr/share/man/man1/bash.1.gz
code --version
Linux DESKTOP-BPEOIL7 4.4.0-18362-Microsoft #1-Microsoft Mon Mar 18 12:02:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
/home/lan/.vscode-server/extensions/rogalmic.bash-debug-0.3.5/bashdb_dir/command/source.sh: line 41: /dev/stdin: No such device or address
{
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (type in script name)",
"cwd": "${workspaceFolder}",
"program": "${command:AskForScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (select script from list of sh files)",
"cwd": "${workspaceFolder}",
"program": "${command:SelectScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (hardcoded script name)",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/path/to/script.sh",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}"
}
]
}
When I debug, my output is displayed in DEBUG CONSOLE,
I can't debug in the terminal.
So I can't interact with the program either.
Please tell me how to debug in the terminal.
(Get-Command -ErrorAction "SilentlyContinue" bash).Path
C:\VSCode-Anywhere\apps\scoop\apps\msys2\current\usr\bin\bash.exe
$ where bash
C:\VSCode-Anywhere\apps\scoop\apps\git\2.24.1.windows.2\usr\bin\bash.exe
C:\VSCode-Anywhere\apps\scoop\apps\msys2\current\usr\bin\bash.exe
code --version
1.41.0
9579eda04fdb3a9bba2750f15193e5fafe16b959
x64
bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
MINGW64_NT-10.0-18362 portable 3.0.7-338.x86_64 2019-07-11 10:58 UTC x86_64 Msys
---
/usr/bin/bash
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
---
which: no bashdb in (/c/VSCode-Anywhere/apps/scoop/apps/python27/current/Scripts:/c/VSCode-Anywhere/apps/scoop/apps/python/current/Scripts:/c/VSCode-Anywhere/apps/saltstack:/mingw64/bin:/mingw32/bin:/usr/bin:/c/VSCode-Anywhere/apps/Chocolatey/bin:/c/VSCode-Anywhere/apps/scoop/shims:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/c/ProgramData/chocolatey/bin:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Logiciels/Calibre2:/c/VSCode-Anywhere/apps/scoop/apps/python27/current/scripts:/c/VSCode-Anywhere/apps/scoop/apps/python/current:/c/VSCode-Anywhere/apps/scoop/apps/python/current/Scripts:/c/VSCode-Anywhere/apps/saltstack:/c/VSCode-Anywhere/apps/scoop/shims:/c/Users/gigi/Documents/anaconda3:/c/Users/gigi/Documents/anaconda3/Library/mingw-w64/bin:/c/Users/gigi/Documents/anaconda3/Library/usr/bin:/c/Users/gigi/Documents/anaconda3/Library/bin:/c/Users/gigi/Documents/anaconda3/Scripts:/c/VSCode-Anywhere/apps/Chocolatey/bin)
/usr/bin/bash: bashdb: command not found
---
/usr/bin/cat
cat (GNU coreutils) 8.31
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund and Richard M. Stallman.
---
/usr/bin/mkfifo
mkfifo (GNU coreutils) 8.31
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
---
which: no pkill in (/c/VSCode-Anywhere/apps/scoop/apps/python27/current/Scripts:/c/VSCode-Anywhere/apps/scoop/apps/python/current/Scripts:/c/VSCode-Anywhere/apps/saltstack:/mingw64/bin:/mingw32/bin:/usr/bin:/c/VSCode-Anywhere/apps/Chocolatey/bin:/c/VSCode-Anywhere/apps/scoop/shims:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/c/ProgramData/chocolatey/bin:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Logiciels/Calibre2:/c/VSCode-Anywhere/apps/scoop/apps/python27/current/scripts:/c/VSCode-Anywhere/apps/scoop/apps/python/current:/c/VSCode-Anywhere/apps/scoop/apps/python/current/Scripts:/c/VSCode-Anywhere/apps/saltstack:/c/VSCode-Anywhere/apps/scoop/shims:/c/Users/gigi/Documents/anaconda3:/c/Users/gigi/Documents/anaconda3/Library/mingw-w64/bin:/c/Users/gigi/Documents/anaconda3/Library/usr/bin:/c/Users/gigi/Documents/anaconda3/Library/bin:/c/Users/gigi/Documents/anaconda3/Scripts:/c/VSCode-Anywhere/apps/Chocolatey/bin)
/usr/bin/bash: pkill: command not found
Paste here outputs in DEBUG CONSOLE (ctrl+shift+D or command+shift+D) with "showDebugOutput": true
and "trace": true
in launch.json
.
Your launch.json
may looks like:
{
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}",
"cwd": "${workspaceFolder}",
"pathBash": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\git\\current\\bin\\bash.exe",
"args": []
}
]
}
Set pathBash not working result in error WSL bash
Is there a way not to use WSL and to use a custom bash? Like the bash.exe included in git or msys2
Hi,
We noticed your extension in package.json
is using a "initialConfigurations"
contribution in a deprecated way by specifiying a command id.
We wanted to let you know that we plan to delete support for this specific use of "initialConfigurations" soon.
More about this deprecation can be found here and in our release notes.
A good example on how to use the DebugConfigurarationProvider
which is the new way of doing this can be found here
Also note other deprecations which are specified in our release notes (which can be found on our site).
Kind regards,
Isidor from the VSCode team
When debugging I'm not able to get it to prompt for the user input on a read command. I recorded a short screen grab of the issue I'm seeing and threw it up on Youtube if it helps.
bashdb
(no need to install before first usage)wsl.exe
instead of deprecated bash.exe
Tests:
Hi, I have posted a new issue about spawing an external terminal on Linux...
Version of bash-debug: bash-3.1-0.09
Output of following commands (on windows, execute them in Command Prompt or PowerShell):
where bash:
what? Do you mean which bash?
code --version:
1.24.1
24f62626b222e9a8313213fb64b10d741a326288
x64
bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done':
Darwin EEDWARDSLT-MAC.local 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64
---
/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)
Copyright (C) 2007 Free Software Foundation, Inc.
---
/usr/local/bin/bashdb
Bourne-Again Shell Debugger, release bash-3.1-0.09
Copyright 2002, 2003, 2004, 2006, 2007 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
bashdb: cannot read program to debug: Bc:hL:nqt:T::x:XYV.
---
/bin/cat
cat: illegal option -- -
usage: cat [-benstuv] [file ...]
---
/usr/bin/mkfifo
mkfifo: illegal option -- -
usage: mkfifo [-m mode] fifoname ...
---
/usr/bin/pkill
pkill: illegal option -- -
usage: pkill [-signal] [-ILfilnovx] [-F pidfile] [-G gid]
[-P ppid] [-U uid] [-g pgrp]
[-t tty] [-u euid] pattern ...
13:03:45, 2018-6-22
From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"bashdb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConditionalBreakpoints":false,"supportsConfigurationDoneRequest":false,"supportsEvaluateForHovers":true,"supportsStepBack":false,"supportsSetVariable":false}}
From client: launch({"type":"bashdb","request":"launch","name":"Bash-Debug (hardcoded script name)","cwd":"/Users/eedwards/Documents/dev/bash-util","program":"/Users/eedwards/Documents/dev/bash-util/bash-util/build/lib/bash-util-1.0/test","args":[],"showDebugOutput":true,"trace":true,"pathBash":"bash","pathBashdb":"bashdb","pathCat":"cat","pathMkfifo":"mkfifo","pathPkill":"pkill","__sessionId":"38047af9-b61e-4e71-bb4f-cd757dda6cbd"})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Bourne-Again Shell Debugger, release bash-3.1-0.09\n"}}
Bourne-Again Shell Debugger, release bash-3.1-0.09
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Copyright 2002, 2003, 2004, 2006, 2007 Rocky Bernstein\nThis is free software, covered by the GNU General Public License, and you are\nwelcome to change it and/or distribute copies of it under certain conditions.\n\n"}}
Copyright 2002, 2003, 2004, 2006, 2007 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"bashdb: cannot read program to debug: Bc:hL:nqt:T::x:XYV.\n"}}
bashdb: cannot read program to debug: Bc:hL:nqt:T::x:XYV.
bashdb works fine when ran from the command line directly:
→ bash --debugger -- test
(/Users/eedwards/Documents/dev/bash-util/build/lib/bash-util-1.0/test:3):
3: source ./bash-util.bash
bashdb<0> q
In addition to the details for issue, please provide us Executables information and Debug output unless you have confidence that they don't help us.
Output of bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill code; do echo ---; which -a $P; command $P --version; done
:
Linux jk-dev 4.13.0-38-generic #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
---
/bin/bash
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
Licens GPLv3+: GNU GPL version 3 eller senere <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
---
/usr/bin/bashdb
bashdb, release 4.3-0.91
---
/bin/cat
cat (GNU coreutils) 8.25
Copyright © 2016 Free Software Foundation, Inc.
Licens GPLv3+: GNU GPL version 3 eller nyere <http://gnu.org/licenses/gpl.html>.
Dette er frit programmel: du kan frit ændre og videredistribuere det.
Der gives INGEN GARANTI, i den grad som loven tillader dette.
Skrevet af Torbjørn Granlund (Torbjörn Granlund) og Richard M. Stallman.
---
/usr/bin/mkfifo
mkfifo (GNU coreutils) 8.25
Copyright © 2016 Free Software Foundation, Inc.
Licens GPLv3+: GNU GPL version 3 eller nyere <http://gnu.org/licenses/gpl.html>.
Dette er frit programmel: du kan frit ændre og videredistribuere det.
Der gives INGEN GARANTI, i den grad som loven tillader dette.
Skrevet af David MacKenzie.
---
/usr/bin/pkill
pkill from procps-ng 3.3.10
---
/usr/bin/code
1.22.1
950b8b0d37a9b7061b6f0d291837ccc4015f5ecd
x64
14:50:10, 2018-4-11
From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"bashdb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConditionalBreakpoints":false,"supportsConfigurationDoneRequest":false,"supportsEvaluateForHovers":true,"supportsStepBack":false,"supportsSetVariable":false}}
From client: launch({"type":"bashdb","request":"launch","name":"Bash-Debug (select script from list of sh files)","cwd":"/home/jk/Arkivering_Frederikshavn/zip - Zip Archive","program":"/home/jk/Arkivering_Frederikshavn/zip - Zip Archive/sort_zips.sh","args":[],"showDebugOutput":true,"trace":true,"pathBash":"bash","pathBashdb":"bashdb","pathCat":"cat","pathMkfifo":"mkfifo","pathPkill":"pkill","__sessionId":"c9c0fb46-948d-4df2-bbf3-462bc6c3d890"})
To client: {"seq":0,"type":"response","request_seq":2,"command":"launch","success":false,"message":"Error: cwd (/home/jk/Arkivering_Frederikshavn/zip - Zip Archive) does not exist."}
From client: disconnect({"restart":false})
To client: {"seq":0,"type":"response","request_seq":3,"command":"disconnect","success":false,"message":"TypeError: Cannot read property 'on' of undefined\n at BashDebugSession.disconnectRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/out/bashDebug.js:35:29)\n at BashDebugSession.dispatchRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_modules/vscode-debugadapter/lib/debugSession.js:347:22)\n at BashDebugSession.dispatchRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_modules/vscode-debugadapter/lib/loggingDebugSession.js:48:15)\n at BashDebugSession._handleData (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_modules/vscode-debugadapter/lib/protocol.js:97:38)\n at Socket.inStream.on (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_modules/vscode-debugadapter/lib/protocol.js:18:44)\n at emitOne (events.js:96:13)\n at Socket.emit (events.js:191:7)\n at readableAddChunk (_stream_readable.js:178:18)\n at Socket.Readable.push (_stream_readable.js:136:10)\n at Pipe.onread (net.js:560:20)","body":{"error":{"id":1104,"format":"{_stack}","variables":{"_exception":"Cannot read property 'on' of undefined","_stack":"TypeError: Cannot read property 'on' of undefined\n at BashDebugSession.disconnectRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/out/bashDebug.js:35:29)\n at BashDebugSession.dispatchRequest (/home/jk/.vscode/extensions/rogalmic.bash-debug-0.1.1/node_[...]
Details goes here.
Whenever I work in a directory where the path contains spaces (in this case the project folder is named zip - Zip Archive
) I get the following error message when trying to debug:
For years, I have looking for a real bash debugger. I think I found it. Thanks a lot for your work.
When I start the debugger, I get the following error message
/home/oracle/.vscode/extensions/rogalmic.bash-debug-0.3.5/bashdb_dir/command/source.sh: line 41: _Dbg_fdi: No such device or address
I hope have provided you will all the info you might need.
operating system Centos 7
$ bashdb --version
bashdb, release 4.4-1.0.1
$ bash --version
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
$ code --version
1.35.1
c7d83e57cd18f18026a8162d042843bda1bcf21f
x64
/usr/bin/bash
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
/usr/bin/cat
cat (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
/usr/bin/mkfifo
mkfifo (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
/usr/bin/pkill
pkill from procps-ng 3.3.10
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}"
"showDebugOutput": true,
"trace": true
}
]
}
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":false,"supportsEvaluateForHovers":true,"supportsStepBack":false,"supportsSetVariable":false}}
From client: launch({"type":"bashdb","request":"launch","name":"Bash-Debug (simplest configuration)","program":"/home/oracle/Downloads/test/test.sh","showDebugOutput":true,"trace":true,"args":[],"env":{},"cwd":"/home/oracle/5000_MSVisual_Studio","pathBash":"bash","pathBashdb":"/home/oracle/.vscode/extensions/rogalmic.bash-debug-0.3.5/bashdb_dir/bashdb","pathBashdbLib":"/home/oracle/.vscode/extensions/rogalmic.bash-debug-0.3.5/bashdb_dir","pathCat":"cat","pathMkfifo":"mkfifo","pathPkill":"pkill","__sessionId":"a171d9d5-3b05-4bc2-9517-e4afbe19c5c2"})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"::PROXYID::30519\n"}}
::PROXYID::30519
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"/home/oracle/.vscode/extensions/rogalmic.bash-debug-0.3.5/bashdb_dir/command/source.sh: line 41: _Dbg_fdi: No such device or address\n"}}
/home/oracle/.vscode/extensions/rogalmic.bash-debug-0.3.5/bashdb_dir/command/source.sh: line 41: _Dbg_fdi: No such device or address
Even when I have no breakpoints, the debugger breaks at the first code line of my script.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.