June 9, 2019

GDB Steps Over Functions

  —A brain-fart using gdb, but a common one.

I recently had occasion to debug some code in Boost.Regex. Boost.Regex is a really well written Boost library that was a pleasure to read.

I got burned initially when debugging Boost.Regex because I had forgotten that it includes a library, so when I tried to use GDB to step into a library function it stepped over it. The solutin, of course was to recompile the library to support debugging.

The surprising thing about this is that I initially tried solving this issue by Googling for “stepping over template” and got a surprising number of hits related to optimization flags. I wonder how many of those problems were because the template had been compiled into a library…

comments powered by Disqus