Sean’s Obsessions

Sean Walberg’s blog

Using Those Debuginfo Packages

Whenever you generate an RPM (rpmbuild -ba foo.spec), an package called foo-debuginfo is also created.

My original thoughts were that this created a debugging version of the binary, ie the same version compiled with -g, because (*hitches up suspenders*) that’s the way we used to do it.  So, I’d delete them.

After needing to get a backtrace of a binary the other day, I researched the use of the package, and it turns out it’s just all the debug information from the object files that were stripped out when creating the binary.  Through some mechanism, gdb knows to look in /usr/lib/debug/…  for the debugs.  This behaviour has been around since Red Hat 9, so I’m pretty embarrassed that I’m just learning about it now!

So, with the -debuginfo package installed you’re running the stripped binary in production, but if you need to attach a debugger or look at a core dump, you have full debug information.

Comments

I’m trying something new here. Talk to me on Twitter with the button above, please.