[Buildroot] [PATCH] store debug information in $HOST_DIR/lib/debug

Thomas Petazzoni thomas.petazzoni at bootlin.com
Mon Feb 4 16:58:09 UTC 2019


Hello Gerhard,

Thanks for this contribution. I'm adding in Cc a few other people to
hopefully get their attention.

On Wed, 23 Jan 2019 14:15:39 +0100
Gerhard Heift <gerhard at heift.name> wrote:

> Before striping the binaries in $TARGET_DIR, the debug information is saved to
> $HOST_DIR/lib/debug using the following command as described in [1]:
> 
>   $ objcopy --only-keep-debug --compress-debug-sections $file
> 
> This allows remote debugging as described in section 8.12.2 with striped
> binaries in the final image. Therefore the build ID is included during the build
> process, if debug information is enabled via BR2_ENABLE_DEBUG.
> 
> [1] https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
> 
> Signed-off-by: Gerhard Heift <Gerhard at Heift.Name>

When you build with BR2_ENABLE_DEBUG=y and BR2_STRIP_strip=y, all the
libraries in $(STAGING_DIR) are installed with debugging symbols, and
they are not stripped.

As explained in our manual section 8.12.2, we provide a gdbinit that
tells gdb to look in $(STAGING_DIR) for debugging symbols.

Your patch has the effect of duplicating the debugging symbols: they
are already in $(STAGING_DIR), and they will now be duplicated in
$(HOST_DIR)/lib/debug. The only benefit that I can see is that the
gdbinit file is no longer needed because gdb will automatically look in
$(HOST_DIR)/lib/debug. But that can probably be resolved by making
$(HOST_DIR)/lib/debug a symlink to $(STAGING_DIR). Could you try this
instead ?

Thanks a lot,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list