From patchwork Thu Dec 14 20:22:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 56512 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 1C96238618E9 for ; Thu, 14 Dec 2023 20:22:57 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by sourceware.org (Postfix) with ESMTPS id CFDAD385842D for ; Thu, 14 Dec 2023 20:22:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CFDAD385842D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CFDAD385842D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702585365; cv=none; b=oeSZoNVhxkWoOhCwaZFaDynrVpeMiUqootWyE9VtyChZ9OrwDlvPe2GQlWmlHZi5SfxQr8jhTfVnDTNANnE0VXizWAuSEO0MbjQOUydBMAatlt4lqkBNf8rSZFkf8Ao52cYyV69QOSYAONPi0VxM3RAEiliFVprut8a0AMHpwIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702585365; c=relaxed/simple; bh=DARtKuVDfeYd+ZXyLLH7qzIc+h6nSJFTwYyhwrdgDwc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=XD9zKYtdKi9BBSlu+ErdK7Kno7arbsF9U4hb4T/U/U5uUjtgnxvjtVzTPfs0Cue0/4tANCj0xwHE691bVVxh9haB1Qf7MjjVVHqKPmmX1x2zKq0qDbg5IozfZk9y57nMM2tDLtYesLoHLuwhRtH8VB5OkOueINI6Pew4jaCqSpY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40c3ceded81so56845525e9.1 for ; Thu, 14 Dec 2023 12:22:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702585361; x=1703190161; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Fv7hFkkQ4XTN4VCMlrG46OwX7O9W3xpA1OCRD6058Vw=; b=LQP3gDlpk5YoDJU0jhuv6w+6n1rXYFe7IeRYCffcR0vy7ekRnBWSV9KZrty3mbCd/Z t/+VjBKWo/021SV0gpHjX5S4HhZ12uvQqRDp/+gqR2cTjNLV969yOR2O/TyTb2n5X99n jHp+/kvYvomilihjB3IE72OgCH/PWNMf7FTWfVgdUUrVBXufxCJ3F6PfCQB5PlIKXwew LgEUFMHRv8X6jC5fqBCsz2H0EiGr3X9YPjKpwnTuA1hYc2n9UN0d/r8ZQVj4g7qn/M33 YbgswkJxogLLF4rlTKig5s7KQazo5WClRRTbs+SwRoIs+8wQvcayQLHJLi3eaolsrTuv xg2w== X-Gm-Message-State: AOJu0Yym2EO8aVb2Ppak048nmOskNpxI01TMtmMuBKwMO9YEKb5PVXab DnPFxeiPalFaV/UR2NrnBf8wpgjRotH/Cw== X-Google-Smtp-Source: AGHT+IEi3xdJLMh4Z90K33dmbzHAdDhyOBJtpOL6RC/LpI25oUW6nQap/aNkGk0DZC46PzAAPjD1Bw== X-Received: by 2002:a05:600c:480a:b0:40c:4ece:9654 with SMTP id i10-20020a05600c480a00b0040c4ece9654mr2636546wmo.57.1702585361195; Thu, 14 Dec 2023 12:22:41 -0800 (PST) Received: from localhost ([2001:8a0:f923:4f00:2646:535c:5a04:e380]) by smtp.gmail.com with UTF8SMTPSA id a11-20020adfeecb000000b00333b17432c0sm16898426wrp.28.2023.12.14.12.22.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Dec 2023 12:22:40 -0800 (PST) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 0/8] Step over thread exit improvements/fixes + AMD GPU Date: Thu, 14 Dec 2023 20:22:30 +0000 Message-ID: <20231214202238.1065676-1-pedro@palves.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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 series is the result of making step-over-thread-exit work properly with the AMD GPU target. It includes some improvements to gdb.threads/step-over-thread-exit.exp, a few core fixes, and then AMD GPU target fixes. Finally, the last two patches include tests that we are carrying downstream, but that unfortunately can't work with upstream GDB yet, because upstream doesn't understand the DWARF extensions that we are working hard to get into DWARF 6, so upstream is missing proper unwinding and accessing variables. I include them in the series so reading the patches makes more sense, but I don't plan on pushing them. Unless we are OK with adding them upstream with some early return, effectivelly making them nops. I sent the first two patches as a separate series last month, and Simon & Lancelot have meanwhile reviewed this whole series internally at AMD, which resulted in some further improvements in those first patches (as well as in the others). Pedro Alves (8): gdb.threads/step-over-thread-exit.exp improvements Ensure selected thread after thread exit stop displaced_step_finish: Don't fetch the regcache of exited threads Step over thread exit, always delete the thread non-silently Fix thread target ID of exited waves Fix handling of vanishing threads that were stepping/stopping Add tests for s_endpgm handling Add tests for handling of vanishing threads that were stepping/stopping gdb/amd-dbgapi-target.c | 313 ++++++++++++++---- gdb/infrun.c | 31 +- gdb/observable.c | 1 + gdb/observable.h | 5 + gdb/regcache.c | 2 + .../gdb.rocm/continue-over-kernel-exit.cpp | 66 ++++ .../gdb.rocm/continue-over-kernel-exit.exp | 165 +++++++++ .../gdb.rocm/step-over-kernel-exit.cpp | 48 +++ .../gdb.rocm/step-over-kernel-exit.exp | 108 ++++++ .../gdb.threads/step-over-thread-exit.c | 16 +- .../gdb.threads/step-over-thread-exit.exp | 127 +++++-- gdb/thread.c | 2 + 12 files changed, 792 insertions(+), 92 deletions(-) create mode 100644 gdb/testsuite/gdb.rocm/continue-over-kernel-exit.cpp create mode 100644 gdb/testsuite/gdb.rocm/continue-over-kernel-exit.exp create mode 100644 gdb/testsuite/gdb.rocm/step-over-kernel-exit.cpp create mode 100644 gdb/testsuite/gdb.rocm/step-over-kernel-exit.exp base-commit: 1d2f86b6b74e6caae77951353a4c353ce9816374