]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/selftest/package: generalise test_gdb_hardlink_debug()
authorRoss Burton <ross.burton@arm.com>
Wed, 9 Nov 2022 19:31:29 +0000 (19:31 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 Nov 2022 13:43:37 +0000 (13:43 +0000)
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 <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/lib/oeqa/selftest/cases/package.py

index 2d1b48a15dff40693608b98d7da8819ef55b6cb0..482a7c02ad4aa227e92bfacf6564755eceec0f0a 100644 (file)
@@ -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)