vscode-bash-debug
vscode-bash-debug copied to clipboard
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.
Thanks in advance!
This behavior is as expected and a current limitation. Showing local variables in VARIABLES view is one of our plans, but is tough to be implemented :(
Understand & thanks for the comments. I wasn't sure if that was the case and glad I know now ;-)
I have seen the BashSupport Pro for JetBrains IDEs. It supports showing variables that are changed. Unfortunately, the product is non free and I think it is impossible to see how that is implemented there. Still, I wanted to mention this for those who search.
BashSupport Pro takes a snapshot of variable names and values when the debugger is launched and later displays changed and new variables by default.