From patchwork Wed Jan 23 11:51:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 31177 Received: (qmail 86009 invoked by alias); 23 Jan 2019 11:52:05 -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 88520 invoked by uid 89); 23 Jan 2019 11:51:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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=HX-HELO:sk:EUR02-A X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00080.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.80) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Jan 2019 11:51:30 +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=+dxN+P87Sfb6lHBgunsydAywdNK9bQYoJbEw7p/viJQ=; b=i3LI/UUtmqbs0HwD06aa9cgmw9L3Q9DZ0GU08fjBZOKjkXKI7md8mJMJEWiOjk62qyK5dwZApsx74Z3Kqx1Lm7iOh0a6EK5MpZ5kjT1RbCV0pVBIedXSKOJvT0tPE+wufkoRNHE9++P1Lqlz39gK+kYW++P56LnCLOM4ijL+FiA= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2358.eurprd08.prod.outlook.com (10.172.228.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.16; Wed, 23 Jan 2019 11:51:27 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::acd7:a958:2aaa:562e]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::acd7:a958:2aaa:562e%5]) with mapi id 15.20.1537.031; Wed, 23 Jan 2019 11:51:27 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [PUSHED/OBV] AArch64: Ensure lwp info is created zeroed Date: Wed, 23 Jan 2019 11:51:27 +0000 Message-ID: <20190123115124.81878-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-IsSubscribed: yes The code to not set empty hardware BPs/WPs on new threads will only work if the newly allocated struct is empty. Ensure the structure is created zeroed. This patch removes the remaining racy behaviour on gdb.threads tests when run on AArch64 Ubuntu. gdb/ChangeLog: * nat/aarch64-linux.c (aarch64_linux_new_thread): Replace XNEW with XCNEW. --- gdb/nat/aarch64-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/nat/aarch64-linux.c b/gdb/nat/aarch64-linux.c index 2616c8aef5..f9a95bb282 100644 --- a/gdb/nat/aarch64-linux.c +++ b/gdb/nat/aarch64-linux.c @@ -76,7 +76,7 @@ aarch64_linux_new_thread (struct lwp_info *lwp) ptid_t ptid = ptid_of_lwp (lwp); struct aarch64_debug_reg_state *state = aarch64_get_debug_reg_state (ptid.pid ()); - struct arch_lwp_info *info = XNEW (struct arch_lwp_info); + struct arch_lwp_info *info = XCNEW (struct arch_lwp_info); /* If there are hardware breakpoints/watchpoints in the process then mark that all the hardware breakpoint/watchpoint register pairs for this thread need