Backtrace - hide the standard library and increase calls

I look at backtrace in gdb and it looks really cluttered due to all the calls made to the standard library and the enhancement. For instance. I see boost::bind and std::allocator in the call stack and several other similar calls to the standard library or Boost.

I think it would be helpful if the backtrace only showed me the functions explicitly defined in my program. Even better, if I could quickly configure the backtrace command to show or hide std and boost calls as and when I need them.

Any idea how to hide boost from the call stack in general or configure backtrace to turn towing on and off?

+5
source share
1 answer

There is no built-in way to do this.

However, this can be done by writing a "frame filter" in Python, which drops frames that you don't like. This is not particularly difficult to do, but this requires writing some Python code using the Python gdb API.

+3
source

All Articles