From patchwork Thu Aug 17 08:49:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 22180 Received: (qmail 23686 invoked by alias); 17 Aug 2017 08:50:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23126 invoked by uid 89); 17 Aug 2017 08:49:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR03-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr50041.outbound.protection.outlook.com (HELO EUR03-VE1-obe.outbound.protection.outlook.com) (40.107.5.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Aug 2017 08:49:27 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) by AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1341.17; Thu, 17 Aug 2017 08:49:23 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::b8e2:8809:e2b2:ae37]) by AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::b8e2:8809:e2b2:ae37%14]) with mapi id 15.01.1341.024; Thu, 17 Aug 2017 08:49:23 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd Subject: [PATCH 6/7]: Regcache: jit should use a writable regcache Date: Thu, 17 Aug 2017 08:49:23 +0000 Message-ID: <88DBCC66-D7BA-48E0-ABE9-CEFFFDC36951@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM3PR08MB0101; 6:08F6IkifdMPCeasIdyMKcTqSES4KJ2AXujsTBGIhK7m3MFDHs1bNSqARRP5AS+yxFCSg4tc7ks7+SMINxwz7EujYp6Kax+YU0kDaQ7iK0AXkAISW2fIBvdZVANtGpwazaeGZh/dmxIS8HNRLLHCiAs0DFTtqa1QxlFTzC9VrDIcPaR3diwKu1MYjhNtUNPgAr3LExLIYl0oPbrV2bDKPSkcuLBJAYobEdQiTFQBsgJK14awAfn97CfERXL+dQPgXFAbEGOimHP1eFKGh+8i2cn0yRVGcT34yFtHfUJK/R2fR+fwbdaNJkDbLFv1piGiqTUpcALJ62jyx3jxXpqX4gQ==; 5:Od9A2KLU0CDXVKGP62zGIaT2NuBAXhHlAFq3kJDCifvi3tJQ7xpCFTbFaWLqeWNmjme0dWMacCuWKNnttwea2l5xzNguQ8LlGzLOx+1C/dmvQyHaRuMizXhQ9dtrcuZj9AiqwAfGT/sq+DZWX2+U9A==; 24:svFwlne2E2fH+00xG6q6SJVlE0EZlvFzDHDWzEQGgUfYAJa/dbaNiYxanLNlEMWkOd2rcIl6B86UqT2eIDBQuGyihQq6I7sSh8LhTHTaHJI=; 7:lJ4O2Fn0990x+gH6Y//UJiUiJhIauv1TRJS9GQVQZ0iONNflqPh8+fsklWQmI3WiqdWuqI+xgTJaYK38q9AHydwngyPjDXADs9uAtY36juRY3/7cZPBciQUrWbt/JidQ7dc3V6zv1LdJYkjEWp1BwoM1FNgq/T+i+8NTyFE2SpbhaIKR5hEvqjtDZqlkgYMNgHNUWp1MK9r3FL2T2eKP7bdqHHgiGcoal30NFfwe1iI= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: adf5d8a9-b8be-46d1-da17-08d4e54cdc14 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM3PR08MB0101; x-ms-traffictypediagnostic: AM3PR08MB0101: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM3PR08MB0101; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM3PR08MB0101; x-forefront-prvs: 0402872DA1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(199003)(377424004)(189002)(81166006)(68736007)(86362001)(3280700002)(478600001)(189998001)(2501003)(5640700003)(99286003)(5660300001)(2906002)(6436002)(25786009)(7736002)(53936002)(3660700001)(33656002)(3846002)(305945005)(6512007)(36756003)(102836003)(101416001)(97736004)(8936002)(6116002)(66066001)(14454004)(50986999)(6916009)(2900100001)(8676002)(54356999)(6486002)(106356001)(105586002)(72206003)(6506006)(81156014)(2351001)(82746002)(83716003)(4326008)(110136004)(5250100002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR08MB0101; H:AM3PR08MB0101.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Aug 2017 08:49:23.8086 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0101 X-IsSubscribed: yes regcache_set_cached_value () is a bit of a hack, allowing the writing to a readonly regcache. With the previous platches in the series in place, you should instead create a writable regcache, and update using raw_supply. Tested on a --enable-targets=all build with board files unix, native-gdbserver and unittest.exp. 2017-08-16 Alan Hayward * jit.c (jit_unwind_reg_set_impl): Use supply method. (jit_frame_sniffer): Create writable regcache. diff --git a/gdb/jit.c b/gdb/jit.c index e96572a8d1d7fe16561be7ba8a61b56d6bb1e85d..ed5bf160a4caa3a671aacd31b58c105a00f93ecc 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -1125,7 +1125,7 @@ jit_unwind_reg_set_impl (struct gdb_unwind_callbacks *cb, int dwarf_regnum, return; } - regcache_raw_set_cached_value (priv->regcache, gdb_reg, value->value); + priv->regcache->raw_supply (gdb_reg, value->value); value->free (value); } @@ -1206,7 +1206,7 @@ jit_frame_sniffer (const struct frame_unwind *self, *cache = XCNEW (struct jit_unwind_private); priv_data = (struct jit_unwind_private *) *cache; - priv_data->regcache = new regcache (gdbarch, aspace); + priv_data->regcache = new regcache (gdbarch, aspace, false); priv_data->this_frame = this_frame; callbacks.priv_data = priv_data;