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
You can skip certain files from being stepped in. See documentation for skip :
-file file
-fi file
Functions in file will be skipped over when stepping.
-gfile file-glob-pattern
-gfi file-glob-pattern
Functions in files matching file-glob-pattern will be skipped over when stepping.
(gdb) skip -gfi utils/*.c
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.