From patchwork Wed Dec 31 11:46:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 77834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C37D3EE6457 for ; Wed, 31 Dec 2025 11:47:51 +0000 (UTC) Received: from mta-65-228.siemens.flowmailer.net (mta-65-228.siemens.flowmailer.net [185.136.65.228]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.83910.1767181666617258447 for ; Wed, 31 Dec 2025 03:47:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=loPNAQns; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.228, mailfrom: fm-1329275-2025123111474406cda5672f000207df-4bjfrj@rts-flowmailer.siemens.com) Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 2025123111474406cda5672f000207df for ; Wed, 31 Dec 2025 12:47:44 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=BC8cvzishBZYzKeIBuGOQ4nQtPXvLzhR6XuZe9jjlfE=; b=loPNAQnsiaVNDFnn5coPBt9M2ydd8v1EkF1CdfOArcgTtIxT1x82FUt/ZrplUr34NojuW7 rnaJ6xj8Q5otJivZmlRcMrTsjzEQyMx40iIludUVTnU47XtaWX4ZKBbbsSJ9wGa8P9e+fgP6 hWqiFuNO0q103M54fJFt0xqFTG6738tldVJgrXj8niaKIVCcTHR2cLRPDHMqdndkBFz7O2Eb MnKkprQEKeRB6XAVIvAlyAzGCGopHijFugiVu4S/RlV+bmI2L3tJVy/2XMzbVtes0oNIT5k3 1WEcMuC9HYx3L/FXhWNQyIDB4qKNV9X2w63xEOh3SMUC/4KhN3Rm3hQg==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH v2 13/14] oe-selftest: devtool: add test for gdb pretty-printing Date: Wed, 31 Dec 2025 12:46:43 +0100 Message-ID: <20251231114718.4031606-14-adrian.freihofer@siemens.com> In-Reply-To: <20251231114718.4031606-1-adrian.freihofer@siemens.com> References: <20251231114718.4031606-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 31 Dec 2025 11:47:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/228739 From: Adrian Freihofer This extends the existing devtool IDE SDK tests to verify that gdb pretty-printing is working correctly. Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/devtool.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index df5c863a85..3f00ce8ffb 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -2725,6 +2725,14 @@ class DevtoolIdeSdkTests(DevtoolBase): gdb_batch_cmd += " -ex 'print CppExample::test_string.compare(\"cpp-example-lib %s\")'" % magic_string gdb_batch_cmd += " -ex 'print CppExample::test_string.compare(\"cpp-example-lib %saaa\")'" % magic_string gdb_batch_cmd += " -ex 'list cpp-example-lib.hpp:14,14'" + + # check if resolving std::vector works with python scripts + # break at line 56, because the line which initializes the vector + # may be optimized out by the compiler + gdb_batch_cmd += " -ex 'list cpp-example.cpp:55,55'" + gdb_batch_cmd += " -ex 'break cpp-example.cpp:56'" + gdb_batch_cmd += " -ex 'continue'" + gdb_batch_cmd += " -ex 'print numbers'" gdb_batch_cmd += " -ex 'continue'" return gdb_batch_cmd @@ -2734,6 +2742,10 @@ class DevtoolIdeSdkTests(DevtoolBase): self.assertIn("$2 = -3", gdb_output) # test.string.compare longer self.assertIn( 'inline static const std::string test_string = "cpp-example-lib %s";' % magic_string, gdb_output) + + # check if resolving std::vector works with python scripts + self.assertRegex(gdb_output, r"55\s+std::vector numbers = \{1, 2, 3\};") + self.assertRegex(gdb_output, r"\$\d+ = std::vector of length 3, capacity 3 = \{1, 2, 3\}") self.assertIn("exited normally", gdb_output) def _gdb_cross_debugging_multi(self, qemu, recipe_name, example_exe, magic_string):