All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Weiwei Li" <liweiwei@iscas.ac.cn>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	nicolas.eder@lauterbach.com,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	kvm@vger.kernel.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Sunil Muthuswamy" <sunilmut@microsoft.com>,
	qemu-s390x@nongnu.org, "Stafford Horne" <shorne@gmail.com>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Marek Vasut" <marex@denx.de>, "Greg Kurz" <groug@kaod.org>,
	"Song Gao" <gaosong@loongson.cn>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Chris Wulff" <crwulff@gmail.com>,
	qemu-riscv@nongnu.org, "Michael Rolnik" <mrolnik@gmail.com>,
	qemu-arm@nongnu.org, "Cleber Rosa" <crosa@redhat.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Yoshinori Sato" <ysato@users.sourceforge.jp>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	mads@ynddal.dk,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	qemu-ppc@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"John Snow" <jsnow@redhat.com>,
	"Xiaojuan Yang" <yangxiaojuan@loongson.cn>,
	"Thomas Huth" <thuth@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Taylor Simpson" <tsimpson@quicinc.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH v4 14/26] gdbstub: specialise handle_query_attached
Date: Thu,  2 Mar 2023 19:08:34 +0000	[thread overview]
Message-ID: <20230302190846.2593720-15-alex.bennee@linaro.org> (raw)
In-Reply-To: <20230302190846.2593720-1-alex.bennee@linaro.org>

In both user and softmmu cases we are just replying with a constant.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v3
  - remove allusions to possible linker optimisations
---
 gdbstub/internals.h |  4 +++-
 gdbstub/gdbstub.c   | 15 ++-------------
 gdbstub/softmmu.c   |  5 +++++
 gdbstub/user.c      |  5 +++++
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 6534e373cb..20caacd744 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -154,7 +154,7 @@ int gdb_continue_partial(char *newstates);
 void gdb_put_buffer(const uint8_t *buf, int len);
 
 /*
- * Command handlers - either softmmu or user only
+ * Command handlers - either specialised or softmmu or user only
  */
 void gdb_init_gdbserver_state(void);
 
@@ -183,6 +183,8 @@ void gdb_handle_query_rcmd(GArray *params, void *user_ctx); /* softmmu */
 void gdb_handle_query_offsets(GArray *params, void *user_ctx); /* user */
 void gdb_handle_query_xfer_auxv(GArray *params, void *user_ctx); /*user */
 
+void gdb_handle_query_attached(GArray *params, void *user_ctx); /* both */
+
 /*
  * Break/Watch point support - there is an implementation for softmmu
  * and user mode.
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 0476ee7039..52d1769f57 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -46,12 +46,6 @@
 
 #include "internals.h"
 
-#ifdef CONFIG_USER_ONLY
-#define GDB_ATTACHED "0"
-#else
-#define GDB_ATTACHED "1"
-#endif
-
 #ifndef CONFIG_USER_ONLY
 static int phy_memory_mode;
 #endif
@@ -1673,11 +1667,6 @@ static void handle_query_xfer_features(GArray *params, void *user_ctx)
                       gdbserver_state.str_buf->len, true);
 }
 
-static void handle_query_attached(GArray *params, void *user_ctx)
-{
-    gdb_put_packet(GDB_ATTACHED);
-}
-
 static void handle_query_qemu_supported(GArray *params, void *user_ctx)
 {
     g_string_printf(gdbserver_state.str_buf, "sstepbits;sstep");
@@ -1787,12 +1776,12 @@ static const GdbCmdParseEntry gdb_gen_query_table[] = {
     },
 #endif
     {
-        .handler = handle_query_attached,
+        .handler = gdb_handle_query_attached,
         .cmd = "Attached:",
         .cmd_startswith = 1
     },
     {
-        .handler = handle_query_attached,
+        .handler = gdb_handle_query_attached,
         .cmd = "Attached",
     },
     {
diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c
index 04e75449a2..7c180b779a 100644
--- a/gdbstub/softmmu.c
+++ b/gdbstub/softmmu.c
@@ -446,6 +446,11 @@ void gdb_handle_query_rcmd(GArray *params, void *user_ctx)
  * Execution state helpers
  */
 
+void gdb_handle_query_attached(GArray *params, void *user_ctx)
+{
+    gdb_put_packet("1");
+}
+
 void gdb_continue(void)
 {
     if (!runstate_needs_reset()) {
diff --git a/gdbstub/user.c b/gdbstub/user.c
index 0c8cd028b1..c0fd83b373 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -345,6 +345,11 @@ void gdbserver_fork(CPUState *cpu)
  * Execution state helpers
  */
 
+void gdb_handle_query_attached(GArray *params, void *user_ctx)
+{
+    gdb_put_packet("0");
+}
+
 void gdb_continue(void)
 {
     gdbserver_user_state.running_state = 1;
-- 
2.39.2


  parent reply	other threads:[~2023-03-02 19:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 19:08 [PATCH v4 00/26] gdbstub/next: re-organise and split build Alex Bennée
2023-03-02 19:08 ` [PATCH v4 01/26] gdbstub/internals.h: clean up include guard Alex Bennée
2023-03-02 19:08 ` [PATCH v4 02/26] gdbstub: fix-up copyright and license files Alex Bennée
2023-03-02 19:08 ` [PATCH v4 03/26] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs Alex Bennée
2023-03-02 19:08 ` [PATCH v4 04/26] gdbstub: clean-up indent on gdb_exit Alex Bennée
2023-03-02 20:29   ` Richard Henderson
2023-03-03  8:33   ` Daniel Henrique Barboza
2023-03-02 19:08 ` [PATCH v4 05/26] gdbstub: define separate user/system structures Alex Bennée
2023-03-02 19:08 ` [PATCH v4 06/26] gdbstub: move GDBState to shared internals header Alex Bennée
2023-03-02 19:08 ` [PATCH v4 07/26] includes: move tb_flush into its own header Alex Bennée
2023-03-02 19:08 ` [PATCH v4 08/26] gdbstub: move fromhex/tohex routines to internals Alex Bennée
2023-03-02 19:08 ` [PATCH v4 09/26] gdbstub: make various helpers visible to the rest of the module Alex Bennée
2023-03-02 19:08 ` [PATCH v4 10/26] gdbstub: move chunk of softmmu functionality to own file Alex Bennée
2023-03-02 19:08 ` [PATCH v4 11/26] gdbstub: move chunks of user code into own files Alex Bennée
2023-03-02 19:08 ` [PATCH v4 12/26] gdbstub: rationalise signal mapping in softmmu Alex Bennée
2023-03-02 19:08 ` [PATCH v4 13/26] gdbstub: abstract target specific details from gdb_put_packet_binary Alex Bennée
2023-03-02 19:08 ` Alex Bennée [this message]
2023-03-02 19:08 ` [PATCH v4 15/26] gdbstub: specialise target_memory_rw_debug Alex Bennée
2023-03-02 19:08 ` [PATCH v4 16/26] gdbstub: introduce gdb_get_max_cpus Alex Bennée
2023-03-02 19:08 ` [PATCH v4 17/26] gdbstub: specialise stub_can_reverse Alex Bennée
2023-03-02 19:08 ` [PATCH v4 18/26] gdbstub: fix address type of gdb_set_cpu_pc Alex Bennée
2023-03-02 19:08 ` [PATCH v4 19/26] gdbstub: don't use target_ulong while handling registers Alex Bennée
2023-03-02 19:08 ` [PATCH v4 20/26] gdbstub: move register helpers into standalone include Alex Bennée
2023-03-02 19:08 ` [PATCH v4 21/26] gdbstub: move syscall handling to new file Alex Bennée
2023-03-02 19:08 ` [PATCH v4 22/26] gdbstub: only compile gdbstub twice for whole build Alex Bennée
2023-03-02 22:00   ` Richard Henderson
2023-03-02 19:08 ` [PATCH v4 23/26] testing: probe gdb for supported architectures ahead of time Alex Bennée
2023-03-02 20:47   ` Richard Henderson
2023-03-02 21:52   ` Richard Henderson
2023-03-02 19:08 ` [PATCH v4 24/26] include: split target_long definition from cpu-defs Alex Bennée
2023-03-02 19:08 ` [PATCH v4 25/26] gdbstub: split out softmmu/user specifics for syscall handling Alex Bennée
2023-03-02 22:21   ` Richard Henderson
2023-03-02 19:08 ` [PATCH v4 26/26] gdbstub: move update guest debug to accel ops Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230302190846.2593720-15-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=alistair.francis@wdc.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=bin.meng@windriver.com \
    --cc=clg@kaod.org \
    --cc=crosa@redhat.com \
    --cc=crwulff@gmail.com \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=david@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=eduardo@habkost.net \
    --cc=erdnaxe@crans.org \
    --cc=gaosong@loongson.cn \
    --cc=groug@kaod.org \
    --cc=iii@linux.ibm.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=jsnow@redhat.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=kvm@vger.kernel.org \
    --cc=laurent@vivier.eu \
    --cc=liweiwei@iscas.ac.cn \
    --cc=ma.mandourr@gmail.com \
    --cc=mads@ynddal.dk \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=marex@denx.de \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mrolnik@gmail.com \
    --cc=nicolas.eder@lauterbach.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shorne@gmail.com \
    --cc=sunilmut@microsoft.com \
    --cc=thuth@redhat.com \
    --cc=tsimpson@quicinc.com \
    --cc=wangyanan55@huawei.com \
    --cc=yangxiaojuan@loongson.cn \
    --cc=ysato@users.sourceforge.jp \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.