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

C++ Debugging broken on linux with latest vscode #2744

Closed
isidorn opened this issue Dec 13, 2018 · 2 comments
Closed

C++ Debugging broken on linux with latest vscode #2744

isidorn opened this issue Dec 13, 2018 · 2 comments

Comments

@isidorn
Copy link
Contributor

isidorn commented Dec 13, 2018

As reported by users here microsoft/vscode#64948
fyi @WardenGnaw @pieandcakes

Version: 1.30.0
Commit: c6e592b2b5770e40a98cb9c2715a8ef89aec3d74
Date: 2018-12-11T22:21:33.585Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Linux x64 4.18.0-3-amd64

Steps to Reproduce:

  1. Create a C/C++ project.
  2. Add a debug configuration with GDB.
  3. Launch with or without debugging.

What happens:

The Debug Console displays:

Stopping due to fatal error: NullReferenceException: Object reference not set to an instance of an object

The program does not start and the external console stays empty.

  • I have been able to reproduce this issue on Debian and Ubuntu. (Other platforms unknown.)
  • I have only seen this happen with C/C++ debugging. (The only other configuration I have tried is Node.js. Could someone please try other configurations?)
  • This began to occur after updating to 1.30.0, although this may be present in prior versions.

The C/C++ Extension must be enabled to use C/C++ debugging.

Screenshot:

screenshot from 2018-12-12 20-57-07

@isidorn
Copy link
Contributor Author

isidorn commented Dec 13, 2018

I have tried reproducing this and could not. I tried with Ubuntu 16 and Mac OS X.
Here's my sample program and my launch.json

I believe this is an issue with the C++ extension thus I am moving it to the C++ repository.
If it turns out to be an issue with VSCode please let us know and we will look into a candidate fix.

#include <stdio.h>

int main(int argc, char *argv[]) {
    for (int i = 0; i < argc; i++) {
        fprintf(stdout, "argv[%d]: %s\n", i, argv[i]);
    }
    return 0;
}
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/a.out",
            "args": [
                "hello", "world", "!"
            ],
            "stopAtEntry": true,
            "cwd": "${workspaceRoot}",
            "linux": {
                "MIMode": "gdb",
                "miDebuggerPath": "/usr/bin/gdb"
            },
            "osx": {
                "MIMode": "lldb"
            },
            "windows": {
                "MIMode": "gdb",
                "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
            },
            "externalConsole": false
        }
    ]
}

screenshot 2018-12-13 at 11 04 17

@isidorn
Copy link
Contributor Author

isidorn commented Dec 13, 2018

Appologies, I created it in the wrong repository

@isidorn isidorn closed this as completed Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant