microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.52k stars 1.55k forks source link

Debugger: Add Support for Enabling/Disabling Steeping into System Libraries #8232

Open stellarpower opened 3 years ago

stellarpower commented 3 years ago

Add Support for Enabling/Disabling Steeping into System Libraries

Type: Feature Request

(I would've thought this would have been an existing issue, or solved, but I haven't found anything after ~20 minutes.)

Background

Sometimes we explicitly want to step into, and set breakpoints in, either the standard library, or other installed system libraries. And at other times, this can be a nuisance that makes "step into" inconvenient to use, for example, because it steps into copy constructors, move assignment operators, whatever it may be, that are performed before the call to our own function. When undesired, the latter can disrupt our flow and be a distraction. Whilst when working on code installedin a systrem location, stepping into the former is an essential requirement.

Rough Proposed Solution

I'm not sure if data breakpoints currently work in C++ in VS Code - at least, I do not see any way to enable it on my setup, but, even if absent, I expect it wil be added in due course.

Implementation Details

WardenGnaw commented 3 years ago

Disable/Enable Feature is similar to https://github.com/microsoft/vscode-cpptools/issues/514 DataBreakpoints are at https://github.com/microsoft/vscode-cpptools/issues/1410 Exception Handling is at https://github.com/microsoft/vscode-cpptools/issues/1800

For the core request of Disable/Enable source files to skip over, you can use setupCommands in your launch.json. e.g.

            "setupCommands": [
                {
                    "description": "Skip over stdlib/*.c",
                    "text": "-exec skip -gfi stdlib/*.c",
                    "ignoreFailures": true
                }
            ]
stellarpower commented 3 years ago

Thanks for the workaround - shall I close in favour of those other issues?