From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by sourceware.org (Postfix) with ESMTPS id 0A3FB3858416 for ; Tue, 5 Dec 2023 16:06:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A3FB3858416 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0A3FB3858416 Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=192.198.163.9 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1701792378; cv=fail; b=b9Mt8ghl+zdm8Z9etvB16nhd+Krt+OW/QvM1Sxev80OXeG5aqTJAb/ghfVB3ue5xlgaFaz9jjdCdYy47deAvMy1YlQn5WUlqOfhCYFqOaodAOHc+KdWbsnQn5Yixcm+DfFejPy7L/AkJwJEhK5fVEhzLHGKVFRO6hsI02iELwX0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1701792378; c=relaxed/simple; bh=mmJCtpnOg46RLwE489OuTxTcFGldrXNkPTsE4Mp1THc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vGEm7xveYL+dUy/0TFiMJH8RQXhxMF+4/4Ox556cAQQTy/oF/6dWTPninlX7TBASadDL6TXdyPxgYzQNO9AM9B7b6ACK/OMMi94fxAclFlNd1Wa8vD0hglLZ62MY8IzTQ7fI6Ng6baFdpyXVmCF+GgGd96n2zmKFgGpyu3j9VIE= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701792368; x=1733328368; h=from:to:subject:date:message-id:references:in-reply-to: mime-version:content-transfer-encoding; bh=mmJCtpnOg46RLwE489OuTxTcFGldrXNkPTsE4Mp1THc=; b=QUoOXwJCDug5gWp1CX3f9kZu46689H4p5f7bjKPUw64uSPtyvMvjvpCb 90rJFr21rbAIdYS/8kLhs8yqUHRbwa09AWlPOwAZFoALuqvUSc38mEJPO +rm+BO//+QmJobvzaa0QWJSV/FvQWy1vVVUHL1Ww66OA0PsFYuBcK8v8a IlgxYeec72euFmuC23tvjJLp+8Q+H8aYVOarkFyUSYBE8g83SwnvM/gDi Wfox+Ai6WIT0NpsuTSVtyUVtJ4AbYS0er2WN9BMkU8x/qITsbqP/o6cWW fNDd6/SIkZJAmtOQtMaUA9O030cRA2WJooaPQTanHAZOxBJ5igQNImoS0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="813602" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="813602" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 08:06:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="764369790" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="764369790" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Dec 2023 08:06:06 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 5 Dec 2023 08:06:05 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 5 Dec 2023 08:06:05 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 5 Dec 2023 08:06:05 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 5 Dec 2023 08:06:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dhkr0GUpeArID7awivem36xw+gwX99LPDDh4mm1KICdlWEaZYjFuN4iBPhg4jK61KSxhkbcVIqcjXX30Mgv3hS7nUhf/tNar6dx6uJ0J3k2HcUzDkZU5ug3ID61xE1eD4/rNQcKcZwWfNtVL+N5jjj4LDD60+56ZCHrNcbU42Hpr70LmisBUW5enD6FaygDSZMxp0l5Lxj7BS9IYyXD95LOTDstr+fb9cXy0NRC3IXyndRz1TUdto1MFTAOHjX+bxPgoVNqKK9iK596s5cw2D171NJN/lrC/YG/ehHZ1fAwiG3SVQ0AmJaRoXu3yeildBFtv+Nm/UOX7J1ezUvCGmA== 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=LXbFbIW7infGIA8N8pwJqIEJy3D6j8o6JTlsysMc/C4=; b=RaFL4zZR2gtTEFGI53YvFjw8xDFGjarb+tdNXLe/ik4vp14syKdjbLfadCT/u8pnu08RLnoCfXWeYTf30mUwIBMAEv7l4kEjAUb9YWPPIX7IfnV/n3Hgyn8rwv1DzxAsuVCHMWsh9dr3GYRYh2WUZ+OSaTtSa4T1SO3hPNbGYXTfLl8/uIAeAyKlh+rla2qFKxiv0GUxykLPyLm8rwMYB3u9OAQe5XAFC875jZlKVGyL5wAfAxe5+6M1XC1DMIZyrGFXOxx97OL/PDWBnC+kXcpQmOweBY7Sjl3nX9bdo2thDwWvjidOjWWcPdmUDVEt9vSKm8ZYV2QamG2Upi1qfw== 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 DM4PR11MB7303.namprd11.prod.outlook.com (2603:10b6:8:108::21) by CY8PR11MB7847.namprd11.prod.outlook.com (2603:10b6:930:7c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Tue, 5 Dec 2023 16:05:58 +0000 Received: from DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::b960:9754:455d:b195]) by DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::b960:9754:455d:b195%7]) with mapi id 15.20.7046.034; Tue, 5 Dec 2023 16:05:58 +0000 From: "Aktemur, Tankut Baris" To: Andrew Burgess , "gdb-patches@sourceware.org" Subject: RE: [PATCHv6 07/10] gdb: don't set breakpoint::pspace for in create_breakpoint Thread-Topic: [PATCHv6 07/10] gdb: don't set breakpoint::pspace for in create_breakpoint Thread-Index: AQHaJQxjjLdLP9cSZ0CEguOa4sDc57Ca3BGg Date: Tue, 5 Dec 2023 16:05:57 +0000 Message-ID: References: <864815443474b68aedb8dbff07442be8d688a209.1701513410.git.aburgess@redhat.com> In-Reply-To: <864815443474b68aedb8dbff07442be8d688a209.1701513410.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: DM4PR11MB7303:EE_|CY8PR11MB7847:EE_ x-ms-office365-filtering-correlation-id: b363e053-7bd5-4252-45aa-08dbf5ac117c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5E8W1rbCdp/zUwsOnlKDbXyGZw+otsoLdFlvpgXX8au0o4nPePgGI4Vf+5JwGGhYy0ZJWxS+EjWcghfnpurmyD2JUbFh69iriOkS05HO9HrVITnbdYH0N1NtXl7RwRT6TArf2Rw4gWyD0P+apGmhri5vCw/EhNitbH6t++GwqGdvpZBYR2Lj6E/klQmOCzKQ/jcBlkVP81HXO9bu4W9KUSLHlDE7q7zwXh7FT+i+EHtdrZMo4jdiJ5k7hexV/fcXBEVltVgOLGsdJcV0L78UUb8pVAL5xRsVFmglcBTyouCDtFo5zNRW8KHSzGd2P23ZqPCMUn/agqXN5sSKsZ2GlaiNs8bghSxcz9l1rjY+kdXxmk1O17fXvTZ++vVMzusD1EHxwHKyL4UNIGGVcXO8w/p3JJLAjXKAyqoGAcvO/cfwZ/C8jujVJrlzXkeL5ABgWOWU5h/AtXTHadEtSr2QIKtZ9AA7EegtA6i/9oKAb5rr+ejuLHV+GtbmQgDWJPe3DTULWFhkjOPgMBvw0uoGmHhiMfQbp9GcnotZ8zv7mzf7Ss5AH5fJOMK1OclWhg4w63XINVFMySRRBlYlz/EAX/a8GNge3R+yUFIAUsJKZAOUnP8V0Ga+1QZ/KzVpaTAd6WCTVypnXiBabLVShKRlediZbs7FmScA2EgAQLhRItY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB7303.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(396003)(366004)(346002)(376002)(136003)(230922051799003)(186009)(64100799003)(1800799012)(451199024)(2906002)(33656002)(316002)(110136005)(66446008)(64756008)(66556008)(66476007)(38070700009)(76116006)(86362001)(66946007)(8676002)(52536014)(55016003)(41300700001)(8936002)(5660300002)(38100700002)(122000001)(82960400001)(966005)(83380400001)(478600001)(26005)(71200400001)(7696005)(9686003)(53546011)(6506007)(2004002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Q1s+pv4rvoToou+3QrfdqeXPZACjmnpOdrMESPIIF7Lpu7X+3kkSgV/VvME9?= =?us-ascii?Q?QRWcNWAaxc8vJHF5GQkYXWukKceVgTv8/p7BRiPETRlKPSvIZr+fbz9tXZqL?= =?us-ascii?Q?WAq4vWVyVgf+MYqIAg23C4mKNAW17qbd/ZyClXtfQLFY6LijWBpFuIQCTCyB?= =?us-ascii?Q?O8wNv42jz81T2iV59NvFfyo8CaelpEWva3xdUR33P+dmBkdTCl6rpDI7aCf9?= =?us-ascii?Q?/VfMi3LgKwJsRoA51Y6AXBGPoRGN4e7+/neh238xOHc70kcNY9m8p4n85OmN?= =?us-ascii?Q?VlX9B/p9DNSAbJEA3EXH4wUmPjIjxmFTqrfTvHg0XI+LAbrVollA9nmUKElG?= =?us-ascii?Q?JgqhD7WT7vWOyig4NF0UrChEN7yh3jL6dZQfPVEo/glH4wj3tWkHOoi0v83u?= =?us-ascii?Q?0YTydO4BH+EnuXxopGAA/1g6y6CN9lZr9Xd0pZPcVIAioZLPkPKovGIzaF9R?= =?us-ascii?Q?nYmYLCTTFpKB8Xxj9fXYoft4Hx1SchTOy3VvDep8zlnGXbVg0oETjRMmHCnE?= =?us-ascii?Q?KKzGrrfXIeDibo/zxAYpLMhG3mUMgJwR25Xt+32Nhf0GTTIvUYx8TVmbaWOH?= =?us-ascii?Q?oVngz6TUEjVQcRoVgCpARpsvsi82fjFMQ3Lb9Mh3JpalgyV15UyUJOQfxcSn?= =?us-ascii?Q?hOJ3dCcVFKvviLYm4ZONT6NBXVG2dwNTniH8wdKQ8G/QzKbt+FMGdv8xlykW?= =?us-ascii?Q?aDsqvxJZS3QeFSb3V0TQiJTKa8fa9Hh7bKC/ST0bjyPqFxeeiaWKZvw0GBv6?= =?us-ascii?Q?tp+M+FkNiQ2QzBL83t7oeT3N/s/LWO2xxDmoI9LC49Qm92enCr6zsJX1UjLt?= =?us-ascii?Q?nnxhGK6sv9IB6SkA/OphjUV9S4NCfg7m/qapza86o7o9vdFMzFVR3KXYhX7Z?= =?us-ascii?Q?VcBGp3cl5RaDqHkVU1FB76DGYFpD935kwD725Kwjl9zkyn0FWPVPFiBiGL6N?= =?us-ascii?Q?8fshWcLkzjDtGrSQuIB5GPP7JiW5fDPbW6X/IruS9NCEmh3yETKihnju4lMS?= =?us-ascii?Q?ZLcWXYHu4k0H9bwZDXT/wPcOAfsCmy0gySaY5cPozo+8KHZf5xOo9dJDOYSz?= =?us-ascii?Q?+Ib/5ECabSwXJ5KVE4FT3y7ulB60w17XlZtCO37o9kY1Yz3ZYsxG3buPzD3J?= =?us-ascii?Q?wz4SZ1k5og8ls2gdYwYc9U6ZQufAX4dR8A9Qb0V6IlS92fC4gJHBC0dcL/TC?= =?us-ascii?Q?4oajlaiGoyY1bq2c7DKTTy/2aLh5bbjey6YtY/htQ6NXwuYuUkGYSwd+a46e?= =?us-ascii?Q?55DHf/f0B1SADuiEgw0QVeHYXin7nQ2w4WQMhRPNjwSQnCJGn8i+NvcCOUkx?= =?us-ascii?Q?5rI8IZjuFlb6gpaj4Z6HA8TmAPIvpiwxZ2Xyf4FUOT4syfYxLZq4fFhlliNj?= =?us-ascii?Q?0CkyURm7IYK3acMHisw6rdq+uOpR6WcIdS4ddR3BCN3gJO2oHsa38CGFMhDs?= =?us-ascii?Q?+GEn5Xzdsm9u3XNciMvZCrmvgnIpUwMBTfGqJG5Ai+9+hwzjymurxZigjJpG?= =?us-ascii?Q?w0I/0LJuR2BuETIlqYJj2UwfJtsh30t+cHJoNt3vGjXv3FDtow4vGfyWq5qM?= =?us-ascii?Q?jIIQvM4uFJoY1jVs8lh6WPj+B08yIu/ufApfKRaIosbT/bjoG8fIcocm61qI?= =?us-ascii?Q?Lg=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB7303.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b363e053-7bd5-4252-45aa-08dbf5ac117c X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2023 16:05:57.9541 (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: hhkWHtMjMojT3qh0DxwBV9NQUzeSMUNv3zdTLmd4FbLMDKcF8SQmVrvkm/fYfj9SmNVyUMtLnxE/XF4sfEjzK2aFKVxBmN7etP+MQyaWOhM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7847 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.8 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,T_SCC_BODY_TEXT_LINE 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 Saturday, December 2, 2023 11:42 AM, Andrew Burgess wrote: > While working on the previous commit, I ran into this code within > create_breakpoint: > = > if ((type_wanted !=3D bp_breakpoint > && type_wanted !=3D bp_hardware_breakpoint) || thread !=3D -1) > b->pspace =3D current_program_space; > = ... > diff --git a/gdb/testsuite/gdb.multi/pending-bp-del-inferior.c > b/gdb/testsuite/gdb.multi/pending-bp-del-inferior.c > new file mode 100644 > index 00000000000..51b6492085f > --- /dev/null > +++ b/gdb/testsuite/gdb.multi/pending-bp-del-inferior.c > @@ -0,0 +1,28 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2023 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 .= */ > + > +int > +foo () Based on my fresh Q&A at https://sourceware.org/pipermail/gdb-patches/2023-December/204812.html this shall be `foo (void)`, right? Also `main (void)` below. > +{ > + return 0; > +} > + > +int > +main () > +{ > + return foo (); > +} > diff --git a/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp > b/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp > new file mode 100644 > index 00000000000..cb1f119ff94 > --- /dev/null > +++ b/gdb/testsuite/gdb.multi/pending-bp-del-inferior.exp > @@ -0,0 +1,216 @@ > +# Copyright 2023 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 . > + > +# Setup two inferiors. Select one inferior and create a pending > +# thread specific breakpoint in the other inferior. > +# > +# Delete the selected inferior (the one for which the thread specific > +# breakpoint doesn't apply), and check that the breakpoint still exists. > +# > +# Repeat this process, but this time, create an inferior specific > +# breakpoint. > + > +# The plain remote target can't do multiple inferiors. > +require !use_gdb_stub > + > +standard_testfile > + > +if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { > + return -1 > +} > + > +# Setup for the tests. Create two inferiors, both running the global > +# BINFILE, and proceed to main in both inferiors. Delete all > +# breakpoints, and check that we do have two threads. > +# > +# Return true after a successful setup, otherwise, return false. > +proc test_setup {} { > + clean_restart $::binfile > + > + if {![runto_main]} { > + return 0 > + } > + > + gdb_test "add-inferior -exec ${::binfile}" "Added inferior 2.*" \ > + "add inferior 2" > + gdb_test "inferior 2" "Switching to inferior 2 .*" \ > + "select inferior 2" > + > + if {![runto_main]} { > + return 0 > + } > + > + delete_breakpoints > + > + gdb_test "info threads" \ > + [multi_line \ > + " Id\\s+Target Id\\s+Frame\\s*" \ > + " 1\\.1\\s+\[^\r\n\]+" \ > + "\\* 2\\.1\\s+\[^\r\n\]+"] \ > + "check we have the expected threads" > + > + return 1 > +} > + > +# Assuming inferior 2 is already selected, kill the current inferior > +# (inferior 2), selected inferior 1, and then remove inferior 2. selected -> select > +proc kill_and_remove_inferior_2 {} { > + gdb_test "kill" "" "kill inferior 2" \ > + "Kill the program being debugged.*y or n. $" "y" > + > + gdb_test "inferior 1" "Switching to inferior 1 .*" \ > + "select inferior 1" > + > + gdb_test_no_output "remove-inferiors 2" > +} > + > +# Setup two inferiors, then created a breakpoint. If BP_PENDING is created -> create > +# true then the breakpoint will be pending, otherwise, the breakpoint > +# will be non-pending. > +# > +# BP_TYPE is either 'thread' or 'inferior', and indicates if the > +# created breakpoint should be thread or inferior specific. > +# > +# The breakpoint is created while inferior 2 is selected, and the > +# thread/inferior restriction always identifies inferior 1. > +# > +# Then inferior 2 is killed and removed. > +# > +# Finally, check that the breakpoint still exists and correctly refers > +# to inferior 1. > +proc do_bp_test { bp_type bp_pending } { > + if {![test_setup]} { > + return > + } > + > + if { $bp_pending } { > + set bp_func "bar" > + } else { > + set bp_func "foo" > + } > + > + if { $bp_type eq "thread" } { > + set bp_restriction "thread 1.1" > + } else { > + set bp_restriction "inferior 1" > + } > + > + gdb_breakpoint "$bp_func $bp_restriction" allow-pending > + set bp_number [get_integer_valueof "\$bpnum" "INVALID" \ > + "get b/p number for previous breakpoint"] > + > + if { $bp_restriction eq "thread 1.1" } { > + set bp_after_restriction "thread 1" > + } else { > + set bp_after_restriction $bp_restriction > + } > + > + if { $bp_pending } { > + set bp_pattern_before \ > + [multi_line \ > + "$bp_number\\s+breakpoint\\s+keep\\s+y\\s+\\s+${bp_func}" \ > + "\\s+stop only in [string_to_regexp $bp_restriction]"] > + set bp_pattern_after \ > + [multi_line \ > + "$bp_number\\s+breakpoint\\s+keep\\s+y\\s+\\s+${bp_func}" \ > + "\\s+stop only in [string_to_regexp $bp_after_restriction]"] > + } else { > + set bp_pattern_before \ > + [multi_line \ > + "$bp_number\\s+breakpoint\\s+keep\\s+y\\s+\\s*" \ > + "\\s+stop only in [string_to_regexp $bp_restriction]" \ > + "$bp_number\\.1\\s+y\\s+$::hex in $bp_func at \[^\r\n\]+ inf 1" \ > + "$bp_number\\.2\\s+y\\s+$::hex in $bp_func at \[^\r\n\]+ inf 2"] > + > + set bp_pattern_after \ > + [multi_line \ > + "$bp_number\\s+breakpoint\\s+keep\\s+y\\s+$::hex in $bp_func at \[^\r= \n\]+" \ > + "\\s+stop only in [string_to_regexp $bp_after_restriction]"] > + } > + > + gdb_test "info breakpoints" $bp_pattern_before \ > + "info breakpoints before inferior removal" > + > + kill_and_remove_inferior_2 > + > + gdb_test "info breakpoints" $bp_pattern_after \ > + "info breakpoints after inferior removal" > +} > + > +# Setup two inferiors, then created a dprintf. If BP_PENDING is created -> create > +# true then the dprintf will be pending, otherwise, the dprintf > +# will be non-pending. > +# > +# The dprintf is created while inferior 2. Then inferior 2 is killed The sentence seems incomplete. Did you mean "... while inferior 2 is selected."? > +# and removed. > +# > +# Finally, check that the dprintf still exists. > +proc do_dprintf_test { bp_pending } { > + if {![test_setup]} { > + return > + } > + > + if { $bp_pending } { > + set bp_func "bar" > + > + gdb_test "dprintf $bp_func,\"in $bp_func\"" ".*" \ > + "create dprintf breakpoint" \ > + "Make dprintf pending on future shared library load\\? \\(y or .n.\= \) $" "y" > + } else { > + set bp_func "foo" > + > + gdb_test "dprintf $bp_func,\"in $bp_func\"" ".*" \ > + "create dprintf breakpoint" > + } > + > + set bp_number [get_integer_valueof "\$bpnum" "INVALID" \ > + "get b/p number for previous breakpoint"] > + > + if { $bp_pending } { > + set bp_pattern_before \ > + [multi_line \ > + "$bp_number\\s+dprintf\\s+keep\\s+y\\s+\\s+${bp_func}" \ > + "\\s+printf \"in $bp_func\""] > + set bp_pattern_after $bp_pattern_before > + } else { > + set bp_pattern_before \ > + [multi_line \ > + "$bp_number\\s+dprintf\\s+keep\\s+y\\s+\\s*" \ > + "\\s+printf \"in $bp_func\"" \ > + "$bp_number\\.1\\s+y\\s+$::hex in $bp_func at \[^\r\n\]+ inf 1" \ > + "$bp_number\\.2\\s+y\\s+$::hex in $bp_func at \[^\r\n\]+ inf 2"] > + > + set bp_pattern_after \ > + [multi_line \ > + "$bp_number\\s+dprintf\\s+keep\\s+y\\s+$::hex in $bp_func at \[^\r\n\= ]+" \ > + "\\s+printf \"in $bp_func\""] > + } > + > + gdb_test "info breakpoints" $bp_pattern_before \ > + "info breakpoints before inferior removal" > + > + kill_and_remove_inferior_2 > + > + gdb_test "info breakpoints" $bp_pattern_after \ > + "info breakpoints after inferior removal" > +} > + > +foreach_with_prefix bp_pending { true false } { > + foreach_with_prefix bp_type { thread inferior } { > + do_bp_test $bp_type $bp_pending > + } > + > + do_dprintf_test $bp_pending > +} > -- > 2.25.4 Thanks, -Baris 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