The Vivandiere
The Vivandiere

Reputation: 3191

backtrace - hide standard library and boost calls

I am looking at a backtrace in gdb, and it looks really cluttered because of all the calls made into the standard library and boost. Eg. I see boost::bind and std::allocator on the call stack, and several other similar calls into the standard library or Boost.

I think I would find it helpful to have backtrace show me just the functions explicitly defined in my program. Better yet, it would help further 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 altogether or to configure backtrace to turn boost logging on and off?

Upvotes: 5

Views: 774

Answers (1)

Tom Tromey
Tom Tromey

Reputation: 22549

There is no built-in way to do this.

It can be done, though, by writing a Python "frame filter" that drops the frames that you don't care to see. This isn't particularly hard to do, but it requires writing a bit of Python code using the gdb Python API.

Upvotes: 3

Related Questions