From: Ross Burton Date: Wed, 9 Nov 2022 19:31:29 +0000 (+0000) Subject: oeqa/selftest/package: generalise test_gdb_hardlink_debug() X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~2536 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c51c12154851d04a81c8fbe190e712b3cd8dc941;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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. Signed-off-by: Ross Burton Signed-off-by: Alexandre Belloni --- diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py index 2d1b48a15df..482a7c02ad4 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)