From patchwork Tue Jun 27 16:09:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 696896 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3872571wrm; Tue, 27 Jun 2023 09:26:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45NPh0oZvsy4BV77uS54ri2jWfpw8erzISKRgsDVZdgSQhu+Q2ueHTuljKHpCnACG7SgkY X-Received: by 2002:a05:620a:bc1:b0:765:5577:5dac with SMTP id s1-20020a05620a0bc100b0076555775dacmr13327557qki.24.1687883193646; Tue, 27 Jun 2023 09:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687883193; cv=none; d=google.com; s=arc-20160816; b=BOlNNVSJQzspPJsatFuHS7ha5x8QGPqC6qGKQuqXwcqODlG05laMbvwbkUL2A6hLis RR6kpQbsLLsDs+btxgRFFM+F7Pr4dpseAOxD4VM1Ay6HhD+Y/eo4VM+aPyLeCZLwy2Cp q8JBjk7xJeZ7EEeLLTpIg4X/VqO84v0y2HXh8Z/+5IQ7owR1iTYDvdJDTxyDy8dMH5y7 K/xVBWiQ2vxZu63rIkJ3pajihjJRRAKiS2UajQjpZ2bEszpsZFusmGyAwLSwx1GSe7MJ 78e6cufvDlHTksjr+/ixtzEztAZfyeHzWcGbSDFqxhz1QXszm4LrjRQDOIzhq0d1F3zM 2niw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tV6uJjNfKxjFHFViquI0SJu1Ss2OiTFYxgVHQ5LvQag=; fh=hiByEWeFbn21iSqViwRQ6WkRWleUD5OSjDppLdgpuhw=; b=E9t2WrxiwgMgXCE1HTivy3QgHdEZoWM/7LkWHnpEv54DspM2JsXPJP+5UJnMGNR0N1 i2xvf7ERhYrfJpg1+uzIxoppYhkauwk0uYKS7Vka2o7vyNbY+BwwbsENGfBDiFWRDYz6 adcF0hpBeJoLXMW252xCuKkIKibpYordy5wLDkTMTTUh26BqKt0OzEkq2gcTnfSD3E8q 5HG/ee1Qt2a0LHFr/nEeKGMB7RrEO4g6ApIjbKPJnvXXENnHKezVs51eiNq8OBGACWyd ZvnzZZAOKvZrFt7wGw1gy2yWaI3cKMNYWdPKqZL05QoGjK4hwDimqVSSTEGmX+Jp+Hnu /iwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vz3GTpJy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m17-20020a05622a119100b003fde1911b28si3180869qtk.591.2023.06.27.09.26.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 09:26:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vz3GTpJy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEBVv-0000EG-0Y; Tue, 27 Jun 2023 12:25:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBVs-0000DT-Lv for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:25:58 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBVm-0003Fl-PZ for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:25:53 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fa8cd4a113so26863125e9.2 for ; Tue, 27 Jun 2023 09:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687883149; x=1690475149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tV6uJjNfKxjFHFViquI0SJu1Ss2OiTFYxgVHQ5LvQag=; b=vz3GTpJyIZzejUR5QStkHDhamW2HoF4hq8Iww0exDXSnuVPrzA/BJY1f+8dlk8RQsJ jHNsGEdlDsqptT1Vcl73cwm4BvXr/AiDlv89aPcTHI0JvE1AUZrdqP2vK4J23Sm5l0Fp k0NifdCqaU97G9yZcd3Jvn26dTEJkeW+fLvlJIcjVYM3vfwCOkksFN85ubkXVuAP4im1 PrllyGMs+IgMJXOLYy9ss/mZxNL5FSARc+1NBUSIDFLAaVHd3R4qy8+ve679QQKtxhrr x1Zh+WfsTfMDwdU+ZXLFlVOSjs3WrdBsoyHdSSvrWXrJbWnabr+5pTc2jgFI3U4Zm+8G g6Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687883149; x=1690475149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tV6uJjNfKxjFHFViquI0SJu1Ss2OiTFYxgVHQ5LvQag=; b=UqMiH2GOURYXK5+eXzqLdkdFF6GolHxYMNixg9G2pfAELpM6ctmVuInnoo8yqLPMHK oVZ10yKMHGiL0DA7yBPFtZBDmzsWr4NnENOZJque5tvHmU+OggLGh3Q859yolfLznABg tbRZn2rapEUo8ThymLBc0KAkKiUfPBT1OwN8oHbKtkueuzoXQUtIA81YGUI8WiaA31MG W7Vq9Uo6lmDxc1mq0kOzqE0FDI6rAEG/Lt1Gx6ruCtI0sybdkuaI03Wd3Agw1IQ1fXTv BTqNKBZ414HAS5qKJbEy0vsJozOb0MPsWjs0wV/efd32HegCYLHgHrH9txYiEtxh/0Pf FZWQ== X-Gm-Message-State: AC+VfDwh6YXKk6EanyDaAXR6r1J5l689rVoJDDNLQ4/rTSt8fCgsMSLO 6Iw0wU7g5C+FSQXkAsiJf5fN6A== X-Received: by 2002:a7b:c4cb:0:b0:3fb:ab7d:ad95 with SMTP id g11-20020a7bc4cb000000b003fbab7dad95mr537473wmk.4.1687883148881; Tue, 27 Jun 2023 09:25:48 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q6-20020a7bce86000000b003fbaa2903f4sm1063394wmj.19.2023.06.27.09.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:25:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 205811FFD3; Tue, 27 Jun 2023 17:09:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , Nicholas Piggin , qemu-stable@nongnu.org, Matheus Tavares Bernardino , Taylor Simpson Subject: [PATCH v3 27/36] gdbstub: Permit reverse step/break to provide stop response Date: Tue, 27 Jun 2023 17:09:34 +0100 Message-Id: <20230627160943.2956928-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Nicholas Piggin The final part of the reverse step and break handling is to bring the machine back to a debug stop state. gdb expects a response. A gdb 'rsi' command hangs forever because the gdbstub filters out the response (also observable with reverse_debugging.py avocado tests). Fix by setting allow_stop_reply for the gdb backward packets. Fixes: 758370052fb ("gdbstub: only send stop-reply packets when allowed to") Cc: qemu-stable@nongnu.org Cc: Matheus Tavares Bernardino Cc: Alex Bennée Cc: Taylor Simpson Signed-off-by: Nicholas Piggin Acked-by: Matheus Tavares Bernardino Message-Id: <20230623035304.279833-1-npiggin@gmail.com> Signed-off-by: Alex Bennée --- gdbstub/gdbstub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index be18568d0a..9496d7b175 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -1814,6 +1814,7 @@ static int gdb_handle_packet(const char *line_buf) .handler = handle_backward, .cmd = "b", .cmd_startswith = 1, + .allow_stop_reply = true, .schema = "o0" }; cmd_parser = &backward_cmd_desc;