Introduction
Debug packages contain debug symbols and usually are named <package>-dbg. They are useful if program crashes and you want to generate stack trace which contains information about functions where it crashed.
How to create one?
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!