[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/3] arm: gdbstub: add support for switchable endianness
From: |
Changbin Du |
Subject: |
[PATCH 2/3] arm: gdbstub: add support for switchable endianness |
Date: |
Mon, 23 Aug 2021 22:20:03 +0800 |
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
- [PATCH 0/3] gdbstub: add support for switchable endianness, Changbin Du, 2021/08/23
- [PATCH 1/3] gdbstub: add basic infrastructure to support switchable endianness, Changbin Du, 2021/08/23
- [PATCH 2/3] arm: gdbstub: add support for switchable endianness,
Changbin Du <=
- [PATCH 3/3] riscv: gdbstub: add support for switchable endianness, Changbin Du, 2021/08/23
- Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Philippe Mathieu-Daudé, 2021/08/23
- Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Peter Maydell, 2021/08/23
- Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Philippe Mathieu-Daudé, 2021/08/23
- Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Changbin Du, 2021/08/23
- Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Peter Maydell, 2021/08/24
- Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Changbin Du, 2021/08/27
- Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Peter Maydell, 2021/08/28
Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Changbin Du, 2021/08/23
Re: [PATCH 0/3] gdbstub: add support for switchable endianness, Peter Maydell, 2021/08/23