Type: Debugger
- OS and Version: windows
- VS Code Version: 1.30.0
- C/C++ Extension Version: 0.21.0
- Other extensions you installed (and if the issue persists after disabling them):
- A clear and concise description of what the bug is.
To Reproduce
Please include a code sample and launch.json configuration.
{
"name": "C++ Attach in hello_gdb container",
"type": "cppdbg",
"request": "attach",
"program": "/hello.out",
"processId": "${command:pickRemoteProcess}",
"pipeTransport": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "docker",
"pipeArgs": [
"exec",
"-i",
"hello_gdb",
"sh",
"-c"
],
"debuggerPath": "/usr/bin/gdb"
},
Steps to reproduce the behavior:
- Build a simple docker container image for cpp project. Start the container.
- Start the debugger to attach to the process.
- See error
Command failed: "docker" "exec" "-i" "hello_gdb" "sh" "-c" 'sh -c 'uname && if [ $(uname) = "Linux" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = "Darwin" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= -c; fi''
$(uname) was unexpected at this time.
Additional context
It seems the process picker script has some problem. I tried to use the remote process picker from csharp extension (use cshap debugger attach configuration), it could list the process. And I think the problem is instead of using "sh -c" to run the script, it should be "sh -s" instead.
Type: Debugger
To Reproduce
Please include a code sample and
launch.jsonconfiguration.{
"name": "C++ Attach in hello_gdb container",
"type": "cppdbg",
"request": "attach",
"program": "/hello.out",
"processId": "${command:pickRemoteProcess}",
"pipeTransport": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "docker",
"pipeArgs": [
"exec",
"-i",
"hello_gdb",
"sh",
"-c"
],
"debuggerPath": "/usr/bin/gdb"
},
Steps to reproduce the behavior:
Command failed: "docker" "exec" "-i" "hello_gdb" "sh" "-c" 'sh -c 'uname && if [
$(uname) was unexpected at this time.
Additional context
It seems the process picker script has some problem. I tried to use the remote process picker from csharp extension (use cshap debugger attach configuration), it could list the process. And I think the problem is instead of using "sh -c" to run the script, it should be "sh -s" instead.