Message ID | 20220329154931.493851-12-npiggin@gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=fSOVtAqU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=<UNKNOWN>) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KSYt8509vz9sFk for <incoming@patchwork.ozlabs.org>; Wed, 30 Mar 2022 02:50:08 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KSYt83crZz2yJ5 for <incoming@patchwork.ozlabs.org>; Wed, 30 Mar 2022 02:50:08 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=fSOVtAqU; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::632; helo=mail-pl1-x632.google.com; envelope-from=npiggin@gmail.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=fSOVtAqU; dkim-atps=neutral Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4KSYt60TNgz2xr9 for <pdbg@lists.ozlabs.org>; Wed, 30 Mar 2022 02:50:06 +1100 (AEDT) Received: by mail-pl1-x632.google.com with SMTP id f10so7659817plr.6 for <pdbg@lists.ozlabs.org>; Tue, 29 Mar 2022 08:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i9k4DWVGb/MmzaFdC5D9OzoWnfTirgUUpyc3DNlRM+A=; b=fSOVtAqUmwxK9Rl9Mk5k7JvzUqtQphsE4beFnCZhGrB1dcVidQtm0Sl5keF3gsSnIQ 1PiqB8APyxW3BfdY2QH5Y0vmGI/rsPiEi4Mtk69MK1ZNWB3UTWdlhWtGohp9fLLMReHT hs7cjKTKX3B/sNu+xVelay0qaYVY5o5aVOI4Jupw3xBJrSKiYhvNETNg2yxaZjhYQXCj aUTVS6x5rpXzsW0CQ4ZQcG2xOtyIwmM899mxZVdKJ3LeFpdaAD9O0fu4/TVoQ5uIoU5U STgT1z+d+HFDJe5O/V+vBSZ2j0ZhdvfhlIN2tqaIkibmz0AcCRZP6sBx77A/M62RxX7E V1Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i9k4DWVGb/MmzaFdC5D9OzoWnfTirgUUpyc3DNlRM+A=; b=v2a9biYzVXyK01jcOhNjJGlcNSe5wmHPZRaSHEqJ+SqF49ArS8w1/CRi32NC2h19DE MSdRt1BGLPUtiGSkRBYeVrAx3bEGlD8rLq1MQ2xSo6YoX7Qte0PTKYxo2tZdSWcmlfS3 GDPhvD7E/VC798+UdWzKT8kjLWD2jpxLdj2dFNyOyt73TzknhKPHkp0lbKJ0mpC/vmzB YaGViPyFmuLtI0nBQ3K5CavXLYiTSIneLV2NBEjYqwmD9F2oxt7Lt7rt6kn+Xf0NM6XX k3+Isomsop0tH99l9uKiWfsShh6jAv2zLbNn38T0phMhK5yPPub6K5HYStCO8nTCTIww 4QXQ== X-Gm-Message-State: AOAM530H5QNTUOQjiuPd7CGk6iAn95VoWjDyRXlnQ8n3w0DhLZXleD5q zR9RMcnTTSYhFmqkjIu1wTbguf7LHIo= X-Google-Smtp-Source: ABdhPJwIFd92ElYEVG7yQZxRzlshTZj+s3gFYxuLd7cqNTtdGH1f8flCVdomykr77ageMvygF7Onfw== X-Received: by 2002:a17:90a:8a05:b0:1c6:e527:c613 with SMTP id w5-20020a17090a8a0500b001c6e527c613mr205370pjn.143.1648569004329; Tue, 29 Mar 2022 08:50:04 -0700 (PDT) Received: from bobo.ibm.com (58-6-255-110.tpgi.com.au. [58.6.255.110]) by smtp.gmail.com with ESMTPSA id s35-20020a056a001c6300b004fb20b5d6c1sm14163564pfw.40.2022.03.29.08.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Mar 2022 08:50:04 -0700 (PDT) From: Nicholas Piggin <npiggin@gmail.com> To: pdbg@lists.ozlabs.org Date: Wed, 30 Mar 2022 01:49:04 +1000 Message-Id: <20220329154931.493851-12-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220329154931.493851-1-npiggin@gmail.com> References: <20220329154931.493851-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 11/38] gdbserver: fix interrupt double stop reason response X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" <pdbg.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/pdbg>, <mailto:pdbg-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/pdbg/> List-Post: <mailto:pdbg@lists.ozlabs.org> List-Help: <mailto:pdbg-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/pdbg>, <mailto:pdbg-request@lists.ozlabs.org?subject=subscribe> Cc: Nicholas Piggin <npiggin@gmail.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" <pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> |
Series |
gdbserver multi-threaded debugging and POWER9/10 support
|
expand
|
diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c index 9e5e7d8..1668126 100644 --- a/src/pdbgproxy.c +++ b/src/pdbgproxy.c @@ -320,11 +320,20 @@ static void v_contc(uint64_t *stack, void *priv) static void interrupt(uint64_t *stack, void *priv) { - PR_INFO("Interrupt\n"); + struct thread_state status; + + PR_INFO("Interrupt from gdb client\n"); + thread_stop(thread_target); - send_response(fd, TRAP); - return; + status = thread_status(thread_target); + if (!(status.quiesced)) { + PR_ERROR("Could not quiesce thread\n"); + return; + } + state = IDLE; + poll_interval = VCONT_POLL_DELAY; + send_response(fd, TRAP); } static void poll(void)
The interrupt command sends a stop reason (TRAP) response, then the main loop notices that the thread was stopped and also sends a stop reason response. Prevent the second response by having the interrupt handler move the state to IDLE. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- src/pdbgproxy.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)