Code Monkey home page Code Monkey logo

vscode-bash-debug's People

Contributors

adolfojunior avatar antonio-petricca avatar felipecrs avatar puremourning avatar rogalmic avatar wataash avatar xhiroga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vscode-bash-debug's Issues

Watch Variables can't be resolved after a Debugging Restart and Debugger does not start

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) 

VS code crashes when script has syntax error or once execution completes

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.

  • Directly run the script in debug mode, vs code exits after script finishes exec
  • Make a syntax error and run in debug mode, vs code crashes and exits

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

Support for msys2 bash

Executables

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

Debug output

N/A

Details

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.

Error: Reached to unreachable code while validating enviroment

How to reproduce:

  • Install Bash Debug
  • Try Debugging using Bash-Debug

Output:

I get this error:

1

Executables

Bash Debug: 0.3.5

Details

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"
    
}

Debbuging does not start

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

System Info
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%

FAIL: test-bug-set-e

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)

Initiating debug produces `stty: stdin isn't a terminal` in debug console

Running on MacOS, receive stty: stdin isn't a terminal

Executables

❯ 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

Debug output

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": []
        },

Relative paths

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": []
}
]
}

Ubuntu 18.04 LTS - lack of bashdb (not relevant anymore)

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

"bashdb: command not found"

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.

Errors when running PR with bashdb built in

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.

Executables

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

Debug output

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

@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.

Issue 1

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}]}}

Issue 2

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}

Enable BashOnWindows

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?

Configuration Options not Displayed After Selecting "Bash Debug"

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:

  • Press ctrl+shift+P (cmd+shift+P) and run "Debug: Open launch.json"
  • Select "Bash Debug"

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.

Default launch.json incorrect

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?

define execute location

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?

calling another script stops the debugger

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

Error: Only bash versions 4.* are supported

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.

Executables

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'

Debug output

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

Details goes here.

how can i change `pwd` to the script directory

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

bashdb not found

Executables

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)._

Undefined symbol: sh_xfree

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

ssh remote debug or docker support

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?

script selection error

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

Debug scripts with root priviliges

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.

Do local variables show up in the window automatically?

Executables

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 ...

Debug output

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
        }
    ]

Details

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 $PWD and $?. Is there something I need to do in order to have them register in the UI? If I go to the debug console and type in each variable I want to inspect, I can get the results there.

Image

Thanks in advance!

bash not found - wsl

Windows Version: 10.0.15063 - 1703 (Creators Update)

Executables

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)

Debug output

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": []
        }
    ]
}

Details

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)

  1. How can I further help promote this issue?
  2. Thank you very much for this extension, IT IS AWESOME! I greatly appreciate the work done on this..

Command not found (regarding to EOL)

Executables

Version of bash-debug: 0.3.6

Details

Following error: $'\r': command not found
This is due to the EOL; in VSCode it can be set in the right bottom in the statusbar.
Setting it to LF or CRLF doesn't solve the problem.
VSCode_BashDebug

Unmatched "

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}"
        }
    ]
}

[Windows10 + 0.3.4] error message 'bash not found' misleading?

Starting the debugger on Windows, the bash app given in pathBash cannot be found:

  • Windows_NT x64 10.0.17763
  • VC 1.33.1
  • bash-debug 0.3.4
  • pathBash pointing to c:/cygwin/bin/bash.exe, see launch.json further down
  • Windows Subsystem for Linux not installed
  • Error: bash not found. (pathBash: <path/to/bash>)

... hours later:

  • Going through the source code a bit, it appears that on Windows (process.platform == "win32") the use of WSL Bash is currently mandatory and pathBash is not used.
  • If true, then it would be great to amend the error message accordingly.

Separately, a feature request brought by others as well:

  • It would be great if cygwin/msys2 bash could be used, too!
  • Potentially related: #99

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" 
        }
    ]
}

typeset: -A: invalid option

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

Executables

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)

Debug output

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

Details goes here.

DEBUG IN 'DEBUG CONSOLE'

WINDOWS10 1903

Executables

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

Debug output

/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}"
        }
    ]
}

Details

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.

How to force to use custom bash.exe on Windows (without wsl)

Executables

(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

Debug output

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": []
        }
    ]
}

Details

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

VSCode is no longer supporting specifiying a commandId in the "initialConfigurations" contribution

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

I can't get output

when I use it, I only get output from console, but not in output. Is it normal? (macOS 10.12.5)
2017-06-15 2 33 21
2017-06-15 2 33 34

Test new version with extra features

  • ease of use: internal copy of bashdb (no need to install before first usage)
  • interactive scripting in terminal (possibility to use stdin in scripts)
  • change for windows: utilize wsl.exe instead of deprecated bash.exe
  • performance: remove polling in debugger console handling

https://github.com/rogalmic/vscode-bash-debug/releases/download/untagged-239b6677158a4c8754a9/bash-debug-0.3.1.vsix

Tests:

  • Windows 64bit
  • Windows Wow 32bit->64bit
  • Linux 32bit
  • Linux 64bit
  • MacOS some problems
  • Bash 4.4
  • Bash 4.3
  • Bash 3 does not work
  • Bash <4.3

unrecognized option -- -

Executables

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 ...

Debug output

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.

Details

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

Spaces in fil/folder names give issues

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.

Executables

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

Debug output

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

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:
skaermbillede fra 2018-04-11 14-52-34

_Dbg_fdi: No such device or address

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

$ bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
Linux Z800.ldom 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

/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

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.4-1.0.1

/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.

Written by Torbjörn Granlund and Richard M. Stallman.

/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.

Written by David MacKenzie.

/usr/bin/pkill
pkill from procps-ng 3.3.10

Debug output

"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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.