the dinosaur (ze_dinosaur) wrote,
the dinosaur
ze_dinosaur

More Secrets of Debian Revealed: -dbg packages

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!

Tags: debian, en
Subscribe

  • Epic Lameness

    SF.net now supports OpenID. Hooray! I'd like to make a comment on a thread about the RTL8187se chip I've got in my new MSI Wind. So I go to sign…

  • Sentiment Sharing

    Biella, I am from there and I do agree. If I was still living there I would try to form a team and make a bid. Simon even made noises about…

  • Conferencing

    So first the bad news is that I'm not coming to DebConf this year. There are a few reasons for this. It's fairly far and expensive. I thought the…

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 5 comments