Discussion:
[yocto] How to generate debug symbols but not copied to the image?
Austin Kim
2016-06-28 15:38:55 UTC
Permalink
Hi,

I'm wondering how to copy only stripped binary and leave debug symbols on
the host build machine. I'm running on the OS on a very tight HDD space so
I cannot put debug symbols into the image. So I tried


PACKAGE_DEBUG_SPLIT_STYLE = 'debug-without-src'

EXTRA_IMAGE_FEATURES = "dbg-pkgs"

But the output image is still bigger than the original image. Is there
anyway to keep the original size and keep debug symbols and source code in
the host so DBG may reference them during debugging?

*- Austin*
Burton, Ross
2016-06-28 15:42:56 UTC
Permalink
Post by Austin Kim
I'm wondering how to copy only stripped binary and leave debug symbols on
the host build machine. I'm running on the OS on a very tight HDD space so
I cannot put debug symbols into the image. So I tried
PACKAGE_DEBUG_SPLIT_STYLE = 'debug-without-src'
EXTRA_IMAGE_FEATURES = "dbg-pkgs"
But the output image is still bigger than the original image. Is there
anyway to keep the original size and keep debug symbols and source code in
the host so DBG may reference them during debugging?
Adding dbg-pkgs to IMAGE_FEATURES says that you want full debugging on the
target. Simply don't set that and you'll get stripped binaries on the
target but full debugging is available on the host for remote gdb (see
IMAGE_GEN_DEBUGFS).

Ross
Austin Kim
2016-06-28 17:28:47 UTC
Permalink
Thank you for the help.

Now, it generate the debug image but there are two questions.

1. I have problem with Eclipse ADT plugin. I don't know how to set
debug-file-directory into my .dbginit. My project is created via eclipse
Yocto ADT plugin and it overwrites .dbginit whenever Eclipse starts
debugger.I'm pretty new to Yocto, Eclipse and Linux world. Could you give
me any idea how I can set debug-file-directory? I cannot update .dbginit
since the file is overwritten whenever debug starts.

2. When I build the image, it generates tar.gz compressed image and I have
to manually extract the image in some directory whenever build the image
and debug it. Is there any way to deploy the debug symbols under existing
sysroot during the build phase?

These are what I did -

IMAGE_GEN_DEBUGFS = "1"
PACKAGE_DEBUG_SPLIT_STYLE = "debug-file-directory"
IMAGE_FSTYPES_DEBUGFS = "tar.gz"


Thanks!


*- Austin*
Post by Burton, Ross
Post by Austin Kim
I'm wondering how to copy only stripped binary and leave debug symbols on
the host build machine. I'm running on the OS on a very tight HDD space so
I cannot put debug symbols into the image. So I tried
PACKAGE_DEBUG_SPLIT_STYLE = 'debug-without-src'
EXTRA_IMAGE_FEATURES = "dbg-pkgs"
But the output image is still bigger than the original image. Is there
anyway to keep the original size and keep debug symbols and source code in
the host so DBG may reference them during debugging?
Adding dbg-pkgs to IMAGE_FEATURES says that you want full debugging on the
target. Simply don't set that and you'll get stripped binaries on the
target but full debugging is available on the host for remote gdb (see
IMAGE_GEN_DEBUGFS).
Ross
Loading...