Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude files from vscode C++ debug step into?

Is it possible to exclude certain files from being stepped in to in the vscode C++ debugger? I'm using gdb for debugging.

My executable is built and run remotely in a Docker container, and the host environment for VSCode does not have the standard header files instead for the Docker environment.

In particular, it's trying to step into STL code, which I'd rather exclude anyway.

Thanks

like image 738
Steve Folly Avatar asked Jul 11 '26 14:07

Steve Folly


1 Answers

To skip files while debugging with gdb in VSCode, one could add the following section to setupCommands of launch.json :

 "setupCommands": [
                      {
                        "description": "Skip library files",
                        "text": "-interpreter-exec console \"skip -gfi **/bits/*.h\""
                      }  
                  ],

This is going to skip all header files in all folders named bits. Similarly, one could type -exec skip -gfi **/bits/*.h in VSCode debug console.

Docs

like image 89
ambushed Avatar answered Jul 14 '26 05:07

ambushed