Hi all, I sent this patch to start the conversation, but I guess
PACKAGE_MINIDEBUGINFO may have to be turned into a DISTRO_FEATURES before
this can be merged.
I tested this with core-image-sato after enabling systemd in local.conf. I
then started:
$ vi
In other terminal:
$ kill -SEGV $(pidof vi)
$ coredumpctl info

Before the patch, I didn't get a call-stack with symbols. After the patch,
I get a call-stack including function names inside busybox.nosuid
("read_key()").

This is a very useful feature for debugging and/or bug reporting, so I
think it would make sense to make it easy to enable via a DISTRO_FEATURES.
I was just not sure why MINIDEBUGINFO was not a DISTRO_FEATURES in the
first place, and whether you would be willing to enable systemd-coredump
via the MINIDEBUGINFO DISTRO_FEATURES.

On Thu, Nov 30, 2023 at 11:59 AM Etienne Cordonnier via
lists.openembedded.org <ecordonnier=snap....@lists.openembedded.org> wrote:

> From: Etienne Cordonnier <ecordonn...@snap.com>
>
> Enabling minidebuginfo is not useful if gdb and systemd-coredump
> are unable to parse it.
>
> In order to parse it, gdb needs xz support. Systemd needs coredump
> enabled, as
> well as elfutil enabled as well (systemd-coredump loads libdw which is
> part of elfutils using dlopen).
>
> Signed-off-by: Etienne Cordonnier <ecordonn...@snap.com>
> ---
>  meta/recipes-core/systemd/systemd_254.4.bb       | 1 +
>  meta/recipes-devtools/elfutils/elfutils_0.189.bb | 3 ++-
>  meta/recipes-devtools/gdb/gdb-common.inc         | 3 ++-
>  3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/systemd/systemd_254.4.bb
> b/meta/recipes-core/systemd/systemd_254.4.bb
> index ecf693ef92..f3e56bf94c 100644
> --- a/meta/recipes-core/systemd/systemd_254.4.bb
> +++ b/meta/recipes-core/systemd/systemd_254.4.bb
> @@ -70,6 +70,7 @@ PACKAGECONFIG ??= " \
>      ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
>      ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
>      ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '',
> 'link-udev-shared', d)} \
> +    ${@'coredump elfutils' if d.getVar('PACKAGE_MINIDEBUGINFO') == '1'
> else ''} \
>      backlight \
>      binfmt \
>      gshadow \
> diff --git a/meta/recipes-devtools/elfutils/elfutils_0.189.bb
> b/meta/recipes-devtools/elfutils/elfutils_0.189.bb
> index d8bf82b022..4f097e5b5c 100644
> --- a/meta/recipes-devtools/elfutils/elfutils_0.189.bb
> +++ b/meta/recipes-devtools/elfutils/elfutils_0.189.bb
> @@ -39,7 +39,8 @@ BUILD_CFLAGS += "-Wno-error=stringop-overflow"
>  DEPENDS_BZIP2 = "bzip2-replacement-native"
>  DEPENDS_BZIP2:class-target = "bzip2"
>
> -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'debuginfod',
> 'debuginfod libdebuginfod', '', d)}"
> +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'debuginfod',
> 'debuginfod libdebuginfod', '', d)} \
> +                   ${@'xz' if d.getVar('PACKAGE_MINIDEBUGINFO') == '1'
> else ''}"
>  PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
>  PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
>  PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
> diff --git a/meta/recipes-devtools/gdb/gdb-common.inc
> b/meta/recipes-devtools/gdb/gdb-common.inc
> index 3349719a6b..c444af62b3 100644
> --- a/meta/recipes-devtools/gdb/gdb-common.inc
> +++ b/meta/recipes-devtools/gdb/gdb-common.inc
> @@ -30,7 +30,8 @@ EXTRA_OECONF = "--disable-gdbtk --disable-x
> --disable-werror \
>                  --with-libgmp-prefix=${STAGING_EXECPREFIXDIR} \
>  "
>
> -PACKAGECONFIG ??= "readline ${@bb.utils.filter('DISTRO_FEATURES',
> 'debuginfod', d)} python"
> +PACKAGECONFIG ??= "readline ${@bb.utils.filter('DISTRO_FEATURES',
> 'debuginfod', d)} python \
> +                   ${@'xz' if d.getVar('PACKAGE_MINIDEBUGINFO') == '1'
> else ''}"
>  # Use --without-system-readline to compile with readline 5.
>  PACKAGECONFIG[readline] =
> "--with-system-readline,--without-system-readline,readline"
>  PACKAGECONFIG[python] =
> "--with-python=${WORKDIR}/python,--without-python,python3,python3-codecs"
> --
> 2.36.1.vfs.0.0
>
>
> 
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191495): 
https://lists.openembedded.org/g/openembedded-core/message/191495
Mute This Topic: https://lists.openembedded.org/mt/102891486/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to