From patchwork Mon Mar 25 16:18:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 31974 Received: (qmail 68155 invoked by alias); 25 Mar 2019 16:18:28 -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 68140 invoked by uid 89); 25 Mar 2019 16:18:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 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= X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00042.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Mar 2019 16:18:26 +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=lHStXSjsZnUUY59MM5jWf4iWgalB0K5LM/XcJoTtt5U=; b=lQHjwwZP8TRIYjcGGKVQk8sHEhN4cDRiGNTsc7I45gP+aE0/YmLn8Or63bxQbRk1md7IC8LCFze8gdXyRfwsWGGtWEsPwxChIW3T/lNKeLPNeVz7bgayq++Zc1ZguHWL3x0pIMYn3Md4Dl0Qv5gia2J6KzRVuHoGiM/EpG65yEA= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2325.eurprd08.prod.outlook.com (10.172.227.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.16; Mon, 25 Mar 2019 16:18:23 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::2083:2d62:84fa:a547]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::2083:2d62:84fa:a547%3]) with mapi id 15.20.1730.019; Mon, 25 Mar 2019 16:18:23 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [PATCH] infun debug: Use correct target pid Date: Mon, 25 Mar 2019 16:18:23 +0000 Message-ID: <20190325161820.15406-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 infrun debug reads the id for the exited thread from the ws value. However, this is always 0, causing an assert in find_inferior_pid. Instead, the id should be read from the wait return value. This fixes a racy FAIL in gdb.threads/watchthreads-reorder.exp gdb/ChangeLog: 2019-03-25 Alan Hayward * infrun.c (stop_all_threads): Fix debug print. --- gdb/infrun.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index ad7892105a..5350ab73a1 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4364,14 +4364,10 @@ stop_all_threads (void) || ws.kind == TARGET_WAITKIND_SIGNALLED) { if (debug_infrun) - { - ptid_t ptid = ptid_t (ws.value.integer); - - fprintf_unfiltered (gdb_stdlog, - "infrun: %s exited while " - "stopping threads\n", - target_pid_to_str (ptid).c_str ()); - } + fprintf_unfiltered (gdb_stdlog, + "infrun: %s exited while " + "stopping threads\n", + target_pid_to_str (event_ptid).c_str ()); } else {