Comments (23)
You have to do debugging by "Extension + Server":
and after another vscode launched, please set "debugServer": 4711
in your launch.json
, and run it.
Please see official document for details.
from vscode-bash-debug.
@wataash It works, now I can debug it!
from vscode-bash-debug.
Does bashdb work when running it directly from shell commandline?
Please try uninstalling bash and compiling it manually:
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
from vscode-bash-debug.
I does not work from shell command line too! 👎
I installed it as you suggested me, and now works in shell command line. 👍
I am going to try it inside VS Code...
from vscode-bash-debug.
Here is my configuration:
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (hardcoded script name)",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/ci/scripts/pipeline-configure",
"args": []
}
Here is the screenshot:
It stucks here, and any of the debugging button work!
from vscode-bash-debug.
Can you try non-insider build for sanity check?
from vscode-bash-debug.
Sure! I have just tried with Code NON Insider, and it stucks in the same way.
from vscode-bash-debug.
OK, please create separate folder with dummy script.sh:
#!/bin/bash
echo test
And create simplest debug configuration (debug pane -> dropdown -> add configuration)
I want to check if simplest case works at all.
If not, add following to launch.config and send logs from debug console:
"showDebugOutput": true,
"trace": true
from vscode-bash-debug.
I confirm you that script.sh with simplest configuration works!
from vscode-bash-debug.
Any other solution?!
from vscode-bash-debug.
2 ways to go from this point (assuming everything works correctly from commandline):
- you can try to narrow down the problem by commenting out parts of code and checking when it starts to work
- you can post the debug output here and/or provide the script if possible
from vscode-bash-debug.
Hi, I removed any content inside my script.
I get this log:
7:39:02 AM, 7/16/2018
From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code - Insiders","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 - Test)","cwd":"/home/antonio/projects/sisal/development/ci-template","program":"/home/antonio/projects/sisal/development/ci-template/test.sh","args":[],"showDebugOutput":true,"trace":true,"pathBash":"bash","pathBashdb":"bashdb","pathCat":"cat","pathMkfifo":"mkfifo","pathPkill":"pkill","__sessionId":"3a9abf17-0365-4413-abcc-3c9aa54333d0"})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"(/home/antonio/projects/sisal/development/ci-template/test.sh:3):\n3:\techo Test!\n"}}
(/home/antonio/projects/sisal/development/ci-template/test.sh:3):
3: echo Test!
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"9997\n"}}
9997
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":"pipeline-configure","path":"/home/antonio/projects/sisal/development/ci-template/ci/scripts/pipeline-configure"},"lines":[254],"breakpoints":[{"line":254}],"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}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"delete <>\n"}}
delete <>
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"I don't understand "load".\n"}}
I don't understand "load".
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Please try again entering 'yes' or 'no'.\nI don't understand "print".\nPlease try again entering 'yes' or 'no'.\n"}}
Please try again entering 'yes' or 'no'.
I don't understand "print".
Please try again entering 'yes' or 'no'.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"I don't understand "break".\n"}}
I don't understand "break".
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Please try again entering 'yes' or 'no'.\n"}}
Please try again entering 'yes' or 'no'.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"I don't understand "print".\n"}}
I don't understand "print".
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Please try again entering 'yes' or 'no'.\n"}}
Please try again entering 'yes' or 'no'.
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})
From client: stackTrace({"threadId":42,"startFrame":0,"levels":20})
from vscode-bash-debug.
I am not sure why, but seems that bashdb does not support options 'load' or 'break' in the debugging console. You could try removing breakpoints/variables or installing newest bashdb.
I do not have access to pc, so cannot check this for some time...
from vscode-bash-debug.
As suggested by you, I have installed BASHDB from sources...
from vscode-bash-debug.
Please check if 'print' or 'break' options work from debugging console, when running bashdb directly...
from vscode-bash-debug.
$ bashdb pipeline-configure bash debugger, bashdb, release 4.4-0.94
Copyright 2002-2004, 2006-2012, 2014, 2016-2017 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.
(/home/antonio/pipeline-configure:5):
5: if [ $# -lt 2 ]; then
bashdb<0> l
1: #!/bin/bash
2:
3: # Check parameter(s)
4:
5: => if [ $# -lt 2 ]; then
6: SCRIPT_NAME=$(basename $0)
7: echo "${SCRIPT_NAME} [Root POM path (e.g. \"sw\")] [Jenkinsfile properties path (e.g. \"ci/settings\")]"
8: exit 1
9: fi
10:
bashdb<1> print $#
0
bashdb<2> break 6
Breakpoint 1 set in file /home/antonio/pipeline-configure, line 6.
bashdb<3>
from vscode-bash-debug.
I believe on this project, so I am going to take some time to debug your great extension on my development environment...
Edit 1: I setup my workspace following CONTRIBUTING.md. I would debug your extention, so I put some breakpoints into bashDebug.ts file, started the session by F5 (not CTRL-F5), but those BPs become grayed. What is wrong?!
from vscode-bash-debug.
I found the solution, here is the pull request.
Do you think to make it will be available as update early?
Thank you,
Antonio
from vscode-bash-debug.
Thanks! This needs to be fixed for newest bashdb version, so that is a very good finding.
I took some time and tested this on bashdb, release 4.2-0.8
, it works there just giving a warning:
Removed 3 breakpoint(s).
** Undefined command "yes". Try "help".
I think it needs a bit more testing time with different bashdb versions, because I am a bit worried about breaking backwards compatibility.
I think we can merge this, but lets wait with release for now.
@wataash : Do you agree?
from vscode-bash-debug.
agree :)
from vscode-bash-debug.
Hi, have you planned to release this fix?
from vscode-bash-debug.
Yes, I have not noticed any issues so far (though I did not spend much time testing), so we will release it.
I will try to release that this week + I will update the dependencies and Readme (the default supported bashdb version will be 4.4).
from vscode-bash-debug.
Thank you!
from vscode-bash-debug.
Related Issues (20)
- Error: cwd ... does not exist. HOT 8
- No Debug Terminal appears when starting debug HOT 2
- Cryptographic Failure via escaped character
- Add variables to "VARIABLES" panel automatically. HOT 14
- Wrong command passed to wsl integrated terminal HOT 2
- TypeError: Cannot read properties of undefined (reading 'on') HOT 4
- Debugger times out while the Bash shell is still going through the initialization HOT 1
- Extension appears to be missing `npm-which`? HOT 1
- cwd does not exist error when attempting to launch debugger HOT 1
- debugger stops when a file is sourced and never returns
- Every time a script has a "read" command the debugger got stuck and nothing is displayed in the debug console HOT 2
- BASH_REMATCH fails
- "Stop Debugger" crashes VSCode irrespective of program being debugged
- Debugger does not stop at breakpoints when relative path to script contains spaces
- examine.sh: line 71: typeset: $var0: not found HOT 1
- When starting debugger, debug console shows "stty: standard input: Inappropriate ioctl for device" HOT 2
- Bashdb doesn't stop in breakpoints in VSCode when using WSL Ubuntu in Windows HOT 3
- setting text variables ending with numeral fails
- Passing empty arguments in launch config don't get recognized
- Support hierarchical display of array values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-bash-debug.