Project

General

Profile

What is the purpose of the 'debug' packages?

Time4Tea - about 4 years ago -

Hi, I started building packages from PKGBUILDs about a week ago (for ones I have been having issues with). I notice that when a package is built with makepkg , it creates two packages: a 'regular' one and a 'debug' one. I get the impression the debug one is not produced as standard with the Arch version of makepkg, and I am wondering how to use it? (I can't see any reference to it on the Arch wiki pages for makepkg)

I mean, clearly it is used for debugging applications, but are there any instructions anywhere on how to use it? If I want to debug something, do I install the debug package alongside the regular one, or instead of? Does that allow me to then run gdb with the installed program?


Replies (6)

RE: What is the purpose of the 'debug' packages? - freemor - about 4 years ago -

Debug packages are actually more of a compiler option then a mkpkg option, tho makepkg does know how to roll the debug files created by the compile into a package.

They contain the symbol tables and other information needed by gdb. Well needed if you want human comprehendable lables/etc in your traces and decompiles.

A good starter on them is here:

https://www.sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

RE: What is the purpose of the 'debug' packages? - Time4Tea - about 4 years ago -

freemor ok, thanks for the link. So, it seems like I install the debug package alongside the regular one, then I can use gdb?

RE: What is the purpose of the 'debug' packages? - bill-auger - about 4 years ago -

yes, just install the debug package and gdb will find it - gdb
will work the same without the debug symbols; but it will not be
as helpful locating the source of the error - often the error is
not in the program, but in a library - in that case you would
also need the debug symbols for that library - unfortunately,
those are mostly arch packages, and arch does not make debug
packages; so you would need to build those yourself, in such
cases

RE: What is the purpose of the 'debug' packages? - Time4Tea - about 4 years ago -

Is there a way to suppress building the debug packages? They seem to add quite a bit of time to the build.

RE: What is the purpose of the 'debug' packages? - bill-auger - about 4 years ago -

to avoid making the debug package, add options=(!debug) to the PKGBUILD

RE: What is the purpose of the 'debug' packages? - eschwartz - about 4 years ago -

makepkg.conf(5) is the correct place to add this option!

The file at https://git.parabola.nu/abslibre.git/tree/libre/pacman/makepkg.conf.in contains different settings from the one in https://git.archlinux.org/svntogit/packages.git/tree/trunk/makepkg.conf?h=packages/pacman
One of these changes is that parabola makes 'debug' the default-enabled option in OPTIONS=()

    (1-6/6)