You are not logged in.

#1 2011-01-03 11:09:38

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

How do I compile ABS package with gdb debugging symbols?

The info I read on gdb says, "Pass the -g flag to your compiler".

Is this possible with PKGBUILD and makepkg? Can I just edit the PKGBUILD or better to temp edit to makepkg.conf?

eg: 'makeflags-g' added to the options in the PKGBUILD

I've compiled everything from the AUR on my system manually, rather than relying on an AUR "helper", so I think I have a basic understanding of this part.
The only time I've had to change anything in a PKGBUILD was just the source url and md5sum.

I have a copy of nautilus from ABS ready to go.

Also, how do I differentiate the version number to keep things straight on my part, but not screw things up on my system? 
Could I just edit the version after compiling to add a "d" and install as normal?  eg: nautilus-2.32.2.1-1d-x86_64.pkg.tar.xz


Check out my website for info on the Arch Linux Installer

Offline

#2 2011-01-03 11:25:02

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,459
Website

Re: How do I compile ABS package with gdb debugging symbols?

"man makepkg.conf" and look for strip.

Offline

#3 2011-01-03 11:27:13

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: How do I compile ABS package with gdb debugging symbols?

Overall it would probably be easier to edit makepkg.conf. You could save the edited version somewhere else and specify it with the "--config" option rather than revert the edit (which is what I assume you meant by "temp edit").

If you need to make more complicated edits to PKGBUILDs you could use Bauerbill, which provides a way to create a PKGBUILD patch after an edit and automatically apply on subsequent rebuilds. That would let you continue to upgrade normally without needing to hack version numbers or worry about detecting new versions.

You shouldn't add anything to the $pkgrel variable and adding letters to the $pkgver will have undesired effects, as vercmp will treat it as a beta version and think that it should be upgraded. Just leave the $pkgver and $pkgrel variables unchanged. You won't mess up anything by recompiling the package with custom flags and re-installing it.

If you just want to keep track of which packages you've customized then you could either keep a simple list or rename the packages, e.g. "foo-gdb". In that case, add "provides=('foo')" and "conflicts=('foo')" to the PKGBUILD.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2011-01-03 12:10:37

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: How do I compile ABS package with gdb debugging symbols?

Even if makepkg  doesn't strip symbols there no guarantee the build-sys includes the -g flag in CFLAGS.

Offline

#5 2011-01-03 13:02:55

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Re: How do I compile ABS package with gdb debugging symbols?

Thanks for all the help

Yea, I just saved my orig makepkg.conf as makepkg.conf.orig so I can rename it when I'm done having fun with this.
I commented out strip in the the OPTIONS=(!strip docs libtool emptydirs zipman purge)
Then I edited to "--strip-unneeded" on the STRIP_BINARIES, STRIP_SHARED, STRIP_STATIC.

I did edit the pkgver per above (d) before I returned to read that it's not good to do......

I installed the newly compiled version to still get

Reading symbols from /usr/bin/nautilus...(no debugging symbols found)...done. 
(gdb) 

@ falconindy   Quote: no guarantee the build-sys includes the -g flag in CFLAGS

Where to get source that would have it, and how to tell if it does before building it?
If I'm getting what your saying, it could be stripped from the original source?

EDIT:  Should have read this before now....https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces... missing pieces of the puzzle for me!

Last edited by jeff story (2011-01-03 13:13:03)


Check out my website for info on the Arch Linux Installer

Offline

Board footer

Powered by FluxBB