From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2066.outbound.protection.outlook.com [40.107.22.66]) by sourceware.org (Postfix) with ESMTPS id E2A493858C5F for ; Thu, 8 Feb 2024 08:57:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E2A493858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E2A493858C5F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.66 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1707382647; cv=pass; b=H86hTLtIBsn+kDLhCcW6J/UIQhcVCPZrqb3SmOpw8Wc/kHYxJ1fEmgJWGq2MYTCa+QdtcDTj6RCcCrD7Bs5FsnWTP+CiSp4Tyr/kliioiQxg3OXfDz04MT0U/BnLNIRUqqAJTw5ZnPixNXPDq69u7b1bA+Z9cj1WU4/e8INr0kc= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1707382647; c=relaxed/simple; bh=mQa5gALDwgkKNkHtk1F+ridTeadLGaYd4RVGW4n7hlw=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=xt5HUV7wOh0g3ttVV90wjksIO8wMZRARIdFMi4WDh1XgK5KezF10GCyuV638AbY7nlcG0+vaWvmZyQfvUUiYlxV+t6Wecz3H2noC2FffUyJVkmNGjl4mr2b+KM1EgNu7l/+OssUZwZsfykEaXTuiOgw/nCDf4thx3jQKPIcU4Wk= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=f9nd9zqE/8sLupTKFjUnXGG9RbbAwYKmd4wf6D9l8GmYUJqZl3n5mk5MHPdLgdNm6+3leqaJq2YaYU/31ihnMc40pK6iGzipAUy+P8z/PYuB4qOvcVsQB42MKL/TXpDdHYxf23MRP4IEKvu7pFDap3WzM1NP8ekyTa9Kb9RmI3sCXwo5nV7ZuRzuw2L8PHa8DjVe5BxLyaa4MkE16WgsOCmMRXtzbhjjefE2JSF9Gb+f1J0+6BuxIJGdkBpUTCofXFSS3RfvEDL9M8w9HVXd6C9JAavTpZPOupg2+GPIYS8Znt4VHRhw3rIzfgqqbQsgTklH4F6kH+yYKejcVl9tiA== ARC-Message-Signature: i=2; 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=B1W2eXgj5Wknwz1ovIcD6knzu+RABOxlAHabL+6FKmg=; b=BizWnUIKE0yR8Nl4QYVjF1N1IbqKS6ob8tj9uAKlV19kpSsTVmOTBifO3vhWKWoWVD3QC9S8PMqWmKLNCLLzdWtdFegvp1/uSgEI4PeIq/vSQKMx1XK6z5NKRerio9ogSIyOP88uncgRCqy/VZxbxPwStfh+AzDElMsnHjGfWlIYpkwn7RDBSdIBq8QgRlZsJ48H8lYwUi40Hfv8Ukk3FXfr3fnrMapnrVDZuCd8PyRlJilwdeblPYHL7rdzWkC7IO5uBUCqe1xDT+g7rnsnzomya3BPG5fBo2m/PgEpSb5khLIVHf2vAOG6CAcPFYnJ8ULzBvPyBUIJidFXsH4P/Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B1W2eXgj5Wknwz1ovIcD6knzu+RABOxlAHabL+6FKmg=; b=mECVgKNPqlEZDy7OyMpc9Usz1dunHPIl0VH2Y3mjv5M1tPubWR7L/fXE1FzTTRyz5zON4ERZXBCDIWJujCbtIaB6B0QvPDBYSu5M00TdyiOFpIgWXsO2UsJE6U19G3Z2XgGckEuxPN0gXEqh6nz/tPpAGzS3UJEQqh0ZEJzhnaU= Received: from DUZPR01CA0127.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bc::13) by AS8PR08MB5944.eurprd08.prod.outlook.com (2603:10a6:20b:297::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.24; Thu, 8 Feb 2024 08:57:14 +0000 Received: from DU6PEPF00009523.eurprd02.prod.outlook.com (2603:10a6:10:4bc:cafe::5d) by DUZPR01CA0127.outlook.office365.com (2603:10a6:10:4bc::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.39 via Frontend Transport; Thu, 8 Feb 2024 08:57:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DU6PEPF00009523.mail.protection.outlook.com (10.167.8.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Thu, 8 Feb 2024 08:57:14 +0000 Received: ("Tessian outbound a297577ee0df:v228"); Thu, 08 Feb 2024 08:57:14 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 103026ae9e85b27e X-CR-MTA-TID: 64aa7808 Received: from 9b66f936d3e1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 37DC0112-B719-4430-B8F2-0EDF1BE99171.1; Thu, 08 Feb 2024 08:57:07 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9b66f936d3e1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 08 Feb 2024 08:57:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DSQrHGLBa50v1ZONcHfzxU+4opeor9HGH9PlnWmpsvtH0wBp5ndFMUmKGEH3dCH4t3zUjsY94d2I42fyMkmIHryaNmT5ryJYP4QgV6W/Skm5Axj1WCa2wZ6KiAOSdJ3WedSrVoQFPa1TVOtXgJ4C8bYjFkwwvoIS4xhagjRAQtltNNd4AjnQxnzGSW5Yu5K7oQBfbwwR0bZpeA0skOlrwV9nsO9JnmHlhWYSG+t4NwwaLVWPGPMetw9svcRhYRVLt4yt9YM1+mAS1kiPLajRuo7bCx7bD/WiyKMGTmnmAQ0EtlZaZEzQb2YQXu+I14l4k4MHjfQgSPxNxb2o5S7AzQ== 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=B1W2eXgj5Wknwz1ovIcD6knzu+RABOxlAHabL+6FKmg=; b=XOuh5dwJWPZsbI/Fyead4Z04GeB2nF0A70N6Vjx+LNL3d+nrVorVdJ8dV2UseDvxQBBIpMBLrOhp1DPo+uvk/YO1kG4CoijnTRVEP6m+FmuiQ7oaO06whxgMTQMLbYqzhM/GAdtQS+bnlfa2GaLxzHjOoBWYmCGinssUpbU56BBEqPXnGDlrTXQjnZSFgygZHE38kswACLXf0v+HoBIPyb5226Vb7vcRFkMWYpiOtNVVMd3GDbwsBjE96mJgzWt5/AjRwAY1kWTo3WCb8aPTLrxlVs0C3rj/+vz1u+qMfFLowCen9c3Dxj3q53l0z5xjPakoOv8oO5MkUZMbzHHEug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B1W2eXgj5Wknwz1ovIcD6knzu+RABOxlAHabL+6FKmg=; b=mECVgKNPqlEZDy7OyMpc9Usz1dunHPIl0VH2Y3mjv5M1tPubWR7L/fXE1FzTTRyz5zON4ERZXBCDIWJujCbtIaB6B0QvPDBYSu5M00TdyiOFpIgWXsO2UsJE6U19G3Z2XgGckEuxPN0gXEqh6nz/tPpAGzS3UJEQqh0ZEJzhnaU= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by DB9PR08MB6459.eurprd08.prod.outlook.com (2603:10a6:10:256::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.39; Thu, 8 Feb 2024 08:57:05 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::935e:b3a1:b0fd:99ac]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::935e:b3a1:b0fd:99ac%4]) with mapi id 15.20.7249.035; Thu, 8 Feb 2024 08:57:05 +0000 Message-ID: <4ad04baa-287f-41ce-8c13-45bc8091edee@arm.com> Date: Thu, 8 Feb 2024 08:57:03 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [FYI/pushed v4 08/25] Thread options & clone events (Linux GDBserver) To: Pedro Alves , Tom Tromey Cc: Simon Marchi , gdb-patches@sourceware.org, Andrew Burgess References: <20231113150427.477431-1-pedro@palves.net> <20231113150427.477431-9-pedro@palves.net> <87eddpej3r.fsf@tromey.com> <2e61811c-ff0f-44d0-bf6f-e98a9de87c33@arm.com> <87mssccmb3.fsf@tromey.com> <27777234-0335-4ef1-bc2b-34324d335e30@arm.com> <87sf24b0jd.fsf@tromey.com> <82b48b9e-710e-404b-b0bf-8b245a7ca632@palves.net> Content-Language: en-US From: Luis Machado In-Reply-To: <82b48b9e-710e-404b-b0bf-8b245a7ca632@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0150.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:188::11) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DB9PR08MB6459:EE_|DU6PEPF00009523:EE_|AS8PR08MB5944:EE_ X-MS-Office365-Filtering-Correlation-Id: 0573841e-42e7-4963-141c-08dc2883f1d8 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: eGKxoDV+eLOiZWCc+cNh36TecA7j37PX6MrxsZVGj5XI8gPVArN5oHtqyJ7HXPAky+pyS1WlyNCeP5mmttzJV1PriAmxt6ZWmnGZf5EC+fEUr4fqqxStz0B2TB1IR6GMUfWOfdShziRVk5pN8earGlfnfzTYPdfIHM1gk4xBOTQhcS1UV9W74aqwJTnmIw9yYWUXHXb43ipXAhiiBXzYqo6OUwu/HXWv0733UrbNTLg0eFB94ANI2Tbol8mhK6AUfukvwxc2054Ul+v4vlzKFUTUCvLS85S6Ez3BT+HZx6OJxe7A78o9S9uWyZDadVVjPKfOOOsQSg4yR4VqUqGAaHH627T3wCRBviqSS2844VjCbpWHLxPW4H6vMYaCVxK+6HvzuDayf6u3LLACsW2rwcrfZLjMHSPailZZtslbN4+H/+Upc2It15tQYSzW6BpMFlZbngjO48vgbSp/uC8v70cSQwcCYFpCCIjOXdbucpk2qrcq6yjT0ecsDuo03P5d34ucj+0cS2z52ACDtP3f3eDtMsk5rgcqAL5nE9yrd78epwzi9dypulR50lyMunsW X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(346002)(396003)(376002)(39860400002)(366004)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(41300700001)(6486002)(478600001)(110136005)(53546011)(6512007)(6506007)(36756003)(316002)(66476007)(66556008)(54906003)(66946007)(26005)(38100700002)(2616005)(86362001)(83380400001)(31696002)(44832011)(4326008)(2906002)(8936002)(8676002)(5660300002)(31686004);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6459 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF00009523.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 87c150ef-6ef0-48e7-fae4-08dc2883ec80 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZbRpqmESZtNavYDgE7cjbyYoS8MnOP7PyUE3uDqPjAJ96pxTto/zNqes08wzAVQRy/mfors/QyQQC9W9cw7Y4Ntup1FriNpESkZO/FFPYP7Mc1b4q0KXMBOutsO52efpvFIZ0jRi2cvCA6MQwISNybmFZmNM9IhY68rikIM7POMLnfYuSifdGoeawI9oSDygvzFLMtGJphq93p3GZ2j9Gx2ZSYKWvGYD9304jZnOn3RgtfXijGJ4rplWGqsVCsZnj37OMEKCnZjj0mxaMGICrcpOIJkkenMoeyc4oephTiUu4I0+LppZMRzd6yyb6bCLM3lPdcYNpADQfKG4RHqUuI6b4Nu42Z2Br6nsG/ldq34gFY6E7XKpLL4M5RypL8Plka2NszYWPjzmbSZMTi3jaR8IM9JqdYyzEaK5kdPW7fPlJGCr+HQQGEWlr2NARXpO3my2j6bMjB+tQxVqfJoT2KnOK3ys2XCEMLeRoIEGvlbcccVHOOmVvpMpotatR1My0r2W2jrMhEJJY00H/iwp6TeXJDnFrk0TFE+GW5+yDDw3xQDgYHqY0iUoieMps9LXUVuBabQEfYtSAz9AHszAhW9UZTpFjpDhBH1EgmtEMs0= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(346002)(396003)(376002)(136003)(230922051799003)(1800799012)(64100799003)(451199024)(82310400011)(186009)(36840700001)(40470700004)(46966006)(8936002)(8676002)(4326008)(81166007)(82740400003)(31686004)(356005)(86362001)(31696002)(41300700001)(36756003)(107886003)(2906002)(44832011)(83380400001)(70206006)(70586007)(54906003)(110136005)(316002)(5660300002)(336012)(26005)(6486002)(2616005)(478600001)(53546011)(6506007)(6512007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2024 08:57:14.3064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0573841e-42e7-4963-141c-08dc2883f1d8 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF00009523.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5944 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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: Hi! On 2/7/24 20:11, Pedro Alves wrote: > On 2024-02-07 18:56, Pedro Alves wrote: >> Hi! >> >> On 2024-02-07 18:18, Tom Tromey wrote: >>>>>>>> "Luis" == Luis Machado writes: >>> >>> Luis> I see. Is this logic expected? Naturally I'd expect a process to >>> Luis> exist before a thread can exist. >>> >>> Me too but you can see it in >>> linux-low.cc:linux_process_target::handle_extended_wait. >>> >>> lwp_info *child_lwp = add_lwp (child_ptid); >>> [...] >>> if (event != PTRACE_EVENT_CLONE) >>> { >>> /* Add the new process to the tables and clone the breakpoint >>> lists of the parent. We need to do this even if the new process >>> will be detached, since we will need the process object and the >>> breakpoints to remove any breakpoints from memory when we >>> detach, and the client side will access registers. */ >>> process_info *child_proc = add_linux_process (new_pid, 0); >>> [...] >>> >> >> I don't recall off hand a reason that prevents us from tweaking this code a little to >> create the child process before the child lwp is created. I think that was how it was >> done before my changes, and I just reordered code to make it end up with fewer lines. >> I think we can create the child process earlier. >> >> I'll send a patch in a sec, once I test it. > > Like so? Does it fix the crash? It does, thanks for the quick patch. Maybe before this series we were relying on some other path eventually creating a process first, and the new code somehow caused a (indirect?) change. I'm putting this through the gdbserver testsuite on my end. I'll let you know what comes out of it. > > From 0c308ac13c4537c885491305cee7215fbfdf04c0 Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Wed, 7 Feb 2024 18:48:16 +0000 > Subject: [PATCH] Fix crash in aarch64-linux gdbserver > > Since commit 393a6b5947d0 ("Thread options & clone events (Linux > GDBserver)"), aarch64-linux gdbserver crashes when the inferior > vforks. This happens in aarch64_get_debug_reg_state: > > struct process_info *proc = find_process_pid (pid); > > return &proc->priv->arch_private->debug_reg_state; > > Here, find_process_pid returns nullptr -- the new inferior hasn't yet > been created in linux_process_target::handle_extended_wait. > > This patch fixes the problem by having > linux_process_target::handle_extended_wait create the child process > earlier, before the child LWP is created. This is what the function > did before it was reorganized by the commit referred above. > > Change-Id: Ib8b3a2e6048c3ad2b91a92ea4430da507db03c50 > Co-Authored-By: Tom Tromey > --- > gdbserver/linux-low.cc | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) > > diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc > index 444eebc6bbe..9d5a6242803 100644 > --- a/gdbserver/linux-low.cc > +++ b/gdbserver/linux-low.cc > @@ -555,6 +555,16 @@ linux_process_target::handle_extended_wait (lwp_info **orig_event_lwp, > ? ptid_t (new_pid, new_pid) > : ptid_t (ptid_of (event_thr).pid (), new_pid)); > > + process_info *child_proc = nullptr; > + > + if (event != PTRACE_EVENT_CLONE) > + { > + /* Add the new process to the tables before we add the LWP. > + We need to do this even if the new process will be > + detached. See breakpoint cloning code further below. */ > + child_proc = add_linux_process (new_pid, 0); > + } > + > lwp_info *child_lwp = add_lwp (child_ptid); > gdb_assert (child_lwp != NULL); > child_lwp->stopped = 1; > @@ -588,12 +598,11 @@ linux_process_target::handle_extended_wait (lwp_info **orig_event_lwp, > > if (event != PTRACE_EVENT_CLONE) > { > - /* Add the new process to the tables and clone the breakpoint > - lists of the parent. We need to do this even if the new process > - will be detached, since we will need the process object and the > - breakpoints to remove any breakpoints from memory when we > - detach, and the client side will access registers. */ > - process_info *child_proc = add_linux_process (new_pid, 0); > + /* Clone the breakpoint lists of the parent. We need to do > + this even if the new process will be detached, since we > + will need the process object and the breakpoints to > + remove any breakpoints from memory when we detach, and > + the client side will access registers. */ > gdb_assert (child_proc != NULL); > > process_info *parent_proc = get_thread_process (event_thr); > > base-commit: 6fb99666f4bbc79708acb8efb2d80e57de67b80b