vscode-bash-debug icon indicating copy to clipboard operation
vscode-bash-debug copied to clipboard

Adding "args": "Hello World" to launch.json result in non-starting debug

Open colindavidfoster opened this issue 5 years ago • 5 comments

Bash-Debug seems to work fine until I try to pass in a command line argument at which point I just get a continuous blue Knight Rider strobe under the DEBUG AND RUN box

Executables

Version 0.3.6

where bash gives /bin/bash

code --version gives /usr/share/code/bin/../code: /lib/x86_64-linux-gnu/libdbus-1.so.3: no version information available (required by /usr/share/code/bin/../code) 1.41.1 26076a4de974ead31f97692a0d32f90d735645c0 x64

bash -c 'uname -a; for P in bash bashdb cat mkfifo pkill; do echo ---; which -a $P; command $P --version; done' gives Linux lmde2 3.16.0-10-amd64 #1 SMP Debian 3.16.76-1 (2019-11-12) x86_64 GNU/Linux

/bin/bash GNU bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu) 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.

bash: bashdb: command not found

/bin/cat cat (GNU coreutils) 8.23 Copyright (C) 2014 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.23 Copyright (C) 2014 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.9

Debug output

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-gb"}) 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/colin/Workspaces/root - linuxrouter/internal_libs/buildtools/BuildAll.sh","args":"Hello, World","showDebugOutput":true,"trace":true,"env":{},"cwd":"/home/colin/Workspaces/root - linuxrouter/internal_libs/buildtools","pathBash":"bash","pathBashdb":"/home/colin/.vscode/extensions/rogalmic.bash-debug-0.3.6/bashdb_dir/bashdb","pathBashdbLib":"/home/colin/.vscode/extensions/rogalmic.bash-debug-0.3.6/bashdb_dir","pathCat":"cat","pathMkfifo":"mkfifo","pathPkill":"pkill","__sessionId":"d739cda8-73db-4143-b47a-c2be3afab725"}) To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"::PROXYID::24446\n"}} ::PROXYID::24446

Details

Debugging does not start

colindavidfoster avatar Jan 24 '20 14:01 colindavidfoster

Please attach the lauch.json contents.

rogalmic avatar Jan 24 '20 15:01 rogalmic

{ // 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}", "args": "Hello, World", "showDebugOutput": true, "trace": true
} ] }

colindavidfoster avatar Jan 26 '20 12:01 colindavidfoster

Please use array for args:

"args": [ "Hello, World" , "arg2" ],

I will need to fix error handling though, since extension should show proper error...

rogalmic avatar Jan 26 '20 13:01 rogalmic

You can also use argsString now:

{ 
  "argsString": "\"Hello, World\" arg2"
}

I believe this issue can be closed.

felipecrs avatar Aug 13 '20 13:08 felipecrs

Bash Debug version: v0.3.9

check.sh

code content


echo 111111111
echo 333333333
echo $@

echo 111111111
echo 111111122

launch.json config content

{
    // 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}",
            "args": [       // input args
                "aa",
                "bb"
            ]
        }
    ]
}

output

111111111
333333333
aa bb
111111111
111111122

xuarehere avatar Aug 09 '22 09:08 xuarehere