From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by sourceware.org (Postfix) with ESMTPS id 8C99D3858D33 for ; Thu, 16 Feb 2023 12:59:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C99D3858D33 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=1676552384; x=1708088384; h=from:to:subject:date:message-id:references:in-reply-to: mime-version:content-transfer-encoding; bh=VvGOCIZILgs7M6Yv1ZosPgfA2hurEy53jrsoYjxteEQ=; b=hNeCXmk7jLXU2F66XlNJgqhHkQZ0Z4MbNUUTSvxq66y3eqvwqZICVQDM nQUbHXNQnxVinoiK/g2qpMw6rOjzSe+UmdKpnweMaTxqhO3shtgItWaNS AEqAtTzlixp+q2OE1ekzcQePTuC7wN8M6Oi0YwY+7mQD3jH8kvUoaqBte ch3zyRvR8267SkH3BFxUt1LawSPaU6zHIg0YlTzu/6ZW/qmcuY5VmyJW+ L6GIQMfbMvPR3DMsHxfihgA+bOiHEVYPU8jWdTXTtCVZSlXhFWbvUAYl6 2FZw4SuWeoz1Hryk9sb1BxfHauiYDhc7OmYSkdChLnp59JukhH99VyNd4 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="329429185" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="329429185" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2023 04:59:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="758925059" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="758925059" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by FMSMGA003.fm.intel.com with ESMTP; 16 Feb 2023 04:59:43 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 16 Feb 2023 04:59:43 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 16 Feb 2023 04:59:42 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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 via Frontend Transport; Thu, 16 Feb 2023 04:59:42 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 16 Feb 2023 04:59:41 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fkIpgwQN0mF0y94CeaennflcW93O+Cgo6PUT74XWPugLlKNDWjHP3MEwMTpisXSD3/yJJ5VdGqSDrMlOldxf964qPBdHEZkZqwx+Lp5xqs95HpCER9MCA8d30CPdNGQkPNLwhktkfCM3u8/pYTw7ae1eap+/9fYdis3+siMtDD7ua+2uIN9r0OUdNJ1/0wRQOPtRCHY3er6/lA9GnE/eNWKAr4rxaIYjx8sqq+rV7XzICtFqs14DDRbW3GJkx/XUrUKg0QTLqwiRRL+FJ3hXtGcHEwJp2GyDac0817ivrS/+SAADVP/bt59TuHeoG6dmvP3ODXXAB42OLwIE+YQFRQ== 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=fAwM71u7r7OIy+d6C95b1PgPrenXVM1Tdoqb91Y/UHA=; b=YL+TNxPDl+L6DVZnW362sEVEsOSDxUVEseiwNOmfL7fqvsIN2kIoXTxFlCpt7SyYZJhc7S4MAKBf7qrf2p74tDYjuVwRyrh7rU+H4IQFfJO7BLBF0MIge1ZpNcYQDpTVqg8MN4gYsn/1gDiSvQkZKKm/cZShY3InDGMsE1cNS0KvmE/pHuBHpXYytcPkjDhciRctuL8lZsFflkRAWs+qUI7N0EIDezIa1+rs3y2NoZ6KN+hnWQWvsYD3bp1qs6DfUE57WQwmkvp9sUFpQ3fkvvqsULzhxSvRtQjpqBTpYj845wilWG+iq2eHjrq3HaNMTG2Sk6Hj65wEbVgsn6Vv3A== 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 DS0PR11MB7508.namprd11.prod.outlook.com (2603:10b6:8:152::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Thu, 16 Feb 2023 12:59:34 +0000 Received: from DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::dec6:d57d:f767:c5f2]) by DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::dec6:d57d:f767:c5f2%4]) with mapi id 15.20.6111.013; Thu, 16 Feb 2023 12:59:34 +0000 From: "Aktemur, Tankut Baris" To: Andrew Burgess , "gdb-patches@sourceware.org" Subject: RE: [PATCHv2 6/6] gdb: convert the 'start' breakpoint to use inferior keyword Thread-Topic: [PATCHv2 6/6] gdb: convert the 'start' breakpoint to use inferior keyword Thread-Index: AQHZLLQzLKQhE3Syn0CG+WHLS/Gdta7Rsu4A Date: Thu, 16 Feb 2023 12:59:33 +0000 Message-ID: References: <0823d00de1408044915aa3bbcac4de0361d4ac30.1674207665.git.aburgess@redhat.com> In-Reply-To: <0823d00de1408044915aa3bbcac4de0361d4ac30.1674207665.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_|DS0PR11MB7508:EE_ x-ms-office365-filtering-correlation-id: 8709bbd2-f5e3-4161-20ec-08db101da6bb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nIZMeB5XMXq3NRyzPck88om0fdJuGEjjQB+LVHi9ReDBQ8eA3Tr86uTQbC6ot7En+YiHEaK86xTNLceeT03MorJ6b/lKd8GEu7HZNJq7XwF5QChu+yDmb1pI8LyFdRAtkW6ui+Sw9i+OPEVJaCtnivC33NORI6BSQ5xS1BsCmXvpHfOtMN8lKtIsJbIzqDDKxn9vSjs76hIWe/Ub3c0gY1HZ5BSY7GjBUfTC2IGN9o6sukSelEurEAw3GEYyx0KpSU9lDCCxrUg43bxK+CUQw2/XZTsXr4OvFDYDgIUaJyw8Zg4VGE8RbepVfk2lPQh3Yk/QkWaTQlS5bX3Vpg+BIUicDzdkAwiV/CrT1wkmQDqGufqZKfrFSh+KI17AlkyYjNC4QPPanLES9qwjJB8TgeR56PLN0fssrIwxOSDNTGVvi/gYlhpeBXGPEnQrfG1LWKlHsmzcZtiYgQDSa/WQWVMErEO+9mxGb9PvsRWwyerKYJQ21G2R2lNVaFwtPmcd8/5awOgWWEwGs/eiXzT4zbMIafi8OdXo0hBgmurLNaptzamNKnRgyp8hcNOzwXmmFAECBxqxCNfVhGShneZxFX7X95vxyMcuDlbC/SHAMyJI+0KTobvAXHP+9q/p+MBhL8kJrx7D14MbTT6+s48KG04MVi2dh5DCLXij7PH4k9QS41x60VhlLU+C+R63TJPc0TyOZAnyGexlVhichufEcA== 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:(13230025)(346002)(396003)(136003)(39860400002)(366004)(376002)(451199018)(86362001)(38070700005)(38100700002)(110136005)(122000001)(82960400001)(478600001)(186003)(53546011)(33656002)(9686003)(6506007)(71200400001)(26005)(7696005)(83380400001)(41300700001)(66556008)(2906002)(66476007)(5660300002)(316002)(66946007)(76116006)(66446008)(64756008)(8676002)(55016003)(8936002)(52536014)(2004002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8k/rrIxCkWVOBsC+w4E62AyGo5JwrT4dvQpaoaTPPNrJ0Hn7mQ51S6Ifbhdt?= =?us-ascii?Q?Zv8jxC6HrLEEpuE0fsDsNSxMx+Mv4KbYNQv0k+mNTj0UwPxQrJtebzSwqh6J?= =?us-ascii?Q?p3qZwKaBrVInILDFxuOKhdjVtWBm4ZAPKF6ZNKnh1BaG71PVmadRULofh9ay?= =?us-ascii?Q?PFC6b153dEYr5jsVErBk1uuMMjlj6cT1p13u8wbFrqRImyD7jJjeeGr2n8B2?= =?us-ascii?Q?wFL8kXkhf+WFmrFtJgNiO9H9uIFPr4rdo5EiLv78MdJ6gRgpC0ivTgtt4zbW?= =?us-ascii?Q?lWvfCIwcwCaByT9ux6EzGzYz6AxWgmU2rAWi+KM6XAJuBXieaf56bas2DWR2?= =?us-ascii?Q?etlIG6JIudrYk4g4aeQnPYU1uXSfOeedxQ/HOmZKggmAtjCu95XHv8gZfR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/dz9EpJ3BgmLHfhR5Vf1dCk?= =?us-ascii?Q?5eMCI9gLWQs/vVJmIAoNEF1V1B9VnG/zv1tLLWeqKf/9q2jfsEw6jOZEufI5?= =?us-ascii?Q?NS+69GGCruM32XLlHXxnSygE0vrbPivo+VG42cY9+GgcHIWByccvXtNHkH3u?= =?us-ascii?Q?z7xt7cmqOe5msUt/kDEbdW5NmTyp7tSkYUTT+iWsZRsEeCAOUXwsKmX6oNNJ?= =?us-ascii?Q?/bdg/QoHGSfblDDvkla/VfiQqZzMxfB9/0eEDkllTaN+QID0KVUv10kYJ6i8?= =?us-ascii?Q?/APWgBPdkZeWtHVIs7j3W4rqfFplyY5wLS6QGADatbDRIiYBWHdZohWpwSeX?= =?us-ascii?Q?9A=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: 8709bbd2-f5e3-4161-20ec-08db101da6bb X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2023 12:59:33.9965 (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: SSH2aIzUSDj5jc5/vsh2IAKTmFgOoJUCTRhfs8xBN+ptWjqkp3ddmxkc6eyuRVeRHqYnZFQRHTMQ4GZhkMksNT8KHbWamEufnCw9iggvS+Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7508 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.7 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 Friday, January 20, 2023 10:46 AM, Andrew Burgess wrote: > Now that we have support for inferior specific breakpoints, the > breakpoint created for the 'start' command can make use of this > keyword. > = > In most cases the observed functionality should be unchanged from a > user's point of view, though the code in GDB is a little cleaner now, > we no longer need to change the expression used based on the > language. > = > I do wonder if the current mechanism could run into problems if we had > different inferiors of different languages. For example, if we had an > Ada inferior and a C inferior and followed a process a little like > this: > = > 1. Start C inferior, the inferior stops before main for some reason, > = > 2. Start the Ada inferior, this runs to main, > = > 3. I think when we hit main, the condition for both breakpoints will > be evaluated, this will include evaluating the expression for the C > 'start' breakpoint, which uses '=3D=3D' and is, I guess, not valid for > Ada. > = > I haven't tried to create a testcase for this situation, but it's a > possibly interesting edge case. > = > One place where the observed behaviour is different, is that inferior > breakpoints, like thread breakpoints, will be auto-deleted when the > contained inferior exits. > = > As a result, if an inferior exits before hitting the start breakpoint, > then the 'start' breakpoint will be auto-deleted. > = > I have got a test that covers this situation. > --- > gdb/infcmd.c | 10 +--- > .../gdb.base/start-inferior-specific-1.c | 32 +++++++++++ > .../gdb.base/start-inferior-specific-2.c | 22 ++++++++ > .../gdb.base/start-inferior-specific.exp | 55 +++++++++++++++++++ > 4 files changed, 112 insertions(+), 7 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/start-inferior-specific-1.c > create mode 100644 gdb/testsuite/gdb.base/start-inferior-specific-2.c > create mode 100644 gdb/testsuite/gdb.base/start-inferior-specific.exp > = > diff --git a/gdb/infcmd.c b/gdb/infcmd.c > index 7d5ec77ff57..7dfef4b5a23 100644 > --- a/gdb/infcmd.c > +++ b/gdb/infcmd.c > @@ -429,13 +429,9 @@ run_command_1 (const char *args, int from_tty, enum = run_how run_how) > have proper inferior-specific breakpoint support, in the breakpoint > machinery. We could then avoid inserting a breakpoint in the program > spaces unrelated to this inferior. */ > - const char *op > - =3D ((current_language->la_language =3D=3D language_ada > - || current_language->la_language =3D=3D language_pascal > - || current_language->la_language =3D=3D language_m2) ? "=3D" : "=3D= =3D"); > - std::string arg =3D string_printf > - ("-qualified %s if $_inferior %s %d", main_name (), op, > - current_inferior ()->num); > + std::string arg =3D string_printf ("-qualified %s inferior %d", > + main_name (), > + current_inferior ()->num); > tbreak_command (arg.c_str (), 0); > } > = > diff --git a/gdb/testsuite/gdb.base/start-inferior-specific-1.c > b/gdb/testsuite/gdb.base/start-inferior-specific-1.c > new file mode 100644 > index 00000000000..1717a82b75d > --- /dev/null > +++ b/gdb/testsuite/gdb.base/start-inferior-specific-1.c > @@ -0,0 +1,32 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2022 Free Software Foundation, Inc. 2022-2023 > + > + 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 .= */ > + > +#include > +#include > + > +__attribute__((constructor)) > +static void > +ctor (void) > +{ > + exit (1); > +} > + > +int > +main () > +{ > + return 0; > +} > diff --git a/gdb/testsuite/gdb.base/start-inferior-specific-2.c > b/gdb/testsuite/gdb.base/start-inferior-specific-2.c > new file mode 100644 > index 00000000000..b69e218962a > --- /dev/null > +++ b/gdb/testsuite/gdb.base/start-inferior-specific-2.c > @@ -0,0 +1,22 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2022 Free Software Foundation, Inc. 2022-2023 > + > + 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 > +main () > +{ > + return 0; > +} > diff --git a/gdb/testsuite/gdb.base/start-inferior-specific.exp > b/gdb/testsuite/gdb.base/start-inferior-specific.exp > new file mode 100644 > index 00000000000..7271f6d49d3 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/start-inferior-specific.exp > @@ -0,0 +1,55 @@ > +# Copyright 2022 Free Software Foundation, Inc. 2022-2023 Regards, -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