From patchwork Fri Mar 3 02:57:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 658472 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp226841wrb; Thu, 2 Mar 2023 19:02:40 -0800 (PST) X-Google-Smtp-Source: AK7set8RuT+D1U6+qydAH0Fp47aarATj1Rt+JzHcJBKRmk7cD641JwEhztVbBJC8tOedCrH6lxsQ X-Received: by 2002:a05:622a:2cc:b0:3bf:de2e:6165 with SMTP id a12-20020a05622a02cc00b003bfde2e6165mr650218qtx.56.1677812560239; Thu, 02 Mar 2023 19:02:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677812560; cv=none; d=google.com; s=arc-20160816; b=Uc8M0Qr06zOODUD0hbsw/cM2Gt1Hpkatly3ae24NTP4MHIi2uqUf1KRHnmz7w4x4fB hpMm7+0KKAdwnwjSJVr6wV1L/mZd8Q2oYs0s0CcJYByVIfgiBL/hGErOUYk8+BNgTSwF bYWTsdXNhDvKL98mZPLntoTNnj84Qgs+VQ5iWYa+lnZaieoE5Tb/csIKivnTr9b2IjvK 9A2+h/hkVPZOvwY+WlJTociwbhpV1Qr/btWHzcR2XwiBsHjSjo3gaz616l6Z+3yFNL9Y AlED7TYPLZHTRpqJw3i95vukxxM6UlLmTXWfpu6VOWogXQEFiS+Ty9I4gg9G9Rh6mA1S BBEg== 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=IZ1Q69yObMWzKVjZpAHDz6uWngdi7nRVdbETM5dlXlg=; b=jPDHOPApJeMkwmPo9iJBrZiK+g2B0tfMPKpHsp6SfgmvkdFp0/B6UTV7D7+XO3x7cB 8Kh1IBfx7yM7fM/wu4lqSVUUAM/24ojFZ69mLNL0A5C7ERtG0ug+M0gNDwOPd6L7Hylb nlCHZrrbQYUCEdV3GKRpegAEVzJvIcLF3C6qr7CFMISp/GJDPDGdV2t8470pZ8N/z9lA ALGdYsFRVozPkrzOgDWPDlhvBaDiEBNl2JsbYayczVqsTYOCclf07eWdPZWgvwJCLetS 0N1SYYTTdyzDBttp4rjticqiu87Xqvmu2r/hZjhPafKkD3KZ/C6lzLTJUCL8OjBXQUtR Azxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xo0UXvk1; 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 bp20-20020a05620a459400b007424e7e1e07si1112599qkb.303.2023.03.02.19.02.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Mar 2023 19:02:40 -0800 (PST) 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=xo0UXvk1; 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 1pXvco-0007Va-8O; Thu, 02 Mar 2023 21:58:26 -0500 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 1pXvcn-0007VB-0x for qemu-devel@nongnu.org; Thu, 02 Mar 2023 21:58:25 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXvcl-0001r7-8m for qemu-devel@nongnu.org; Thu, 02 Mar 2023 21:58:24 -0500 Received: by mail-pl1-x62d.google.com with SMTP id h8so1315993plf.10 for ; Thu, 02 Mar 2023 18:58:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677812302; 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=IZ1Q69yObMWzKVjZpAHDz6uWngdi7nRVdbETM5dlXlg=; b=xo0UXvk1TGZ1HfUuDaj07iZE2n10h20QkBB1xcTnOwUvjTcn1L+eavlpIIMeh8/0fx e6Kybe/IJluDRHGee0fDAdRkvj4uZVx074uZcyRgfNJytG0Qsoh4oxzgZdW4IaBzSC+M GrNZVWBOfS9i4YsXnTvWmHL9ajRevmOxTpLtHdfDk1Y82nvaCJZlvZb1HvYxXJzgTdnS f6W5lIvaeQXo97Rpx364i7rWU9hplhFux/kfOFp7H8rkUDpL3c9ozn1FxMBYU5Xlmjth 9Eo7CudXVGZNx1xQrLKv9TNwyf1txnl5LogXrCUSWu0qIBmwulZIvBGmVAgUXBIVT+8n qjTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677812302; 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=IZ1Q69yObMWzKVjZpAHDz6uWngdi7nRVdbETM5dlXlg=; b=fIPtwx4gLjM3CTzf0PZslqmKHzT2cHEYDNQ2Ys67OElCzmAX/wTF5AwveglaQx5pPF iNKzhUWmk+BjNkzNIiiBcLdsLqPD1FeHY025O9BFUsSwR2Z2bZ8n3k2FpUrKAPCoAlBG eUwcnLHA709TqDBYtgtYn6fzVN/7kIEkh2hiEQmbnGrUw9pvxx+M62pMdcmk1eGXK3wf GfNlG3zBrcfB9rxGraYOEyu3M+tlwSnjWPZTw7aBIZBHiDgLNujoIWLv/W777Sx+QMiw Eumaf0q3RN1hUPBTgTK/3IgFOzsql+/bnQDT8Bd6fj5CIui95LdrOWY16/5z7WnSB0b+ d+9A== X-Gm-Message-State: AO0yUKX1WEkx7NCrtP3XUfbyHtmKN3Pz/d8srQmsq5zd7Da9LivSKDQ9 K6WU8kb47IM8OVotWOwgmvI04ZukRoABWbWsmAo= X-Received: by 2002:a17:902:c94f:b0:19e:73df:b0e9 with SMTP id i15-20020a170902c94f00b0019e73dfb0e9mr560756pla.21.1677812301696; Thu, 02 Mar 2023 18:58:21 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:f3e6:4626:fbc8:b2ce]) by smtp.gmail.com with ESMTPSA id e4-20020a17090301c400b001992e74d055sm372244plh.12.2023.03.02.18.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 18:58:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v4.5 17/29] gdbstub: specialise stub_can_reverse Date: Thu, 2 Mar 2023 18:57:53 -0800 Message-Id: <20230303025805.625589-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230303025805.625589-1-richard.henderson@linaro.org> References: <20230303025805.625589-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 autolearn=ham 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: Alex Bennée Currently we only support replay for softmmu mode so it is a constant false for user-mode. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230302190846.2593720-18-alex.bennee@linaro.org> --- gdbstub/internals.h | 1 + gdbstub/gdbstub.c | 13 ++----------- gdbstub/softmmu.c | 5 +++++ gdbstub/user.c | 5 +++++ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 26a6468a69..be0eef4850 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -130,6 +130,7 @@ CPUState *gdb_first_attached_cpu(void); void gdb_append_thread_id(CPUState *cpu, GString *buf); int gdb_get_cpu_index(CPUState *cpu); unsigned int gdb_get_max_cpus(void); /* both */ +bool gdb_can_reverse(void); /* softmmu, stub for user */ void gdb_create_default_process(GDBState *s); diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 1b783100c2..7301466ff5 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -113,15 +113,6 @@ int use_gdb_syscalls(void) return gdb_syscall_mode == GDB_SYS_ENABLED; } -static bool stub_can_reverse(void) -{ -#ifdef CONFIG_USER_ONLY - return false; -#else - return replay_mode == REPLAY_MODE_PLAY; -#endif -} - /* writes 2*len+1 bytes in buf */ void gdb_memtohex(GString *buf, const uint8_t *mem, int len) { @@ -1308,7 +1299,7 @@ static void handle_step(GArray *params, void *user_ctx) static void handle_backward(GArray *params, void *user_ctx) { - if (!stub_can_reverse()) { + if (!gdb_can_reverse()) { gdb_put_packet("E22"); } if (params->len == 1) { @@ -1559,7 +1550,7 @@ static void handle_query_supported(GArray *params, void *user_ctx) g_string_append(gdbserver_state.str_buf, ";qXfer:features:read+"); } - if (stub_can_reverse()) { + if (gdb_can_reverse()) { g_string_append(gdbserver_state.str_buf, ";ReverseStep+;ReverseContinue+"); } diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c index 3a5587d387..d2863d0663 100644 --- a/gdbstub/softmmu.c +++ b/gdbstub/softmmu.c @@ -450,6 +450,11 @@ unsigned int gdb_get_max_cpus(void) return ms->smp.max_cpus; } +bool gdb_can_reverse(void) +{ + return replay_mode == REPLAY_MODE_PLAY; +} + /* * Softmmu specific command helpers */ diff --git a/gdbstub/user.c b/gdbstub/user.c index e10988a62b..3f6183e66a 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -409,6 +409,11 @@ unsigned int gdb_get_max_cpus(void) return max_cpus; } +/* replay not supported for user-mode */ +bool gdb_can_reverse(void) +{ + return false; +} /* * Break/Watch point helpers