From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id B5C053858425 for ; Fri, 23 Dec 2022 08:37:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B5C053858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671784670; x=1703320670; h=from:to:subject:date:message-id:references:in-reply-to: mime-version:content-transfer-encoding; bh=mpriQ96hLuPcq9pTKZomFHghANMUy6bgarbIx5dD9fU=; b=OM40RlY48mr+roi/+lbA7vZAnSeWBvZtjKdBCwSpx6F8Uogf71U1xNbP hN0jkip79+7oMSLfD2sJmodWr1Em0hSxLLfJDub8CzNceILhxBskQG+BZ ymToLlJbYvDiVLY9fdAt/+TRUX0bUEPzKGH1B2rWIKzFkFNt9V32fRKlU XD3R54fE7fkjQDE6Guv7iERf/Xmd8Qg57iqMuWRB1Xs3fFVM4ut7NupmU mptH9ctZ8ktohKdbOd4kcrky1q1mWO1qZ9HgWml/N3RhQtfLO7qFplAfu SsNy+LloA54A8cagHYihqaMu5nJc4u0zHdFseS11uTMKuMUTB1H7hWVjq A==; X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="303770936" X-IronPort-AV: E=Sophos;i="5.96,268,1665471600"; d="scan'208";a="303770936" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Dec 2022 00:37:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="776302117" X-IronPort-AV: E=Sophos;i="5.96,268,1665471600"; d="scan'208";a="776302117" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga004.jf.intel.com with ESMTP; 23 Dec 2022 00:37:49 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 23 Dec 2022 00:37:48 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 23 Dec 2022 00:37:48 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 23 Dec 2022 00:37:48 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 23 Dec 2022 00:37:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JRkM7dTheLPuwXx0jtadez5i4mR6zsA0fxqLfK/BRQwfBZUa7xqGk24GbV5NXj/8ejGeKAUy44qZktOU3pDV2KGyxd97mwzaGvCNRugBzHT2M0YKGL7CNa62qQfc9HYFvI40sfZ4ParWXmWmP0pTR0sv8RO3TT9NMjP1k3LSvzxvWISCJ4t7QdarBKW1WoMb1Z9piyW6VSBTa5hMvt6TRwUwXf4doKzcKGPiu7NZbaGKVbG8FY4xwyXtRXG8rvcfoRdI8nE6KJMWIaEFZavIrpgZgn3ri5D1tVZGevXRzRLz+3+eahJLTD87/wWABeJUMclmaRcuaYh6pwdHjn6jYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NidiL+03cVtjlatRntBNQfFA7Q3HaLPs1+D9D2UfI28=; b=Evm01z3vui+L18BT4l8iPgtTS9v6f5YuJ1gZ5LHAT5lKqFNdrUhmymOv5yAg8MErdVGCdgWL9J4J8wjOCVyL3T3Z7Ri1w6U8sdyxY/Zl2fhD4wBVby9H1avlklfwLd7t4Qfz0elJamb5OvMW1WPi1/8URSNGZ2k9UabLjgJqtONhe+R5X+SoysHHBL8HPmj4RdvNH4Ruq1B2rhYf7wYrAd7Q/NUsqZzzO1MfHetxKDGBpVoDsraDSuUiwNXngRJQLKzgTpuoUV0Q4nGya/+Uzhaj5dGY59u5mtR46h63mbh+VPv+Hyo6fsNderoZBgwbctQHIo/kLUYw71wCrqG7EQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MWHPR1101MB2271.namprd11.prod.outlook.com (2603:10b6:301:52::23) by CH3PR11MB7817.namprd11.prod.outlook.com (2603:10b6:610:123::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.13; Fri, 23 Dec 2022 08:37:41 +0000 Received: from MWHPR1101MB2271.namprd11.prod.outlook.com ([fe80::c801:5fec:f9a6:c87a]) by MWHPR1101MB2271.namprd11.prod.outlook.com ([fe80::c801:5fec:f9a6:c87a%2]) with mapi id 15.20.5944.013; Fri, 23 Dec 2022 08:37:40 +0000 From: "Aktemur, Tankut Baris" To: Andrew Burgess , "gdb-patches@sourceware.org" Subject: RE: [PATCH 3/6] gdb: fix display of thread condition for multi-location breakpoints Thread-Topic: [PATCH 3/6] gdb: fix display of thread condition for multi-location breakpoints Thread-Index: AQHZAxxIM92PxaFE7k23ES/IKAwsT657RpvQ Date: Fri, 23 Dec 2022 08:37:40 +0000 Message-ID: References: <685ac9c3cc26e43c47b1a5fd3a59f7e97c5eca2b.1669634536.git.aburgess@redhat.com> In-Reply-To: <685ac9c3cc26e43c47b1a5fd3a59f7e97c5eca2b.1669634536.git.aburgess@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MWHPR1101MB2271:EE_|CH3PR11MB7817:EE_ x-ms-office365-filtering-correlation-id: 55708498-47ab-42a8-7110-08dae4c0f438 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QSAW/ClkWQTCpsAi0hRdG0s4XO/HdSd76utSAJjl0hSIxhizVYJ38yr15cMylV5iObFyyza8wFOzQnLPmO4XbtuZyMbFZXTmJlxEEaVSL4uTGS5ejH3n4PxGcKClFCr0PwkTx0TJBSvBg1YtF7sYVDKrEok/Fe+yN3BFlemJcwc66tJa89pYC2Bzc6d70TCJP1fq2znF6hMAvd6oO966PUnRp16jqQ3QqLncwz5HWPRWt+FXunpne+pYSUhvZhBUHiTLyC72jFRxu2G6B2U2mOT6VIrVHj8ccYX9ShqftVW3495TP6OR4LewwwygJ39n+HjiBYaDCjmbjmMTnhfbxY26oss+gLR218loge4vbaOKXFTTCE3cmlzyninscSaRzcZGO+4ZtHhM5n2jFDD1SK3R0fZto50seBiVIyYvMWRd7BMQlLBCqhP70iXufkki+ay8NH77u8Xt5nkluYwPsDx5HHFT8I6CqTWi/o5+E1eyjWLX2fiZOZ5PwxsiVnrOJKL0UCzbMpRtVEzDJbQql9ncCljrm3+/v1pFQJZ5ytiZP/IiWzwbhqx08+uhoICamLs8pFjbvw0OrxfJ45dvqp4ptUAu8qUYF3z35xNPPcbfV/GBZowEHid8MGJOVzArPUydUBncpVZfv+Xkd5JX3FeSHvTuodsrLOUny3bamk5V8gmZLLtft+SsQ03KMNzl9bGFafbNs8nP2AMPZaoWllZIMzNqlTnOWn6pRBEFt83tLdZDb/ilV5bhxdFaXFBG/zEjz5NNOM2V/yQFan7ggCAdH1Mw/GVe8NIeSYiaOwY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2271.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(366004)(376002)(396003)(136003)(346002)(451199015)(2906002)(8936002)(5660300002)(316002)(52536014)(41300700001)(66476007)(66946007)(66556008)(76116006)(8676002)(64756008)(66446008)(478600001)(71200400001)(38100700002)(122000001)(82960400001)(7696005)(9686003)(186003)(26005)(53546011)(6506007)(110136005)(33656002)(55016003)(38070700005)(86362001)(83380400001)(333604002)(2004002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?A8vCQ+hCC8jHz6p7GHsJNYTeOyYDczVrUwHxmw0bURr4KB9z3x3HGIj7EPoS?= =?us-ascii?Q?IPl4PkvXjltpYAmtw/5/1DnjcyaJFKIcdVy9mYQBa6+Z3q4/So8IKZf2qLxY?= =?us-ascii?Q?7dUei19RzkpcJ42UKN/Cjm9ZwyJKZKXJSRY5L0QmF7Yqc/yWapyjqIBAs4uL?= =?us-ascii?Q?2mafu+sv4BjyPND1rD5wHMa30f7+2RlCDIzaQceZk9xwuTHD5dVoLyupKmS8?= =?us-ascii?Q?ePqgntNJNCzibVRZFh6SjcpDedEdmxuJA6LTwaQp5qcduw3IGdeFFXrX1s4s?= =?us-ascii?Q?O5HSHpj2ycLBIwgzsiktAXGfOBiobTfqpQ/IIMyflPW9Mii4Y7HZRN9Qihb0?= =?us-ascii?Q?6hjOEC8yIfqZ9CW4yPloq7tlSXX9pd5EK2++MCn7S3RC/dR5nSfp2VONq2W0?= =?us-ascii?Q?O5Tu0rn8IY06GlHUvfvIEK+djGHDfsLAoRmlGpDjs/hsjBnV8ZFNgzFzxJEg?= =?us-ascii?Q?YdaJ3utqtLbQfOrUxnQH3gccT6FYQJ9vhTqnbwQLebIWN3pS9IkYsWP+35E7?= =?us-ascii?Q?J4caO0orhutSVff8sQ4cFttjBP28pz6lxT54IaAj+wwnVuEMqxR5YVxIBfPq?= =?us-ascii?Q?Xgfi8ZANAY1rvVijeiGiNR3e6d6+InIJqZ2k8QwrIr8gImYdm8pJLWXYDDAR?= =?us-ascii?Q?DhU7OumsWuPv4ojtgmPKx+ksef4YL38liAcHlppywmV8KoK/rC/bEm6jVj9S?= =?us-ascii?Q?xGNCX5lzjew37yhZoVG/lR09joMKEpOV0LPYvVnsQV7FMQ1u1ZQIsT3HmYFW?= =?us-ascii?Q?I2/wcYADdxTDLJba290OeMPWpRDOiBGVOa7GaItLpAFGletu/tqqoGqXhCOy?= =?us-ascii?Q?aFXOVGtqE9Fy1QSbaw7gIovL+8XSlPpf64WnawOZUpvt6SqqnOQ2tFaORhA9?= =?us-ascii?Q?4wbaJXZCV0VxSj5CFADz4drFxC7vHitachY389YScpfVfyIqbzsYZmaRXyOu?= =?us-ascii?Q?Oubre14E4sIV9uI3Gw7KEaWZQgSkaVvpbl0XzGiYtlqU8oX8UyvyJ1iO7wtQ?= =?us-ascii?Q?SqXprAonIesR1buasPpEKS2BQbsigA3RGD0IVgehYE7Fh7KiqDQvowA2BQO2?= =?us-ascii?Q?K79wcwhZnHOF7cNOoRZL3BdoqrsKH+gCXkVEUFZns2p7MOe/S6tprxXzvbML?= =?us-ascii?Q?MWOriwv2/ML2jCNP1elve+ShiwYYxCWGRjbVoU51+dwZWeYXQxAdNkzqfvow?= =?us-ascii?Q?zPrHEG9TWvPLYuJxflJkqMJvXY+5GZQu4FO0nzXzHqWQ2BRmy83bRuhBv4Xx?= =?us-ascii?Q?8giNAl3CcDsRQ/hT2goAgetsvpWIOdIZOYvWlwxcTrr5D2JIp4j9zEMKgVys?= =?us-ascii?Q?oAOJJzJb49jMhrxx2smmyZDk8VEtYTdUkIzn9uBz6SLsXGsJqaSp0d5DduhH?= =?us-ascii?Q?JPHH2XXdK1+ADcZasAc7pemgMw4sTYxiGuIbJFH15yaB0IQZoCvknd3PTZ6/?= =?us-ascii?Q?EGrPwn3rAuPESxZ92Whncw2TZdrvdM+P8HK/FYwjmproSX6plr+vYxN7gm3R?= =?us-ascii?Q?njv7lP1f1cfJSCrqwDYmIwNcE/n8juOLkMWdMhiZ9YbeAz33tmRfiUbEqJAi?= =?us-ascii?Q?MyJuiLr12mk6lFFZ4DcivMabqzwLTGUFuuFGVBq38lbIZhJQUsZXeda7844v?= =?us-ascii?Q?pA=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2271.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55708498-47ab-42a8-7110-08dae4c0f438 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Dec 2022 08:37:40.8071 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: D9ha4976Q3C5so9xZwS9y/78mJpNeHHItGEaTPqF70Kq/Qryvexa42olFKnml+K8DYaWgKEjtrqlBNBq7gdmNdr12McXVwFMjG9ztgu+g/A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7817 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Monday, November 28, 2022 12:26 PM, Andrew Burgess wrote: > If a breakpoint with multiple locations has a thread condition, then > the 'info breakpoints' output is a little messed up, here's an example > of the current output: > = > (gdb) break foo thread 1 > Breakpoint 2 at 0x401114: foo. (3 locations) > (gdb) break bar thread 1 > Breakpoint 3 at 0x40110a: file /tmp/src/gdb/testsuite/gdb.base/thread-b= p-multi-loc.c, line > 32. > (gdb) info breakpoints > Num Type Disp Enb Address What > 2 breakpoint keep y thread 1 > stop only in thread 1 > 2.1 y 0x0000000000401114 in foo at > /tmp/src/gdb/testsuite/gdb.base/thread-bp-multi-loc.c:25 > 2.2 y 0x0000000000401146 in foo at > /tmp/src/gdb/testsuite/gdb.base/thread-bp-multi-loc.c:25 > 2.3 y 0x0000000000401168 in foo at > /tmp/src/gdb/testsuite/gdb.base/thread-bp-multi-loc.c:25 > 3 breakpoint keep y 0x000000000040110a in bar at > /tmp/src/gdb/testsuite/gdb.base/thread-bp-multi-loc.c:32 thread 1 > stop only in thread 1 > = > Notice that, at the end of the location for breakpoint 3, the 'thread > 1' condition is printed. > = > In contrast, for breakpoint 2, the 'thread 1' appears randomly, in the > "What" column, though slightly offset. > = > I believe this is a bug in GDB, in the function > print_one_breakpoint_location, due to checking the local variable > part_of_multiple, instead of header_of_multiple. > = > If I fix this oversight, then the output is now: > = > (gdb) break foo thread 1 > Breakpoint 2 at 0x401114: foo. (3 locations) > (gdb) break bar thread 1 > Breakpoint 3 at 0x40110a: file /tmp/src/gdb/testsuite/gdb.base/thread-b= p-multi-loc.c, line > 32. > (gdb) info breakpoints > Num Type Disp Enb Address What > 2 breakpoint keep y > stop only in thread 1 > 2.1 y 0x0000000000401114 in foo at > /tmp/src/gdb/testsuite/gdb.base/thread-bp-multi-loc.c:25 thread 1 > 2.2 y 0x0000000000401146 in foo at > /tmp/src/gdb/testsuite/gdb.base/thread-bp-multi-loc.c:25 thread 1 > 2.3 y 0x0000000000401168 in foo at > /tmp/src/gdb/testsuite/gdb.base/thread-bp-multi-loc.c:25 thread 1 > 3 breakpoint keep y 0x000000000040110a in bar at > /tmp/src/gdb/testsuite/gdb.base/thread-bp-multi-loc.c:32 thread 1 > stop only in thread 1 We already state the condition in "stop only in thread 1". Do we need to repeat it also as part of the location? > The 'thread 1' condition is now displayed at the end of each location, > which makes the output the same for single location breakpoints and > multi-location breakpoints. > --- > gdb/breakpoint.c | 2 +- > gdb/testsuite/gdb.base/thread-bp-multi-loc.c | 44 ++++++++++ > .../gdb.base/thread-bp-multi-loc.exp | 88 +++++++++++++++++++ > 3 files changed, 133 insertions(+), 1 deletion(-) > create mode 100644 gdb/testsuite/gdb.base/thread-bp-multi-loc.c > create mode 100644 gdb/testsuite/gdb.base/thread-bp-multi-loc.exp > = > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index f0276a963c0..2ec8ca364b6 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -6467,7 +6467,7 @@ print_one_breakpoint_location (struct breakpoint *b, > output_thread_groups (uiout, "thread-groups", inf_nums, mi_only); > } > = > - if (!part_of_multiple) > + if (!header_of_multiple) > { > if (b->thread !=3D -1) > { > diff --git a/gdb/testsuite/gdb.base/thread-bp-multi-loc.c b/gdb/testsuite= /gdb.base/thread- > bp-multi-loc.c > new file mode 100644 > index 00000000000..cab009c39ec > --- /dev/null > +++ b/gdb/testsuite/gdb.base/thread-bp-multi-loc.c > @@ -0,0 +1,44 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2022 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see .= */ > + > +volatile int global_var =3D 0; > + > +__attribute__((__always_inline__)) static inline void > +foo (void) > +{ > + int i; > + > + for (i =3D 0; i < 10; ++i) > + global_var =3D i; > +} > + > +static void > +bar (void) > +{ > + global_var =3D 0; > + foo (); > +} > + > +int > +main (void) > +{ > + global_var =3D 0; > + foo (); > + bar (); > + foo (); > + return 0; > +} > diff --git a/gdb/testsuite/gdb.base/thread-bp-multi-loc.exp b/gdb/testsui= te/gdb.base/thread- > bp-multi-loc.exp > new file mode 100644 > index 00000000000..9abff5866d9 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/thread-bp-multi-loc.exp > @@ -0,0 +1,88 @@ > +# Copyright 2022 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# Create a multi-location breakpoint with a thread condition, then check= the > +# output of 'info breakpoints' to ensure that the thread condition is > +# displayed correctly. > + > +standard_testfile > + > +if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { > + return > +} > + > +if ![runto_main] then { Maybe use {} here, too, for consistency. > + return The testsuite is unfortunately highly inconsistent about what to do here. There is "return 0", "return 1", "return -1", and "return". If we cannot run to the main function, "return -1" seems a better choice to me. What do you think? > +} > + > +gdb_test_no_output "with confirm off -- delete breakpoints" Why not use delete_breakpoints? > + > +set bp_number "" > +gdb_test_multiple "break foo thread 1" "" { > + -re "^break foo thread 1\r\n" { > + exp_continue > + } > + -re "^Breakpoint ($decimal) at $hex: foo\[^\r\n\]+3 locations\[^\r\n= \]+\r\n" { > + set bp_number $expect_out(1,string) > + exp_continue > + } > + -re "^$gdb_prompt $" { > + gdb_assert { ![string eq $bp_number ""] } > + } > +} > + > +if { $bp_number =3D=3D "" } { > + unresolved "breakpoint not placed correctly" > + return > +} An alternative could be to use "gdb_breakpoint" followed by set bp_number [get_integer_valueof "\$bpnum" 0] > + > +set saw_header false > +set saw_cond false > +set loc_count 0 > +gdb_test_multiple "info breakpoints" "" { > + -re "^info breakpoints\r\n" { > + exp_continue > + } > + > + -re "^Num\\s+\[^\r\n\]+\r\n" { If we remove "^" at the beginning, we can also get rid of the = first regexp above for a bit shorter code. Thanks -Baris > + exp_continue > + } > + > + -re "^$bp_number\\s+breakpoint\\s+keep\\s+y\\s+\\s*\r\n" { > + set saw_header true > + exp_continue > + } > + > + -re "^\\s+stop only in thread 1\r\n" { > + set saw_cond true > + exp_continue > + } > + > + -re "^$bp_number\\.\[123\]\\s+\[^\r\n\]+ thread 1\r\n" { > + incr loc_count > + exp_continue > + } > + > + -re "^$gdb_prompt $" { > + with_test_prefix $gdb_test_name { > + gdb_assert { $saw_header } \ > + "saw header line" > + gdb_assert { $saw_cond } \ > + "saw b/p condition line" > + gdb_assert { $loc_count =3D=3D 3 } \ > + "saw all three locations" > + } > + } > +} > -- > 2.25.4 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva = Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928