From patchwork Mon Mar 18 16:28:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 31896 Received: (qmail 67883 invoked by alias); 18 Mar 2019 16:28:11 -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 67875 invoked by uid 89); 18 Mar 2019 16:28:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.9 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.1 spammy=H*RU:sk:EUR03-V, HX-HELO:sk:EUR03-V, HX-Spam-Relays-External:sk:EUR03-V X-HELO: EUR03-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr50063.outbound.protection.outlook.com (HELO EUR03-VE1-obe.outbound.protection.outlook.com) (40.107.5.63) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Mar 2019 16:28:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OJzviGjIfdcxd1CbKXkdvvm0FlVDcWKZ2ZO/xxMhUvk=; b=Zo7MOGVtYTYHjSLEw2CRA7cTvyAcUR9sT9wcRzQdULR3QLwHDoYNrVDNRX/ZstFWTA4UxcKSsSv4vmjaT679efLTm9JZAQB8F14D8VlCp/LMaNAVhbfmBTVpsW0a8mlThVUY+lzPLwRaE3O5H8QfFB1xdLyaKKx/TacuME988LU= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2389.eurprd08.prod.outlook.com (10.172.250.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.15; Mon, 18 Mar 2019 16:28:06 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::e974:35a7:c83c:e5b7]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::e974:35a7:c83c:e5b7%3]) with mapi id 15.20.1709.015; Mon, 18 Mar 2019 16:28:06 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: "tromey@adacore.com" , nd , Alan Hayward Subject: [PATCH] Fix Arm build error Date: Mon, 18 Mar 2019 16:28:06 +0000 Message-ID: <20190318162759.31241-1-alan.hayward@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-IsSubscribed: yes The following commit broke the build for Arm: d3a70e03cf51c8fb6bc183eaff7559edffec2045 Change iterate_over_lwps to take a gdb::function_view Correct the changes made to arm_linux_insert_hw_breakpoint1 and make similar changes to arm_linux_remove_hw_breakpoint1. 2019-03-18 Alan Hayward * arm-linux-nat.c (arm_linux_insert_hw_breakpoint1): Fix variable names. (arm_linux_remove_hw_breakpoint1): Use a gdb::function_view. --- gdb/arm-linux-nat.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index 8c98a7189f..11e353e61c 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -1005,8 +1005,8 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt, iterate_over_lwps (pid_ptid, [=] (struct lwp_info *info) { - return update_registers_callback (info, watch, - index); + return update_registers_callback (info, watchpoint, + i); }); break; } @@ -1024,7 +1024,6 @@ arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt, gdb_byte count, i; ptid_t pid_ptid; struct arm_linux_hw_breakpoint* bpts; - struct update_registers_data data; pid = inferior_ptid.pid (); pid_ptid = ptid_t (pid); @@ -1043,10 +1042,13 @@ arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt, for (i = 0; i < count; ++i) if (arm_linux_hw_breakpoint_equal (bpt, bpts + i)) { - data.watch = watchpoint; - data.index = i; bpts[i].control = arm_hwbp_control_disable (bpts[i].control); - iterate_over_lwps (pid_ptid, update_registers_callback, &data); + iterate_over_lwps (pid_ptid, + [=] (struct lwp_info *info) + { + return update_registers_callback (info, watchpoint, + i); + }); break; }