From: Changbin Du <changbin.du@gmail.com>
To: "Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-riscv@nongnu.org, Bin Meng <bin.meng@windriver.com>,
qemu-devel@nongnu.org, qemu-arm@nongnu.org,
Alistair Francis <alistair.francis@wdc.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Changbin Du <changbin.du@gmail.com>
Subject: [PATCH 2/3] arm: gdbstub: add support for switchable endianness
Date: Mon, 23 Aug 2021 22:20:03 +0800 [thread overview]
Message-ID: <20210823142004.17935-3-changbin.du@gmail.com> (raw)
In-Reply-To: <20210823142004.17935-1-changbin.du@gmail.com>
Apply new gdbstub interfaces we added previously to support both little
and big endian guest debugging for ARM. And enable the
TARGET_SWICHABLE_ENDIANNESS option.
Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
configs/targets/aarch64-softmmu.mak | 1 +
configs/targets/arm-softmmu.mak | 1 +
target/arm/gdbstub.c | 2 +-
target/arm/gdbstub64.c | 2 +-
4 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/configs/targets/aarch64-softmmu.mak b/configs/targets/aarch64-softmmu.mak
index 7703127674..14e7f166a7 100644
--- a/configs/targets/aarch64-softmmu.mak
+++ b/configs/targets/aarch64-softmmu.mak
@@ -3,3 +3,4 @@ TARGET_BASE_ARCH=arm
TARGET_SUPPORTS_MTTCG=y
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
TARGET_NEED_FDT=y
+TARGET_SWICHABLE_ENDIANNESS=y
diff --git a/configs/targets/arm-softmmu.mak b/configs/targets/arm-softmmu.mak
index 84a98f4818..5f40e858f9 100644
--- a/configs/targets/arm-softmmu.mak
+++ b/configs/targets/arm-softmmu.mak
@@ -2,3 +2,4 @@ TARGET_ARCH=arm
TARGET_SUPPORTS_MTTCG=y
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
TARGET_NEED_FDT=y
+TARGET_SWICHABLE_ENDIANNESS=y
diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c
index 826601b341..188e82d938 100644
--- a/target/arm/gdbstub.c
+++ b/target/arm/gdbstub.c
@@ -74,7 +74,7 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
CPUARMState *env = &cpu->env;
uint32_t tmp;
- tmp = ldl_p(mem_buf);
+ tmp = gdb_read_reg32(mem_buf);
/* Mask out low bit of PC to workaround gdb bugs. This will probably
cause problems if we ever implement the Jazelle DBX extensions. */
diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c
index 251539ef79..5358ad31b4 100644
--- a/target/arm/gdbstub64.c
+++ b/target/arm/gdbstub64.c
@@ -47,7 +47,7 @@ int aarch64_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
CPUARMState *env = &cpu->env;
uint64_t tmp;
- tmp = ldq_p(mem_buf);
+ tmp = gdb_read_reg64(mem_buf);
if (n < 31) {
/* Core integer register. */
--
2.32.0
next prev parent reply other threads:[~2021-08-23 14:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-23 14:20 [PATCH 0/3] gdbstub: add support for switchable endianness Changbin Du
2021-08-23 14:20 ` [PATCH 1/3] gdbstub: add basic infrastructure to support " Changbin Du
2021-08-23 14:20 ` Changbin Du [this message]
2021-08-23 14:20 ` [PATCH 3/3] riscv: gdbstub: add support for " Changbin Du
2021-08-23 15:21 ` [PATCH 0/3] " Philippe Mathieu-Daudé
2021-08-23 15:30 ` Peter Maydell
2021-08-23 15:51 ` Philippe Mathieu-Daudé
2021-08-23 23:05 ` Changbin Du
2021-08-24 9:11 ` Peter Maydell
2021-08-27 14:49 ` Changbin Du
2021-08-28 10:51 ` Peter Maydell
2021-08-23 22:47 ` Changbin Du
2021-08-23 15:23 ` Peter Maydell
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=20210823142004.17935-3-changbin.du@gmail.com \
--to=changbin.du@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.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).