Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   Split debugging symbols into separate package (http://www.linux-archive.org/archlinux-pacman-development/706668-split-debugging-symbols-into-separate-package.html)

Allan McRae 09-23-2012 03:40 PM

Split debugging symbols into separate package
 
On 24/09/12 00:44, Allan McRae wrote:
> This patchset allows makepkg to automatically create packages from the stripped
> debugging symbols.
>
> Patches 1, 4 and 6 are only mildly related... but a fixes that were "needed"
> along the way.
>
> The idea is to add options=('debug') to your PKGBUILD or in makepkg.conf and
> then makepkg will add DEBUG_CFLAGS and DEBUG_CXXFLAGS (defined in makepkg.conf)
> to their buildflag counterparts.
>
> When both "debug" and "strip" are specified in the options, the debug symbols
> are copied into a separate folder before the files are stripped. The main
> debugging symbols are in /usr/lib/debug/path/to/file
> (e.g. /usr/lib/debug/usr/bin/pacman) and are hardlinked if required. If the
> binary was linked with a build ID, the relevant symlinks in
> /usr/lib/debug/.build_id are created.
>
> Testing is needed...
>

valgrind without debug package installed:
==27108== Invalid free() / delete / delete[] / realloc()
==27108== at 0x4029F8C: operator delete(void*) (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==27108== by 0x8048760: ??? (in /usr/bin/foo)
==27108== by 0x41AD604: (below main) (in /usr/lib/libc-2.16.so)
==27108== Address 0x4342028 is 0 bytes inside a block of size 4 free'd
==27108== at 0x4029F8C: operator delete(void*) (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==27108== by 0x8048754: ??? (in /usr/bin/foo)
==27108== by 0x41AD604: (below main) (in /usr/lib/libc-2.16.so)


valgrind with debug package:
==27142== Invalid free() / delete / delete[] / realloc()
==27142== at 0x4029F8C: operator delete(void*) (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==27142== by 0x8048760: main (test.cpp:8)
==27142== Address 0x4342028 is 0 bytes inside a block of size 4 free'd
==27142== at 0x4029F8C: operator delete(void*) (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==27142== by 0x8048754: main (test.cpp:7)


Similar things happen with gdb!

Allan


All times are GMT. The time now is 08:34 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.