qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Romero <gustavo.romero@linaro.org>
To: qemu-devel@nongnu.org, alex.bennee@linaro.org,
	richard.henderson@linaro.org
Cc: philmd@linaro.org, peter.maydell@linaro.org, gustavo.romero@linaro.org
Subject: [PATCH v4 7/9] gdbstub: Make get cpu and hex conversion functions non-internal
Date: Mon, 24 Jun 2024 05:30:44 +0000	[thread overview]
Message-ID: <20240624053046.221802-8-gustavo.romero@linaro.org> (raw)
In-Reply-To: <20240624053046.221802-1-gustavo.romero@linaro.org>

Make the gdb_first_attached_cpu and gdb_hextomem non-internal so they
are not confined to use only in gdbstub.c.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 gdbstub/internals.h        | 2 --
 include/exec/gdbstub.h     | 5 +++++
 include/gdbstub/commands.h | 6 ++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 34121dc61a..81875abf5f 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -107,7 +107,6 @@ static inline int tohex(int v)
 
 void gdb_put_strbuf(void);
 int gdb_put_packet_binary(const char *buf, int len, bool dump);
-void gdb_hextomem(GByteArray *mem, const char *buf, int len);
 void gdb_memtohex(GString *buf, const uint8_t *mem, int len);
 void gdb_memtox(GString *buf, const char *mem, int len);
 void gdb_read_byte(uint8_t ch);
@@ -130,7 +129,6 @@ bool gdb_got_immediate_ack(void);
 /* utility helpers */
 GDBProcess *gdb_get_process(uint32_t pid);
 CPUState *gdb_get_first_cpu_in_process(GDBProcess *process);
-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 */
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 1bd2c4ec2a..77e5ec9a5b 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -135,4 +135,9 @@ void gdb_set_stop_cpu(CPUState *cpu);
 /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */
 extern const GDBFeature gdb_static_features[];
 
+/**
+ * Return the first attached CPU
+ */
+CPUState *gdb_first_attached_cpu(void);
+
 #endif /* GDBSTUB_H */
diff --git a/include/gdbstub/commands.h b/include/gdbstub/commands.h
index 2204c3ddbe..914b6d7313 100644
--- a/include/gdbstub/commands.h
+++ b/include/gdbstub/commands.h
@@ -93,4 +93,10 @@ void gdb_extend_set_table(GdbCmdParseEntry *table, int size);
  */
 void gdb_extend_qsupported_features(char *qsupported_features);
 
+/**
+ * Convert a hex string to bytes. Conversion is done per byte, so 2 hex digits
+ * are converted to 1 byte. Invalid hex digits are treated as 0 digits.
+ */
+void gdb_hextomem(GByteArray *mem, const char *buf, int len);
+
 #endif /* GDBSTUB_COMMANDS_H */
-- 
2.34.1



  parent reply	other threads:[~2024-06-24  5:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24  5:30 [PATCH v4 0/9] Add MTE stubs for aarch64 user mode Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 1/9] gdbstub: Clean up process_string_cmd Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 2/9] gdbstub: Move GdbCmdParseEntry into a new header file Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 3/9] gdbstub: Add support for target-specific stubs Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 4/9] target/arm: Fix exception case in allocation_tag_mem_probe Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 5/9] target/arm: Make some MTE helpers widely available Gustavo Romero
2024-06-24  7:47   ` Philippe Mathieu-Daudé
2024-06-25 14:14     ` Philippe Mathieu-Daudé
2024-06-27  4:42     ` Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 6/9] target/arm: Factor out code for setting MTE TCF0 field Gustavo Romero
2024-06-24  7:48   ` Philippe Mathieu-Daudé
2024-06-24  5:30 ` Gustavo Romero [this message]
2024-06-24  5:30 ` [PATCH v4 8/9] gdbstub: Add support for MTE in user mode Gustavo Romero
2024-06-24  5:30 ` [PATCH v4 9/9] tests/tcg/aarch64: Add MTE gdbstub tests Gustavo Romero

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=20240624053046.221802-8-gustavo.romero@linaro.org \
    --to=gustavo.romero@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).