From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by sourceware.org (Postfix) with ESMTPS id E5EED3858C52 for ; Thu, 19 Jan 2023 10:13:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5EED3858C52 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=1674123236; x=1705659236; h=from:to:subject:date:message-id:references:in-reply-to: mime-version:content-transfer-encoding; bh=A+XAWlb667vB6PB97JbW2+ETUcsTosy+iEKsZwxZ56o=; b=kAqQsPbS4qM/pUwFsorakPedB3/MJkYNjMEuDLgTo8p9TVgNX+DAUtsI 9F16cFTjVG+WCPI3YC9loinl+mPOxXIkTsfluAuw6XX+iOpyxpJMWFxC2 gMYvZVw2/oUDIzBZrpQ6aF8F75fwCVcbb7HzavreEoy7IOqN8Ph4LX0ve us6gJF8H9QIQuwE3ZBpEEx5WyfG9oCGPgYNJTGcNHQg3kLfLLnwnnKoBd oqml8uKGT5AU1RXzmeR4g+oFQf567Z4PQf1/TgS7TsR30wThMHrqSbnwC ADhwIoIodix6gMmrxSUtR79egAg71qPb3hnX40WANLgKGSqqbph0vHmUO Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="326508868" X-IronPort-AV: E=Sophos;i="5.97,228,1669104000"; d="scan'208";a="326508868" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 02:13:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="905464295" X-IronPort-AV: E=Sophos;i="5.97,228,1669104000"; d="scan'208";a="905464295" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 19 Jan 2023 02:13:54 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 19 Jan 2023 02:13:54 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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; Thu, 19 Jan 2023 02:13:53 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) 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, 19 Jan 2023 02:13:53 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) 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.16; Thu, 19 Jan 2023 02:13:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NhAo+Z7ZYcXYvq9hkOXOgLzOx2JJwZ2GRnP0wQHGury1kkpV9iu9/0JkSzqNTLrHZ2QboIAuTdqpJ0R9Nk+CA+zG9CpF7eAW3G2gf9ZjpIr31m8vVjrKY4CxrB8ie5OaFM3SE4qNZA0XDM3tvdWuDJ8uN/oKraMpRr/cxr9oxIh33POlUR0uIjysBj/JzWoArSyH7cq44tWoOK8/y66DalBLZMb8xOB6ZmsBiH1WNHR0SLcS8YmxWRsirsW7RkIlONDRM5e8elYuHVMSKmso0FKxhckEORqEyJtOpkJAg5FlmQ86ZdQ0cZs3nfcFRaaphnjKcsOwSI8MhTaCKqOzdg== 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=0FKVZBEG4kND+I2l2W9xr6rvKudxYEBwREp+J2K9+uQ=; b=GjBqM1x11PNiQN09hu1uS1lTpVlPMKjl8IUFbglPqZ93WOWFBNilaU32TLkup65XRdyPsi22ebTcK0q9y19tItjX/tggnHQwqlsYvLFCwixGCL9Vb7EzwOpvsgDWFANXu0gZtkpSWxRzbMIeVtRgdyOFVA6qcWKn3mi15f8KD5hUbrynUQNaRN20AwQKmTzaxVSTHRFwKv+XFi3xaKQjYp6rD3iQpE22dGSVeSMoUG0fqrOdojXgQ21Zy1z3BNFPZxR1I2c2qI95Iz1nB25i5HrYWsHSSP/GP2qQrUcYBQhgslYde50OAA+LNPDJH2rgtQQclFCqMCFWVY57cPVlZA== 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 SJ0PR11MB7702.namprd11.prod.outlook.com (2603:10b6:a03:4e2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.26; Thu, 19 Jan 2023 10:13:51 +0000 Received: from DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::d2a1:8dd2:854f:d5df]) by DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::d2a1:8dd2:854f:d5df%8]) with mapi id 15.20.5986.023; Thu, 19 Jan 2023 10:13:51 +0000 From: "Aktemur, Tankut Baris" To: Andrew Burgess , "gdb-patches@sourceware.org" Subject: RE: [PATCHv2 05/13] gdbserver: allow agent expressions to fail with invalid memory access Thread-Topic: [PATCHv2 05/13] gdbserver: allow agent expressions to fail with invalid memory access Thread-Index: AQHZK1jC003X+JhPg0+jwBuHbRfu4K6lhNQg Date: Thu, 19 Jan 2023 10:13:51 +0000 Message-ID: References: In-Reply-To: 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_|SJ0PR11MB7702:EE_ x-ms-office365-filtering-correlation-id: 5137a474-0efc-4da6-7c9d-08dafa05dce6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Pp/nRH/3+hnjwI3rp6kn8SrDRG4wQ9cMSmvgMzsjalH8Qi2okHHA6uaZYKPRlsPBzAYyDTusONBryzbcgl3mb93UrfYtvtUpLTjLgBrHPYRktMB4PLR9dt1qOFziM2u9VvglavxdS95Ns0on1kEKIUe9kpQYeSpPVEpqBJukCx/46Psq9rAuhCtRgsShzkxE3fYwQRM+EV/yd3r6pIMXM0rNippbzA8HA/pVcgoKjttccFawDk5Ep/z9X0tqdeQGyMfHPvY2eWVwvws5L78scDCXqXLhdxj0TieuYImrVUOXlbPmwL3ccrFwgPSvL8Q68teLawxECGNMNzZdZB9HZoQhLmrY72y39u5kCVbFWI3We3UW2sNv+dzVbkDmKK+ke4Wu+zGhsSDPy+vjkYGsq9BF1BbNDfRrzlso8MOSMZVSMqZK+iSoQ9gtxKtVybJVph/ukcNlmTFF4CihdB0PGwoz/OYy7yoFbz1rgc5lC4NmvXO3faWAQ1iTtavKS0EcrzJ4zIC1YIqXvIP9PMppPzmvqOIRJKCgOV2NWbxKbHjNT6CFnhfpUBCJ0s1SYAvxjP8BWVBkf/SNp11/CIQnjlSpsMFy3rtnHeP8mJ4QSdK1T1CvPP4or8c6Aj+wxdct7bDc8IlExLCVJlCGf7ZUUvNr+O2qWfFhX2/eM7unWRsvZwNqJ79aWSJeU9RDsi6Y+0r56Z9E8r6N8ru8nMG6kjWlPSYz8w1Fi0o2sEfNRXs= 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)(396003)(39860400002)(346002)(136003)(376002)(366004)(451199015)(55016003)(38070700005)(6506007)(71200400001)(53546011)(478600001)(7696005)(84970400001)(86362001)(2906002)(110136005)(316002)(5660300002)(122000001)(82960400001)(76116006)(66946007)(66556008)(66476007)(66446008)(64756008)(83380400001)(33656002)(52536014)(41300700001)(8936002)(38100700002)(26005)(186003)(8676002)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?KszAi2zeczVqjnLTJ7SQ1UDjST6fF6+MgGr67yrIPUmiQR37EyLvLJv7ls/b?= =?us-ascii?Q?PDCFaTtl0llFJrFik0IQzM77osCJ0XdnB3Azgzb0Znp7WaBUsEo3RK8y9r+3?= =?us-ascii?Q?I0UN0ZIcjfaXQA1mh1+swBv3jKfCNyETWSn3TqfF35hli9QwDXB5UHBgWtVG?= =?us-ascii?Q?A/H7cxHcuf5wkGL3LH+cbu3OLRWHBbjuTREKRsP432Ly1dXzmqT8/g+mj9Be?= =?us-ascii?Q?hIjxbnZw+uiIxnjl6mIMSLAZqA/MtyGe01GKEX501LtFxI58tnu56aMQ8qDg?= =?us-ascii?Q?h86RG+CCot4qoKMMYdGGDBcKF836zXDBekG3PfEewbJOycJ7cbf91NFdPiMF?= =?us-ascii?Q?e5VE5iZgEzsuzE8QjzQUuFX1Ysl8kJDDmt2eehdf1RK0rQqfbk0AYw0NDWAe?= =?us-ascii?Q?LKm4fcQxv7IB2v6uA+0VR+sH08jLlET7Cu+kUxJ7FRlSpvuVUjcGVdFtO5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xf8543F84KrHzFaqilhoAD0/b4DUvNorhI?= =?us-ascii?Q?lqaYWZLo6nalwoVWBIdp5NXqWiHfO6HMnK3SwS9pBK+Zi4O7Z2fR7UpRnTMw?= =?us-ascii?Q?dZ++9faNM9SEngxD9l+v8DbWH+y65uZdCBwfn8ux2kJh1i5Kg2YREZPQuF48?= =?us-ascii?Q?yHTliAAnSIp5TA2ypxxwE+2dJb+YHnjSTJaZQ1MCQXydZGNmPoDcU2mJkX44?= =?us-ascii?Q?X3MHrdsN0dnFt9wgV6rm+E4fe8zUllIg7MtdSpkDMB1bn9PWU8F+R2aRuYIb?= =?us-ascii?Q?yA=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: 5137a474-0efc-4da6-7c9d-08dafa05dce6 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2023 10:13:51.3750 (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: eYuj/0VphPvFigpN8sll3kTPXC93I6vkcJTO9g2Lzk44fgtZfWQh2SOusmkqvwTZyM/BRWa82vaw9Oqlevebcl+kS/SZraBhn7ByTNFIdEg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB7702 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Wednesday, January 18, 2023 5:18 PM, Andrew Burgess wrote: > This commit extends gdbserver to take account of a failed memory > access from agent_mem_read, and to return a new eval_result_type > expr_eval_invalid_memory_access. > = > I have only updated the agent_mem_read calls related directly to > reading memory, I have not updated any of the calls related to > tracepoint data collection. This is just because I'm not familiar > with that area of gdb/gdbserver, and I don't want to break anything, > so leaving the existing behaviour as is seems like the safest is -> it > approach. > = > I've then update gdb.base/bp-cond-failure.exp to test evaluating the update -> updated > breakpoints on the target, and have also extended the test so that it > checks for different sizes of memory access. > --- > gdb/testsuite/gdb.base/bp-cond-failure.exp | 16 +++++++--------- > gdbserver/ax.cc | 12 ++++++++---- > gdbserver/ax.h | 3 ++- > 3 files changed, 17 insertions(+), 14 deletions(-) > = > diff --git a/gdb/testsuite/gdb.base/bp-cond-failure.exp b/gdb/testsuite/g= db.base/bp-cond- > failure.exp > index 6f89771d187..aa39b638592 100644 > --- a/gdb/testsuite/gdb.base/bp-cond-failure.exp > +++ b/gdb/testsuite/gdb.base/bp-cond-failure.exp > @@ -39,7 +39,7 @@ if { [is_address_zero_readable] } { > # Where the breakpoint will be placed. > set bp_line [gdb_get_line_number "Breakpoint here"] > = > -proc run_test { cond_eval } { > +proc run_test { cond_eval access_type } { > clean_restart ${::binfile} > = > if {![runto_main]} { > @@ -52,7 +52,7 @@ proc run_test { cond_eval } { > } > = > # Setup the conditional breakpoint and record its number. > - gdb_breakpoint "${::srcfile}:${::bp_line} if (*(int *) 0) =3D=3D 0" > + gdb_breakpoint "${::srcfile}:${::bp_line} if (*(${access_type} *) 0)= =3D=3D 0" > set bp_num [get_integer_valueof "\$bpnum" "*UNKNOWN*"] > = > gdb_test "continue" \ > @@ -68,16 +68,14 @@ proc run_test { cond_eval } { > # If we're using a remote target then conditions could be evaulated > # locally on the host, or on the remote target. Otherwise, conditions > # are always evaluated locally (which is what auto will select). > -# > -# NOTE: 'target' is not included here for remote targets as a > -# gdbserver bug prevents the test from passing. This will be fixed in > -# the next commit, and this test updated. > if { [gdb_is_remote_or_extended_remote_target] } { > - set cond_eval_modes { "host" } > + set cond_eval_modes { "host" "target" } If this test were executed against a gdbserver build that does not support condition evaluation, would we get failures? To that regard, would it be s= afer to define the modes as { "host" "auto" }? 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