From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by sourceware.org (Postfix) with ESMTPS id 4FE2F3858D33 for ; Thu, 16 Feb 2023 10:29:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FE2F3858D33 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=1676543386; x=1708079386; h=from:to:subject:date:message-id:references:in-reply-to: mime-version:content-transfer-encoding; bh=glJZ1+i4kLanVzMJO3YpJyFK1wgNYDaqIL0oC8V9MqE=; b=MRlL+lo/wI26ghfW/kq5umd5Klw5H88J5pN0kiPrptWCqhsGzq6M7vNN XmWFZlJj9F0a++kyTeOJ7kF5cL+7vLiRJtga6nKFTENMdFE6nYsqDTGws xCsdWEjNDwZXIJUj7NAWEtrbyFht1sB3w4m8W5aijsSQyJW9lhQeTFyEJ j0KCOIjzrQpFs/xM4MksjptflUP28N9AD5DQ9m6uvuzwSpPI40CO8PA02 ZMssxyhelYc18/KoY13libBEHyYxIlWDA2ntLRfY0T/Ys+UhI7vBDqgv7 xeVvZTxrhC+ZPqM7wfJbTzQSmPTziLajVhZxBqg+qEluf9+3+7PYgcJLV Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="319743108" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="319743108" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2023 02:29:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="915614933" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="915614933" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga006.fm.intel.com with ESMTP; 16 Feb 2023 02:29:37 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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 02:29:37 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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; Thu, 16 Feb 2023 02:29:37 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.44) by edgegateway.intel.com (192.55.55.71) 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 02:29:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FNFj3uvdVyEa4YFLwrlkXwAwhS7cl7SeJzhcb1Evyj8nSKZL+q5Bk/wjLTaOocXnd2tzaDERfOKajzZXZxgki01QVPdtxdEm9QCi0+IsFko5bltnU9aqvbYEIUyg556TcEGAAIL/sHXzsPO7MZMogWmQk4sar0S6rl8v8/ahYjEQaRroAGYDRAqdS0hpZ1iExPssmhkm4iEVETVeySJ0N/laSTDVePDHiDo2W4upX5Qa52qPmMnIZYL+LmDuAuOMyan9xg0lNq4sydJsuhXvjyKXKRTSxrUNC/1eCndI/qsJ/Cwge3fvnYWnPOqkB/6ZbsrciUjz78rJnlEJd2AXLA== 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=C7ltwiZDT3QBjiNe0ijsIzfnWasjR5yh+pGdcy+4w7I=; b=l7moleOYqyVY7w34w10TrXoR3P7idIIfHArUS8JsOepid8X4eNnEZSueUSQb8w5XH8gpI193YVQKSezCS/4RDoCbNWGE4QHmeeiQnNAckJ2Ki7NLh9Tp9bHhdURlc9RP6RwIazpG8pahy8+vBao7OwM1jk4pzoFmEBPm2egtx2Atmbs8gD5ATyBTQrKZw6LNRfUTv+/6s7aP2MEeBrQtHTH2/DqPcRhjgOXTDtaAP89reb57VDpm74/P7jXLn+ZVaFhVoUxkVg192vPWq0gcnY3toQsaG8bcd92VRorfMjY2HYw3g4t4GrNU/nvFVCfYqFHzj+9pTTYCl0hE2iOgEw== 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 CO1PR11MB4962.namprd11.prod.outlook.com (2603:10b6:303:99::23) 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 10:29:35 +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 10:29:35 +0000 From: "Aktemur, Tankut Baris" To: Andrew Burgess , "gdb-patches@sourceware.org" Subject: RE: [PATCHv3 05/13] gdbserver: allow agent expressions to fail with invalid memory access Thread-Topic: [PATCHv3 05/13] gdbserver: allow agent expressions to fail with invalid memory access Thread-Index: AQHZNZyJmfEOO0A3ak2lzkLGRjuxH67RdK3g Date: Thu, 16 Feb 2023 10:29:35 +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_|CO1PR11MB4962:EE_ x-ms-office365-filtering-correlation-id: e9384eca-d1ba-4c6c-43a1-08db1008b324 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: o6VnIRis7mFrHXDV2Bfn/WriJBOtUOWWut1jqRx74G+kfFUgyR7BOzQrDqVLBJZNrIC382Zo+slhGfCb0WqedQvpZGqB1HgiJQsWX/vQV/h+CWG2DPmmhNrH3OX0hv7bhjhta5Xn8v+9bRmg0Z5IbdoKlqMhJV3ctrxVnvuAFsYGKPtJ9PkzZLVzHSFOzjcKLHhpTCnKfR78LosNhQz4hMSerBTVBVsfkGKqof4TBuZn9Slz3TDYBxyA+ohpiYpfklDE8Wf7yezaqhdH6J+V3KJfQ0XYY0W9CbRz7WWmLsQeAFUDRbNpeR2pbdf5+Wn7i4LgtWZ0GVsDoYr51d5UHqAvGq8DombcFs7JdJROTqGTEc3AVPSjC+kFyqSv8XLHLCqMc7DJoHEoV4ozLqpqbmhHaOTVcKZiPC8POm/e6c3i3j3VIr3vYJEWWc2SeZLsveZkoegWQv38FN4b4Au3r4V1OTqYXGMm5Mxi6clmwicmGDo3zTUf+tBdtGF5djwwN9e0zPPrBfi+Ghu+iaiZOfEHXFgKYTvNHdnY2bl808DsCiYVngZOyiP7M9Tccna1vX/N5Bg2VO9uh6pfy9d/svytTVyRioceArvX+Bw0QzIq3xdQGE+arA+z8ho5UyBor/0gBqzIR+4k41bHfDCEvSn0vRDCqcCRn2LlRRxgREbIcLCleLWXOG5rhYDbhVt/ 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)(39860400002)(366004)(396003)(136003)(376002)(346002)(451199018)(71200400001)(7696005)(6506007)(53546011)(83380400001)(9686003)(76116006)(316002)(478600001)(64756008)(66946007)(41300700001)(66556008)(8936002)(84970400001)(66446008)(8676002)(66476007)(38100700002)(5660300002)(52536014)(2906002)(122000001)(55016003)(38070700005)(82960400001)(110136005)(186003)(26005)(86362001)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cwhk39f6ENu8I2QvI9QjWuOM6OHBCS+y0uxEDOKbsqRbNEnMs7AJCu23gUlx?= =?us-ascii?Q?9SIzytvesQVXtri7U8gXJuq0QPV56WHL6EO03+ggPfRU1cfA1FyRVxpcw8X2?= =?us-ascii?Q?ztGd/ZIP4qHnDU8L4G8vTrNEMo1aI8zMQTtzbpShYW3mV2FkGymI8ZSiJkc/?= =?us-ascii?Q?XPiPuyFB7vp+eUMHtxXdPXHN35XM6IbBJWRdZqwXpZJE8hh5P0WtV1d1yOcK?= =?us-ascii?Q?5Ul7IPnm868Rrrrfw+lkeWQnNiQ+Bt109a/6TOET2ewKW1F8SZ5mgF70QcQD?= =?us-ascii?Q?bXvFvd7Qybjfp7g3PCd5LXwMRDDd92kEOK+JOtePX0/Veyr0MIWX+1uQi+HP?= =?us-ascii?Q?fP37Oj6hvbcJaUopn6M7ufLnWTU+4aBqQFceDeZh/pqSm/5gyUeIpglhzjTb?= =?us-ascii?Q?bkCJSynEKpZh5lGbiWCZ1AwOOG3/Yn+8bRsTnfPZm8mO0cHfx5XeU7hTBMdT?= =?us-ascii?Q?2LYklvDjaiPBDkMmFbtzNyrEkKEbbCPoO+p8FWElereIOuZA/lneNx3nYEwH?= =?us-ascii?Q?ll627KX8MK73gXtJcKvaK8G3YTxyJr/a7RyFwoLdeq7I2wlYiXje9Ykb4mXw?= =?us-ascii?Q?jC8UM12MyVh0/9kLrX+DSgf6etkDTI+rED3O861ujf+0r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sPxn6Mnl+y1kZds6zHptJbaLHCTMashYv7dai?= =?us-ascii?Q?ASbU6zDGH7j/3N5PfXsuk25seg39FbHX9xIVXeRvom5NsAz8A3xcmDAu/Fiu?= =?us-ascii?Q?0w=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: e9384eca-d1ba-4c6c-43a1-08db1008b324 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2023 10:29:35.4025 (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: 8omMbCK2ch8a+8G+1yvRLfOkpoBgBD00at0349F54NAHYQ7qSYj+jFWwdhE8mGMKVR33P4vwLpJEQhFu7IWVZ0gEuSU6Xj82meQ2X01mWEU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4962 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,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 Tuesday, January 31, 2023 6:27 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 it is seems like the safest "it is" -> "it" > approach. > = > I've then updated gdb.base/bp-cond-failure.exp to test evaluating the > 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 | 21 +++++++-------------- > gdbserver/ax.cc | 12 ++++++++---- > gdbserver/ax.h | 3 ++- > 3 files changed, 17 insertions(+), 19 deletions(-) > = > diff --git a/gdb/testsuite/gdb.base/bp-cond-failure.exp b/gdb/testsuite/g= db.base/bp-cond- > failure.exp > index 9388b8cf582..d67c68c46a1 100644 > --- a/gdb/testsuite/gdb.base/bp-cond-failure.exp > +++ b/gdb/testsuite/gdb.base/bp-cond-failure.exp > @@ -48,7 +48,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] } { > @@ -61,7 +61,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" \ > @@ -90,16 +90,7 @@ set cond_eval_modes { "auto" } > = > gdb_test_multiple "show breakpoint condition-evaluation" "" { > -re -wrap "Breakpoint condition evaluation mode is auto \\(currently= target\\)\\." { > - > - ## NOTE: Instead of testing with "auto" and "host" in this > - ## case we only test with "host". This is because a GDB bug > - ## prevents the "auto" (a.k.a. target) mode from working. > - ## > - ## Don't worry, this will be fixed in a later commit, and this > - ## comment will be removed at that time. > - ## > - ## lappend cond_eval_modes "host" > - > + lappend cond_eval_modes "host" > set cond_eval_modes { "host" } We do lappend but then set the variable. Did you mean to remove the second= line? 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