From 8e72283f546e5ce99b05e1482b55cf5af7ae5f37 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Wed, 9 Nov 2022 19:31:29 +0000 Subject: oeqa/selftest/package: generalise test_gdb_hardlink_debug() When the trivial test binary, which just calls printf(), is compiled for aarch64 with -O2 -D_FORTIFY=2 (as is the default configuration), gdb resolves main() to the inlined printf() wrapper in stdio2.h instead of main.c, so the test fails. Presumably, this is due to debugging being unreliable with -O2. Solve this problem by not caring where the main() breakpoint resolves to, just check that it was resolved at all. (From OE-Core rev: c51c12154851d04a81c8fbe190e712b3cd8dc941) Signed-off-by: Ross Burton Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/package.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py index 2d1b48a15d..482a7c02ad 100644 --- a/meta/lib/oeqa/selftest/cases/package.py +++ b/meta/lib/oeqa/selftest/cases/package.py @@ -135,8 +135,10 @@ class PackageTests(OESelftestTestCase): self.logger.error("No debugging symbols found. GDB result:\n%s" % output) return False - # Check debugging symbols works correctly - elif re.match(r"Breakpoint 1.*hello\.c.*4", l): + # Check debugging symbols works correctly. Don't look for a + # source file as optimisation can put the breakpoint inside + # stdio.h. + elif "Breakpoint 1 at" in l: return True self.logger.error("GDB result:\n%d: %s", status, output) -- cgit v1.2.3-54-g00ecf