microsoft / microsoft/vscode-cpptools

Option(s) to suppress notifications when source files cannot be found in the debugger

Open
#2,762 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger Feature Request
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: Debugger

Describe the bug

  • OS and Version: Ubuntu 16.04.05 LTS
  • VS Code Version: 1.28.2 (7f3ce96ff4729c91352ae6def877e59c561f4850)
  • C/C++ Extension Version: 0.20.1
  • Other extensions you installed (and if the issue persists after disabling them):

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:

  • Provide an option to suppress the notification when files could not be found
  • A timed popup (so it pops up and only stays there for 2 seconds)
  • A less intrusive way of a notification

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the notification with the supplied C++ sample and launch.json on the VS Code C/C++ extension. Determine whether the notification is emitted by the extension or VS Code core, then identify the appropriate entry point and existing tests. Done means an agreed, tested way to suppress or reduce these missing-source notifications.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.