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

CPP Debug not work #70

Closed
wwbmmm opened this issue Mar 7, 2019 · 5 comments
Closed

CPP Debug not work #70

wwbmmm opened this issue Mar 7, 2019 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@wwbmmm
Copy link

wwbmmm commented Mar 7, 2019

  • code-server version: code-server v1.0.0
  • OS Version: Ubuntu 18.10
  • Extension: ms-vscode.cpptools

Steps to Reproduce

  1. install ms-vscode.cpptools extension
  2. write a cpp file, eg. a.cpp, and compile as target a.out
  3. edit .vscode/launch.json, add debug configuration:
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "mydebug",
            "type": "cppdbg",
            "request": "launch",
            "program": "/path-to-out/a.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": ".",
            "externalConsole": true,
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "miDebuggerPath": "/path-to-gdb/bin/gdb",
            "logging": {
                "engineLogging": true,
                "trace": true,
                "traceResponse": true
            },
            "linux": {
                "MIMode": "gdb"
            },
            "osx": {
                "MIMode": "gdb"
            },
            "windows": {
                "MIMode": "gdb"
            }
        } 
    ]
}
  1. launch debug, and it will be blocked

output in Debug Console:

1: (333) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-aql0olr8.7a7 ; cd /Users/wangweibing/dev/demo/bc_out/baidu/bcloud-demo/hello-git/output/bin ; DbgTerm=`tty` ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-v0g5v6cv.yd2 /tmp/Microsoft-MIEngine-Out-eprffizq.g0y /tmp/Microsoft-MIEngine-Pid-aql0olr8.7a7 /tmp/Microsoft-MIEngine-Cmd-kbqexxnx.681' EXIT ; /opt/compiler/gcc-4.8.2/bin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-v0g5v6cv.yd2 > /tmp/Microsoft-MIEngine-Out-eprffizq.g0y & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-aql0olr8.7a7 ; wait $pid; 
--> C (runInTerminal-30): {"command":"runInTerminal","arguments":{"kind":"external","title":"cppdbg: child","cwd":"","args":["sh","/tmp/Microsoft-MIEngine-Cmd-kbqexxnx.681"],"env":{}},"seq":30,"type":"request"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (347) Wait for connection completion.\n"},"seq":32,"type":"event"}
1: (347) Wait for connection completion.
@kylecarbs
Copy link
Member

kylecarbs commented Mar 7, 2019

Possibly related to: #63

@nhooyr nhooyr added bug Something isn't working needs-investigation labels Mar 8, 2019
@justmao945
Copy link

+1

@therealkenc
Copy link

This worked for me with code-server 1.32.0-282, vscode-cpptools 0.21.0, self hosted on Ubuntu 18.10. I haven't tried the docker image. You'll probably want "externalConsole": false in your launch.json, although : true did work as well for me (launching an external gnome-terminal on the server side).

@kylecarbs kylecarbs self-assigned this Mar 26, 2019
@kylecarbs kylecarbs added this to the March 2019 milestone Mar 26, 2019
@kylecarbs
Copy link
Member

This should definitely work now. We've fixed the core problem with debugging.

@kylecarbs
Copy link
Member

Fixed with the latest release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants