[PATCH 18/25] gdbstub: Remove gdb_has_xml variable

Alex Bennée posted 25 patches 2 years, 4 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Song Gao <gaosong@loongson.cn>, Xiaojuan Yang <yangxiaojuan@loongson.cn>, Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liweiwei@iscas.ac.cn>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Radoslaw Biernacki <rad@semihalf.com>, Leif Lindholm <quic_llindhol@quicinc.com>, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, Brad Smith <brad@comstyle.com>
[PATCH 18/25] gdbstub: Remove gdb_has_xml variable
Posted by Alex Bennée 2 years, 4 months ago
From: Akihiko Odaki <akihiko.odaki@daynix.com>

GDB has XML support since 6.7 which was released in 2007.
It's time to remove support for old GDB versions without XML support.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230912224107.29669-12-akihiko.odaki@daynix.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 gdbstub/internals.h    |  2 --
 include/exec/gdbstub.h |  8 --------
 gdbstub/gdbstub.c      | 15 ---------------
 3 files changed, 25 deletions(-)

diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index fee243081f..7128c4aa85 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -32,8 +32,6 @@ enum {
 typedef struct GDBProcess {
     uint32_t pid;
     bool attached;
-
-    /* If gdb sends qXfer:features:read:target.xml this will be populated */
     char *target_xml;
 } GDBProcess;
 
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 705be2c5d7..1a01c35f8e 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -45,14 +45,6 @@ int gdbserver_start(const char *port_or_device);
 
 void gdb_set_stop_cpu(CPUState *cpu);
 
-/**
- * gdb_has_xml() - report of gdb supports modern target descriptions
- *
- * This will report true if the gdb negotiated qXfer:features:read
- * target descriptions.
- */
-bool gdb_has_xml(void);
-
 /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */
 extern const GDBFeature gdb_static_features[];
 
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 3dc847f835..62608a5389 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -349,11 +349,6 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid)
     }
 }
 
-bool gdb_has_xml(void)
-{
-    return !!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml;
-}
-
 static const char *get_feature_xml(const char *p, const char **newp,
                                    GDBProcess *process)
 {
@@ -1086,11 +1081,6 @@ static void handle_set_reg(GArray *params, void *user_ctx)
 {
     int reg_size;
 
-    if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) {
-        gdb_put_packet("");
-        return;
-    }
-
     if (params->len != 2) {
         gdb_put_packet("E22");
         return;
@@ -1107,11 +1097,6 @@ static void handle_get_reg(GArray *params, void *user_ctx)
 {
     int reg_size;
 
-    if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) {
-        gdb_put_packet("");
-        return;
-    }
-
     if (!params->len) {
         gdb_put_packet("E14");
         return;
-- 
2.39.2


Re: [PATCH 18/25] gdbstub: Remove gdb_has_xml variable
Posted by Alistair Francis 2 years, 4 months ago
On Tue, Oct 10, 2023 at 2:48 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> From: Akihiko Odaki <akihiko.odaki@daynix.com>
>
> GDB has XML support since 6.7 which was released in 2007.
> It's time to remove support for old GDB versions without XML support.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> Message-Id: <20230912224107.29669-12-akihiko.odaki@daynix.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  gdbstub/internals.h    |  2 --
>  include/exec/gdbstub.h |  8 --------
>  gdbstub/gdbstub.c      | 15 ---------------
>  3 files changed, 25 deletions(-)
>
> diff --git a/gdbstub/internals.h b/gdbstub/internals.h
> index fee243081f..7128c4aa85 100644
> --- a/gdbstub/internals.h
> +++ b/gdbstub/internals.h
> @@ -32,8 +32,6 @@ enum {
>  typedef struct GDBProcess {
>      uint32_t pid;
>      bool attached;
> -
> -    /* If gdb sends qXfer:features:read:target.xml this will be populated */
>      char *target_xml;
>  } GDBProcess;
>
> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
> index 705be2c5d7..1a01c35f8e 100644
> --- a/include/exec/gdbstub.h
> +++ b/include/exec/gdbstub.h
> @@ -45,14 +45,6 @@ int gdbserver_start(const char *port_or_device);
>
>  void gdb_set_stop_cpu(CPUState *cpu);
>
> -/**
> - * gdb_has_xml() - report of gdb supports modern target descriptions
> - *
> - * This will report true if the gdb negotiated qXfer:features:read
> - * target descriptions.
> - */
> -bool gdb_has_xml(void);
> -
>  /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */
>  extern const GDBFeature gdb_static_features[];
>
> diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
> index 3dc847f835..62608a5389 100644
> --- a/gdbstub/gdbstub.c
> +++ b/gdbstub/gdbstub.c
> @@ -349,11 +349,6 @@ static CPUState *gdb_get_cpu(uint32_t pid, uint32_t tid)
>      }
>  }
>
> -bool gdb_has_xml(void)
> -{
> -    return !!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml;
> -}
> -
>  static const char *get_feature_xml(const char *p, const char **newp,
>                                     GDBProcess *process)
>  {
> @@ -1086,11 +1081,6 @@ static void handle_set_reg(GArray *params, void *user_ctx)
>  {
>      int reg_size;
>
> -    if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) {
> -        gdb_put_packet("");
> -        return;
> -    }
> -
>      if (params->len != 2) {
>          gdb_put_packet("E22");
>          return;
> @@ -1107,11 +1097,6 @@ static void handle_get_reg(GArray *params, void *user_ctx)
>  {
>      int reg_size;
>
> -    if (!gdb_get_cpu_process(gdbserver_state.g_cpu)->target_xml) {
> -        gdb_put_packet("");
> -        return;
> -    }
> -
>      if (!params->len) {
>          gdb_put_packet("E14");
>          return;
> --
> 2.39.2
>
>