Type: Debugger
Describe the bug
When debugging, a notification always pops up when a source file cannot be found, for example:
Unable to open 'raise.c': File not found (file:///build/glibc-Cl5G7W/glibc-2.23/sysdeps/unix/sysv/linux/raise.c).Unable to open 'abort.c': File not found (file:///build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c).This happens when an uncaught exception occurred, for example. In itself it's not an impeding issue (everything works), but it is annoying nonetheless - I have to forcefully click the × button each time to close the notification window when this happens.
I could install the libc sources but that's a rather crude solution in my opinion :)
I'd prefer if there is some way to improve on this, such as:
I am not sure if this repository is the right place to request this feature (maybe it's written in the VSCode core) but here goes anyway.
To Reproduce
Code sample:
#include <exception>
int main() {
throw std::exception();
}
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
When launching, the debugger will kick in ("PAUSED ON EXCEPTION"). A popup immediately shows up that it's unable to open 'raise.c'.
Additional context
The issue is somewhat relevant to this issue (for a different extension): https://github.com/vadimcn/vscode-lldb/issues/146
In any case, thanks so far for the wonderful extension.
@krpors The problem is that the debugger returns that as where the breakpoint is being hit and we send it to VS Code. VS Code has suggested a way for us not to display it but we aren't able to determine from gdb/lldb that this file is not part of the users debugging solution, which causes the file not found message to be displayed. If there was a way for us to figure out that the file isn't one of the user's file, then we might be able to implement a solution.
I think a hacky way would be to try and "guess" if its a framework file and suppress it but I don't know if that is the right way to go either.
I've been running into this problem as well. It gets tedious after about the hundredth time you dismiss the dialog asking if you want to create a source file for "raise.c".
What would work for me is simply a button on the dialog that says "don't ask me again" for this particular file. That is, the first time it pops open the dialog telling me that it can't find "raise.c", I'd click on the button that says "don't ask me again", and it would add that source path to its exclusion list (which could be stored in my user settings or elsewhere).
Just give us an option to disable this whole message. It's useless.
And incredibly tedious having to click to close it allthefsckingtime*.
@crazydef The message is not from the extension.
How this works is that we hit a breakpoint (or a stopping point) and VS Code asks us for a file path as part of a stack walk . We return said file path. VS Code tries to load the file and then says "I can't find it." and shows you the message. VS Code has an option of presentationHint but we haven't tested to see how that reacts.
Most helpful comment
Just give us an option to disable this whole message. It's useless.
And incredibly tedious having to click to close it allthefsckingtime*.