CLion debug: Skip C++ standard files in GDB debugger

You need to tell GDB debugger to skip standard file by making two .gdbinit files.

One is inside the project folder and is a part of oorbs repository.

The other one is inside you home directory and will address the other .gdbinit file.

More info:
https://stackoverflow.com/questions/5676241/tell-gdb-to-skip-standard-files/42985979#42985979
https://www.jetbrains.com/help/clion/configuring-debugger-options.html#gdbinit-lldbinit

 Add .gdbinit file in your home directory (if it didn’t work try Linux root: /root/.gdbinit). Past this content into the file:

# info:
printf "\n\n***this is .gdbinit in ROOT dir***\n"
# Load local gdb
set auto-load local-gdbinit on
add-auto-load-safe-path /
printf "\nLocal .gdbinit file can be loaded now.\n"

The other .gdbinit file is a part of the project and should be inside Git clone folder of the project:

# info:
printf "\nThis is .gdbinit in local Git dir\n"
# To skip default .h files
skip -gfile /usr/include/c++/9/bits/*.h
printf "\n"

Number 9 on line 4 above, may be wrong for you depending on your GCC version.

When you run in debug mode you should see this on the GDB tab of Clion:

Leave a comment

Design a site like this with WordPress.com
Get started