From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2040.outbound.protection.outlook.com [40.107.223.40]) by sourceware.org (Postfix) with ESMTPS id EAC0F3854E5C for ; Fri, 16 Jun 2023 09:25:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EAC0F3854E5C Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F70uHnO7GS9BUQAYIFrZid+94Uc4g1qFjrhqYO4PGcGMiybhMANNjRr03QxSYisFDXF9sqbfsAjS2wpbBiJSgk6Xu5apxaBfIXgDOO/cxRFTZLaKYi9wXYMOvW34wnxKtKWoIUpmNDzni6QQ4LxROwOM67ST/l8bIBocQLucMZRTu+bUm4bGYe/5PkSk/sJgtMfPLo0vf4VnmXdRuniLMxax8y9KvFDvBHeBis1P3fJOSYQ0BJSjQNEnAQScaL6GtTk3AedeMgo+fenkWNpcUnbkCtJV9Mx8O4dOlU7sGtws6srXChFbIx5zRiwUC2mOXj6sNXOJnOztrJtiuxiELQ== 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=nUQrJcfU9rZM9pEl/6acpHll/BYwKhmXd3mCy4xVLv8=; b=nvEoivMYIH4eKlidmBz9P5+7KbH54RD94pia2/nlEq4kI8Pdndn9ZhfQpi6JfkUa+17KTvvkvs9Huv5bbDT6fqbXKAOfAGgSwGHk5Q67Uj6Gwh5gep1W1IZdDDo+PLt/2t+iq/OFLQQLIfrDLOVwMwHLn+LIqjp2Pc7FEydmMTeG+DgJAQ+qoSgqwzBJOCoDKQDC7bHsMhSs5Km2Lt4RMWiyTnBXV2PHaEKFwTkZyYjVWap6khHwK92sCdbkM/bi4JSXxPYi5AE400tLDAbO9+kipBooITh/i/uxUCNcHAOw9+/aX2tjFQSebEi+sp57iHwdy9slv/DrxwoR+ojQcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nUQrJcfU9rZM9pEl/6acpHll/BYwKhmXd3mCy4xVLv8=; b=dJzC4c2k347Tg2X4jWsyrP5B43eoSzc2UU79b24WYm8ku1bEmnjhoh2QBERgj/vccPkpSYcsJQU62n+vlrDb/7UONjiSOCg00IDrHotKC2xfPuO/cB6KjNlP+K31XZn0Y49VjSEbhjmUpJ7vOeB0SgYE4OF+/cq09Z52G9tgfzQ= Received: from SN4PR0501CA0025.namprd05.prod.outlook.com (2603:10b6:803:40::38) by SJ2PR12MB8784.namprd12.prod.outlook.com (2603:10b6:a03:4d0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 09:25:43 +0000 Received: from SN1PEPF000252A4.namprd05.prod.outlook.com (2603:10b6:803:40:cafe::d7) by SN4PR0501CA0025.outlook.office365.com (2603:10b6:803:40::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25 via Frontend Transport; Fri, 16 Jun 2023 09:25:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF000252A4.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6500.27 via Frontend Transport; Fri, 16 Jun 2023 09:25:43 +0000 Received: from khazad-dum.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 16 Jun 2023 04:25:42 -0500 From: Lancelot SIX To: CC: , Lancelot SIX Subject: [PATCH] gdb/amd-dbgapi-target: Use inf param in detach Date: Fri, 16 Jun 2023 10:25:28 +0100 Message-ID: <20230616092528.69358-1-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A4:EE_|SJ2PR12MB8784:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e1b68ea-7c46-44d3-26e0-08db6e4ba8d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O8/SvgbIqLQSTipl7WcsnKa250ID70ObilRmVhj40sXkoPiAYhfRNJx0yeIB9qmsx1wPvG5y0TIFdPNS7TancAeFWmun/hOBBuW5YElit6W2zilghwblKMYoXHoSEHYbfBIGE2Ai2EZbazqO6FUlc3Y4e9DRZL17qhmjdr7OZTASuaZD33n40Lqu1jmXZpY9Vj3lJKqGEZWaZeA88bsl6SH4PT3AmDa5UnhbrU6neypFhD5C2/hOSvJXN7LoDHrtElbAjYI0/XbDcCZWPyDOGBr6tlwUjqGeXr7s5eAMQPjiylygeabNDvlRiVID+wl5vmQy2aTBctWvCyXqCVFfr0+laSu7MsQFUiB3T8paxzCmYQ62UumVT6uakYRwzLpjqRe85hix/FiDqRZvAQsWzswCjeS0F4D8AZrWUdPRMkxYBkib3eUisC7SqZ29wABaaBu+ZT3/bf2sniWUw+DUckhRIwHTiBNSQOszTL6gesgubOUtNM3BjKcJDnXpQRGCsW6HHiL2pb15Xc/+m+EM+iA3ghQMaGrIidZwwtG4NtME0mpORiumOytWOyq0XNLW2Z75LyAVkd0xjXU8LaHSulrxpZR6EqvN0FpB2Qiwfa79OjbIPYqMW9U1LrtWY42rh4iobviw7h/7V+/PI4VZb4T+2pf171xhrjVOwFW8h+pS35h3mrmTfnJw79Ccg69CROfSfL5Qh/f2XVhafz+u59422ZPSQgd7G5EzeS4MSbC1u/X37wFNRCHErJaR5wwz2DDbWv3AMi7faOSaZLMwQA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(396003)(376002)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(5660300002)(83380400001)(426003)(186003)(336012)(40480700001)(2906002)(16526019)(47076005)(2616005)(41300700001)(36860700001)(8936002)(26005)(7696005)(40460700003)(8676002)(54906003)(316002)(6666004)(478600001)(356005)(82310400005)(82740400003)(81166007)(36756003)(4326008)(86362001)(70206006)(70586007)(6916009)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 09:25:43.6041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e1b68ea-7c46-44d3-26e0-08db6e4ba8d4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8784 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: Current implementation of amd_dbgapi_target::detach (inferior *, int) does the following: remove_breakpoints_inf (current_inferior ()); detach_amd_dbgapi (inf); beneath ()->detach (inf, from_tty); I find that using a mix of `current_inferior ()` and `inf` disturbing. At this point, we know that both are the same (target_detach does assert that `inf == current_inferior ()` before calling target_ops::detach). To improve consistency, this patch replaces `current_inferior ()` with `inf` in amd_dbgapi_target::detach. Change-Id: I01b7ba2e661c25839438354b509d7abbddb7c5ed --- gdb/amd-dbgapi-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c index 5565cf907fa..40f24b5fc2f 100644 --- a/gdb/amd-dbgapi-target.c +++ b/gdb/amd-dbgapi-target.c @@ -1463,7 +1463,7 @@ amd_dbgapi_target::detach (inferior *inf, int from_tty) Breakpoints may still be inserted because the inferior may be running in non-stop mode, or because GDB changed the default setting to leave all breakpoints inserted in all-stop mode when all threads are stopped. */ - remove_breakpoints_inf (current_inferior ()); + remove_breakpoints_inf (inf); detach_amd_dbgapi (inf); beneath ()->detach (inf, from_tty); base-commit: b1c792568662d7e00158d19e0439b64f98b78e47 -- 2.34.1