From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by sourceware.org (Postfix) with ESMTPS id 74C303858D1E for ; Fri, 20 Jan 2023 13:12:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 74C303858D1E 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=1674220325; x=1705756325; h=from:to:subject:date:message-id:references:in-reply-to: mime-version:content-transfer-encoding; bh=zhax7cod4cDlI08/J9LjCrqyZqwyYpWm35SkVrOa1Bg=; b=FbT5rIgYXhXnKawXECk3R/oviaFGGE9zwb7K76rCkv8Ro/IggA8VpUeK fnoWLFVFAtKGh/LdMHDzkQ/LD00SriIyh6v06i5CMO42LOYevQCSy5KQo 5sArrIWs80t8xCidCMYxOg1Qc/9qGbN/jxxPr4kVehPNLeuBsCC3NSKHP bsuKt+3GchRXqYLmcQOiY9CDBzbPZuh1CfHE2fwtg48HaxMVKeiVM5JZj AN4mrF2z5XtHpYO3eGiNxfwNK7Yqg6jYnrWrvVJv6uIxvt+0wnZvMWeEA LjsXQMG24TGLUR8XNTDoN4Zhqm1EU/ufy2b4dfO27vViQ68gaMUtomkvn Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="305247146" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="305247146" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2023 05:12:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="768688923" X-IronPort-AV: E=Sophos;i="5.97,232,1669104000"; d="scan'208";a="768688923" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga002.fm.intel.com with ESMTP; 20 Jan 2023 05:12:04 -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.16; Fri, 20 Jan 2023 05:12:03 -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.16; Fri, 20 Jan 2023 05:12:03 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.16 via Frontend Transport; Fri, 20 Jan 2023 05:12:03 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 20 Jan 2023 05:12:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NuVXlzPz1awwk/M27zNgLEWo09CmpFFJciY+W83Rw+cTPdhmem3cWuvZjm8KlBuUQWgUnAyxV5ky2RLVXQJqF5L67QM1bSVpVc8vENqit+dqdmOIQWgV0eYSlh3F8CMDOmIlQ55awVsKOG1VtU80CR8A14jRokHieIbq/1cKneshF331K/NtNodQCrvIf0KiGWamil70Z8PZJgxt53uJRtXeXXaVXejr4Ef/YIm/hLd/IwAQlFhIy6cay81BA+ejFN7FESghqMsBeinAcu2gyXXaRyjLlf+z+/p5EHm8HbS8D8tTEylo4UVABly/CVs0sEUip3pGkzS1qEkzYl9qYA== 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=X8DBM+BZsovnEym8HyZXTqnRBxwCgAPkFQsOJgZPfnY=; b=RYqXqE49pw+pLGRcp4XOVmMC1Cx0j8tHeEtuu1sQbh8+MAu6/WMZF/lcJjai77Ns8H5O3r5sWrjGMmQQaVVvtwiBODUVIiRbMLXmzfC3y8n10oaxX4zg3V7EFJcGwXUXJp16cHDfmOtNpNu9bk+zf6ss4Q/ZndC9mw2/5bggAILlRAwyxR8YT9EN+1zAGjltcyWHGMME700u1SU9bKicjBA6lCnqI7GTTcFv7S5u24GyOdzp319bZFaExQsp5Hpjq2DV0neomePoxsN2k+lg4xFSFvX/m0leBCcqNJ0Xyi7V7ka7ZvkV5JQ01xK30OYCal5h7hhNMgeWlP8KhCWLbQ== 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 IA0PR11MB7741.namprd11.prod.outlook.com (2603:10b6:208:400::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.24; Fri, 20 Jan 2023 13:12:00 +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.6002.026; Fri, 20 Jan 2023 13:12:00 +0000 From: "Aktemur, Tankut Baris" To: Andrew Burgess , "gdb-patches@sourceware.org" Subject: RE: [PATCH 5/6] gdb: add inferior-specific breakpoints and watchpoints Thread-Topic: [PATCH 5/6] gdb: add inferior-specific breakpoints and watchpoints Thread-Index: AQHZAxx9jvujEPaZaUCUDBSLG5fZeq57VB6ggCsZ+oCAASoqsA== Date: Fri, 20 Jan 2023 13:12:00 +0000 Message-ID: References: <0d3144a162d93c2b7d409234bd199e3c9fbbfce8.1669634536.git.aburgess@redhat.com> <87lelye3rm.fsf@redhat.com> In-Reply-To: <87lelye3rm.fsf@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_|IA0PR11MB7741:EE_ x-ms-office365-filtering-correlation-id: 1d8521ec-c86f-4d0a-baa9-08dafae7ea5c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: M7/y/7AaEVngRDth+zxW+IZ5u3PvxJtdsSwlTaGYoHJ5DL3uOsu8YNaV9oK3tfi8zLydNpQD1yZrLB7rJ5neGf+s9LIMB0d6DSYUZ2+20XYLiBw+dO1GzhXVyELt9xeuRyUyqoC+TX+sT8NkISwdPxGoz1ig/yeOUzW+jS1yQN44s1Q8e3kPRLJmpll7TNjsD4jnVsorTentQ6KRKvRyNHJN8JAIod8eAptEzJRjPI1/4P/fLII7asIKBr6ijLz4gz3+BD6ICCW4j9T79m95oiu5AqAO98SW7VpR2MdkzyU8dFg2egBLPQhYhWs327soGD9oc4qzyxKVAP4FEueAVToVIPNCfiEdKu0U2aaVEM74J0rVK3j/7t7xBwOY95eQxSZRbCX+mwBQ7WFl3aANayRmpnznekroZOtqw4uOmkvh7i0rMpsgVPuaWhN9y7hSF//uJTbkWtJ5HEROfRGMQ2MBxqTxnjLrt/D0buqOI4s1Xyl1KlnMW/1HGNpsUXb8gp32Z+3K14FzmiDbMADZOeu44BG7Z587r0l3duKZutk0reCn4mZ+2KqRE78s02OfaHqUVgjIObhj2TTeGW1NuDx0v/Qb2Ting/6o+/ERzVkTipjMCYSMCoB7AVkuDLD/Gzau5ZQqp+92VQPytVwQSzBc5MSMn4JWLQinWK2VRsmkdbnoRsx3hai1E2YhZdoRG3992wFkmApmm9QaoRaiD4mEZAVe4RahYrFgBaNR4Gk= 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:(13230022)(39860400002)(376002)(366004)(396003)(136003)(346002)(451199015)(186003)(7696005)(26005)(6506007)(9686003)(82960400001)(83380400001)(53546011)(38100700002)(478600001)(966005)(71200400001)(122000001)(38070700005)(110136005)(5660300002)(8676002)(64756008)(66476007)(66946007)(66556008)(76116006)(8936002)(41300700001)(316002)(52536014)(2906002)(86362001)(66446008)(33656002)(55016003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AiBRls3MF2MLQNzh3fB0XpA9nNeh1bNtVppS1kRtCmngmI3ULh0Nt+CPRGte?= =?us-ascii?Q?tFuK+eNEFyHrBE3H01UwMilw4gWBF9Bi9ZBS+kcwAbMOolnxpdaTn49saCXy?= =?us-ascii?Q?8X5vg75P2+ZRsjXawb67fyPA8L0jtexpk6vZWeJrRhR8flcZipAk9l5SE7a2?= =?us-ascii?Q?g1hcYVKUQ6odctjT84vsuFGePbKufFkX4en8LH/iRlLukcH2/HoMNHvHDQ1j?= =?us-ascii?Q?muku216FZr+yczJHBXIXhyId7kRzkAXZE7/bLUH0iPwi5XMzI/Z3Np7q0c58?= =?us-ascii?Q?HshsDHup7m2GiZ8QFsvU02PgNNOVflFSUI2FCx5De8DxxiHvaH29j1OikcQV?= =?us-ascii?Q?AOSvYe8khNrEn8Sdijf5kfVaCkx7WnP79k48T4puFdiu8Gex8lJPE1jGbGFF?= =?us-ascii?Q?5OmKH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hCotPygEZppI6BEf?= =?us-ascii?Q?FpB9Q/dg3jBhGPs8z5+C7AjxqDpa2DRFKtE+Sr1L0H1nkO9Mgw8Gjb0BUUWo?= =?us-ascii?Q?jn8xEjYaN8Y5X4ZOBrIo2BArdClCxWHl98B5TyyThBOnNRblXHPnnhEf1qXa?= =?us-ascii?Q?EvolPQGImvwMFMuw/HioeKhLJe0+diMe4TyqwS/Kuip5mc3rCpZTPyTHg8AU?= =?us-ascii?Q?0tF9DLK+0J9aCNn6HygVp2KgAA2hFEIkvsuKR3LbtOyYS/3hLeaBN2bFPf5E?= =?us-ascii?Q?4dNUzBrXMtdNAFHooNEO6Hy2kzSPP7SoIHckvJQgCa3bnBPRdcc3vKKz3ZUa?= =?us-ascii?Q?Gg=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: 1d8521ec-c86f-4d0a-baa9-08dafae7ea5c X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2023 13:12:00.2368 (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: 4PALP9RYwKBJCAOixz0cRBrOyMeJlIMs9xg8w55DP80tCZ1otuJ4LaX+qkVcyK8hh8ywMDyRoieFSKO5JQgy0AlQUGQpidnJtTjUmFAZhmE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7741 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 Thursday, January 19, 2023 8:14 PM, Andrew Burgess wrote: > "Aktemur, Tankut Baris" writes: > = > > On Monday, November 28, 2022 12:26 PM, Andrew Burgess wrote: > >> This commit extends the breakpoint mechanism to allow for inferior > >> specific breakpoints (and watchpoints). > >> > >> As GDB gains better support for multiple connections, and so for > >> running multiple (possibly unrelated) inferiors, then it is not hard > > > > Nit: IMHO, removing "then" makes the sentence sound better. > > > >> to imagine that a user might wish to create breakpoints that apply to > >> any thread in a single inferior. To achieve this currently, the user > >> would need to create a condition possibly making use of the $_inferior > >> convenience variable, which, though functional, isn't the most user > >> friendly. > > > > An important difference of an inferior-specific breakpoint wrt using > > conditions that contain the 'thread' keyword or the '$_inferior' variab= le > > could be that the breakpoints would not be inserted at all on other inf= eriors. > > For inferiors that have a large number of threads, this could save a > > substantial amount of overhead of stopping, evaluating the condition, a= nd > > resuming. IMHO, it is worth considering this for inferior-specific bre= akpoints. > > > > In a downstream debugger, we had included this feature: > > https://github.com/intel/gdb/commit/7d87ac91308cd7a8984ba7b0e333a668979= 0972d > > (Please see the modifications in 'create_breakpoint'). > = > Neat. I wasn't aware Intel had already worked on this feature. > = > I had also thought about not inserting breakpoints into non-matching > inferiors. In the end I decided to leave that for a follow up patch, > but it's nice to see that Intel have been doing this for a few years now. We should&could have submitted the patch to upstream earlier, but this was delayed due to several factors. Sorry about that. This could have saved s= ome efforts. Avoiding the insertion of the bp in other inferiors can certainly be done in a follow-up, IMHO. > > > > With this perspective, I also think that allowing the use of both 'thre= ad' > > and 'inferior' clauses makes sense, because they would have different a= dvantages. > = > Except, isn't the thread-id passed to a 'thread' condition a global > thread-id? i.e. "break foo thread 1" isn't thread 1 in every inferior, > it's GDB's global thread 1, which is one thread in one inferior. > > So we could (if we implemented it) already limit into which inferiors a > thread specific breakpoint is inserted by just figuring out which > inferior that thread is in. Yes, this would make sense. = > I think it makes sense, at least initially, to prevent use of 'thread' > and 'inferior' together. If we decide to relax this restriction later, > then that's no problem. It's much harder to add more restrictions > later. Ok, that's right. ... > >> + return 0 > > > > As I wrote previously, the testsuite does not look consistent > > about what to return here. But "-1" makes more sense to me, because > > not being able to run to main sounds like a major problem. > = > The difference in the other patch where you pointed this out is that the > return as at the top level of the script (I fixed that other case as per > your suggestion). > = > In this case the return is from a function. We don't actually check the > return value, but I'd rather leave this return consistent with all the > other similar return statements, in all the other functions, in this > test script. I missed that this was returning from a function. I see your point and it makes sense. > I've made all the other updates you suggested, these will be included in > a V2 series shortly. I'll go over the series once more as soon as I can. 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