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

NullReferenceException on Linux when trying to debug #3698

Closed
dunderX opened this issue May 26, 2019 · 4 comments
Closed

NullReferenceException on Linux when trying to debug #3698

dunderX opened this issue May 26, 2019 · 4 comments

Comments

@dunderX
Copy link

dunderX commented May 26, 2019

  • OS and Version: Linux Manjaro
  • VS Code Version: 1.34.0
  • C/C++ Extension Version: 0.23.1
  • Other extensions you installed (and if the issue persists after disabling them): none
  • A clear and concise description of what the bug is:
    got "Stopping due to fatal error: NullReferenceException: Object reference not set to an instance of an object" on CONSOLE DEBUG. just tried to debug a simple c++ program to see how it works on vscode

launch.json:

    "name": "(gdb) Launch",
    "type": "cppdbg",
    "request": "launch",
    "program": "{workspaceFolder}/${fileBasenameNoExtension}",
    "args": [],
    "stopAtEntry": true,
    "cwd": "${workspaceFolder}",
    "environment": [],
    "externalConsole": false,
    "MIMode": "gdb",
    "miDebuggerPath": "/usr/bin/gdb",

with a simplle "hello world" program

If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.

when I tried to add these, I got "Property X is not allowed." on all of them..

@pieandcakes
Copy link
Contributor

@dunderX can you paste a launch.json that has the logging that fails? I can't duplicate your error. Note you need to have the outer logging object and then specify the individual logging types within it: "logging": { "engineLogging": true } for example to enable engine logging.

@dunderX
Copy link
Author

dunderX commented May 28, 2019

@dunderX can you paste a launch.json that has the logging that fails? I can't duplicate your error. Note you need to have the outer logging object and then specify the individual logging types within it: "logging": { "engineLogging": true } for example to enable engine logging.

I did it,
but also changed "program" to the full path instead of "${fileDirname}/${fileBasenameNoExtension}".
Now it's started. I guess this "${fileDirname}/${fileBasenameNoExtension}" doesn't point to the right executable file.
Is there any way I can check what those values are and how to make sure they are set automatically for the next times?

thanks

@pieandcakes
Copy link
Contributor

Those are resolved by VS Code and unfortunately without enabling a setting like traceResponse logging, where you can see what we are sent, there doesn't seem to be a good way to see the values.

@dunderX
Copy link
Author

dunderX commented May 28, 2019

thanks, I'll figure it out.

@dunderX dunderX closed this as completed May 28, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants