From patchwork Wed Nov 15 19:41:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Buettner X-Patchwork-Id: 56379 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC5193858CDB for ; Wed, 15 Nov 2023 19:55:43 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 396C83858D20 for ; Wed, 15 Nov 2023 19:55:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 396C83858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 396C83858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700078131; cv=none; b=xWHNTzgsmY0BiBesiIwdy9GrBoBNOyd0PVRkHsh1V/LKyHiBQxTDlUO4jcyR+FuKJ7ZhRDs7Jci7zeBb0DUuSfbo8mxdMKrOHidOwJrJreci6hUn8cXRoVM9ajnvLfv2IdVPuxoTVeYB/ZLp0P+IcsA07gcM5rV3jh5truFrrKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700078131; c=relaxed/simple; bh=JD6FHDKv4fuwJlWb3Hh5pkGQ/GqqrsDrUwNeqac8vno=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lvHANb1jcyz5CObxrbsjCCh/y4tJL7Q5hhqNlyW29u7AbY8MZ9mXYoPhTZ6H0gvahgJx+gx5b4Cf0k3JQbLmp54m0v2teSGQX/iBUT3zmpvtzdDT3d7/p/omf10up4QGpPJj6yPx5cj9bxy+f3IQkkUjglyBd8bJ8NFdcbrJt+I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700078129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lIuGJSaciumCFvaF+YTWb7yekRhz7ZYKlOvY8a24cBA=; b=YcCylP/ifD0VW7j2QlZ7mFnsNI6DOujtcLaJ0x0apDkNIc3U4d9OarhjGNKrKM0OYwjJ/4 T5XYB7bS7asDl/dGHr0xSGMNL6wZD0yLpYDS3DD1x1Fi4Nlvgpbspw79rpAWBIhx/vzNMD yZD8bnlBsn0K1PrE463YSX5IPE04rDk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-Cal1hOc3M6qMnk_TDqgNSw-1; Wed, 15 Nov 2023 14:55:28 -0500 X-MC-Unique: Cal1hOc3M6qMnk_TDqgNSw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6DBE1872743 for ; Wed, 15 Nov 2023 19:55:28 +0000 (UTC) Received: from f39-1.lan (unknown [10.22.8.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 176B72026D4C; Wed, 15 Nov 2023 19:55:28 +0000 (UTC) From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [PATCH v2 0/1] Fix detach bug when lwp has exited/terminated Date: Wed, 15 Nov 2023 12:41:32 -0700 Message-ID: <20231115195458.2938701-1-kevinb@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This v2 patch addresses Andrew's concerns from his review of the v1 series. In particular, it does the following: - Restores the order of the '#include" statements in linux-fork.c, using 'extern struct lwpinfo;' in linux-fork.h instead. - Fixes a whitespace problem. - Adds a call to to delete_lwp() prior to the early return added in v1. - Combines the test case and the fix into a single commit. (For largish changes, I prefer them to be separate, but I have no objection to grouping them into a single commit for something like this.) Kevin Buettner (1): Fix detach bug when lwp has exited/terminated gdb/linux-fork.c | 20 ++- gdb/linux-fork.h | 3 +- gdb/linux-nat.c | 18 ++- gdb/testsuite/gdb.base/kill-during-detach.c | 32 +++++ gdb/testsuite/gdb.base/kill-during-detach.exp | 132 ++++++++++++++++++ 5 files changed, 197 insertions(+), 8 deletions(-) create mode 100644 gdb/testsuite/gdb.base/kill-during-detach.c create mode 100644 gdb/testsuite/gdb.base/kill-during-detach.exp