Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDB Remote Attach Fails with "Linux: unexpected operator" #2473

Closed
timedroid opened this issue Aug 31, 2018 · 1 comment
Closed

GDB Remote Attach Fails with "Linux: unexpected operator" #2473

timedroid opened this issue Aug 31, 2018 · 1 comment

Comments

@timedroid
Copy link

timedroid commented Aug 31, 2018

Type: Debugger

Describe the bug

  • OS and Version: Windows 7
  • VS Code Version: 1.26.1
  • C/C++ Extension Version: 0.18.1
  • Other extensions you installed (and if the issue persists after disabling them):
  • Process picket command fails due to unexpected operator

To Reproduce

"name": "(gdb)",
"type": "cppdbg",
"request": "attach",
"program": "...",
"processId":"${command:pickRemoteProcess}",
"pipeTransport": {
    "pipeCwd": "",
    "pipeProgram": "C:/Program Files/Git/usr/bin/ssh.exe",
    "pipeArgs": [
        "root@172.20.0.253"
    ],
    "debuggerPath": "/usr/bin/gdb"
},

Steps to reproduce the behavior:

  1. Try to connect to Ubuntu 16.04 using above config
  2. Get error message containing the following:
    sh: 1: [: Linux: unexpected operator
    sh: 1: [: Linux: unexpected operator

Trying to debug, it appears the following command is being executed:
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
I get the following output executing the command manually.

I believe the problem is the use of '=='. As far as I know, this depends on bash. The normal shell should use '=' instead.

Additional context
Output window contains:
Linux
sh: 1: [: Linux: unexpected operator
sh: 1: [: Linux: unexpected operator

Nothing else is logged, despite logging being enabled

@pieandcakes
Copy link
Contributor

Thank you for reporting this issue. This is a duplicate of #2444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants