1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

gdb/systemd: enable minidebuginfo support conditionally

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).

(From OE-Core rev: 0d2df803bebfd7e832ab7da54c4dacaaeeb424a9)

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Etienne Cordonnier
2023-12-05 14:37:54 +01:00
committed by Richard Purdie
parent 72342e8eea
commit 959b1f7de4
7 changed files with 31 additions and 5 deletions
+21
View File
@@ -5,6 +5,7 @@
#
import re
import threading
import time
from oeqa.runtime.case import OERuntimeTestCase
@@ -136,6 +137,26 @@ class SystemdServiceTests(SystemdTest):
status = self.target.run('mount -oro,remount /')[0]
self.assertTrue(status == 0, msg='Remounting / as r/o failed')
@skipIfNotFeature('minidebuginfo', 'Test requires minidebuginfo to be in DISTRO_FEATURES')
@OEHasPackage(['busybox'])
def test_systemd_coredump_minidebuginfo(self):
"""
Verify that call-stacks generated by systemd-coredump contain symbolicated call-stacks,
extracted from the minidebuginfo metadata (.gnu_debugdata elf section).
"""
t_thread = threading.Thread(target=self.target.run, args=("ulimit -c unlimited && sleep 1000",))
t_thread.start()
time.sleep(1)
status, output = self.target.run('pidof sleep')
# cause segfault on purpose
self.target.run('kill -SEGV %s' % output)
self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % output)
(status, output) = self.target.run('coredumpctl info')
self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output)
self.assertEqual('sleep_for_duration (busybox.nosuid' in output, True, msg='Call stack is missing minidebuginfo symbols (functions shown as "n/a"): %s' % output)
class SystemdJournalTests(SystemdTest):
@OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])