rogalmic / vscode-bash-debug

Bash shell debugger extension for VSCode (based on bashdb)
MIT License
217 stars 26 forks source link

Debug - watch variable - Does not display multiline #144

Open nsolthe opened 4 years ago

nsolthe commented 4 years ago

When debugging I am getting results with multiline. When I add these varaibles to my watch I only get the first line but nothing more.

Couuld you please provide a way to make multiline visible?

I am using visual studio code in a linux environment

Executables

Version of bash-debug: 0.3.9

nsolthe@nsolthe-lm:~$ which bash
/bin/bash
nsolthe@nsolthe-lm:~$ code --version
1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64
nsolthe@nsolthe-lm:~$ bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done'
Linux nsolthe-lm 4.15.0-106-generic #107-Ubuntu SMP Thu Jun 4 11:27:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
---
/bin/bash
GNU bash, version 4.4.20(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

Debug Console:

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":"test","program":"/home/nsolthe/repos/sap-sysinfo/test.sh","showDebugOutput":true,"trace":true,"args":[],"argsString":"","env":{},"cwd":"/home/nsolthe/repos/sap-sysinfo","pathBash":"bash","pathBashdb":"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb","pathBashdbLib":"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir","pathCat":"cat","pathMkfifo":"mkfifo","pathPkill":"pkill","__sessionId":"cba10d77-789c-4131-86c2-1ac3685faa07"})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"::PROXYID::3835\n"}}
::PROXYID::3835
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/command/source.sh: line 41: /dev/stdin: No such device or address\n"}}
/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/command/source.sh: line 41: /dev/stdin: No such device or address
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"(/home/nsolthe/repos/sap-sysinfo/test.sh:10):\n10:\t'\n"}}
(/home/nsolthe/repos/sap-sysinfo/test.sh:10):
10: '
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":"stdout","output":"Debug environment: bash_ver=4.4.20(1)-release, bashdb_ver=4.4-0.94-mod, program=/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb, args=\n"}}
Debug environment: bash_ver=4.4.20(1)-release, bashdb_ver=4.4-0.94-mod, program=/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb, args=
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"3837\n"}}
3837
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","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: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":3,"command":"threads","success":true,"body":{"threads":[{"id":42,"name":"Bash thread"}]}}
From client: setExceptionBreakpoints({"filters":[]})
To client: {"seq":0,"type":"response","request_seq":4,"command":"setExceptionBreakpoints","success":true}
From client: stackTrace({"threadId":42,"startFrame":0,"levels":20})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"backtrace\n"}}
backtrace
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"->0 in file `/home/nsolthe/repos/sap-sysinfo/test.sh' at line 10\n"}}
->0 in file `/home/nsolthe/repos/sap-sysinfo/test.sh' at line 10
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"##1 source"}}
##1 sourceTo client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"(\"/home/nsolthe/repos/sap-sysinfo/test.sh\") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 102\n"}}
("/home/nsolthe/repos/sap-sysinfo/test.sh") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 102
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"##2 main"}}
##2 mainFrom client: stackTrace({"threadId":42,"startFrame":0,"levels":20})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-17719\", \"--tty_in\", \"/tmp/vscode-bash-debug-fifo-17719_in\", \"--library\", \"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir\", \"--\", \"/home/nsolthe/repos/sap-sysinfo/test.sh\") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 0\n"}}
("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-17719", "--tty_in", "/tmp/vscode-bash-debug-fifo-17719_in", "--library", "/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir", "--", "/home/nsolthe/repos/sap-sysinfo/test.sh") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 0
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"3837############################################################\n"}}
3837############################################################
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Execution breaks at '->0 in file `/home/nsolthe/repos/sap-sysinfo/test.sh' at line 10'\n"}}
To client: {"seq":0,"type":"response","request_seq":5,"command":"stackTrace","success":true,"body":{"stackFrames":[{"id":0,"source":{"name":"test.sh","path":"/home/nsolthe/repos/sap-sysinfo/test.sh","sourceReference":0,"adapterData":"bash-adapter-data"},"line":10,"column":0,"name":"->0 in file `/home/nsolthe/repos/sap-sysinfo/test.sh' at line 10"},{"id":1,"source":{"name":"bashdb","path":"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":102,"column":0,"name":"##1 source(\"/home/nsolthe/repos/sap-sysinfo/test.sh\") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 102"},{"id":2,"source":{"name":"bashdb","path":"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":0,"column":0,"name":"##2 main(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-17719\", \"--tty_in\", \"/tmp/vscode-bash-debug-fifo-17719_in\", \"--library\", \"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir\", \"--\", \"/home/nsolthe/repos/sap-sysinfo/test.sh\") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 0"}],"totalFrames":4}}
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":7,"command":"threads","success":true,"body":{"threads":[{"id":42,"name":"Bash thread"}]}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"backtrace\n"}}
backtrace
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"->0 in file `/home/nsolthe/repos/sap-sysinfo/test.sh' at line 10\n"}}
->0 in file `/home/nsolthe/repos/sap-sysinfo/test.sh' at line 10
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"##1 source"}}
##1 sourceTo client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"(\"/home/nsolthe/repos/sap-sysinfo/test.sh\") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 102\n"}}
("/home/nsolthe/repos/sap-sysinfo/test.sh") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 102
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"##2 main"}}
##2 mainTo client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-17719\", \"--tty_in\", \"/tmp/vscode-bash-debug-fifo-17719_in\", \"--library\", \"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir\", \"--\", \"/home/nsolthe/repos/sap-sysinfo/test.sh\") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 0\n"}}
("--quiet", "--tty", "/tmp/vscode-bash-debug-fifo-17719", "--tty_in", "/tmp/vscode-bash-debug-fifo-17719_in", "--library", "/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir", "--", "/home/nsolthe/repos/sap-sysinfo/test.sh") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 0
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"3837############################################################\n"}}
3837############################################################
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Execution breaks at '->0 in file `/home/nsolthe/repos/sap-sysinfo/test.sh' at line 10'\n"}}
To client: {"seq":0,"type":"response","request_seq":6,"command":"stackTrace","success":true,"body":{"stackFrames":[{"id":0,"source":{"name":"test.sh","path":"/home/nsolthe/repos/sap-sysinfo/test.sh","sourceReference":0,"adapterData":"bash-adapter-data"},"line":10,"column":0,"name":"->0 in file `/home/nsolthe/repos/sap-sysinfo/test.sh' at line 10"},{"id":1,"source":{"name":"bashdb","path":"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":102,"column":0,"name":"##1 source(\"/home/nsolthe/repos/sap-sysinfo/test.sh\") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 102"},{"id":2,"source":{"name":"bashdb","path":"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb","sourceReference":0,"adapterData":"bash-adapter-data"},"line":0,"column":0,"name":"##2 main(\"--quiet\", \"--tty\", \"/tmp/vscode-bash-debug-fifo-17719\", \"--tty_in\", \"/tmp/vscode-bash-debug-fifo-17719_in\", \"--library\", \"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir\", \"--\", \"/home/nsolthe/repos/sap-sysinfo/test.sh\") called from file `/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb' at line 0"}],"totalFrames":4}}
From client: scopes({"frameId":0})
To client: {"seq":0,"type":"response","request_seq":8,"command":"scopes","success":true,"body":{"scopes":[{"name":"Local","variablesReference":15,"expensive":false}]}}
From client: variables({"variablesReference":15})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Program stopped.\n"}}
Program stopped.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"It stopped after being stepped.\nNext statement to be run is:\n\tORA_SBP2='\n========================================================\nGENERIC OPATCH VERSION - FOR USE IN SAP ENVIRONMENT ONLY\n========================================================\nOPatch could not create/open history file for writing.\n\n'\n"}}
It stopped after being stepped.
Next statement to be run is:
    ORA_SBP2='
========================================================
GENERIC OPATCH VERSION - FOR USE IN SAP ENVIRONMENT ONLY
========================================================
OPatch could not create/open history file for writing.

'
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"examine <$PWD> \n"}}
examine <$PWD>
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"/home/nsolthe/repos/sap-sysinfo\n"}}
/home/nsolthe/repos/sap-sysinfo
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"examine <$? # from . \"$_Dbg_script_file\"> \n"}}
examine <$? # from . "$_Dbg_script_file">
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"0 # from '. \"$_Dbg_script_file\"'\n"}}
0 # from '. "$_Dbg_script_file"'
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"3837############################################################\n"}}
3837############################################################
To client: {"seq":0,"type":"response","request_seq":9,"command":"variables","success":true,"body":{"variables":[{"name":"$PWD","type":"string","value":"/home/nsolthe/repos/sap-sysinfo","variablesReference":0},{"name":"$? ","type":"string","value":"0 # from '. \"$_Dbg_script_file\"'","variablesReference":0}]}}
From client: continue({"threadId":42})
To client: {"seq":0,"type":"response","request_seq":10,"command":"continue","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"continue\n"}}
continue
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Debugged program terminated normally. Use q to quit or R to restart.\n"}}
Debugged program terminated normally. Use q to quit or R to restart.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"Sending TerminatedEvent"}}
To client: {"seq":0,"type":"event","event":"terminated"}
From client: disconnect({"restart":false})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"bash: line 1:  3839 Killed                  \"bash\" \"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb\" --quiet --tty \"/tmp/vscode-bash-debug-fifo-17719\" --tty_in \"/tmp/vscode-bash-debug-fifo-17719_in\" --library \"/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir\" -- \"/home/nsolthe/repos/sap-sysinfo/test.sh\"\n"}}
bash: line 1:  3839 Killed                  "bash" "/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir/bashdb" --quiet --tty "/tmp/vscode-bash-debug-fifo-17719" --tty_in "/tmp/vscode-bash-debug-fifo-17719_in" --library "/home/nsolthe/.vscode-server/extensions/rogalmic.bash-debug-0.3.9/bashdb_dir" -- "/home/nsolthe/repos/sap-sysinfo/test.sh"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"Terminated\n"}}
Terminated
To client: {"seq":0,"type":"response","request_seq":11,"command":"disconnect","success":true}
{
    // 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": "test",
            "program": "${workspaceFolder}/test.sh",
            "showDebugOutput": true
            "trace": true
        }
    ]
}

Details

I hope I have given all required info above no_multiline.zip

jd-mtb commented 4 years ago

I've noticed this exists in the debug console as well - you can see the full version with 'showDebugOutput' option but it isn't ideal.