Log in

apparently I'm a dinosaur

More Secrets of Debian Revealed: -dbg packages

the dinosaur


More Secrets of Debian Revealed: -dbg packages

Previous Entry Share Next Entry

Living with mricon I get exposed to the way the other half lives. One thing I've noticed is that the RPM tools automatically build extra -debuginfo packages that contain the debugging symbols for the binaries in the package, which gdb can use. I thought too myself "That's cool, why doesn't Debian do that?" Of course, after some research it's actually very easy to accomplish the same thing in a DEB.

First step is just to add a dbg package to your debian/control file like so:

Package: giblib1-dbg
Architecture: any
Section: libdevel
Priority: extra
Depends: giblib1 (= ${Source-Version})
Description: debugging symbols for giblib1
 giblib is a library of handy stuff. Contains an imlib2 wrapper to avoid the
 context stuff, doubly-linked lists and font styles.
 This package contains the debugging symbols for giblib1.

Then change your call to dh_strip in your debian/rules files so it looks like this:

dh_strip --dbg-package=giblib1-dbg

If you use cdbs then just add the line:

DEB_DH_STRIP_ARGS := --dbg-package=giblib1-dbg

These cause dh_strip to place the debugging symbols under /usr/lib/debug in the named package. Make sure you have debhelper compatibility level set to 5, as the semantics for the --dbg-package switch in 4 and earlier were different and weird.

So add a -dbg package to your library or binary today!

  • thanks!

    Thanks for sharing your research! Hope this finds its way to Debian documentation, if it is not already the case. Eventually, users could easily provide debugging information when submitting bug reports. "> So add a -dbg package to your library or binary today!" Not sure debian mirrors could hold the additional disk space for all libraries and binaries, so keep it a bit secret ;-) But easy way to rebuild packages with -dbg would be helpful (without editing any control file).
    • Re: thanks!

      Bah, we just went through a big mirror reorganization, I think we can take it :)
  • that debhelper change annoyed me because I didn't understand why my -dbg package was no longer being created.... 'til I read the complete changelog if the package.
    • But you must of changed your debhelper compatibility level, right?
      • yeah. I was using compat 4, but ubuntu wants to use compat 5. So I did on a new package. That's why.
Powered by LiveJournal.com