gdbstub: Build once on various targets (single-binary)
Subsystems (2)
v2 cover gdbstub: Build once on various targets (single-binary)
This series absorbed "monitor/hmp: Automatically handle gdb-xml exposed registers", thus version 2. Previous cover:
MonitorDef registers parsing is one of the oldest APIs in QEMU, thus predates gdbstub and XML register files. The latters are maintained by the GDB/binutils project and are more up-to-date. Getting the target register list from them allows to expose all accessible registers to the HMP commands.
This series adds gdb_get_register() to monitor to use XML generated registers, and remove the legacy MonitorDef entries which became unreachable.
First we need to have the SPARC target better follow the gdb-xml API.
On top of that we remove more TARGET_LONG_BITS uses, replacing ldtul_p() -> ldn_p() and gdb_get_regl() -> gdb_get_reg32/64(), allowing to build various gdbstub.c files once. Few other meson cleanups on the way.
Philippe Mathieu-Daudé (50):
target/ppc: Move user_only_helper.c to target_user_arch[] source set target/ppc: Remove PPC_DEBUG_SPR left-over comment target/i386: Inline GDB_FORCE_64 definition
target/avr: Fix typo in gdb-xml feature name
target/alpha: Document gdbstub register indexes target/riscv: Extract monitor-related code to monitor.c target/ppc: Fix CPUClass::gdb_num_core_regs value target/ppc: Remove dead code depending on USE_APPLE_GDB
gdbstub: Always infer gdb_num_core_regs when using XML file target/sparc: Introduce sparc_cpu_register_gdb_regs() stub target/sparc: Restore 'gdb-xml/sparc64-cp0.xml' target/sparc: Restore 'gdb-xml/sparc64-fpu.xml' target/sparc: Restore 'gdb-xml/sparc64-cpu.xml' target/sparc: Expose gdbstub registers to sparc32plus target target/sparc: Expose gdbstub registers to sparc32 targets monitor/hmp: Handle gdb-xml exposed registers via gdb_get_register() target/sparc: Remove MonitorDef register entries available via gdbstub target/i386: Remove MonitorDef register entries available via gdbstub target/m68k: Remove MonitorDef register entries available via gdbstub target/ppc: Remove MonitorDef register entries available via gdbstub target/ppc: Extract monitor-related code to monitor.c target/or1k: Use XML register definitions from GDB target/riscv: Remove empty target_monitor_defs() symbol target/sparc: Factor sparc_cpu_gdb_write_register() out target/ppc: Replace ldtul_p() -> ldn_p()
target/mips: Replace ldtul_p() -> ldn_p()
target/riscv: Replace ldtul_p() -> ldn_p()
target/riscv: Remove unnecessary target_ulong type uses target/i386: Replace ldtul_p() -> ldn_p()
target/i386: Expand 64-bit definitions when TARGET_LONG_BITS == 64
gdbstub: Remove ldtul*() macros
target/alpha: Expand gdb_get_regl() -> gdb_get_reg64() target/hexagon: Expand gdb_get_regl() -> gdb_get_reg32() target/rx: Expand gdb_get_regl() -> gdb_get_reg32() target/sh4: Expand gdb_get_regl() -> gdb_get_reg32() target/sparc: Expand gdb_get_regl() in gdb_get_rega() gdbstub/helpers: Convert gdb_get_regl() macro to inlined helper target/microblaze: Build 'gdbstub.c' once for system binaries target/sh4: Build 'monitor.c' once for system binaries target/sh4: Build 'gdbstub.c' once for system binaries target/or1k: Rename 'openrisc' -> 'or1k' in meson.build target/or1k: Build 'gdbstub.c' once for system single binary target/alpha: Build 'gdbstub.c' once for system single binary target/avr: Build 'gdbstub.c' once for system single binary target/loongarch: Build 'gdbstub.c' once for system single binary target/m68k: Build 'gdbstub.c' once for system single binary target/rx: Build 'gdbstub.c' once for system single binary target/s390x: Build 'gdbstub.c' once for system single binary target/tricore: Build 'gdbstub.c' once for system single binary DONOTREVIEW Revert "target/loongarch: Build 'gdbstub.c' once"
configs/targets/or1k-linux-user.mak | 1 +
configs/targets/or1k-softmmu.mak | 1 +
configs/targets/sparc-linux-user.mak | 1 +
configs/targets/sparc-softmmu.mak | 1 +
configs/targets/sparc32plus-linux-user.mak | 1 +
configs/targets/sparc64-linux-user.mak | 2 +-
configs/targets/sparc64-softmmu.mak | 2 +-
include/gdbstub/helpers.h | 28 +-
include/hw/core/cpu.h | 4 +-
target/ppc/cpu.h | 2 -
target/sparc/cpu.h | 1 +
gdbstub/gdbstub.c | 1 +
monitor/hmp.c | 49 ++-
target/alpha/cpu.c | 1 -
target/alpha/gdbstub.c | 27 +-
target/hexagon/gdbstub.c | 12 +-
target/i386/gdbstub.c | 23 +-
target/i386/monitor.c | 39 ---
target/m68k/monitor.c | 18 -
target/mips/gdbstub.c | 14 +-
target/or1k/cpu.c | 2 +-
target/ppc/cpu_init.c | 10 -
target/ppc/gdbstub.c | 146 +-------
target/ppc/monitor.c | 41 +++
target/ppc/ppc-qmp-cmds.c | 148 +-------
target/riscv/gdbstub.c | 20 +-
target/riscv/monitor.c | 135 ++++++++
target/riscv/riscv-qmp-cmds.c | 150 ---------
target/rx/gdbstub.c | 20 +-
target/sh4/gdbstub.c | 32 +-
target/sparc/cpu.c | 7 +-
target/sparc/gdbstub.c | 317 +++++++++++-------
target/sparc/monitor.c | 107 ------
gdb-xml/avr-cpu.xml | 2 +-
gdb-xml/or1k-core.xml | 65 ++++
gdb-xml/sparc32-cp0.xml | 18 +
gdb-xml/sparc32-cpu.xml | 42 +++
gdb-xml/sparc32-fpu.xml | 42 +++
gdb-xml/sparc64-cp0.xml | 16 +
gdb-xml/sparc64-cpu.xml | 42 +++
gdb-xml/{sparc64-core.xml => sparc64-fpu.xml} | 44 +--
target/alpha/meson.build | 14 +-
target/avr/meson.build | 5 +-
target/m68k/meson.build | 9 +-
target/microblaze/meson.build | 11 +-
target/or1k/meson.build | 23 +-
target/ppc/meson.build | 7 +-
target/rx/meson.build | 6 +-
target/s390x/meson.build | 3 +-
target/sh4/meson.build | 14 +-
target/tricore/meson.build | 10 +-
51 files changed, 836 insertions(+), 900 deletions(-)
create mode 100644 target/ppc/monitor.c
create mode 100644 gdb-xml/or1k-core.xml
create mode 100644 gdb-xml/sparc32-cp0.xml
create mode 100644 gdb-xml/sparc32-cpu.xml
create mode 100644 gdb-xml/sparc32-fpu.xml
create mode 100644 gdb-xml/sparc64-cp0.xml
create mode 100644 gdb-xml/sparc64-cpu.xml
rename gdb-xml/{sparc64-core.xml => sparc64-fpu.xml} (59%)Signature · 1 line
2.52.0
PATCH v2 1/50 target/ppc: Move user_only_helper.c to target_user_arch[] source set
Since commit 46369b50ee3 ("meson: Introduce meson_user_arch source set for arch-specific user-mode") using target_user_arch[] is preferred because clearer, and no need to filter on CONFIG_USER_ONLY.
--- target/ppc/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
target/ppc/meson.build +5 -1
@@ -31,7 +31,10 @@ gen = [ ] ppc_ss.add(when: 'CONFIG_TCG', if_true: gen) -ppc_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user_only_helper.c')) +ppc_user_ss = ss.source_set() +ppc_user_ss.add(files( + 'user_only_helper.c', +)) ppc_system_ss = ss.source_set() ppc_system_ss.add(files(
@@ -57,4 +60,5 @@ ppc_system_ss.add(when: 'TARGET_PPC64', if_true: files( )) target_arch += {'ppc': ppc_ss} +target_user_arch += {'ppc': ppc_user_ss} target_system_arch += {'ppc': ppc_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 01/50] target/ppc: Move user_only_helper.c to target_user_arch[] source set
Quoted 9 lines · Philippe Mathieu-Daudé
Since commit
46369b50ee3("meson: Introducemeson_user_archsource set for arch-specific user-mode") using target_user_arch[] is preferred because clearer, and no need to filter onCONFIG_USER_ONLY.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/ppc/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
PATCH v2 2/50 target/ppc: Remove PPC_DEBUG_SPR left-over comment
In reply to Philippe Mathieu-DaudéThe PPC_DEBUG_SPR definition was fully removed in commit 61135639821 ("target/ppc: Clean up _spr_register et al").
--- target/ppc/cpu_init.c | 1 - 1 file changed, 1 deletion(-)
target/ppc/cpu_init.c +0 -1
@@ -52,7 +52,6 @@#endif #include "cpu_init.h" -/* #define PPC_DEBUG_SPR */ /* #define USE_APPLE_GDB */ static const Property powerpc_cpu_properties[] = {
Signature · 1 line
2.52.0
Re: [PATCH v2 02/50] target/ppc: Remove PPC_DEBUG_SPR left-over comment
Quoted 8 lines · Philippe Mathieu-Daudé
The
PPC_DEBUG_SPRdefinition was fully removed in commit 61135639821 ("target/ppc: Clean up_spr_registeret al").Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/ppc/cpu_init.c | 1 - 1 file changed, 1 deletion(-)
PATCH v2 3/50 target/i386: Inline GDB_FORCE_64 definition
In reply to Philippe Mathieu-DaudéDirectly checking TARGET_LONG_BITS allows to remove GDB_FORCE_64.
--- target/i386/gdbstub.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
target/i386/gdbstub.c +1 -7
@@ -79,15 +79,9 @@ static const int gpr_map32[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };#define IDX_CTL_CR8_REG (IDX_CTL_REGS + 4)#define IDX_CTL_EFER_REG (IDX_CTL_REGS + 5) -#ifdef TARGET_X86_64 -#define GDB_FORCE_64 1 -#else -#define GDB_FORCE_64 0 -#endif -static int gdb_read_reg_cs64 (uint32_t hflags,GByteArray *buf,target_ulong val) { -if ((hflags &HF_CS64_MASK ) ||GDB_FORCE_64 ) { +if ((hflags &HF_CS64_MASK ) ||TARGET_LONG_BITS ==64 ) {return gdb_get_reg64 (buf, val); }return gdb_get_reg32 (buf, val);
Signature · 1 line
2.52.0
Re: [PATCH v2 03/50] target/i386: Inline GDB_FORCE_64 definition
Quoted 7 lines · Philippe Mathieu-Daudé
Directly checking
TARGET_LONG_BITSallows to removeGDB_FORCE_64.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/i386/gdbstub.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
PATCH v2 4/50 target/avr: Fix typo in gdb-xml feature name
In reply to Philippe Mathieu-DaudéWhile GDB doesn't provide an official XML for the gdbstub protocol, it is still better to name it 'avr' instead of 'riscv'.
--- gdb-xml/avr-cpu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
gdb-xml/avr-cpu.xml +1 -1
@@ -10,7 +10,7 @@ register descriptions. --> <!DOCTYPE feature SYSTEM "gdb-target.dtd"> -<feature name="org.gnu.gdb.riscv.cpu"> +<feature name="org.gnu.gdb.avr.cpu"> <reg name="r0" bitsize="8" type="int" regnum="0"/> <reg name="r1" bitsize="8" type="int"/> <reg name="r2" bitsize="8" type="int"/>
Signature · 1 line
2.52.0
Re: [PATCH v2 04/50] target/avr: Fix typo in gdb-xml feature name
Quoted 9 lines · Philippe Mathieu-Daudé
While GDB doesn't provide an official XML for the gdbstub protocol, it is still better to name it 'avr' instead of 'riscv'.
Fixes 12b35405476 ("target/avr: CPU class: Add GDB support")Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- gdb-xml/avr-cpu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v2 5/50 target/alpha: Document gdbstub register indexes
In reply to Philippe Mathieu-DaudéFollow GDB XML comments. Re-order switch cases for clarity.
--- target/alpha/gdbstub.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
target/alpha/gdbstub.c +12 -13
@@ -31,6 +31,9 @@ int alpha_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) case 0 ... 30: val =cpu_alpha_load_gr (env, n);break ; +case 31 :/* zero register */ + val =0 ; +break ; case 32 ... 62: d.d = env->fir[n -32 ]; val = d.ll;
@@ -41,15 +44,12 @@ int alpha_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)case 64 : val = env->pc;break ; -case 66 : - val = env->unique; -break ; -case 31 : -case 65 : -/* 31 really is the zero register; 65 is unassigned in the -gdb protocol, but is still required to occupy 8 bytes. */ +case 65 :/* former Virtual Register (reserved as unassigned) */ val =0 ;break ; +case 66 :/* PALcode Memory Slot */ + val = env->unique; +break ;default :return 0 ; }
@@ -66,6 +66,8 @@ int alpha_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) case 0 ... 30:cpu_alpha_store_gr (env, n, tmp);break ; +case 31 :/* zero register */ +break ; case 32 ... 62: d.ll = tmp; env->fir[n -32 ] = d.d;
@@ -76,13 +78,10 @@ int alpha_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)case 64 : env->pc = tmp;break ; -case 66 : - env->unique = tmp; +case 65 :/* former Virtual Register (reserved as unassigned) */ break ; -case 31 : -case 65 : -/* 31 really is the zero register; 65 is unassigned in the -gdb protocol, but is still required to occupy 8 bytes. */ +case 66 :/* PALcode Memory Slot */ + env->unique = tmp;break ;default :return 0 ;
Signature · 1 line
2.52.0
Re: [PATCH v2 05/50] target/alpha: Document gdbstub register indexes
Quoted 7 lines · Philippe Mathieu-Daudé
Follow GDB XML comments. Re-order switch cases for clarity.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/alpha/gdbstub.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
PATCH v2 6/50 target/riscv: Extract monitor-related code to monitor.c
In reply to Philippe Mathieu-DaudéKeep riscv-qmp-cmds.c for QMP, use monitor.c for HMP.
--- target/riscv/monitor.c | 148 +++++++++++++++++++++++++++++++++ target/riscv/riscv-qmp-cmds.c | 150 ---------------------------------- 2 files changed, 148 insertions(+), 150 deletions(-)
target/riscv/monitor.c +148 -0
@@ -19,6 +19,8 @@*/ #include "qemu/osdep.h" +#include "qemu/ctype.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "cpu_bits.h" #include "monitor/monitor.h"
@@ -241,3 +243,149 @@ void hmp_info_mem(Monitor *mon, const QDict *qdict)mem_info_svxx (mon, env); } + +/* +* We have way too many potential CSRs and regs being added +* regularly to register them in a static array. +* +* Declare an empty array instead, making get_monitor_def() use +* the target_get_monitor_def() API directly. +*/ +const MonitorDef monitor_defs[] = { { } }; +const MonitorDef *target_monitor_defs (void ) +{ +return monitor_defs; +} + +static bool reg_is_ulong_integer (CPURISCVState *env,const char *name, +target_ulong *val,bool is_gprh) +{ +const char *const *reg_names; +target_ulong *vals; + +if (is_gprh) { + reg_names = riscv_int_regnamesh; + vals = env->gprh; + }else { + reg_names = riscv_int_regnames; + vals = env->gpr; + } + +for (int i =0 ; i <32 ; i++) { +g_auto (GStrv) reg_name =g_strsplit (reg_names[i],"/" ,2 ); + +g_assert (reg_name[0 ]); +g_assert (reg_name[1 ]); + +if (g_ascii_strcasecmp (reg_name[0 ], name) ==0 || +g_ascii_strcasecmp (reg_name[1 ], name) ==0 ) { + *val = vals[i]; +return true; + } + } + +return false; +} + +static bool reg_is_u64_fpu (CPURISCVState *env,const char *name,uint64_t *val) +{ +if (qemu_tolower (name[0 ]) !='f' ) { +return false; + } + +for (int i =0 ; i <32 ; i++) { +g_auto (GStrv) reg_name =g_strsplit (riscv_fpr_regnames[i],"/" ,2 ); + +g_assert (reg_name[0 ]); +g_assert (reg_name[1 ]); + +if (g_ascii_strcasecmp (reg_name[0 ], name) ==0 || +g_ascii_strcasecmp (reg_name[1 ], name) ==0 ) { + *val = env->fpr[i]; +return true; + } + } + +return false; +} + +static bool reg_is_vreg (const char *name) +{ +if (qemu_tolower (name[0 ]) !='v' ||strlen (name) >3 ) { +return false; + } + +for (int i =0 ; i <32 ; i++) { +if (strcasecmp (name, riscv_rvv_regnames[i]) ==0 ) { +return true; + } + } + +return false; +} + +int target_get_monitor_def (CPUState *cs,const char *name,uint64_t *pval) +{ +CPURISCVState *env = &RISCV_CPU (cs)->env; +target_ulong val =0 ; +uint64_t val64 =0 ; +int i; + +if (reg_is_ulong_integer (env, name, &val, false) || +reg_is_ulong_integer (env, name, &val, true)) { + *pval = val; +return 0 ; + } + +if (reg_is_u64_fpu (env, name, &val64)) { + *pval = val64; +return 0 ; + } + +if (reg_is_vreg (name)) { +if (!riscv_cpu_cfg (env)->ext_zve32x) { +return -EINVAL ; + } + +qemu_printf ("Unable to print the value of vector " +"vreg '%s' from this API\n" , name); + +/* +* We're returning 0 because returning -EINVAL triggers +* an 'unknown register' message in exp_unary() later, +* which feels ankward after our own error message. +*/ + *pval =0 ; +return 0 ; + } + +for (i =0 ; i <ARRAY_SIZE (csr_ops); i++) { +RISCVException res; +int csrno = i; + +/* +* Early skip when possible since we're going +* through a lot of NULL entries. +*/ +if (csr_ops[csrno].predicate ==NULL ) { +continue ; + } + +if (strcasecmp (csr_ops[csrno].name, name) !=0 ) { +continue ; + } + + res =riscv_csrrw_debug (env, csrno, &val,0 ,0 ); + +/* +* Rely on the smode, hmode, etc, predicates within csr.c +* to do the filtering of the registers that are present. +*/ +if (res ==RISCV_EXCP_NONE ) { + *pval = val; +return 0 ; + } + } + +return -EINVAL ; +}
target/riscv/riscv-qmp-cmds.c +0 -150
159 lines not on this page · raw message
Signature · 1 line
2.52.0
Re: [PATCH v2 06/50] target/riscv: Extract monitor-related code to monitor.c
Quoted 8 lines · Philippe Mathieu-Daudé
Keep
riscv-qmp-cmds.cfor QMP, usemonitor.cfor HMP.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/riscv/monitor.c | 148 +++++++++++++++++++++++++++++++++ target/riscv/riscv-qmp-cmds.c | 150 ---------------------------------- 2 files changed, 148 insertions(+), 150 deletions(-)
Re: [PATCH v2 06/50] target/riscv: Extract monitor-related code to monitor.c
In reply to Philippe Mathieu-DaudéQuoted 4 lines · Philippe Mathieu-Daudé
Keep
riscv-qmp-cmds.cfor QMP, usemonitor.cfor HMP.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Quoted 332 lines
target/riscv/monitor.c | 148 +++++++++++++++++++++++++++++++++ target/riscv/riscv-qmp-cmds.c | 150 ---------------------------------- 2 files changed, 148 insertions(+), 150 deletions(-)target/riscv/monitor.c +148
-0@@ -19,6 +19,8 @@*/ #include "qemu/osdep.h" +#include "qemu/ctype.h" +#include "qemu/qemu-print.h" #include "cpu.h" #include "cpu_bits.h" #include "monitor/monitor.h" @@ -241,3 +243,149 @@ void hmp_info_mem(Monitor *mon, const QDict *qdict)mem_info_svxx (mon, env); } + +/* +* We have way too many potential CSRs and regs being added +* regularly to register them in a static array. +* +* Declare an empty array instead, making get_monitor_def() use +* the target_get_monitor_def() API directly. +*/ +const MonitorDef monitor_defs[] = { { } }; +const MonitorDef *target_monitor_defs (void ) +{ +return monitor_defs; +} + +static bool reg_is_ulong_integer (CPURISCVState *env,const char *name, +target_ulong *val,bool is_gprh) +{ +const char *const *reg_names; +target_ulong *vals; + +if (is_gprh) { + reg_names = riscv_int_regnamesh; + vals = env->gprh; + }else { + reg_names = riscv_int_regnames; + vals = env->gpr; + } + +for (int i =0 ; i <32 ; i++) { +g_auto (GStrv) reg_name =g_strsplit (reg_names[i],"/" ,2 ); + +g_assert (reg_name[0 ]); +g_assert (reg_name[1 ]); + +if (g_ascii_strcasecmp (reg_name[0 ], name) ==0 || +g_ascii_strcasecmp (reg_name[1 ], name) ==0 ) { + *val = vals[i]; +return true; + } + } + +return false; +} + +static bool reg_is_u64_fpu (CPURISCVState *env,const char *name,uint64_t *val) +{ +if (qemu_tolower (name[0 ]) !='f' ) { +return false; + } + +for (int i =0 ; i <32 ; i++) { +g_auto (GStrv) reg_name =g_strsplit (riscv_fpr_regnames[i],"/" ,2 ); + +g_assert (reg_name[0 ]); +g_assert (reg_name[1 ]); + +if (g_ascii_strcasecmp (reg_name[0 ], name) ==0 || +g_ascii_strcasecmp (reg_name[1 ], name) ==0 ) { + *val = env->fpr[i]; +return true; + } + } + +return false; +} + +static bool reg_is_vreg (const char *name) +{ +if (qemu_tolower (name[0 ]) !='v' ||strlen (name) >3 ) { +return false; + } + +for (int i =0 ; i <32 ; i++) { +if (strcasecmp (name, riscv_rvv_regnames[i]) ==0 ) { +return true; + } + } + +return false; +} + +int target_get_monitor_def (CPUState *cs,const char *name,uint64_t *pval) +{ +CPURISCVState *env = &RISCV_CPU (cs)->env; +target_ulong val =0 ; +uint64_t val64 =0 ; +int i; + +if (reg_is_ulong_integer (env, name, &val, false) || +reg_is_ulong_integer (env, name, &val, true)) { + *pval = val; +return 0 ; + } + +if (reg_is_u64_fpu (env, name, &val64)) { + *pval = val64; +return 0 ; + } + +if (reg_is_vreg (name)) { +if (!riscv_cpu_cfg (env)->ext_zve32x) { +return -EINVAL ; + } + +qemu_printf ("Unable to print the value of vector " +"vreg '%s' from this API\n" , name); + +/* +* We're returning 0 because returning -EINVAL triggers +* an 'unknown register' message in exp_unary() later, +* which feels ankward after our own error message. +*/ + *pval =0 ; +return 0 ; + } + +for (i =0 ; i <ARRAY_SIZE (csr_ops); i++) { +RISCVException res; +int csrno = i; + +/* +* Early skip when possible since we're going +* through a lot of NULL entries. +*/ +if (csr_ops[csrno].predicate ==NULL ) { +continue ; + } + +if (strcasecmp (csr_ops[csrno].name, name) !=0 ) { +continue ; + } + + res =riscv_csrrw_debug (env, csrno, &val,0 ,0 ); + +/* +* Rely on the smode, hmode, etc, predicates within csr.c +* to do the filtering of the registers that are present. +*/ +if (res ==RISCV_EXCP_NONE ) { + *pval = val; +return 0 ; + } + } + +return -EINVAL ; +}target/riscv/riscv-qmp-cmds.c +0
-150@@ -31,10 +31,6 @@#include "qapi/qobject-input-visitor.h" #include "qapi/visitor.h" #include "qom/qom-qobject.h" -#include "qemu/ctype.h" -#include "qemu/qemu-print.h" -#include "monitor/hmp.h" -#include "monitor/hmp-target.h" #include "system/kvm.h" #include "system/tcg.h" #include "cpu-qom.h" @@ -244,149 +240,3 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,return expansion_info; } - -/* -* We have way too many potential CSRs and regs being added -* regularly to register them in a static array. -* -* Declare an empty array instead, making get_monitor_def() use -* the target_get_monitor_def() API directly. -*/ -const MonitorDef monitor_defs[] = { { } }; -const MonitorDef *target_monitor_defs (void ) -{ -return monitor_defs; -} - -static bool reg_is_ulong_integer (CPURISCVState *env,const char *name, -target_ulong *val,bool is_gprh) -{ -const char *const *reg_names; -target_ulong *vals; - -if (is_gprh) { - reg_names = riscv_int_regnamesh; - vals = env->gprh; - }else { - reg_names = riscv_int_regnames; - vals = env->gpr; - } - -for (int i =0 ; i <32 ; i++) { -g_auto (GStrv) reg_name =g_strsplit (reg_names[i],"/" ,2 ); - -g_assert (reg_name[0 ]); -g_assert (reg_name[1 ]); - -if (g_ascii_strcasecmp (reg_name[0 ], name) ==0 || -g_ascii_strcasecmp (reg_name[1 ], name) ==0 ) { - *val = vals[i]; -return true; - } - } - -return false; -} - -static bool reg_is_u64_fpu (CPURISCVState *env,const char *name,uint64_t *val) -{ -if (qemu_tolower (name[0 ]) !='f' ) { -return false; - } - -for (int i =0 ; i <32 ; i++) { -g_auto (GStrv) reg_name =g_strsplit (riscv_fpr_regnames[i],"/" ,2 ); - -g_assert (reg_name[0 ]); -g_assert (reg_name[1 ]); - -if (g_ascii_strcasecmp (reg_name[0 ], name) ==0 || -g_ascii_strcasecmp (reg_name[1 ], name) ==0 ) { - *val = env->fpr[i]; -return true; - } - } - -return false; -} - -static bool reg_is_vreg (const char *name) -{ -if (qemu_tolower (name[0 ]) !='v' ||strlen (name) >3 ) { -return false; - } - -for (int i =0 ; i <32 ; i++) { -if (strcasecmp (name, riscv_rvv_regnames[i]) ==0 ) { -return true; - } - } - -return false; -} - -int target_get_monitor_def (CPUState *cs,const char *name,uint64_t *pval) -{ -CPURISCVState *env = &RISCV_CPU (cs)->env; -target_ulong val =0 ; -uint64_t val64 =0 ; -int i; - -if (reg_is_ulong_integer (env, name, &val, false) || -reg_is_ulong_integer (env, name, &val, true)) { - *pval = val; -return 0 ; - } - -if (reg_is_u64_fpu (env, name, &val64)) { - *pval = val64; -return 0 ; - } - -if (reg_is_vreg (name)) { -if (!riscv_cpu_cfg (env)->ext_zve32x) { -return -EINVAL ; - } - -qemu_printf ("Unable to print the value of vector " -"vreg '%s' from this API\n" , name); - -/* -* We're returning 0 because returning -EINVAL triggers -* an 'unknown register' message in exp_unary() later, -* which feels ankward after our own error message. -*/ - *pval =0 ; -return 0 ; - } - -for (i =0 ; i <ARRAY_SIZE (csr_ops); i++) { -RISCVException res; -int csrno = i; - -/* -* Early skip when possible since we're going -* through a lot of NULL entries. -*/ -if (csr_ops[csrno].predicate ==NULL ) { -continue ; - } - -if (strcasecmp (csr_ops[csrno].name, name) !=0 ) { -continue ; - } - - res =riscv_csrrw_debug (env, csrno, &val,0 ,0 ); - -/* -* Rely on the smode, hmode, etc, predicates within csr.c -* to do the filtering of the registers that are present. -*/ -if (res ==RISCV_EXCP_NONE ) { - *pval = val; -return 0 ; - } - } - -return -EINVAL ; -}
PATCH v2 7/50 target/ppc: Fix CPUClass::gdb_num_core_regs value
In reply to Philippe Mathieu-DaudéOnly 70 registers are exposed from GDB XML file (for either 32 / 64-bit variants).
--- gdbstub/gdbstub.c | 2 ++ target/ppc/cpu_init.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
gdbstub/gdbstub.c +2 -0
@@ -593,6 +593,8 @@ void gdb_init_cpu(CPUState *cpu)gdb_register_feature (cpu,0 , cc->gdb_read_register, cc->gdb_write_register, feature); +assert (!cc->gdb_num_core_regs + || cc->gdb_num_core_regs == feature->num_regs); cpu->gdb_num_regs = cpu->gdb_num_g_regs = feature->num_regs; }
target/ppc/cpu_init.c +1 -1
@@ -7553,7 +7553,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, const void *data) PAGE_WRITE == 2 && PAGE_EXEC == 4);#endif - cc->gdb_num_core_regs =71 ; + cc->gdb_num_core_regs =70 ;#ifdef USE_APPLE_GDB cc->gdb_read_register = ppc_cpu_gdb_read_register_apple; cc->gdb_write_register = ppc_cpu_gdb_write_register_apple;
Signature · 1 line
2.52.0
Re: [PATCH v2 07/50] target/ppc: Fix CPUClass::gdb_num_core_regs value
Quoted 9 lines · Philippe Mathieu-Daudé
Only 70 registers are exposed from GDB XML file (for either 32 / 64-bit variants).
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- gdbstub/gdbstub.c | 2 ++ target/ppc/cpu_init.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
Did you check the assert is not triggered for all other architectures?
Re: [PATCH v2 07/50] target/ppc: Fix CPUClass::gdb_num_core_regs value
Quoted 4 lines · Pierrick Bouvier
Quoted 3 lines · Philippe Mathieu-Daudé
Only 70 registers are exposed from GDB XML file (for either 32 / 64-bit variants).
Quoted 8 lines
Quoted 6 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
gdbstub/gdbstub.c | 2 ++
target/ppc/cpu_init.c| 2 +-2 files changed, 3 insertions(+), 1 deletion(-)Did you check the assert is not triggered for all other architectures?
Yes.
Quoted 1 line
Reviewed-by Pierrick Bouvier <[email protected]>
Thanks!
PATCH v2 8/50 target/ppc: Remove dead code depending on USE_APPLE_GDB
In reply to Philippe Mathieu-DaudéWe never defined USE_APPLE_GDB, so the code introduced in commit b3cad3abf6d ("PPC: Add support for Apple gdb in gdbstub") is dead since almost 12 years. Remove it.
--- target/ppc/cpu.h | 2 - target/ppc/cpu_init.c | 7 --- target/ppc/gdbstub.c | 124 ------------------------------------------ 3 files changed, 133 deletions(-)
target/ppc/cpu.h +0 -2
@@ -1637,9 +1637,7 @@ static inline bool vhyp_cpu_in_nested(PowerPCCPU *cpu)void ppc_cpu_dump_state (CPUState *cpu,FILE *f,int flags);int ppc_cpu_gdb_read_register (CPUState *cpu,GByteArray *buf,int reg); -int ppc_cpu_gdb_read_register_apple (CPUState *cpu,GByteArray *buf,int reg);int ppc_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -int ppc_cpu_gdb_write_register_apple (CPUState *cpu,uint8_t *buf,int reg);#ifndef CONFIG_USER_ONLY hwaddr ppc_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr);#endif
target/ppc/cpu_init.c +0 -7
@@ -52,7 +52,6 @@#endif #include "cpu_init.h" -/* #define USE_APPLE_GDB */ static const Property powerpc_cpu_properties[] = { DEFINE_PROP_BOOL("rtas-stopped-state", PowerPCCPU,
@@ -7554,12 +7553,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, const void *data)#endif cc->gdb_num_core_regs =70 ; -#ifdef USE_APPLE_GDB - cc->gdb_read_register = ppc_cpu_gdb_read_register_apple; - cc->gdb_write_register = ppc_cpu_gdb_write_register_apple; - cc->gdb_num_core_regs =71 +32 ; -#endif - cc->gdb_arch_name = ppc_gdb_arch_name;#if defined(TARGET_PPC64 ) cc->gdb_core_xml_file ="power64-core.xml" ;
target/ppc/gdbstub.c +0 -124
142 lines not on this page · raw message
Signature · 1 line
2.52.0
Re: [PATCH v2 08/50] target/ppc: Remove dead code depending on USE_APPLE_GDB
Quoted 11 lines · Philippe Mathieu-Daudé
We never defined
USE_APPLE_GDB, so the code introduced in commitb3cad3abf6d("PPC: Add support for Apple gdb in gdbstub") is dead since almost 12 years. Remove it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/ppc/cpu.h | 2 - target/ppc/cpu_init.c | 7 --- target/ppc/gdbstub.c | 124 ------------------------------------------ 3 files changed, 133 deletions(-)
PATCH v2 9/50 gdbstub: Always infer gdb_num_core_regs when using XML file
In reply to Philippe Mathieu-DaudéRather correct inferred count over invalid manual one.
--- include/hw/core/cpu.h | 4 ++-- gdbstub/gdbstub.c | 3 +-- target/alpha/cpu.c | 1 - target/ppc/cpu_init.c | 2 -- target/sparc/cpu.c | 1 - 5 files changed, 3 insertions(+), 8 deletions(-)
include/hw/core/cpu.h +2 -2
@@ -128,9 +128,9 @@ struct SysemuCPUOps;* @gdb_adjust_breakpoint: Callback for adjusting the address of a * breakpoint. Used by AVR to handle a gdb mis-feature with * its Harvard architecture split code and data. -* @gdb_num_core_regs: Number of core registers accessible to GDB or 0 to infer -* from @gdb_core_xml_file. * @gdb_core_xml_file: File name for core registers GDB XML description. +* @gdb_num_core_regs: Number of core registers accessible to GDB if no +* @gdb_core_xml_file available (otherwise inferred). * @gdb_get_core_xml_file: Optional callback that returns the file name for * the core registers GDB XML description. The returned value is expected to * be a simple constant string: the caller will not g_free() it. If this
gdbstub/gdbstub.c +1 -2
@@ -593,8 +593,7 @@ void gdb_init_cpu(CPUState *cpu)gdb_register_feature (cpu,0 , cc->gdb_read_register, cc->gdb_write_register, feature); -assert (!cc->gdb_num_core_regs - || cc->gdb_num_core_regs == feature->num_regs); +assert (!cc->gdb_num_core_regs); cpu->gdb_num_regs = cpu->gdb_num_g_regs = feature->num_regs; }
target/alpha/cpu.c +0 -1
@@ -295,7 +295,6 @@ static void alpha_cpu_class_init(ObjectClass *oc, const void *data) cc->disas_set_info = alpha_cpu_disas_set_info; cc->tcg_ops = &alpha_tcg_ops; - cc->gdb_num_core_regs =67 ; }#define DEFINE_ALPHA_CPU_TYPE (base_type, cpu_model, initfn) \
target/ppc/cpu_init.c +0 -2
@@ -7551,8 +7551,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, const void *data)MMU_INST_FETCH ==2 &&PAGE_READ ==1 && PAGE_WRITE == 2 && PAGE_EXEC == 4);#endif - - cc->gdb_num_core_regs =70 ; cc->gdb_arch_name = ppc_gdb_arch_name;#if defined(TARGET_PPC64 ) cc->gdb_core_xml_file ="power64-core.xml" ;
target/sparc/cpu.c +0 -1
@@ -1092,7 +1092,6 @@ static void sparc_cpu_class_init(ObjectClass *oc, const void *data)#if defined(TARGET_SPARC64 ) && !defined(TARGET_ABI32 ) cc->gdb_core_xml_file ="sparc64-core.xml" ; - cc->gdb_num_core_regs =86 ;#else cc->gdb_num_core_regs =72 ;#endif
Signature · 1 line
2.52.0
Re: [PATCH v2 09/50] gdbstub: Always infer gdb_num_core_regs when using XML file
Quoted 11 lines · Philippe Mathieu-Daudé
Rather correct inferred count over invalid manual one.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/core/cpu.h | 4 ++-- gdbstub/gdbstub.c | 3 +-- target/alpha/cpu.c | 1 - target/ppc/cpu_init.c | 2 -- target/sparc/cpu.c | 1 - 5 files changed, 3 insertions(+), 8 deletions(-)
You can merge this with patch 7.
PATCH v2 10/50 target/sparc: Introduce sparc_cpu_register_gdb_regs() stub
In reply to Philippe Mathieu-DaudéIntroduce sparc_cpu_register_gdb_regs() which we are going to fill in the next commits.
--- target/sparc/cpu.h | 1 + target/sparc/cpu.c | 2 ++ target/sparc/gdbstub.c | 9 +++++++++ 3 files changed, 12 insertions(+)
target/sparc/cpu.h +1 -0
@@ -586,6 +586,7 @@ hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);void sparc_cpu_do_interrupt (CPUState *cpu);int sparc_cpu_gdb_read_register (CPUState *cpu,GByteArray *buf,int reg);int sparc_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); +void sparc_cpu_register_gdb_regs (CPUState *cs); G_NORETURN void sparc_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx,
target/sparc/cpu.c +2 -0
@@ -897,6 +897,8 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error **errp)return ; } +sparc_cpu_register_gdb_regs (cs); +qemu_init_vcpu (cs); scc->parent_realize (dev, errp);
target/sparc/gdbstub.c +9 -0
@@ -215,3 +215,12 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)return 8 ;#endif } + +void sparc_cpu_register_gdb_regs (CPUState *cs) +{ +#if defined(TARGET_ABI32 ) || !defined(TARGET_SPARC64 ) +/* Not yet supported */ +#else +/* Not yet supported */ +#endif +}
Signature · 1 line
2.52.0
Re: [PATCH v2 10/50] target/sparc: Introduce sparc_cpu_register_gdb_regs() stub
Quoted 10 lines · Philippe Mathieu-Daudé
Introduce
sparc_cpu_register_gdb_regs()which we are going to fill in the next commits.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/sparc/cpu.h | 1 + target/sparc/cpu.c | 2 ++ target/sparc/gdbstub.c | 9 +++++++++ 3 files changed, 12 insertions(+)
PATCH v2 11/50 target/sparc: Restore 'gdb-xml/sparc64-cp0.xml'
In reply to Philippe Mathieu-DaudéRestore gdb-xml/sparc64-cp0.xml from mainstream binutils, tag 'binutils-2_46', found in the gdb/features/sparc/folder [*].
Extract sparc_cp0_gdb_write_register() out of sparc_cpu_gdb_read_register() and sparc_cp0_gdb_write_register() out of sparc_cpu_gdb_write_register(), taking care to update the register indexes in the switch cases.
Register these helpers with a call to gdb_register_coprocessor() in sparc_cpu_register_gdb_regs().
--- configs/targets/sparc64-linux-user.mak | 2 +- configs/targets/sparc64-softmmu.mak | 2 +- target/sparc/gdbstub.c | 193 ++++++++++++++----------- gdb-xml/sparc64-core.xml | 7 - gdb-xml/sparc64-cp0.xml | 16 ++ 5 files changed, 130 insertions(+), 90 deletions(-) create mode 100644 gdb-xml/sparc64-cp0.xml
configs/targets/sparc64-linux-user.mak +1 -1
@@ -4,6 +4,6 @@ TARGET_ABI_DIR=sparc TARGET_SYSTBL_ABI=common,64 TARGET_SYSTBL=syscall.tbl TARGET_BIG_ENDIAN=y -TARGET_XML_FILES=gdb-xml/sparc64-core.xml +TARGET_XML_FILES=gdb-xml/sparc64-core.xml gdb-xml/sparc64-cp0.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
configs/targets/sparc64-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ TARGET_ARCH=sparc64 TARGET_BASE_ARCH=sparc TARGET_BIG_ENDIAN=y -TARGET_XML_FILES=gdb-xml/sparc64-core.xml +TARGET_XML_FILES=gdb-xml/sparc64-core.xml gdb-xml/sparc64-cp0.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
target/sparc/gdbstub.c +112 -81
237 lines not on this page · raw message
gdb-xml/sparc64-core.xml +0 -7
@@ -89,11 +89,4 @@ <reg name="f58" bitsize="64" type="ieee_double" regnum="77"/> <reg name="f60" bitsize="64" type="ieee_double" regnum="78"/> <reg name="f62" bitsize="64" type="ieee_double" regnum="79"/> - - <reg name="pc" bitsize="64" type="code_ptr" regnum="80"/> - <reg name="npc" bitsize="64" type="code_ptr" regnum="81"/> - <reg name="state" bitsize="64" type="uint64" regnum="82"/> - <reg name="fsr" bitsize="64" type="uint64" regnum="83"/> - <reg name="fprs" bitsize="64" type="uint64" regnum="84"/> - <reg name="y" bitsize="64" type="uint64" regnum="85"/> </feature>
gdb-xml/sparc64-cp0.xml new file +16 -0
@@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<!-- Copyright (C) 2013-2026 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. --> + +<!DOCTYPE feature SYSTEM "gdb-target.dtd"> +<feature name="org.gnu.gdb.sparc.cp0"> + <reg name="pc" bitsize="64" type="code_ptr" regnum="80"/> + <reg name="npc" bitsize="64" type="code_ptr" regnum="81"/> + <reg name="state" bitsize="64" type="uint64" regnum="82"/> + <reg name="fsr" bitsize="64" type="uint64" regnum="83"/> + <reg name="fprs" bitsize="64" type="uint64" regnum="84"/> + <reg name="y" bitsize="64" type="uint64" regnum="85"/> +</feature>
Signature · 1 line
2.52.0
Re: [PATCH v2 11/50] target/sparc: Restore 'gdb-xml/sparc64-cp0.xml'
Quoted 14 lines · Philippe Mathieu-Daudé
Restore
gdb-xml/sparc64-cp0.xmlfrom mainstream binutils, tag 'binutils-2_46', found in the gdb/features/sparc/folder [*].Extract
sparc_cp0_gdb_write_register()out ofsparc_cpu_gdb_read_register()andsparc_cp0_gdb_write_register()out ofsparc_cpu_gdb_write_register(), taking care to update the register indexes in the switch cases.Register these helpers with a call to
gdb_register_coprocessor()insparc_cpu_register_gdb_regs().Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 9 lines
--- configs/targets/sparc64-linux-user.mak | 2 +- configs/targets/sparc64-softmmu.mak | 2 +- target/sparc/gdbstub.c | 193 ++++++++++++++----------- gdb-xml/sparc64-core.xml | 7 - gdb-xml/sparc64-cp0.xml | 16 ++ 5 files changed, 130 insertions(+), 90 deletions(-)create mode 100644
gdb-xml/sparc64-cp0.xml
PATCH v2 12/50 target/sparc: Restore 'gdb-xml/sparc64-fpu.xml'
In reply to Philippe Mathieu-DaudéRestore gdb-xml/sparc64-fpu.xml from mainstream binutils, tag 'binutils-2_46', found in the gdb/features/sparc/folder [*].
Extract sparc_fpu_gdb_write_register() out of sparc_cpu_gdb_read_register() and sparc_fpu_gdb_write_register() out of sparc_cpu_gdb_write_register(), taking care to update the register indexes in the switch cases.
Register these helpers with a call to gdb_register_coprocessor() in sparc_cpu_register_gdb_regs().
--- configs/targets/sparc64-linux-user.mak | 2 +- configs/targets/sparc64-softmmu.mak | 2 +- target/sparc/gdbstub.c | 88 +++++++++++++++++--------- gdb-xml/sparc64-core.xml | 50 --------------- gdb-xml/sparc64-fpu.xml | 59 +++++++++++++++++ 5 files changed, 119 insertions(+), 82 deletions(-) create mode 100644 gdb-xml/sparc64-fpu.xml
configs/targets/sparc64-linux-user.mak +1 -1
@@ -4,6 +4,6 @@ TARGET_ABI_DIR=sparc TARGET_SYSTBL_ABI=common,64 TARGET_SYSTBL=syscall.tbl TARGET_BIG_ENDIAN=y -TARGET_XML_FILES=gdb-xml/sparc64-core.xml gdb-xml/sparc64-cp0.xml +TARGET_XML_FILES=gdb-xml/sparc64-core.xml gdb-xml/sparc64-fpu.xml gdb-xml/sparc64-cp0.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
configs/targets/sparc64-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ TARGET_ARCH=sparc64 TARGET_BASE_ARCH=sparc TARGET_BIG_ENDIAN=y -TARGET_XML_FILES=gdb-xml/sparc64-core.xml gdb-xml/sparc64-cp0.xml +TARGET_XML_FILES=gdb-xml/sparc64-core.xml gdb-xml/sparc64-fpu.xml gdb-xml/sparc64-cp0.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
target/sparc/gdbstub.c +58 -30
135 lines not on this page · raw message
gdb-xml/sparc64-core.xml +0 -50
54 lines not on this page · raw message
gdb-xml/sparc64-fpu.xml new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
2.52.0
Re: [PATCH v2 12/50] target/sparc: Restore 'gdb-xml/sparc64-fpu.xml'
Quoted 14 lines · Philippe Mathieu-Daudé
Restore
gdb-xml/sparc64-fpu.xmlfrom mainstream binutils, tag 'binutils-2_46', found in the gdb/features/sparc/folder [*].Extract
sparc_fpu_gdb_write_register()out ofsparc_cpu_gdb_read_register()andsparc_fpu_gdb_write_register()out ofsparc_cpu_gdb_write_register(), taking care to update the register indexes in the switch cases.Register these helpers with a call to
gdb_register_coprocessor()insparc_cpu_register_gdb_regs().Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 9 lines
--- configs/targets/sparc64-linux-user.mak | 2 +- configs/targets/sparc64-softmmu.mak | 2 +- target/sparc/gdbstub.c | 88 +++++++++++++++++--------- gdb-xml/sparc64-core.xml | 50 --------------- gdb-xml/sparc64-fpu.xml | 59 +++++++++++++++++ 5 files changed, 119 insertions(+), 82 deletions(-)create mode 100644
gdb-xml/sparc64-fpu.xml
PATCH v2 13/50 target/sparc: Restore 'gdb-xml/sparc64-cpu.xml'
In reply to Philippe Mathieu-DaudéRestore gdb-xml/sparc64-cpu.xml from mainstream binutils, tag 'binutils-2_46', found in the gdb/features/sparc/folder [*].
---
configs/targets/sparc64-linux-user.mak | 2 +-
configs/targets/sparc64-softmmu.mak | 2 +-
target/sparc/cpu.c | 2 +-
gdb-xml/{sparc64-core.xml => sparc64-cpu.xml} | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
rename gdb-xml/{sparc64-core.xml => sparc64-cpu.xml} (95%)configs/targets/sparc64-linux-user.mak +1 -1
@@ -4,6 +4,6 @@ TARGET_ABI_DIR=sparc TARGET_SYSTBL_ABI=common,64 TARGET_SYSTBL=syscall.tbl TARGET_BIG_ENDIAN=y -TARGET_XML_FILES=gdb-xml/sparc64-core.xml gdb-xml/sparc64-fpu.xml gdb-xml/sparc64-cp0.xml +TARGET_XML_FILES=gdb-xml/sparc64-cpu.xml gdb-xml/sparc64-fpu.xml gdb-xml/sparc64-cp0.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
configs/targets/sparc64-softmmu.mak +1 -1
@@ -1,7 +1,7 @@ TARGET_ARCH=sparc64 TARGET_BASE_ARCH=sparc TARGET_BIG_ENDIAN=y -TARGET_XML_FILES=gdb-xml/sparc64-core.xml gdb-xml/sparc64-fpu.xml gdb-xml/sparc64-cp0.xml +TARGET_XML_FILES=gdb-xml/sparc64-cpu.xml gdb-xml/sparc64-fpu.xml gdb-xml/sparc64-cp0.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
target/sparc/cpu.c +1 -1
@@ -1093,7 +1093,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, const void *data) cc->disas_set_info = cpu_sparc_disas_set_info;#if defined(TARGET_SPARC64 ) && !defined(TARGET_ABI32 ) - cc->gdb_core_xml_file ="sparc64-core.xml" ; + cc->gdb_core_xml_file ="sparc64-cpu.xml" ;#else cc->gdb_num_core_regs =72 ;#endif
gdb-xml/sparc64-cpu.xml renamed from gdb-xml/sparc64-core.xml +2 -2
@@ -1,12 +1,12 @@ <?xml version="1.0"?> -<!-- Copyright (C) 2013-2025 Free Software Foundation, Inc. +<!-- Copyright (C) 2013-2026 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. --> <!DOCTYPE feature SYSTEM "gdb-target.dtd"> -<feature name="org.gnu.gdb.sparc.core"> +<feature name="org.gnu.gdb.sparc.cpu"> <reg name="g0" bitsize="64" type="uint64" regnum="0"/> <reg name="g1" bitsize="64" type="uint64" regnum="1"/> <reg name="g2" bitsize="64" type="uint64" regnum="2"/>
Signature · 1 line
2.52.0
Re: [PATCH v2 13/50] target/sparc: Restore 'gdb-xml/sparc64-cpu.xml'
Quoted 5 lines · Philippe Mathieu-Daudé
Restore
gdb-xml/sparc64-cpu.xmlfrom mainstream binutils, tag 'binutils-2_46', found in the gdb/features/sparc/folder [*].
Quoted 9 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- configs/targets/sparc64-linux-user.mak | 2 +- configs/targets/sparc64-softmmu.mak | 2 +- target/sparc/cpu.c | 2 +- gdb-xml/{sparc64-core.xml => sparc64-cpu.xml} | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-)rename
gdb-xml/{sparc64-core.xml=> sparc64-cpu.xml} (95%)
PATCH v2 14/50 target/sparc: Expose gdbstub registers to sparc32plus target
In reply to Philippe Mathieu-Daudé--- configs/targets/sparc32plus-linux-user.mak | 1 + 1 file changed, 1 insertion(+)
configs/targets/sparc32plus-linux-user.mak +1 -0
@@ -5,5 +5,6 @@ TARGET_ABI_DIR=sparc TARGET_SYSTBL_ABI=common,32 TARGET_SYSTBL=syscall.tbl TARGET_BIG_ENDIAN=y +TARGET_XML_FILES=gdb-xml/sparc64-cpu.xml gdb-xml/sparc64-fpu.xml gdb-xml/sparc64-cp0.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
Signature · 1 line
2.52.0
Re: [PATCH v2 14/50] target/sparc: Expose gdbstub registers to sparc32plus target
Quoted 5 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- configs/targets/sparc32plus-linux-user.mak | 1 + 1 file changed, 1 insertion(+)
PATCH v2 15/50 target/sparc: Expose gdbstub registers to sparc32 targets
In reply to Philippe Mathieu-DaudéImport gdb-xml/sparc32-{cpu,fpu,cp0}.xml from mainstream binutils, tag 'binutils-2_46', found in the gdb/features/sparc/folder [*].
Register them by setting the CPUClass::gdb_core_xml_file field and calling gdb_register_coprocessor() in sparc_cpu_register_gdb_regs().
--- configs/targets/sparc-linux-user.mak | 1 + configs/targets/sparc-softmmu.mak | 1 + target/sparc/cpu.c | 2 +- target/sparc/gdbstub.c | 13 +++++---- gdb-xml/sparc32-cp0.xml | 18 ++++++++++++ gdb-xml/sparc32-cpu.xml | 42 ++++++++++++++++++++++++++++ gdb-xml/sparc32-fpu.xml | 42 ++++++++++++++++++++++++++++ 7 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 gdb-xml/sparc32-cp0.xml create mode 100644 gdb-xml/sparc32-cpu.xml create mode 100644 gdb-xml/sparc32-fpu.xml
configs/targets/sparc-linux-user.mak +1 -0
@@ -2,5 +2,6 @@ TARGET_ARCH=sparc TARGET_SYSTBL_ABI=common,32 TARGET_SYSTBL=syscall.tbl TARGET_BIG_ENDIAN=y +TARGET_XML_FILES=gdb-xml/sparc32-cpu.xml gdb-xml/sparc32-fpu.xml gdb-xml/sparc32-cp0.xml TARGET_LONG_BITS=32 TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
configs/targets/sparc-softmmu.mak +1 -0
@@ -1,5 +1,6 @@ TARGET_ARCH=sparc TARGET_BIG_ENDIAN=y +TARGET_XML_FILES=gdb-xml/sparc32-cpu.xml gdb-xml/sparc32-fpu.xml gdb-xml/sparc32-cp0.xml TARGET_LONG_BITS=32 TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
target/sparc/cpu.c +1 -1
@@ -1095,7 +1095,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, const void *data)#if defined(TARGET_SPARC64 ) && !defined(TARGET_ABI32 ) cc->gdb_core_xml_file ="sparc64-cpu.xml" ;#else - cc->gdb_num_core_regs =72 ; + cc->gdb_core_xml_file ="sparc32-cpu.xml" ;#endif cc->tcg_ops = &sparc_tcg_ops; }
target/sparc/gdbstub.c +8 -5
@@ -43,7 +43,6 @@ int sparc_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)return 0 ; } -__attribute__((unused))static int sparc_fpu_gdb_read_register (CPUState *cs,GByteArray *mem_buf,int n) {CPUSPARCState *env =cpu_env (cs);
@@ -79,7 +78,6 @@ static int sparc_fpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)return 0 ; } -__attribute__((unused))static int sparc_cp0_gdb_read_register (CPUState *cs,GByteArray *mem_buf,int n) {CPUSPARCState *env =cpu_env (cs);
@@ -154,7 +152,6 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)#endif } -__attribute__((unused))static int sparc_fpu_gdb_write_register (CPUState *cs,uint8_t *mem_buf,int n) {CPUSPARCState *env =cpu_env (cs);
@@ -197,7 +194,6 @@ static int sparc_fpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)#endif } -__attribute__((unused))static int sparc_cp0_gdb_write_register (CPUState *cs,uint8_t *mem_buf,int n) {CPUSPARCState *env =cpu_env (cs);
@@ -271,7 +267,14 @@ static int sparc_cp0_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)void sparc_cpu_register_gdb_regs (CPUState *cs) {#if defined(TARGET_ABI32 ) || !defined(TARGET_SPARC64 ) -/* Not yet supported */ +gdb_register_coprocessor (cs, sparc_fpu_gdb_read_register, + sparc_fpu_gdb_write_register, +gdb_find_static_feature ("sparc32-fpu.xml" ), +0 ); +gdb_register_coprocessor (cs, sparc_cp0_gdb_read_register, + sparc_cp0_gdb_write_register, +gdb_find_static_feature ("sparc32-cp0.xml" ), +0 );#else gdb_register_coprocessor(cs, sparc_fpu_gdb_read_register, sparc_fpu_gdb_write_register,
gdb-xml/sparc32-cp0.xml new file +18 -0
@@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- Copyright (C) 2013-2026 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. --> + +<!DOCTYPE feature SYSTEM "gdb-target.dtd"> +<feature name="org.gnu.gdb.sparc.cp0"> + <reg name="y" bitsize="32" type="uint32" regnum="64"/> + <reg name="psr" bitsize="32" type="uint32" regnum="65"/> + <reg name="wim" bitsize="32" type="uint32" regnum="66"/> + <reg name="tbr" bitsize="32" type="uint32" regnum="67"/> + <reg name="pc" bitsize="32" type="code_ptr" regnum="68"/> + <reg name="npc" bitsize="32" type="code_ptr" regnum="69"/> + <reg name="fsr" bitsize="32" type="uint32" regnum="70"/> + <reg name="csr" bitsize="32" type="uint32" regnum="71"/> +</feature>
gdb-xml/sparc32-cpu.xml new file +42 -0
42 lines not on this page · raw message
gdb-xml/sparc32-fpu.xml new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
2.52.0
Re: [PATCH v2 15/50] target/sparc: Expose gdbstub registers to sparc32 targets
Quoted 18 lines · Philippe Mathieu-Daudé
Import
gdb-xml/sparc32-{cpu,fpu,cp0}.xmlfrom mainstream binutils, tag 'binutils-2_46', found in the gdb/features/sparc/folder [*].Register them by setting the
CPUClass::gdb_core_xml_filefield and callinggdb_register_coprocessor()insparc_cpu_register_gdb_regs().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- configs/targets/sparc-linux-user.mak | 1 + configs/targets/sparc-softmmu.mak | 1 + target/sparc/cpu.c | 2 +- target/sparc/gdbstub.c | 13 +++++---- gdb-xml/sparc32-cp0.xml | 18 ++++++++++++ gdb-xml/sparc32-cpu.xml | 42 ++++++++++++++++++++++++++++ gdb-xml/sparc32-fpu.xml | 42 ++++++++++++++++++++++++++++ 7 files changed, 113 insertions(+), 6 deletions(-)
Quoted 4 lines
create mode 100644
gdb-xml/sparc32-cp0.xml
create mode 100644gdb-xml/sparc32-cpu.xml
create mode 100644gdb-xml/sparc32-fpu.xml
PATCH v2 16/50 monitor/hmp: Handle gdb-xml exposed registers via gdb_get_register()
In reply to Philippe Mathieu-DaudéImplement the gdb_get_register() helper and call it before the regular get_monitor_def() one. Registers is exposed via the GDB XML files will be directly handled, possibily allowing new registers added to XML files to be automatically accessible in QEMU monitor. All targets having GDB XML files can now be used within the monitor.
For example with Loongarch, before:
$ qemu-system-loongarch64 -M virt -S -monitor stdio QEMU 10.2.0 monitor - type 'help' for more information
(qemu) info registers
CPU#0
PC=000000001c000000 FCSR0 0x00000000
...
(qemu) p/x $pc
unknown register
Try "help p" for more information
(qemu)
and after:
$ ./qemu-system-loongarch64 -M virt -S -monitor stdio QEMU 10.2.50 monitor - type 'help' for more information (qemu) p/x $pc 0x1c000000 (qemu)
Similarly RISC-V:
QEMU 10.2.0 monitor - type 'help' for more information (qemu) p/x $pc
unknown register
Try "help p" for more information
VS
QEMU 10.2.50 monitor - type 'help' for more information (qemu) p/x $pc
0x1000
(qemu)
---
TODO (Dave on v1):
add more checks on the return size of gdb_read_register(..) just in case any arch is a bit screwy (e.g. if they're 0 for example?)
--- monitor/hmp.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-)
monitor/hmp.c +46 -3
@@ -27,14 +27,18 @@#include "hw/core/qdev.h" #include "monitor-internal.h" #include "monitor/hmp.h" +#include "monitor/hmp-target.h" #include "qobject/qdict.h" #include "qobject/qnum.h" +#include "qemu/bswap.h" #include "qemu/config-file.h" #include "qemu/ctype.h" #include "qemu/cutils.h" #include "qemu/log.h" #include "qemu/option.h" +#include "qemu/target-info.h" #include "qemu/units.h" +#include "exec/gdbstub.h" #include "system/block-backend.h" #include "trace.h"
@@ -306,6 +310,46 @@ void hmp_help_cmd(Monitor *mon, const char *name)free_cmdline_args (args, nb_args); } +/* +* Set @pval to the value in the register identified by @name. +* return %true if the register is found, %false otherwise. +*/ +static bool gdb_get_register (Monitor *mon,int64_t *pval,const char *name) +{ +g_autoptr (GArray) regs =NULL ; +CPUState *cs =mon_get_cpu (mon); + +if (cs ==NULL ) { +return false; + } + + regs =gdb_get_register_list (cs); + +for (int i =0 ; i < regs->len; i++) { +GDBRegDesc *reg = &g_array_index (regs, GDBRegDesc, i); +g_autoptr (GByteArray) buf =NULL ; +int reg_size; + +if (!reg->name ||g_strcmp0 (name, reg->name)) { +continue ; + } + + buf =g_byte_array_new (); + reg_size =gdb_read_register (cs, buf, reg->gdb_reg); +if (reg_size >sizeof (*pval)) { +return false; + } + +if (target_big_endian ()) { + *pval =ldn_be_p (buf->data, reg_size); + }else { + *pval =ldn_le_p (buf->data, reg_size); + } +return true; + } +return false; +} +/*******************************************************************/ static const char *pch;
@@ -338,7 +382,6 @@ static int64_t expr_unary(Monitor *mon) {int64_t n;char *p; -int ret;switch (*pch) {case '+' :
@@ -393,8 +436,8 @@ static int64_t expr_unary(Monitor *mon) pch++; } *q =0 ; - ret =get_monitor_def (mon, ®, buf); -if (ret <0 ) { +if (!gdb_get_register (mon, ®, buf) + &&get_monitor_def (mon, ®, buf) <0 ) {expr_error (mon,"unknown register" ); } n = reg;
Signature · 1 line
2.52.0
PATCH v2 17/50 target/sparc: Remove MonitorDef register entries available via gdbstub
In reply to Philippe Mathieu-DaudéAll these registers are already provided by via gdbstub parsed XML and handler by the gdb_get_register() helper in the monitor/hmp.c file. Remove as now unreachable code.
--- target/sparc/monitor.c | 107 ----------------------------------------- 1 file changed, 107 deletions(-)
target/sparc/monitor.c +0 -107
@@ -39,114 +39,8 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)dump_mmu (env1); } -#ifndef TARGET_SPARC64 -static target_long monitor_get_psr (Monitor *mon,const struct MonitorDef *md, -int val) -{ -CPUArchState *env =mon_get_cpu_env (mon); - -return cpu_get_psr (env); -} -#endif - -static target_long monitor_get_reg (Monitor *mon,const struct MonitorDef *md, -int val) -{ -CPUArchState *env =mon_get_cpu_env (mon); -return env->regwptr[val]; -} - const MonitorDef monitor_defs[] = { - { "g0", offsetof(CPUSPARCState, gregs[0]) }, - { "g1", offsetof(CPUSPARCState, gregs[1]) }, - { "g2", offsetof(CPUSPARCState, gregs[2]) }, - { "g3", offsetof(CPUSPARCState, gregs[3]) }, - { "g4", offsetof(CPUSPARCState, gregs[4]) }, - { "g5", offsetof(CPUSPARCState, gregs[5]) }, - { "g6", offsetof(CPUSPARCState, gregs[6]) }, - { "g7", offsetof(CPUSPARCState, gregs[7]) }, - {"o0" ,0 , monitor_get_reg }, - {"o1" ,1 , monitor_get_reg }, - {"o2" ,2 , monitor_get_reg }, - {"o3" ,3 , monitor_get_reg }, - {"o4" ,4 , monitor_get_reg }, - {"o5" ,5 , monitor_get_reg }, - {"o6" ,6 , monitor_get_reg }, - {"o7" ,7 , monitor_get_reg }, - {"l0" ,8 , monitor_get_reg }, - {"l1" ,9 , monitor_get_reg }, - {"l2" ,10 , monitor_get_reg }, - {"l3" ,11 , monitor_get_reg }, - {"l4" ,12 , monitor_get_reg }, - {"l5" ,13 , monitor_get_reg }, - {"l6" ,14 , monitor_get_reg }, - {"l7" ,15 , monitor_get_reg }, - {"i0" ,16 , monitor_get_reg }, - {"i1" ,17 , monitor_get_reg }, - {"i2" ,18 , monitor_get_reg }, - {"i3" ,19 , monitor_get_reg }, - {"i4" ,20 , monitor_get_reg }, - {"i5" ,21 , monitor_get_reg }, - {"i6" ,22 , monitor_get_reg }, - {"i7" ,23 , monitor_get_reg }, - {"pc" , offsetof(CPUSPARCState , pc) }, - {"npc" , offsetof(CPUSPARCState , npc) }, - {"y" , offsetof(CPUSPARCState , y) }, -#ifndef TARGET_SPARC64 - {"psr" ,0 , &monitor_get_psr, }, - {"wim" , offsetof(CPUSPARCState , wim) }, -#endif - {"tbr" , offsetof(CPUSPARCState , tbr) }, - {"fsr" , offsetof(CPUSPARCState , fsr) }, - { "f0", offsetof(CPUSPARCState, fpr[0].l.upper) }, - { "f1", offsetof(CPUSPARCState, fpr[0].l.lower) }, - { "f2", offsetof(CPUSPARCState, fpr[1].l.upper) }, - { "f3", offsetof(CPUSPARCState, fpr[1].l.lower) }, - { "f4", offsetof(CPUSPARCState, fpr[2].l.upper) }, - { "f5", offsetof(CPUSPARCState, fpr[2].l.lower) }, - { "f6", offsetof(CPUSPARCState, fpr[3].l.upper) }, - { "f7", offsetof(CPUSPARCState, fpr[3].l.lower) }, - { "f8", offsetof(CPUSPARCState, fpr[4].l.upper) }, - { "f9", offsetof(CPUSPARCState, fpr[4].l.lower) }, - { "f10", offsetof(CPUSPARCState, fpr[5].l.upper) }, - { "f11", offsetof(CPUSPARCState, fpr[5].l.lower) }, - { "f12", offsetof(CPUSPARCState, fpr[6].l.upper) }, - { "f13", offsetof(CPUSPARCState, fpr[6].l.lower) }, - { "f14", offsetof(CPUSPARCState, fpr[7].l.upper) }, - { "f15", offsetof(CPUSPARCState, fpr[7].l.lower) }, - { "f16", offsetof(CPUSPARCState, fpr[8].l.upper) }, - { "f17", offsetof(CPUSPARCState, fpr[8].l.lower) }, - { "f18", offsetof(CPUSPARCState, fpr[9].l.upper) }, - { "f19", offsetof(CPUSPARCState, fpr[9].l.lower) }, - { "f20", offsetof(CPUSPARCState, fpr[10].l.upper) }, - { "f21", offsetof(CPUSPARCState, fpr[10].l.lower) }, - { "f22", offsetof(CPUSPARCState, fpr[11].l.upper) }, - { "f23", offsetof(CPUSPARCState, fpr[11].l.lower) }, - { "f24", offsetof(CPUSPARCState, fpr[12].l.upper) }, - { "f25", offsetof(CPUSPARCState, fpr[12].l.lower) }, - { "f26", offsetof(CPUSPARCState, fpr[13].l.upper) }, - { "f27", offsetof(CPUSPARCState, fpr[13].l.lower) }, - { "f28", offsetof(CPUSPARCState, fpr[14].l.upper) }, - { "f29", offsetof(CPUSPARCState, fpr[14].l.lower) }, - { "f30", offsetof(CPUSPARCState, fpr[15].l.upper) }, - { "f31", offsetof(CPUSPARCState, fpr[15].l.lower) },#ifdef TARGET_SPARC64 - { "f32", offsetof(CPUSPARCState, fpr[16]) }, - { "f34", offsetof(CPUSPARCState, fpr[17]) }, - { "f36", offsetof(CPUSPARCState, fpr[18]) }, - { "f38", offsetof(CPUSPARCState, fpr[19]) }, - { "f40", offsetof(CPUSPARCState, fpr[20]) }, - { "f42", offsetof(CPUSPARCState, fpr[21]) }, - { "f44", offsetof(CPUSPARCState, fpr[22]) }, - { "f46", offsetof(CPUSPARCState, fpr[23]) }, - { "f48", offsetof(CPUSPARCState, fpr[24]) }, - { "f50", offsetof(CPUSPARCState, fpr[25]) }, - { "f52", offsetof(CPUSPARCState, fpr[26]) }, - { "f54", offsetof(CPUSPARCState, fpr[27]) }, - { "f56", offsetof(CPUSPARCState, fpr[28]) }, - { "f58", offsetof(CPUSPARCState, fpr[29]) }, - { "f60", offsetof(CPUSPARCState, fpr[30]) }, - { "f62", offsetof(CPUSPARCState, fpr[31]) }, { "asi", offsetof(CPUSPARCState, asi) }, { "pstate", offsetof(CPUSPARCState, pstate) }, { "cansave", offsetof(CPUSPARCState, cansave) },
@@ -154,7 +48,6 @@ const MonitorDef monitor_defs[] = { { "otherwin", offsetof(CPUSPARCState, otherwin) }, { "wstate", offsetof(CPUSPARCState, wstate) }, { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, - { "fprs", offsetof(CPUSPARCState, fprs), NULL, MD_I32 }, #endif { NULL }, };
Signature · 1 line
2.52.0
Re: [PATCH v2 17/50] target/sparc: Remove MonitorDef register entries available via gdbstub
Quoted 9 lines · Philippe Mathieu-Daudé
All these registers are already provided by via gdbstub parsed XML and handler by the
gdb_get_register()helper in themonitor/hmp.cfile. Remove as now unreachable code.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/sparc/monitor.c | 107 ----------------------------------------- 1 file changed, 107 deletions(-)
PATCH v2 18/50 target/i386: Remove MonitorDef register entries available via gdbstub
In reply to Philippe Mathieu-DaudéAll these registers are already provided by via gdbstub parsed XML and handler by the gdb_get_register() helper in the monitor/hmp.c file. Remove as now unreachable code.
--- target/i386/monitor.c | 39 --------------------------------------- 1 file changed, 39 deletions(-)
target/i386/monitor.c +0 -39
@@ -602,46 +602,7 @@ static target_long monitor_get_pc(Monitor *mon, const struct MonitorDef *md,const MonitorDef monitor_defs[] = { #define SEG(name, seg) \ - { name, offsetof(CPUX86State, segs[seg].selector), NULL, MD_I32 },\ - { name ".base", offsetof(CPUX86State, segs[seg].base) },\ { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_I32 }, - - { "eax", offsetof(CPUX86State, regs[0]) }, - { "ecx", offsetof(CPUX86State, regs[1]) }, - { "edx", offsetof(CPUX86State, regs[2]) }, - { "ebx", offsetof(CPUX86State, regs[3]) }, - { "esp|sp", offsetof(CPUX86State, regs[4]) }, - { "ebp|fp", offsetof(CPUX86State, regs[5]) }, - { "esi", offsetof(CPUX86State, regs[6]) }, - { "edi", offsetof(CPUX86State, regs[7]) }, -#ifdef TARGET_X86_64 - { "r8", offsetof(CPUX86State, regs[8]) }, - { "r9", offsetof(CPUX86State, regs[9]) }, - { "r10", offsetof(CPUX86State, regs[10]) }, - { "r11", offsetof(CPUX86State, regs[11]) }, - { "r12", offsetof(CPUX86State, regs[12]) }, - { "r13", offsetof(CPUX86State, regs[13]) }, - { "r14", offsetof(CPUX86State, regs[14]) }, - { "r15", offsetof(CPUX86State, regs[15]) }, - { "r16", offsetof(CPUX86State, regs[16]) }, - { "r17", offsetof(CPUX86State, regs[17]) }, - { "r18", offsetof(CPUX86State, regs[18]) }, - { "r19", offsetof(CPUX86State, regs[19]) }, - { "r20", offsetof(CPUX86State, regs[20]) }, - { "r21", offsetof(CPUX86State, regs[21]) }, - { "r22", offsetof(CPUX86State, regs[22]) }, - { "r23", offsetof(CPUX86State, regs[23]) }, - { "r24", offsetof(CPUX86State, regs[24]) }, - { "r25", offsetof(CPUX86State, regs[25]) }, - { "r26", offsetof(CPUX86State, regs[26]) }, - { "r27", offsetof(CPUX86State, regs[27]) }, - { "r28", offsetof(CPUX86State, regs[28]) }, - { "r29", offsetof(CPUX86State, regs[29]) }, - { "r30", offsetof(CPUX86State, regs[30]) }, - { "r31", offsetof(CPUX86State, regs[31]) }, -#endif - {"eflags" , offsetof(CPUX86State , eflags) }, - {"eip" , offsetof(CPUX86State , eip) }, SEG("cs", R_CS) SEG("ds", R_DS)SEG ("es" ,R_ES )
Signature · 1 line
2.52.0
Re: [PATCH v2 18/50] target/i386: Remove MonitorDef register entries available via gdbstub
Quoted 9 lines · Philippe Mathieu-Daudé
All these registers are already provided by via gdbstub parsed XML and handler by the
gdb_get_register()helper in themonitor/hmp.cfile. Remove as now unreachable code.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/i386/monitor.c | 39 --------------------------------------- 1 file changed, 39 deletions(-)
PATCH v2 19/50 target/m68k: Remove MonitorDef register entries available via gdbstub
In reply to Philippe Mathieu-DaudéAll these registers are already provided by via gdbstub parsed XML and handler by the gdb_get_register() helper in the monitor/hmp.c file. Remove as now unreachable code.
--- target/m68k/monitor.c | 18 ------------------ 1 file changed, 18 deletions(-)
target/m68k/monitor.c +0 -18
@@ -24,24 +24,6 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict) }static const MonitorDef monitor_defs[] = { - { "d0", offsetof(CPUM68KState, dregs[0]), NULL, MD_I32 }, - { "d1", offsetof(CPUM68KState, dregs[1]), NULL, MD_I32 }, - { "d2", offsetof(CPUM68KState, dregs[2]), NULL, MD_I32 }, - { "d3", offsetof(CPUM68KState, dregs[3]), NULL, MD_I32 }, - { "d4", offsetof(CPUM68KState, dregs[4]), NULL, MD_I32 }, - { "d5", offsetof(CPUM68KState, dregs[5]), NULL, MD_I32 }, - { "d6", offsetof(CPUM68KState, dregs[6]), NULL, MD_I32 }, - { "d7", offsetof(CPUM68KState, dregs[7]), NULL, MD_I32 }, - { "a0", offsetof(CPUM68KState, aregs[0]), NULL, MD_I32 }, - { "a1", offsetof(CPUM68KState, aregs[1]), NULL, MD_I32 }, - { "a2", offsetof(CPUM68KState, aregs[2]), NULL, MD_I32 }, - { "a3", offsetof(CPUM68KState, aregs[3]), NULL, MD_I32 }, - { "a4", offsetof(CPUM68KState, aregs[4]), NULL, MD_I32 }, - { "a5", offsetof(CPUM68KState, aregs[5]), NULL, MD_I32 }, - { "a6", offsetof(CPUM68KState, aregs[6]), NULL, MD_I32 }, - { "a7", offsetof(CPUM68KState, aregs[7]), NULL, MD_I32 }, - {"pc" , offsetof(CPUM68KState , pc),NULL ,MD_I32 }, - {"sr" , offsetof(CPUM68KState , sr),NULL ,MD_I32 }, { "ssp", offsetof(CPUM68KState, sp[0]), NULL, MD_I32 }, { "usp", offsetof(CPUM68KState, sp[1]), NULL, MD_I32 }, { "isp", offsetof(CPUM68KState, sp[2]), NULL, MD_I32 },
Signature · 1 line
2.52.0
Re: [PATCH v2 19/50] target/m68k: Remove MonitorDef register entries available via gdbstub
Quoted 9 lines · Philippe Mathieu-Daudé
All these registers are already provided by via gdbstub parsed XML and handler by the
gdb_get_register()helper in themonitor/hmp.cfile. Remove as now unreachable code.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/m68k/monitor.c | 18 ------------------ 1 file changed, 18 deletions(-)
PATCH v2 20/50 target/ppc: Remove MonitorDef register entries available via gdbstub
In reply to Philippe Mathieu-DaudéAll these registers are already provided by via gdbstub parsed XML and handler by the gdb_get_register() helper in the monitor/hmp.c file. Remove as now unreachable code.
--- target/ppc/ppc-qmp-cmds.c | 132 -------------------------------------- 1 file changed, 132 deletions(-)
target/ppc/ppc-qmp-cmds.c +0 -132
@@ -33,54 +33,6 @@#include "cpu-models.h" #include "cpu-qom.h" -static target_long monitor_get_ccr (Monitor *mon,const struct MonitorDef *md, -int val) -{ -CPUArchState *env =mon_get_cpu_env (mon); -unsigned int u; - - u =ppc_get_cr (env); - -return u; -} - -static target_long monitor_get_xer (Monitor *mon,const struct MonitorDef *md, -int val) -{ -CPUArchState *env =mon_get_cpu_env (mon); -return cpu_read_xer (env); -} - -static target_long monitor_get_decr (Monitor *mon,const struct MonitorDef *md, -int val) -{ -CPUArchState *env =mon_get_cpu_env (mon); -if (!env->tb_env) { -return 0 ; - } -return cpu_ppc_load_decr (env); -} - -static target_long monitor_get_tbu (Monitor *mon,const struct MonitorDef *md, -int val) -{ -CPUArchState *env =mon_get_cpu_env (mon); -if (!env->tb_env) { -return 0 ; - } -return cpu_ppc_load_tbu (env); -} - -static target_long monitor_get_tbl (Monitor *mon,const struct MonitorDef *md, -int val) -{ -CPUArchState *env =mon_get_cpu_env (mon); -if (!env->tb_env) { -return 0 ; - } -return cpu_ppc_load_tbl (env); -} -void hmp_info_tlb (Monitor *mon,const QDict *qdict) {CPUArchState *env1 =mon_get_cpu_env (mon);
@@ -92,90 +44,6 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)dump_mmu (env1); } -const MonitorDef monitor_defs[] = { - {"fpscr" , offsetof(CPUPPCState , fpscr) }, -/* Next instruction pointer */ - {"nip|pc" , offsetof(CPUPPCState , nip) }, - {"lr" , offsetof(CPUPPCState , lr) }, - {"ctr" , offsetof(CPUPPCState , ctr) }, - {"decr" ,0 , &monitor_get_decr, }, - {"ccr|cr" ,0 , &monitor_get_ccr, }, -/* Machine state register */ - {"xer" ,0 , &monitor_get_xer }, - {"msr" , offsetof(CPUPPCState , msr) }, - {"tbu" ,0 , &monitor_get_tbu, }, -#if defined(TARGET_PPC64) - {"tb" ,0 , &monitor_get_tbl, }, -#else - {"tbl" ,0 , &monitor_get_tbl, }, -#endif - {NULL }, -}; - -const MonitorDef *target_monitor_defs (void ) -{ -return monitor_defs; -} - -static int ppc_cpu_get_reg_num (const char *numstr,int maxnum,int *pregnum) -{ -int regnum; -char *endptr =NULL ; - -if (!*numstr) { -return false; - } - - regnum =strtoul (numstr, &endptr,10 ); -if (*endptr || (regnum >= maxnum)) { -return false; - } - *pregnum = regnum; - -return true; -} - -int target_get_monitor_def (CPUState *cs,const char *name,uint64_t *pval) -{ -int i, regnum; -CPUPPCState *env =cpu_env (cs); - -/* General purpose registers */ -if ((qemu_tolower (name[0 ]) =='r' ) && -ppc_cpu_get_reg_num (name +1 ,ARRAY_SIZE (env->gpr), ®num)) { - *pval = env->gpr[regnum]; -return 0 ; - } - -/* Floating point registers */ -if ((qemu_tolower (name[0 ]) =='f' ) && -ppc_cpu_get_reg_num (name +1 ,32 , ®num)) { - *pval = *cpu_fpr_ptr (env, regnum); -return 0 ; - } - -/* Special purpose registers */ -for (i =0 ; i <ARRAY_SIZE (env->spr_cb); ++i) { -ppc_spr_t *spr = &env->spr_cb[i]; - -if (spr->name && (strcasecmp (name, spr->name) ==0 )) { - *pval = env->spr[i]; -return 0 ; - } - } - -/* Segment registers */ -#if !defined(CONFIG_USER_ONLY ) -if ((strncasecmp (name,"sr" ,2 ) ==0 ) && -ppc_cpu_get_reg_num (name +2 ,ARRAY_SIZE (env->sr), ®num)) { - *pval = env->sr[regnum]; -return 0 ; - } -#endif - -return -EINVAL ; -} -CpuModelExpansionInfo * qmp_query_cpu_model_expansion(CpuModelExpansionType type, CpuModelInfo *model,
Signature · 1 line
2.52.0
Re: [PATCH v2 20/50] target/ppc: Remove MonitorDef register entries available via gdbstub
Quoted 9 lines · Philippe Mathieu-Daudé
All these registers are already provided by via gdbstub parsed XML and handler by the
gdb_get_register()helper in themonitor/hmp.cfile. Remove as now unreachable code.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/ppc/ppc-qmp-cmds.c | 132 -------------------------------------- 1 file changed, 132 deletions(-)
PATCH v2 21/50 target/ppc: Extract monitor-related code to monitor.c
In reply to Philippe Mathieu-DaudéKeep ppc-qmp-cmds.c for QMP, use monitor.c for HMP.
--- target/ppc/monitor.c | 41 +++++++++++++++++++++++++++++++++++++++ target/ppc/ppc-qmp-cmds.c | 16 +-------------- target/ppc/meson.build | 1 + 3 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 target/ppc/monitor.c
target/ppc/monitor.c new file +41 -0
@@ -0,0 +1,41 @@ +/* +* QEMU PPC (monitor definitions) +* +* Copyright (c) 2003-2004 Fabrice Bellard +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + +#include "qemu/osdep.h" +#include "qemu/ctype.h" +#include "monitor/monitor.h" +#include "monitor/hmp-target.h" +#include "monitor/hmp.h" +#include "cpu.h" + +void hmp_info_tlb (Monitor *mon,const QDict *qdict) +{ +CPUArchState *env1 =mon_get_cpu_env (mon); + +if (!env1) { +monitor_printf (mon,"No CPU available\n" ); +return ; + } +dump_mmu (env1); +}
target/ppc/ppc-qmp-cmds.c +1 -15
@@ -1,5 +1,5 @@/* -* QEMU PPC (monitor definitions) +* QEMU PPC (QMP definitions) * * Copyright (c) 2003-2004 Fabrice Bellard *
@@ -24,26 +24,12 @@#include "qemu/osdep.h" #include "cpu.h" -#include "monitor/monitor.h" #include "qemu/ctype.h" -#include "monitor/hmp-target.h" -#include "monitor/hmp.h" #include "qapi/error.h" #include "qapi/qapi-commands-machine.h" #include "cpu-models.h" #include "cpu-qom.h" -void hmp_info_tlb (Monitor *mon,const QDict *qdict) -{ -CPUArchState *env1 =mon_get_cpu_env (mon); - -if (!env1) { -monitor_printf (mon,"No CPU available\n" ); -return ; - } -dump_mmu (env1); -} -CpuModelExpansionInfo * qmp_query_cpu_model_expansion(CpuModelExpansionType type, CpuModelInfo *model,
target/ppc/meson.build +1 -0
@@ -43,6 +43,7 @@ ppc_system_ss.add(files( 'mmu-hash32.c', 'mmu-booke.c', 'mmu_common.c', + 'monitor.c', 'ppc-qmp-cmds.c', )) ppc_system_ss.add(when: 'CONFIG_TCG', if_true: files(
Signature · 1 line
2.52.0
Re: [PATCH v2 21/50] target/ppc: Extract monitor-related code to monitor.c
Quoted 10 lines · Philippe Mathieu-Daudé
Keep
ppc-qmp-cmds.cfor QMP, usemonitor.cfor HMP.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/ppc/monitor.c | 41 +++++++++++++++++++++++++++++++++++++++ target/ppc/ppc-qmp-cmds.c | 16 +-------------- target/ppc/meson.build | 1 + 3 files changed, 43 insertions(+), 15 deletions(-)create mode 100644
target/ppc/monitor.c
PATCH v2 22/50 target/or1k: Use XML register definitions from GDB
In reply to Philippe Mathieu-DaudéImport gdb-xml/or1k-fpu.xml from mainstream binutils, tag 'binutils-2_46' [*]. Register as CPUClass::gdb_core_xml_file.
--- configs/targets/or1k-linux-user.mak | 1 + configs/targets/or1k-softmmu.mak | 1 + target/or1k/cpu.c | 2 +- gdb-xml/or1k-core.xml | 65 +++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 gdb-xml/or1k-core.xml
configs/targets/or1k-linux-user.mak +1 -0
@@ -2,5 +2,6 @@ TARGET_ARCH=or1k TARGET_BIG_ENDIAN=y TARGET_SYSTBL_ABI=common,32,or1k,time32,stat64,rlimit,renameat TARGET_SYSTBL=syscall.tbl +TARGET_XML_FILES= gdb-xml/or1k-core.xml TARGET_LONG_BITS=32 TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
configs/targets/or1k-softmmu.mak +1 -0
@@ -2,6 +2,7 @@ TARGET_ARCH=or1k TARGET_BIG_ENDIAN=y # needed by boot.c and all boards TARGET_NEED_FDT=y +TARGET_XML_FILES= gdb-xml/or1k-core.xml TARGET_LONG_BITS=32 TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
target/or1k/cpu.c +1 -1
@@ -288,13 +288,13 @@ static void openrisc_cpu_class_init(ObjectClass *oc, const void *data) cc->dump_state = openrisc_cpu_dump_state; cc->set_pc = openrisc_cpu_set_pc; cc->get_pc = openrisc_cpu_get_pc; + cc->gdb_core_xml_file ="or1k-core.xml" ; cc->gdb_read_register = openrisc_cpu_gdb_read_register; cc->gdb_write_register = openrisc_cpu_gdb_write_register;#ifndef CONFIG_USER_ONLY dc->vmsd = &vmstate_openrisc_cpu; cc->sysemu_ops = &openrisc_sysemu_ops;#endif - cc->gdb_num_core_regs =32 +3 ; cc->disas_set_info = openrisc_disas_set_info; cc->tcg_ops = &openrisc_tcg_ops; }
gdb-xml/or1k-core.xml new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
2.52.0
Re: [PATCH v2 22/50] target/or1k: Use XML register definitions from GDB
Quoted 5 lines · Philippe Mathieu-Daudé
Import
gdb-xml/or1k-fpu.xmlfrom mainstream binutils, tag 'binutils-2_46' [*]. Register asCPUClass::gdb_core_xml_file.
Quoted 9 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- configs/targets/or1k-linux-user.mak | 1 + configs/targets/or1k-softmmu.mak | 1 + target/or1k/cpu.c | 2 +- gdb-xml/or1k-core.xml | 65 +++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-)create mode 100644
gdb-xml/or1k-core.xml
PATCH v2 23/50 target/riscv: Remove empty target_monitor_defs() symbol
In reply to Philippe Mathieu-DaudéPrefer the stub target_monitor_defs() symbol introduced in commit bf957284006 ("monitor: remove target-specific code from monitor.c").
--- target/riscv/monitor.c | 13 ------------- 1 file changed, 13 deletions(-)
target/riscv/monitor.c +0 -13
@@ -244,19 +244,6 @@ void hmp_info_mem(Monitor *mon, const QDict *qdict)mem_info_svxx (mon, env); } -/* -* We have way too many potential CSRs and regs being added -* regularly to register them in a static array. -* -* Declare an empty array instead, making get_monitor_def() use -* the target_get_monitor_def() API directly. -*/ -const MonitorDef monitor_defs[] = { { } }; -const MonitorDef *target_monitor_defs (void ) -{ -return monitor_defs; -} -static bool reg_is_ulong_integer (CPURISCVState *env,const char *name,target_ulong *val,bool is_gprh) {
Signature · 1 line
2.52.0
Re: [PATCH v2 23/50] target/riscv: Remove empty target_monitor_defs() symbol
Quoted 8 lines · Philippe Mathieu-Daudé
Prefer the stub
target_monitor_defs()symbol introduced in commitbf957284006("monitor: remove target-specific code frommonitor.c").Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/riscv/monitor.c | 13 ------------- 1 file changed, 13 deletions(-)
Re: [PATCH v2 23/50] target/riscv: Remove empty target_monitor_defs() symbol
In reply to Philippe Mathieu-DaudéQuoted 5 lines · Philippe Mathieu-Daudé
Prefer the stub
target_monitor_defs()symbol introduced in commitbf957284006("monitor: remove target-specific code frommonitor.c").Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Quoted 27 lines
target/riscv/monitor.c | 13 ------------- 1 file changed, 13 deletions(-)target/riscv/monitor.c +0
-13@@ -244,19 +244,6 @@ void hmp_info_mem(Monitor *mon, const QDict *qdict)mem_info_svxx (mon, env); } -/* -* We have way too many potential CSRs and regs being added -* regularly to register them in a static array. -* -* Declare an empty array instead, making get_monitor_def() use -* the target_get_monitor_def() API directly. -*/ -const MonitorDef monitor_defs[] = { { } }; -const MonitorDef *target_monitor_defs (void ) -{ -return monitor_defs; -} -static bool reg_is_ulong_integer (CPURISCVState *env,const char *name,target_ulong *val,bool is_gprh) {
Re: [PATCH v2 23/50] target/riscv: Remove empty target_monitor_defs() symbol
In reply to Philippe Mathieu-DaudéQuoted 36 lines · Philippe Mathieu-Daudé
Prefer the stub
target_monitor_defs()symbol introduced in commitbf957284006("monitor: remove target-specific code frommonitor.c").Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/riscv/monitor.c | 13 ------------- 1 file changed, 13 deletions(-)target/riscv/monitor.c +0
-13@@ -244,19 +244,6 @@ void hmp_info_mem(Monitor *mon, const QDict *qdict)mem_info_svxx (mon, env); } -/* -* We have way too many potential CSRs and regs being added -* regularly to register them in a static array. -* -* Declare an empty array instead, making get_monitor_def() use -* the target_get_monitor_def() API directly. -*/ -const MonitorDef monitor_defs[] = { { } }; -const MonitorDef *target_monitor_defs (void ) -{ -return monitor_defs; -} -static bool reg_is_ulong_integer (CPURISCVState *env,const char *name,target_ulong *val,bool is_gprh) {Signature · 1 line
2.52.0
Thanks,
Chao
PATCH v2 24/50 target/sparc: Factor sparc_cpu_gdb_write_register() out
In reply to Philippe Mathieu-DaudéFactor sparc_cpu_gdb_write_register() out.
Prefer ldn_p(target_long_bits/8) over target-specific ldtul_p().
--- target/sparc/gdbstub.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
target/sparc/gdbstub.c +13 -14
@@ -124,19 +124,22 @@ static int sparc_cp0_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)return 0 ; } +static unsigned sparc_gdb_register_bytes (void ) +{ +#ifdef CONFIG_USER_ONLY +# if defined(TARGET_ABI32 ) +return 4 ; +# endif +#endif +return target_long_bits () /8 ; +} +int sparc_cpu_gdb_write_register (CPUState *cs,uint8_t *mem_buf,int n) {SPARCCPU *cpu =SPARC_CPU (cs);CPUSPARCState *env = &cpu->env; -#if defined(TARGET_ABI32 ) -uint32_t tmp; - - tmp =ldl_p (mem_buf); -#else -target_ulong tmp; - - tmp =ldtul_p (mem_buf); -#endif +const unsigned regsz =sparc_gdb_register_bytes (); +uint64_t tmp =ldn_p (mem_buf, regsz);if (n <8 ) {/* g0..g7 */
@@ -145,11 +148,7 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)/* register window */ env->regwptr[n -8 ] = tmp; } -#if defined(TARGET_ABI32 ) || !defined(TARGET_SPARC64 ) -return 4 ; -#else -return 8 ; -#endif +return regsz; }static int sparc_fpu_gdb_write_register (CPUState *cs,uint8_t *mem_buf,int n)
Signature · 1 line
2.52.0
Re: [PATCH v2 24/50] target/sparc: Factor sparc_cpu_gdb_write_register() out
Quoted 9 lines · Philippe Mathieu-Daudé
Factor
sparc_cpu_gdb_write_register()out.Prefer
ldn_p(target_long_bits/8)over target-specificldtul_p().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/sparc/gdbstub.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
PATCH v2 25/50 target/ppc: Replace ldtul_p() -> ldn_p()
In reply to Philippe Mathieu-DaudéPrefer ldn_p(target_long_bits/8) over target-specific ldtul_p().
--- target/ppc/gdbstub.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
target/ppc/gdbstub.c +11 -11
@@ -23,12 +23,12 @@#include "gdbstub/helpers.h" #include "internal.h" -static int ppc_gdb_register_len (int n) +static unsigned ppc_gdb_register_len (int n) {switch (n) { case 0 ... 31:/* gprs */ -return sizeof (target_ulong); +return target_long_bits () /8 ;case 66 :/* cr */ case 69 :
@@ -42,7 +42,7 @@ static int ppc_gdb_register_len(int n)/* lr */ case 68 :/* ctr */ -return sizeof (target_ulong); +return target_long_bits () /8 ;default :return 0 ; }
@@ -85,7 +85,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n) {CPUPPCState *env =cpu_env (cs);uint8_t *mem_buf; -int r =ppc_gdb_register_len (n); +unsigned r =ppc_gdb_register_len (n);if (!r) {return r;
@@ -127,7 +127,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n)int ppc_cpu_gdb_write_register (CPUState *cs,uint8_t *mem_buf,int n) {CPUPPCState *env =cpu_env (cs); -int r =ppc_gdb_register_len (n); +unsigned r =ppc_gdb_register_len (n);if (!r) {return r;
@@ -135,17 +135,17 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)ppc_maybe_bswap_register (env, mem_buf, r);if (n <32 ) {/* gprs */ - env->gpr[n] =ldtul_p (mem_buf); + env->gpr[n] =ldn_p (mem_buf, r); }else if (n <64 ) {/* fprs */ *cpu_fpr_ptr (env, n -32 ) =ldq_p (mem_buf); }else {switch (n) {case 64 : - env->nip =ldtul_p (mem_buf); + env->nip =ldn_p (mem_buf, r);break ;case 65 : -ppc_store_msr (env,ldtul_p (mem_buf)); +ppc_store_msr (env,ldn_p (mem_buf, r));break ;case 66 : {
@@ -154,17 +154,17 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)break ; }case 67 : - env->lr =ldtul_p (mem_buf); + env->lr =ldn_p (mem_buf, r);break ;case 68 : - env->ctr =ldtul_p (mem_buf); + env->ctr =ldn_p (mem_buf, r);break ;case 69 :cpu_write_xer (env,ldl_p (mem_buf));break ;case 70 :/* fpscr */ -ppc_store_fpscr (env,ldtul_p (mem_buf)); +ppc_store_fpscr (env,ldn_p (mem_buf, r));break ; } }
Signature · 1 line
2.52.0
Re: [PATCH v2 25/50] target/ppc: Replace ldtul_p() -> ldn_p()
Quoted 7 lines · Philippe Mathieu-Daudé
Prefer
ldn_p(target_long_bits/8)over target-specificldtul_p().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/ppc/gdbstub.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
PATCH v2 26/50 target/mips: Replace ldtul_p() -> ldn_p()
In reply to Philippe Mathieu-DaudéPrefer ldn_p(target_long_bits/8) over target-specific ldtul_p().
Use deposit64() in gdb_write_register(), allowing to remove 'target_ulong' type uses.
--- target/mips/gdbstub.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
target/mips/gdbstub.c +8 -6
@@ -18,6 +18,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #include "qemu/osdep.h" +#include "qemu/bitops.h" #include "cpu.h" #include "internal.h" #include "gdbstub/helpers.h"
@@ -77,14 +78,15 @@ int mips_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)int mips_cpu_gdb_write_register (CPUState *cs,uint8_t *mem_buf,int n) { +const unsigned regsz =target_long_bits () /8 ;CPUMIPSState *env =cpu_env (cs); -target_ulong tmp; +uint64_t tmp; - tmp =ldtul_p (mem_buf); + tmp =ldn_p (mem_buf, regsz);if (n <32 ) { env->active_tc.gpr[n] = tmp; -return sizeof (target_ulong); +return regsz; }if (env->CP0_Config1 & (1 <<CP0C1_FP ) && n >=38 && n <72 ) {switch (n) {
@@ -104,7 +106,7 @@ int mips_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) }break ; } -return sizeof (target_ulong); +return regsz; }switch (n) {case 32 :
@@ -127,7 +129,7 @@ int mips_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)#endif break ;case 37 : - env->active_tc.PC = tmp & ~(target_ulong )1 ; + env->active_tc.PC =deposit64 (tmp,63 ,1 ,0 );if (tmp &1 ) { env->hflags |=MIPS_HFLAG_M16 ; }else {
@@ -144,5 +146,5 @@ int mips_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)break ; } -return sizeof (target_ulong); +return regsz; }
Signature · 1 line
2.52.0
Re: [PATCH v2 26/50] target/mips: Replace ldtul_p() -> ldn_p()
Quoted 10 lines · Philippe Mathieu-Daudé
Prefer
ldn_p(target_long_bits/8)over target-specificldtul_p().Use
deposit64()ingdb_write_register(), allowing to remove 'target_ulong' type uses.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/mips/gdbstub.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
PATCH v2 27/50 target/riscv: Replace ldtul_p() -> ldn_p()
In reply to Philippe Mathieu-DaudéPrefer ldn_p(riscv_cpu_is_32bit) over target-specific ldtul_p().
--- target/riscv/gdbstub.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
target/riscv/gdbstub.c +8 -6
@@ -191,14 +191,15 @@ static int riscv_gdb_set_csr(CPUState *cs, uint8_t *mem_buf, int n) {RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env; +const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ;if (n <CSR_TABLE_SIZE ) { -target_ulong val =ldtul_p (mem_buf); +target_ulong val =ldn_p (mem_buf, regsz);int result; result =riscv_csrrw_debug (env, n,NULL , val,-1 );if (result ==RISCV_EXCP_NONE ) { -return sizeof (target_ulong); +return regsz; } }return 0 ;
@@ -225,11 +226,12 @@ static int riscv_gdb_get_virtual(CPUState *cs, GByteArray *buf, int n)static int riscv_gdb_set_virtual (CPUState *cs,uint8_t *mem_buf,int n) {if (n ==0 ) { -#ifndef CONFIG_USER_ONLY RISCVCPU *cpu =RISCV_CPU (cs); +const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ; +#ifndef CONFIG_USER_ONLY CPURISCVState *env = &cpu->env; -target_ulong new_priv =ldtul_p (mem_buf) &0x3 ; +target_ulong new_priv =ldn_p (mem_buf, regsz) &0x3 ;bool new_virt =0 ;if (new_priv ==PRV_RESERVED ) {
@@ -237,7 +239,7 @@ static int riscv_gdb_set_virtual(CPUState *cs, uint8_t *mem_buf, int n) }if (new_priv !=PRV_M ) { - new_virt = (ldtul_p (mem_buf) &BIT (2 )) >>2 ; + new_virt = (ldn_p (mem_buf, regsz) &BIT (2 )) >>2 ; }if (riscv_has_ext (env,RVH ) && new_virt != env->virt_enabled) {
@@ -246,7 +248,7 @@ static int riscv_gdb_set_virtual(CPUState *cs, uint8_t *mem_buf, int n)riscv_cpu_set_mode (env, new_priv, new_virt);#endif -return sizeof (target_ulong); +return regsz; }return 0 ; }
Signature · 1 line
2.52.0
Re: [PATCH v2 27/50] target/riscv: Replace ldtul_p() -> ldn_p()
Quoted 7 lines · Philippe Mathieu-Daudé
Prefer
ldn_p(riscv_cpu_is_32bit)over target-specificldtul_p().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/riscv/gdbstub.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
Re: [PATCH v2 27/50] target/riscv: Replace ldtul_p() -> ldn_p()
In reply to Philippe Mathieu-DaudéQuoted 4 lines · Philippe Mathieu-Daudé
Prefer
ldn_p(riscv_cpu_is_32bit)over target-specificldtul_p().Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Quoted 58 lines
target/riscv/gdbstub.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)target/riscv/gdbstub.c +8
-6@@ -191,14 +191,15 @@ static int riscv_gdb_set_csr(CPUState *cs, uint8_t *mem_buf, int n) {RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env; +const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ;if (n <CSR_TABLE_SIZE ) { -target_ulong val =ldtul_p (mem_buf); +target_ulong val =ldn_p (mem_buf, regsz);int result; result =riscv_csrrw_debug (env, n,NULL , val,-1 );if (result ==RISCV_EXCP_NONE ) { -return sizeof (target_ulong); +return regsz; } }return 0 ;@@ -225,11 +226,12 @@ static int riscv_gdb_get_virtual(CPUState *cs, GByteArray *buf, int n)static int riscv_gdb_set_virtual (CPUState *cs,uint8_t *mem_buf,int n) {if (n ==0 ) { -#ifndef CONFIG_USER_ONLY RISCVCPU *cpu =RISCV_CPU (cs); +const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ; +#ifndef CONFIG_USER_ONLY CPURISCVState *env = &cpu->env; -target_ulong new_priv =ldtul_p (mem_buf) &0x3 ; +target_ulong new_priv =ldn_p (mem_buf, regsz) &0x3 ;bool new_virt =0 ;if (new_priv ==PRV_RESERVED ) {@@ -237,7 +239,7 @@ static int riscv_gdb_set_virtual(CPUState *cs, uint8_t *mem_buf, int n) }if (new_priv !=PRV_M ) { - new_virt = (ldtul_p (mem_buf) &BIT (2 )) >>2 ; + new_virt = (ldn_p (mem_buf, regsz) &BIT (2 )) >>2 ; }if (riscv_has_ext (env,RVH ) && new_virt != env->virt_enabled) {@@ -246,7 +248,7 @@ static int riscv_gdb_set_virtual(CPUState *cs, uint8_t *mem_buf, int n)riscv_cpu_set_mode (env, new_priv, new_virt);#endif -return sizeof (target_ulong); +return regsz; }return 0 ; }
Re: [PATCH v2 27/50] target/riscv: Replace ldtul_p() -> ldn_p()
In reply to Philippe Mathieu-DaudéQuoted 66 lines · Philippe Mathieu-Daudé
Prefer
ldn_p(riscv_cpu_is_32bit)over target-specificldtul_p().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/riscv/gdbstub.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)target/riscv/gdbstub.c +8
-6@@ -191,14 +191,15 @@ static int riscv_gdb_set_csr(CPUState *cs, uint8_t *mem_buf, int n) {RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env; +const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ;if (n <CSR_TABLE_SIZE ) { -target_ulong val =ldtul_p (mem_buf); +target_ulong val =ldn_p (mem_buf, regsz);int result; result =riscv_csrrw_debug (env, n,NULL , val,-1 );if (result ==RISCV_EXCP_NONE ) { -return sizeof (target_ulong); +return regsz; } }return 0 ;@@ -225,11 +226,12 @@ static int riscv_gdb_get_virtual(CPUState *cs, GByteArray *buf, int n)static int riscv_gdb_set_virtual (CPUState *cs,uint8_t *mem_buf,int n) {if (n ==0 ) { -#ifndef CONFIG_USER_ONLY RISCVCPU *cpu =RISCV_CPU (cs); +const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ; +#ifndef CONFIG_USER_ONLY CPURISCVState *env = &cpu->env; -target_ulong new_priv =ldtul_p (mem_buf) &0x3 ; +target_ulong new_priv =ldn_p (mem_buf, regsz) &0x3 ;bool new_virt =0 ;if (new_priv ==PRV_RESERVED ) {@@ -237,7 +239,7 @@ static int riscv_gdb_set_virtual(CPUState *cs, uint8_t *mem_buf, int n) }if (new_priv !=PRV_M ) { - new_virt = (ldtul_p (mem_buf) &BIT (2 )) >>2 ; + new_virt = (ldn_p (mem_buf, regsz) &BIT (2 )) >>2 ; }if (riscv_has_ext (env,RVH ) && new_virt != env->virt_enabled) {@@ -246,7 +248,7 @@ static int riscv_gdb_set_virtual(CPUState *cs, uint8_t *mem_buf, int n)riscv_cpu_set_mode (env, new_priv, new_virt);#endif -return sizeof (target_ulong); +return regsz; }return 0 ; }Signature · 1 line
2.52.0
Thanks,
Chao
PATCH v2 28/50 target/riscv: Remove unnecessary target_ulong type uses
In reply to Philippe Mathieu-Daudé--- target/riscv/gdbstub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
target/riscv/gdbstub.c +4 -4
@@ -52,7 +52,7 @@ int riscv_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)RISCVCPUClass *mcc =RISCV_CPU_GET_CLASS (cs);RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env; -target_ulong tmp; +uint64_t tmp;if (n <32 ) { tmp = env->gpr[n];
@@ -80,7 +80,7 @@ int riscv_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env;int length =0 ; -target_ulong tmp; +uint64_t tmp;switch (mcc->def->misa_mxl_max) {case MXL_RV32 :
@@ -194,7 +194,7 @@ static int riscv_gdb_set_csr(CPUState *cs, uint8_t *mem_buf, int n)const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ;if (n <CSR_TABLE_SIZE ) { -target_ulong val =ldn_p (mem_buf, regsz); +uint64_t val =ldn_p (mem_buf, regsz);int result; result =riscv_csrrw_debug (env, n,NULL , val,-1 );
@@ -215,7 +215,7 @@ static int riscv_gdb_get_virtual(CPUState *cs, GByteArray *buf, int n)CPURISCVState *env = &cpu->env;/* Per RiscV debug spec v1.0.0 rc4 */ -target_ulong vbit = (env->virt_enabled) ?BIT (2 ) :0 ; +uint32_t vbit = (env->virt_enabled) ?BIT (2 ) :0 ;return gdb_get_regl (buf, env->priv | vbit);#endif
Signature · 1 line
2.52.0
Re: [PATCH v2 28/50] target/riscv: Remove unnecessary target_ulong type uses
Quoted 5 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/riscv/gdbstub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Re: [PATCH v2 28/50] target/riscv: Remove unnecessary target_ulong type uses
In reply to Philippe Mathieu-DaudéQuoted 2 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Quoted 43 lines
target/riscv/gdbstub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)target/riscv/gdbstub.c +4
-4@@ -52,7 +52,7 @@ int riscv_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)RISCVCPUClass *mcc =RISCV_CPU_GET_CLASS (cs);RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env; -target_ulong tmp; +uint64_t tmp;if (n <32 ) { tmp = env->gpr[n];@@ -80,7 +80,7 @@ int riscv_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env;int length =0 ; -target_ulong tmp; +uint64_t tmp;switch (mcc->def->misa_mxl_max) {case MXL_RV32 :@@ -194,7 +194,7 @@ static int riscv_gdb_set_csr(CPUState *cs, uint8_t *mem_buf, int n)const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ;if (n <CSR_TABLE_SIZE ) { -target_ulong val =ldn_p (mem_buf, regsz); +uint64_t val =ldn_p (mem_buf, regsz);int result; result =riscv_csrrw_debug (env, n,NULL , val,-1 );@@ -215,7 +215,7 @@ static int riscv_gdb_get_virtual(CPUState *cs, GByteArray *buf, int n)CPURISCVState *env = &cpu->env;/* Per RiscV debug spec v1.0.0 rc4 */ -target_ulong vbit = (env->virt_enabled) ?BIT (2 ) :0 ; +uint32_t vbit = (env->virt_enabled) ?BIT (2 ) :0 ;return gdb_get_regl (buf, env->priv | vbit);#endif
Re: [PATCH v2 28/50] target/riscv: Remove unnecessary target_ulong type uses
In reply to Philippe Mathieu-DaudéQuoted 49 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/riscv/gdbstub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)target/riscv/gdbstub.c +4
-4@@ -52,7 +52,7 @@ int riscv_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)RISCVCPUClass *mcc =RISCV_CPU_GET_CLASS (cs);RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env; -target_ulong tmp; +uint64_t tmp;if (n <32 ) { tmp = env->gpr[n];@@ -80,7 +80,7 @@ int riscv_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)RISCVCPU *cpu =RISCV_CPU (cs);CPURISCVState *env = &cpu->env;int length =0 ; -target_ulong tmp; +uint64_t tmp;switch (mcc->def->misa_mxl_max) {case MXL_RV32 :@@ -194,7 +194,7 @@ static int riscv_gdb_set_csr(CPUState *cs, uint8_t *mem_buf, int n)const unsigned regsz =riscv_cpu_is_32bit (cpu) ?4 :8 ;if (n <CSR_TABLE_SIZE ) { -target_ulong val =ldn_p (mem_buf, regsz); +uint64_t val =ldn_p (mem_buf, regsz);int result; result =riscv_csrrw_debug (env, n,NULL , val,-1 );@@ -215,7 +215,7 @@ static int riscv_gdb_get_virtual(CPUState *cs, GByteArray *buf, int n)CPURISCVState *env = &cpu->env;/* Per RiscV debug spec v1.0.0 rc4 */ -target_ulong vbit = (env->virt_enabled) ?BIT (2 ) :0 ; +uint32_t vbit = (env->virt_enabled) ?BIT (2 ) :0 ;return gdb_get_regl (buf, env->priv | vbit);#endif Signature · 1 line
2.52.0
Thanks,
Chao
PATCH v2 29/50 target/i386: Replace ldtul_p() -> ldn_p()
In reply to Philippe Mathieu-DaudéPrefer ldn_p(target_long_bits) over target-specific ldtul_p().
--- target/i386/gdbstub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
target/i386/gdbstub.c +3 -2
@@ -459,6 +459,7 @@ static int i386_cpu_gdb_get_egprs(CPUState *cs, GByteArray *mem_buf, int n)static int i386_cpu_gdb_set_egprs (CPUState *cs,uint8_t *mem_buf,int n) { +const unsigned regsz =target_long_bits () /8 ;CPUX86State *env = &X86_CPU (cs)->env;if (n >=0 && n <EGPR_NUM ) {
@@ -467,7 +468,7 @@ static int i386_cpu_gdb_set_egprs(CPUState *cs, uint8_t *mem_buf, int n)* XCR0[APX_F] (at least for modification in gdbstub) to be enabled. */ if (env->hflags &HF_CS64_MASK && env->xcr0 &XSTATE_APX_MASK ) { - env->regs[gpr_map[n +CPU_NB_REGS ]] =ldtul_p (mem_buf); + env->regs[gpr_map[n +CPU_NB_REGS ]] =ldn_p (mem_buf, regsz);/* * Per SDM Vol 1, "Processor Tracking of XSAVE-Managed State",
@@ -486,7 +487,7 @@ static int i386_cpu_gdb_set_egprs(CPUState *cs, uint8_t *mem_buf, int n) env->xstate_bv |=XSTATE_APX_MASK ; } } -return sizeof (target_ulong); +return regsz; }return 0 ; }
Signature · 1 line
2.52.0
Re: [PATCH v2 29/50] target/i386: Replace ldtul_p() -> ldn_p()
Quoted 7 lines · Philippe Mathieu-Daudé
Prefer
ldn_p(target_long_bits)over target-specificldtul_p().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/i386/gdbstub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
PATCH v2 30/50 target/i386: Expand 64-bit definitions when TARGET_LONG_BITS == 64
In reply to Philippe Mathieu-DaudéWhere both gdb_read/write_register() functions check for 'TARGET_LONG_BITS == 64' we can expand the following definitions:
ldtul_p() -> ldq_p()
gdb_get_regl() -> gdb_get_reg64()
Do the same in i386_cpu_gdb_get_egprs(): check TARGET_LONG_BITS to effectively inline gdb_get_regl().
--- target/i386/gdbstub.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
target/i386/gdbstub.c +6 -4
@@ -129,7 +129,7 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)return gdb_get_reg64 (mem_buf, env->regs[gpr_map[n]] &0xffffffffUL ); }else { -return gdb_get_regl (mem_buf,0 ); +return gdb_get_reg64 (mem_buf,0 ); } }else {return gdb_get_reg32 (mem_buf, env->regs[gpr_map32[n]]);
@@ -283,9 +283,9 @@ int x86_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)if (n <CPU_NB_REGS ) {if (TARGET_LONG_BITS ==64 ) {if (env->hflags &HF_CS64_MASK ) { - env->regs[gpr_map[n]] =ldtul_p (mem_buf); + env->regs[gpr_map[n]] =ldq_p (mem_buf); }else if (n <CPU_NB_REGS32 ) { - env->regs[gpr_map[n]] =ldtul_p (mem_buf) &0xffffffffUL ; + env->regs[gpr_map[n]] =ldq_p (mem_buf) &0xffffffffUL ; }return sizeof (target_ulong); }else if (n <CPU_NB_REGS32 ) {
@@ -449,8 +449,10 @@ static int i386_cpu_gdb_get_egprs(CPUState *cs, GByteArray *mem_buf, int n)/* EGPRs can be only directly accessible in 64-bit mode. */ if (env->hflags &HF_CS64_MASK ) {return gdb_get_reg64 (mem_buf, env->regs[gpr_map[n +CPU_NB_REGS ]]); + }else if (TARGET_LONG_BITS ==64 ) { +return gdb_get_reg64 (mem_buf,0 ); }else { -return gdb_get_regl (mem_buf,0 ); +return gdb_get_reg32 (mem_buf,0 ); } }
Signature · 1 line
2.52.0
Re: [PATCH v2 30/50] target/i386: Expand 64-bit definitions when TARGET_LONG_BITS == 64
Quoted 7 lines · Philippe Mathieu-Daudé
Where both gdb_read/write_register() functions check for '
TARGET_LONG_BITS== 64' we can expand the following definitions:ldtul_p() -> ldq_p() gdb_get_regl() -> gdb_get_reg64()
Quoted 8 lines
Do the same in
i386_cpu_gdb_get_egprs(): checkTARGET_LONG_BITSto effectively inlinegdb_get_regl().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/i386/gdbstub.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
PATCH v2 31/50 gdbstub: Remove ldtul*() macros
In reply to Philippe Mathieu-DaudéThese macros aren't used anymore, remove them to avoid further uses creeping back in.
--- include/gdbstub/helpers.h | 6 ------ 1 file changed, 6 deletions(-)
include/gdbstub/helpers.h +0 -6
@@ -104,14 +104,8 @@ static inline uint8_t *gdb_get_reg_ptr(GByteArray *buf, int len)#ifdef COMPILING_PER_TARGET #if TARGET_LONG_BITS ==64 #define gdb_get_regl (buf, val) gdb_get_reg64(buf, val) -#define ldtul_p (addr) ldq_p(addr) -#define ldtul_le_p (addr) ldq_le_p(addr) -#define ldtul_be_p (addr) ldq_be_p(addr)#else #define gdb_get_regl (buf, val) gdb_get_reg32(buf, val) -#define ldtul_p (addr) ldl_p(addr) -#define ldtul_le_p (addr) ldl_le_p(addr) -#define ldtul_be_p (addr) ldl_be_p(addr)#endif #endif /* COMPILING_PER_TARGET */
Signature · 1 line
2.52.0
Re: [PATCH v2 31/50] gdbstub: Remove ldtul*() macros
Quoted 8 lines · Philippe Mathieu-Daudé
These macros aren't used anymore, remove them to avoid further uses creeping back in.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/gdbstub/helpers.h | 6 ------ 1 file changed, 6 deletions(-)
😌
PATCH v2 32/50 target/alpha: Expand gdb_get_regl() -> gdb_get_reg64()
In reply to Philippe Mathieu-DaudéThe Alpha targets are only built as 64-bit:
$ git grep TARGET_LONG_BITS configs/targets/alpha-* configs/targets/alpha-linux-user.mak:4:TARGET_LONG_BITS=64 configs/targets/alpha-softmmu.mak:2:TARGET_LONG_BITS=64
Mechanically replace:
gdb_get_regl() -> gdb_get_reg64()
--- target/alpha/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/alpha/gdbstub.c +1 -1
@@ -53,7 +53,7 @@ int alpha_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)default :return 0 ; } -return gdb_get_regl (mem_buf, val); +return gdb_get_reg64 (mem_buf, val); }int alpha_cpu_gdb_write_register (CPUState *cs,uint8_t *mem_buf,int n)
Signature · 1 line
2.52.0
Re: [PATCH v2 32/50] target/alpha: Expand gdb_get_regl() -> gdb_get_reg64()
Quoted 6 lines · Philippe Mathieu-Daudé
The Alpha targets are only built as 64-bit:
$ git grep TARGET_LONG_BITS configs/targets/alpha-* configs/targets/alpha-linux-user.mak:4:TARGET_LONG_BITS=64 configs/targets/alpha-softmmu.mak:2:TARGET_LONG_BITS=64
Quoted 9 lines
Mechanically replace:
gdb_get_regl() -> gdb_get_reg64()Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/alpha/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v2 33/50 target/hexagon: Expand gdb_get_regl() -> gdb_get_reg32()
In reply to Philippe Mathieu-DaudéThe Hexagon target is only built as 32-bit:
$ git grep TARGET_LONG_BITS configs/targets/hexagon* configs/targets/hexagon-linux-user.mak:5:TARGET_LONG_BITS=32
Mechanically replace:
gdb_get_regl() -> gdb_get_reg32()
--- target/hexagon/gdbstub.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
target/hexagon/gdbstub.c +6 -6
@@ -29,11 +29,11 @@ int hexagon_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)for (int i =0 ; i <NUM_PREGS ; i++) { p3_0 =deposit32 (p3_0, i *8 ,8 , env->pred[i]); } -return gdb_get_regl (mem_buf, p3_0); +return gdb_get_reg32 (mem_buf, p3_0); }if (n <TOTAL_PER_THREAD_REGS ) { -return gdb_get_regl (mem_buf, env->gpr[n]); +return gdb_get_reg32 (mem_buf, env->gpr[n]); } n -=TOTAL_PER_THREAD_REGS ;
@@ -56,12 +56,12 @@ int hexagon_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)for (int i =0 ; i <NUM_PREGS ; i++) { env->pred[i] =extract32 (p3_0, i *8 ,8 ); } -return sizeof (target_ulong); +return 4 ; }if (n <TOTAL_PER_THREAD_REGS ) { env->gpr[n] =ldl_le_p (mem_buf); -return sizeof (target_ulong); +return 4 ; } n -=TOTAL_PER_THREAD_REGS ;
@@ -81,7 +81,7 @@ static int gdb_get_vreg(CPUHexagonState *env, GByteArray *mem_buf, int n)int total =0 ;int i;for (i =0 ; i <ARRAY_SIZE (env->VRegs[n].uw); i++) { - total +=gdb_get_regl (mem_buf, env->VRegs[n].uw[i]); + total +=gdb_get_reg32 (mem_buf, env->VRegs[n].uw[i]); }return total; }
@@ -91,7 +91,7 @@ static int gdb_get_qreg(CPUHexagonState *env, GByteArray *mem_buf, int n)int total =0 ;int i;for (i =0 ; i <ARRAY_SIZE (env->QRegs[n].uw); i++) { - total +=gdb_get_regl (mem_buf, env->QRegs[n].uw[i]); + total +=gdb_get_reg32 (mem_buf, env->QRegs[n].uw[i]); }return total; }
Signature · 1 line
2.52.0
Re: [PATCH v2 33/50] target/hexagon: Expand gdb_get_regl() -> gdb_get_reg32()
Quoted 5 lines · Philippe Mathieu-Daudé
The Hexagon target is only built as 32-bit:
$ git grep TARGET_LONG_BITS configs/targets/hexagon* configs/targets/hexagon-linux-user.mak:5:TARGET_LONG_BITS=32
Quoted 9 lines
Mechanically replace:
gdb_get_regl() -> gdb_get_reg32()Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/hexagon/gdbstub.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Re: [PATCH v2 33/50] target/hexagon: Expand gdb_get_regl() -> gdb_get_reg32()
In reply to Philippe Mathieu-DaudéQuoted 6 lines · Philippe Mathieu-Daudé
The Hexagon target is only built as 32-bit:
$ git grep TARGET_LONG_BITS configs/targets/hexagon* configs/targets/hexagon-linux-user.mak:5:TARGET_LONG_BITS=32
Quoted 9 lines
Mechanically replace:
gdb_get_regl()->gdb_get_reg32()Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/hexagon/gdbstub.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Quoted 54 lines
target/hexagon/gdbstub.c +6
-7@@ -29,11 +29,11 @@ int hexagon_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)for (int i =0 ; i <NUM_PREGS ; i++) { p3_0 =deposit32 (p3_0, i *8 ,8 , env->pred[i]); } -return gdb_get_regl (mem_buf, p3_0); +return gdb_get_reg32 (mem_buf, p3_0); }if (n <TOTAL_PER_THREAD_REGS ) { -return gdb_get_regl (mem_buf, env->gpr[n]); +return gdb_get_reg32 (mem_buf, env->gpr[n]); } n -=TOTAL_PER_THREAD_REGS ;@@ -56,12 +56,12 @@ int hexagon_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)for (int i =0 ; i <NUM_PREGS ; i++) { env->pred[i] =extract32 (p3_0, i *8 ,8 ); } -return sizeof (target_ulong); +return 4 ; }if (n <TOTAL_PER_THREAD_REGS ) { env->gpr[n] =ldl_le_p (mem_buf); -return sizeof (target_ulong); +return 4 ; } n -=TOTAL_PER_THREAD_REGS ;@@ -81,7 +81,7 @@ static int gdb_get_vreg(CPUHexagonState *env, GByteArray *mem_buf, int n)int total =0 ;int i;for (i =0 ; i <ARRAY_SIZE (env->VRegs[n].uw); i++) { - total +=gdb_get_regl (mem_buf, env->VRegs[n].uw[i]); + total +=gdb_get_reg32 (mem_buf, env->VRegs[n].uw[i]); }return total; }@@ -91,7 +91,7 @@ static int gdb_get_qreg(CPUHexagonState *env, GByteArray *mem_buf, int n)int total =0 ;int i;for (i =0 ; i <ARRAY_SIZE (env->QRegs[n].uw); i++) { - total +=gdb_get_regl (mem_buf, env->QRegs[n].uw[i]); + total +=gdb_get_reg32 (mem_buf, env->QRegs[n].uw[i]); }return total; } --2.52.0
PATCH v2 34/50 target/rx: Expand gdb_get_regl() -> gdb_get_reg32()
In reply to Philippe Mathieu-DaudéThe Renesas RX target is only built as 32-bit:
$ git grep TARGET_LONG_BITS configs/targets/rx* configs/targets/rx-softmmu.mak:5:TARGET_LONG_BITS=32
Mechanically replace:
gdb_get_regl() -> gdb_get_reg32()
--- target/rx/gdbstub.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
target/rx/gdbstub.c +10 -10
@@ -25,25 +25,25 @@ int rx_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)switch (n) { case 0 ... 15: -return gdb_get_regl (mem_buf, env->regs[n]); +return gdb_get_reg32 (mem_buf, env->regs[n]);case 16 : -return gdb_get_regl (mem_buf, (env->psw_u) ? env->regs[0 ] : env->usp); +return gdb_get_reg32 (mem_buf, (env->psw_u) ? env->regs[0 ] : env->usp);case 17 : -return gdb_get_regl (mem_buf, (!env->psw_u) ? env->regs[0 ] : env->isp); +return gdb_get_reg32 (mem_buf, (!env->psw_u) ? env->regs[0 ] : env->isp);case 18 : -return gdb_get_regl (mem_buf,rx_cpu_pack_psw (env)); +return gdb_get_reg32 (mem_buf,rx_cpu_pack_psw (env));case 19 : -return gdb_get_regl (mem_buf, env->pc); +return gdb_get_reg32 (mem_buf, env->pc);case 20 : -return gdb_get_regl (mem_buf, env->intb); +return gdb_get_reg32 (mem_buf, env->intb);case 21 : -return gdb_get_regl (mem_buf, env->bpsw); +return gdb_get_reg32 (mem_buf, env->bpsw);case 22 : -return gdb_get_regl (mem_buf, env->bpc); +return gdb_get_reg32 (mem_buf, env->bpc);case 23 : -return gdb_get_regl (mem_buf, env->fintv); +return gdb_get_reg32 (mem_buf, env->fintv);case 24 : -return gdb_get_regl (mem_buf, env->fpsw); +return gdb_get_reg32 (mem_buf, env->fpsw);case 25 :return 0 ; }
Signature · 1 line
2.52.0
Re: [PATCH v2 34/50] target/rx: Expand gdb_get_regl() -> gdb_get_reg32()
Quoted 5 lines · Philippe Mathieu-Daudé
The Renesas RX target is only built as 32-bit:
$ git grep TARGET_LONG_BITS configs/targets/rx* configs/targets/rx-softmmu.mak:5:TARGET_LONG_BITS=32
Quoted 9 lines
Mechanically replace:
gdb_get_regl() -> gdb_get_reg32()Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/rx/gdbstub.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
PATCH v2 35/50 target/sh4: Expand gdb_get_regl() -> gdb_get_reg32()
In reply to Philippe Mathieu-DaudéThe SH4 targets are only built as 32-bit:
$ git grep TARGET_LONG_BITS configs/targets/sh4* configs/targets/sh4-linux-user.mak:5:TARGET_LONG_BITS=32 configs/targets/sh4-softmmu.mak:2:TARGET_LONG_BITS=32 configs/targets/sh4eb-linux-user.mak:6:TARGET_LONG_BITS=32 configs/targets/sh4eb-softmmu.mak:3:TARGET_LONG_BITS=32
Mechanically replace:
gdb_get_regl() -> gdb_get_reg32()
--- target/sh4/gdbstub.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
target/sh4/gdbstub.c +16 -16
@@ -31,43 +31,43 @@ int superh_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)switch (n) { case 0 ... 7:if ((env->sr & (1u <<SR_MD )) && (env->sr & (1u <<SR_RB ))) { -return gdb_get_regl (mem_buf, env->gregs[n +16 ]); +return gdb_get_reg32 (mem_buf, env->gregs[n +16 ]); }else { -return gdb_get_regl (mem_buf, env->gregs[n]); +return gdb_get_reg32 (mem_buf, env->gregs[n]); } case 8 ... 15: -return gdb_get_regl (mem_buf, env->gregs[n]); +return gdb_get_reg32 (mem_buf, env->gregs[n]);case 16 : -return gdb_get_regl (mem_buf, env->pc); +return gdb_get_reg32 (mem_buf, env->pc);case 17 : -return gdb_get_regl (mem_buf, env->pr); +return gdb_get_reg32 (mem_buf, env->pr);case 18 : -return gdb_get_regl (mem_buf, env->gbr); +return gdb_get_reg32 (mem_buf, env->gbr);case 19 : -return gdb_get_regl (mem_buf, env->vbr); +return gdb_get_reg32 (mem_buf, env->vbr);case 20 : -return gdb_get_regl (mem_buf, env->mach); +return gdb_get_reg32 (mem_buf, env->mach);case 21 : -return gdb_get_regl (mem_buf, env->macl); +return gdb_get_reg32 (mem_buf, env->macl);case 22 : -return gdb_get_regl (mem_buf,cpu_read_sr (env)); +return gdb_get_reg32 (mem_buf,cpu_read_sr (env));case 23 : -return gdb_get_regl (mem_buf, env->fpul); +return gdb_get_reg32 (mem_buf, env->fpul);case 24 : -return gdb_get_regl (mem_buf, env->fpscr); +return gdb_get_reg32 (mem_buf, env->fpscr); case 25 ... 40:if (env->fpscr &FPSCR_FR ) {return gdb_get_reg32 (mem_buf, env->fregs[n -9 ]); }return gdb_get_reg32 (mem_buf, env->fregs[n -25 ]);case 41 : -return gdb_get_regl (mem_buf, env->ssr); +return gdb_get_reg32 (mem_buf, env->ssr);case 42 : -return gdb_get_regl (mem_buf, env->spc); +return gdb_get_reg32 (mem_buf, env->spc); case 43 ... 50: -return gdb_get_regl (mem_buf, env->gregs[n -43 ]); +return gdb_get_reg32 (mem_buf, env->gregs[n -43 ]); case 51 ... 58: -return gdb_get_regl (mem_buf, env->gregs[n - (51 -16 )]); +return gdb_get_reg32 (mem_buf, env->gregs[n - (51 -16 )]); }return 0 ;
Signature · 1 line
2.52.0
Re: [PATCH v2 35/50] target/sh4: Expand gdb_get_regl() -> gdb_get_reg32()
Quoted 8 lines · Philippe Mathieu-Daudé
The SH4 targets are only built as 32-bit:
$ git grep TARGET_LONG_BITS configs/targets/sh4* configs/targets/sh4-linux-user.mak:5:TARGET_LONG_BITS=32 configs/targets/sh4-softmmu.mak:2:TARGET_LONG_BITS=32 configs/targets/sh4eb-linux-user.mak:6:TARGET_LONG_BITS=32 configs/targets/sh4eb-softmmu.mak:3:TARGET_LONG_BITS=32
Quoted 9 lines
Mechanically replace:
gdb_get_regl() -> gdb_get_reg32()Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/sh4/gdbstub.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
PATCH v2 36/50 target/sparc: Expand gdb_get_regl() in gdb_get_rega()
In reply to Philippe Mathieu-DaudéConvert the gdb_get_rega() macro to an inlined function, expanding gdb_get_regl() via a TARGET_SPARC64 definition check.
--- target/sparc/gdbstub.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
target/sparc/gdbstub.c +6 -3
@@ -22,11 +22,14 @@#include "cpu.h" #include "gdbstub/helpers.h" -#ifdef TARGET_ABI32 -#define gdb_get_rega (buf, val) gdb_get_reg32(buf, val) +static inline int gdb_get_rega (GByteArray *buf,uint64_t val) +{ +#if defined(TARGET_ABI32 ) || !defined(TARGET_SPARC64 ) +return gdb_get_reg32 (buf, val);#else -#define gdb_get_rega (buf, val) gdb_get_regl(buf, val) +return gdb_get_reg64 (buf, val);#endif +}int sparc_cpu_gdb_read_register (CPUState *cs,GByteArray *mem_buf,int n) {
Signature · 1 line
2.52.0
Re: [PATCH v2 36/50] target/sparc: Expand gdb_get_regl() in gdb_get_rega()
Quoted 8 lines · Philippe Mathieu-Daudé
Convert the
gdb_get_rega()macro to an inlined function, expandinggdb_get_regl()via aTARGET_SPARC64definition check.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/sparc/gdbstub.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
PATCH v2 37/50 gdbstub/helpers: Convert gdb_get_regl() macro to inlined helper
In reply to Philippe Mathieu-DaudéRather than checking TARGET_LONG_BITS at build time, check target_long_bits() at runtime.
--- include/gdbstub/helpers.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
include/gdbstub/helpers.h +14 -8
@@ -88,6 +88,20 @@ static inline int gdb_get_zeroes(GByteArray *array, size_t len)return len; } +/** +* gdb_get_regl: append @val in @buf using 32 or 64-bit, depending on target +* +* This function is legacy and deprecated, thus should not be used in new code. +*/ +static inline int gdb_get_regl (GByteArray *buf,uint64_t val) +{ +if (target_long_bits () ==64 ) { +return gdb_get_reg64 (buf, val); + }else { +return gdb_get_reg32 (buf, val); + } +} +/** * gdb_get_reg_ptr: get pointer to start of last element * @len: length of element
@@ -101,12 +115,4 @@ static inline uint8_t *gdb_get_reg_ptr(GByteArray *buf, int len) return buf->data + buf->len - len; } -#ifdef COMPILING_PER_TARGET -#if TARGET_LONG_BITS ==64 -#define gdb_get_regl (buf, val) gdb_get_reg64(buf, val) -#else -#define gdb_get_regl (buf, val) gdb_get_reg32(buf, val) -#endif -#endif /* COMPILING_PER_TARGET */ -#endif /* _GDBSTUB_HELPERS_H_ */
Signature · 1 line
2.52.0
Re: [PATCH v2 37/50] gdbstub/helpers: Convert gdb_get_regl() macro to inlined helper
Quoted 8 lines · Philippe Mathieu-Daudé
Rather than checking
TARGET_LONG_BITSat build time, checktarget_long_bits()at runtime.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/gdbstub/helpers.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
PATCH v2 38/50 target/microblaze: Build 'gdbstub.c' once for system binaries
In reply to Philippe Mathieu-Daudé'gdbstub.c' can now be built once for all qemu-system-microblaze* binaries.
--- target/microblaze/meson.build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
target/microblaze/meson.build +9 -2
@@ -4,12 +4,17 @@ microblaze_ss = ss.source_set() microblaze_ss.add(gen) microblaze_ss.add(files( 'cpu.c', - 'gdbstub.c', 'helper.c', 'op_helper.c', 'translate.c', )) +microblaze_user_ss = ss.source_set() +microblaze_user_ss.add(files('gdbstub.c')) + +microblaze_common_system_ss = ss.source_set() +microblaze_common_system_ss.add(files('gdbstub.c')) + microblaze_system_ss = ss.source_set() microblaze_system_ss.add(files( 'mmu.c',
@@ -17,4 +22,6 @@ microblaze_system_ss.add(files( )) target_arch += {'microblaze': microblaze_ss} -target_common_system_arch += {'microblaze': microblaze_system_ss} +target_user_arch += {'microblaze': microblaze_user_ss} +target_system_arch += {'microblaze': microblaze_system_ss} +target_common_system_arch += {'microblaze': microblaze_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 38/50] target/microblaze: Build 'gdbstub.c' once for system binaries
Quoted 8 lines · Philippe Mathieu-Daudé
'
gdbstub.c' can now be built once for all qemu-system-microblaze* binaries.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/microblaze/meson.build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
🙏
PATCH v2 39/50 target/sh4: Build 'monitor.c' once for system binaries
In reply to Philippe Mathieu-Daudé'monitor.c' can be built once for all qemu-system-sh4* binaries.
--- target/sh4/meson.build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
target/sh4/meson.build +5 -3
@@ -7,8 +7,10 @@ sh4_ss.add(files( 'translate.c', )) -sh4_system_ss = ss.source_set() -sh4_system_ss.add(files('monitor.c')) +sh4_common_system_ss = ss.source_set() +sh4_common_system_ss.add(files( + 'monitor.c', +)) target_arch += {'sh4': sh4_ss} -target_common_system_arch += {'sh4': sh4_system_ss} +target_common_system_arch += {'sh4': sh4_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 39/50] target/sh4: Build 'monitor.c' once for system binaries
Quoted 7 lines · Philippe Mathieu-Daudé
'
monitor.c' can be built once for all qemu-system-sh4* binaries.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/sh4/meson.build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
PATCH v2 40/50 target/sh4: Build 'gdbstub.c' once for system binaries
In reply to Philippe Mathieu-Daudé'gdbstub.c' can now be built once for all qemu-system-sh4* binaries.
--- target/sh4/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
target/sh4/meson.build +5 -1
@@ -1,7 +1,6 @@ sh4_ss = ss.source_set() sh4_ss.add(files( 'cpu.c', - 'gdbstub.c', 'helper.c', 'op_helper.c', 'translate.c',
@@ -9,8 +8,13 @@ sh4_ss.add(files( sh4_common_system_ss = ss.source_set() sh4_common_system_ss.add(files( + 'gdbstub.c', 'monitor.c', )) +sh4_user_ss = ss.source_set() +sh4_user_ss.add(files('gdbstub.c')) + target_arch += {'sh4': sh4_ss} +target_user_arch += {'sh4': sh4_user_ss} target_common_system_arch += {'sh4': sh4_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 40/50] target/sh4: Build 'gdbstub.c' once for system binaries
Quoted 8 lines · Philippe Mathieu-Daudé
'
gdbstub.c' can now be built once for all qemu-system-sh4* binaries.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/sh4/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
PATCH v2 41/50 target/or1k: Rename 'openrisc' -> 'or1k' in meson.build
In reply to Philippe Mathieu-DaudéFollow commit 62822fc7e0f ("target/or1k: Rename from openrisc").
--- target/or1k/meson.build | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
target/or1k/meson.build +7 -7
@@ -1,8 +1,8 @@ gen = decodetree.process('insns.decode') -openrisc_ss = ss.source_set() -openrisc_ss.add(gen) -openrisc_ss.add(files( +or1k_ss = ss.source_set() +or1k_ss.add(gen) +or1k_ss.add(files( 'cpu.c', 'disas.c', 'exception.c',
@@ -14,12 +14,12 @@ openrisc_ss.add(files( 'translate.c', )) -openrisc_system_ss = ss.source_set() -openrisc_system_ss.add(files( +or1k_common_system_ss = ss.source_set() +or1k_common_system_ss.add(files( 'interrupt.c', 'machine.c', 'mmu.c', )) -target_arch += {'or1k': openrisc_ss} -target_common_system_arch += {'or1k': openrisc_system_ss} +target_arch += {'or1k': or1k_ss} +target_common_system_arch += {'or1k': or1k_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 41/50] target/or1k: Rename 'openrisc' -> 'or1k' in meson.build
Quoted 7 lines · Philippe Mathieu-Daudé
Follow commit
62822fc7e0f("target/or1k: Rename from openrisc").Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/or1k/meson.build | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
PATCH v2 42/50 target/or1k: Build 'gdbstub.c' once for system single binary
In reply to Philippe Mathieu-DaudéThere is a single qemu-system-or1k binary, but by moving 'gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
--- target/or1k/meson.build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
target/or1k/meson.build +9 -2
@@ -8,18 +8,25 @@ or1k_ss.add(files( 'exception.c', 'exception_helper.c', 'fpu_helper.c', - 'gdbstub.c', 'interrupt_helper.c', 'sys_helper.c', 'translate.c', )) +or1k_user_ss = ss.source_set() +or1k_user_ss.add(files('gdbstub.c')) + or1k_common_system_ss = ss.source_set() -or1k_common_system_ss.add(files( +or1k_common_system_ss.add(files('gdbstub.c')) + +or1k_system_ss = ss.source_set() +or1k_system_ss.add(files( 'interrupt.c', 'machine.c', 'mmu.c', )) target_arch += {'or1k': or1k_ss} +target_user_arch += {'or1k': or1k_user_ss} +target_system_arch += {'or1k': or1k_system_ss} target_common_system_arch += {'or1k': or1k_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 42/50] target/or1k: Build 'gdbstub.c' once for system single binary
Quoted 10 lines · Philippe Mathieu-Daudé
There is a single qemu-system-or1k binary, but by moving '
gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/or1k/meson.build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
PATCH v2 43/50 target/alpha: Build 'gdbstub.c' once for system single binary
In reply to Philippe Mathieu-DaudéThere is a single qemu-system-alpha binary, but by moving 'gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
--- target/alpha/meson.build | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
target/alpha/meson.build +10 -4
@@ -2,7 +2,6 @@ alpha_ss = ss.source_set() alpha_ss.add(files( 'cpu.c', 'fpu_helper.c', - 'gdbstub.c', 'helper.c', 'clk_helper.c', 'int_helper.c',
@@ -11,11 +10,18 @@ alpha_ss.add(files( 'vax_helper.c', )) -alpha_system_ss = ss.source_set() -alpha_system_ss.add(files( +alpha_user_ss = ss.source_set() +alpha_user_ss.add(files( + 'gdbstub.c', +)) + +alpha_common_system_ss = ss.source_set() +alpha_common_system_ss.add(files( + 'gdbstub.c', 'machine.c', 'sys_helper.c', )) target_arch += {'alpha': alpha_ss} -target_common_system_arch += {'alpha': alpha_system_ss} +target_user_arch += {'alpha': alpha_user_ss} +target_common_system_arch += {'alpha': alpha_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 43/50] target/alpha: Build 'gdbstub.c' once for system single binary
Quoted 10 lines · Philippe Mathieu-Daudé
There is a single qemu-system-alpha binary, but by moving '
gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/alpha/meson.build | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
PATCH v2 44/50 target/avr: Build 'gdbstub.c' once for system single binary
In reply to Philippe Mathieu-DaudéThere is a single qemu-system-avr binary, but by moving 'gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
--- target/avr/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
target/avr/meson.build +4 -1
@@ -11,10 +11,13 @@ avr_ss.add(files( 'translate.c', 'helper.c', 'cpu.c', - 'gdbstub.c', 'disas.c')) +avr_common_system_ss = ss.source_set() +avr_common_system_ss.add(files('gdbstub.c')) + avr_system_ss.add(files('machine.c')) target_arch += {'avr': avr_ss} target_system_arch += {'avr': avr_system_ss} +target_common_system_arch += {'avr': avr_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 44/50] target/avr: Build 'gdbstub.c' once for system single binary
Quoted 10 lines · Philippe Mathieu-Daudé
There is a single qemu-system-avr binary, but by moving '
gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/avr/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
PATCH v2 45/50 target/loongarch: Build 'gdbstub.c' once for system single binary
In reply to Philippe Mathieu-DaudéThere is a single qemu-system-loongarch64 binary, but by moving 'gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
---
Based-on: <[email protected]>
"single-binary: Drop TARGET_PHYS_ADDR_SPACE_BITS"
--- target/loongarch/meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
target/loongarch/meson.build +8 -1
@@ -3,9 +3,14 @@ gen = decodetree.process('insns.decode') loongarch_ss = ss.source_set() loongarch_ss.add(files( 'cpu.c', - 'gdbstub.c', )) +loongarch_user_ss = ss.source_set() +loongarch_user_ss.add(files('gdbstub.c')) + +loongarch_common_system_ss = ss.source_set() +loongarch_common_system_ss.add(files('gdbstub.c')) + loongarch_system_ss = ss.source_set() loongarch_system_ss.add(files( 'arch_dump.c',
@@ -20,5 +25,7 @@ common_ss.add(when: 'CONFIG_LOONGARCH_DIS', if_true: [files('disas.c'), gen]) subdir('tcg') target_arch += {'loongarch': loongarch_ss} +target_user_arch += {'loongarch': loongarch_user_ss} target_system_arch += {'loongarch': loongarch_system_ss} +target_common_system_arch += {'loongarch': loongarch_common_system_ss} subdir('kvm')
Signature · 1 line
2.52.0
Re: [PATCH v2 45/50] target/loongarch: Build 'gdbstub.c' once for system single binary
Quoted 5 lines · Philippe Mathieu-Daudé
There is a single qemu-system-loongarch64 binary, but by moving '
gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Based-on: <[email protected]>
"single-binary: DropTARGET_PHYS_ADDR_SPACE_BITS"--- target/loongarch/meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
PATCH v2 46/50 target/m68k: Build 'gdbstub.c' once for system single binary
In reply to Philippe Mathieu-DaudéThere is a single qemu-system-m68k binary, but by moving 'gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
--- target/m68k/meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
target/m68k/meson.build +8 -1
@@ -2,13 +2,18 @@ m68k_ss = ss.source_set() m68k_ss.add(files( 'cpu.c', 'fpu_helper.c', - 'gdbstub.c', 'helper.c', 'op_helper.c', 'softfloat.c', 'translate.c', )) +m68k_user_ss = ss.source_set() +m68k_user_ss.add(files('gdbstub.c')) + +m68k_common_system_ss = ss.source_set() +m68k_common_system_ss.add(files('gdbstub.c')) + m68k_system_ss = ss.source_set() m68k_system_ss.add(files( 'monitor.c'
@@ -19,4 +24,6 @@ m68k_system_ss.add(when: ['CONFIG_SEMIHOSTING'], ) target_arch += {'m68k': m68k_ss} +target_user_arch += {'m68k': m68k_user_ss} target_system_arch += {'m68k': m68k_system_ss} +target_common_system_arch += {'m68k': m68k_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 46/50] target/m68k: Build 'gdbstub.c' once for system single binary
Quoted 10 lines · Philippe Mathieu-Daudé
There is a single qemu-system-m68k binary, but by moving '
gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/m68k/meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
PATCH v2 47/50 target/rx: Build 'gdbstub.c' once for system single binary
In reply to Philippe Mathieu-DaudéThere is a single qemu-system-rx binary, but by moving 'gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
--- target/rx/meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
target/rx/meson.build +4 -2
@@ -9,8 +9,10 @@ rx_ss.add(files( 'op_helper.c', 'helper.c', 'cpu.c', - 'gdbstub.c', 'disas.c')) +rx_common_system_ss = ss.source_set() +rx_common_system_ss.add(files('gdbstub.c')) + target_arch += {'rx': rx_ss} -target_common_system_arch += {'rx': ss.source_set()} +target_common_system_arch += {'rx': rx_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 47/50] target/rx: Build 'gdbstub.c' once for system single binary
Quoted 10 lines · Philippe Mathieu-Daudé
There is a single qemu-system-rx binary, but by moving '
gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/rx/meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
PATCH v2 48/50 target/s390x: Build 'gdbstub.c' once for system single binary
In reply to Philippe Mathieu-DaudéThere is a single qemu-system-s390x binary, but by moving 'gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
--- target/s390x/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
target/s390x/meson.build +2 -1
@@ -3,7 +3,6 @@ s390x_ss.add(files( 'cpu.c', 'cpu_features.c', 'cpu_models.c', - 'gdbstub.c', 'interrupt.c', 'cpu-dump.c', ))
@@ -34,11 +33,13 @@ s390x_common_system_ss.add(files( 'sigp.c', 'cpu-system.c', 'cpu_models_system.c', + 'gdbstub.c', )) s390x_user_ss = ss.source_set() s390x_user_ss.add(files( 'cpu_models_user.c', + 'gdbstub.c', )) subdir('tcg')
Signature · 1 line
2.52.0
Re: [PATCH v2 48/50] target/s390x: Build 'gdbstub.c' once for system single binary
Quoted 10 lines · Philippe Mathieu-Daudé
There is a single qemu-system-s390x binary, but by moving '
gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/s390x/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
PATCH v2 49/50 target/tricore: Build 'gdbstub.c' once for system single binary
In reply to Philippe Mathieu-DaudéThere is a single qemu-system-tricore binary, but by moving 'gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.
--- target/tricore/meson.build | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
target/tricore/meson.build +7 -3
@@ -5,11 +5,15 @@ tricore_ss.add(files( 'helper.c', 'op_helper.c', 'translate.c', - 'gdbstub.c', )) tricore_ss.add(zlib) -tricore_system_ss = ss.source_set() +tricore_user_ss = ss.source_set() +tricore_user_ss.add(files('gdbstub.c')) + +tricore_common_system_ss = ss.source_set() +tricore_common_system_ss.add(files('gdbstub.c')) target_arch += {'tricore': tricore_ss} -target_common_system_arch += {'tricore': tricore_system_ss} +target_user_arch += {'tricore': tricore_user_ss} +target_common_system_arch += {'tricore': tricore_common_system_ss}
Signature · 1 line
2.52.0
Re: [PATCH v2 49/50] target/tricore: Build 'gdbstub.c' once for system single binary
Quoted 10 lines · Philippe Mathieu-Daudé
There is a single qemu-system-tricore binary, but by moving '
gdbstub.c' in the target_common_system_arch[] source set the resulting object can be linked into a single qemu-sytem binary.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/tricore/meson.build | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
PATCH v2 50/50 DONOTREVIEW Revert "target/loongarch: Build 'gdbstub.c' once"
In reply to Philippe Mathieu-DaudéWhile the previous patch "target/loongarch: Build 'gdbstub.c' once for system single binary" can be reviewed, it depends on Anton's "Drop TARGET_PHYS_ADDR_SPACE_BITS" series. Revert it to allow this whole series to be tested by CI bots.
--- target/loongarch/meson.build | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
target/loongarch/meson.build +1 -8
@@ -3,14 +3,9 @@ gen = decodetree.process('insns.decode') loongarch_ss = ss.source_set() loongarch_ss.add(files( 'cpu.c', + 'gdbstub.c', )) -loongarch_user_ss = ss.source_set() -loongarch_user_ss.add(files('gdbstub.c')) - -loongarch_common_system_ss = ss.source_set() -loongarch_common_system_ss.add(files('gdbstub.c')) - loongarch_system_ss = ss.source_set() loongarch_system_ss.add(files( 'arch_dump.c',
@@ -25,7 +20,5 @@ common_ss.add(when: 'CONFIG_LOONGARCH_DIS', if_true: [files('disas.c'), gen]) subdir('tcg') target_arch += {'loongarch': loongarch_ss} -target_user_arch += {'loongarch': loongarch_user_ss} target_system_arch += {'loongarch': loongarch_system_ss} -target_common_system_arch += {'loongarch': loongarch_common_system_ss} subdir('kvm')
Signature · 1 line
2.52.0
Re: [PATCH v2 50/50] DONOTREVIEW Revert "target/loongarch: Build 'gdbstub.c' once"
Quoted 42 lines · Philippe Mathieu-Daudé
While the previous patch "target/loongarch: Build '
gdbstub.c' once for system single binary" can be reviewed, it depends on Anton's "DropTARGET_PHYS_ADDR_SPACE_BITS" series. Revert it to allow this whole series to be tested by CI bots.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/loongarch/meson.build | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)target/loongarch/meson.build +1
-8@@ -3,14 +3,9 @@ gen = decodetree.process('insns.decode') loongarch_ss = ss.source_set() loongarch_ss.add(files( 'cpu.c', + 'gdbstub.c', )) -loongarch_user_ss = ss.source_set() -loongarch_user_ss.add(files('gdbstub.c')) - -loongarch_common_system_ss = ss.source_set() -loongarch_common_system_ss.add(files('gdbstub.c')) - loongarch_system_ss = ss.source_set() loongarch_system_ss.add(files( 'arch_dump.c',@@ -25,7 +20,5 @@ common_ss.add(when: 'CONFIG_LOONGARCH_DIS', if_true: [files('disas.c'), gen]) subdir('tcg') target_arch += {'loongarch': loongarch_ss} -target_user_arch += {'loongarch': loongarch_user_ss} target_system_arch += {'loongarch': loongarch_system_ss} -target_common_system_arch += {'loongarch': loongarch_common_system_ss} subdir('kvm')Signature · 1 line
2.52.0
Thanks,
Chao
Quoted 42 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (50):
target/ppc: Moveuser_only_helper.cto target_user_arch[] source set target/ppc: RemovePPC_DEBUG_SPRleft-over comment target/i386: InlineGDB_FORCE_64definition
target/avr: Fix typo in gdb-xml feature name
target/alpha: Document gdbstub register indexes target/riscv: Extract monitor-related code tomonitor.ctarget/ppc: FixCPUClass::gdb_num_core_regsvalue target/ppc: Remove dead code depending onUSE_APPLE_GDB
gdbstub: Always infergdb_num_core_regswhen using XML file target/sparc: Introducesparc_cpu_register_gdb_regs()stub target/sparc: Restore 'gdb-xml/sparc64-cp0.xml' target/sparc: Restore 'gdb-xml/sparc64-fpu.xml' target/sparc: Restore 'gdb-xml/sparc64-cpu.xml' target/sparc: Expose gdbstub registers to sparc32plus target target/sparc: Expose gdbstub registers to sparc32 targets monitor/hmp: Handle gdb-xml exposed registers viagdb_get_register()target/sparc: Remove MonitorDef register entries available via gdbstub target/i386: Remove MonitorDef register entries available via gdbstub target/m68k: Remove MonitorDef register entries available via gdbstub target/ppc: Remove MonitorDef register entries available via gdbstub target/ppc: Extract monitor-related code tomonitor.ctarget/or1k: Use XML register definitions from GDB target/riscv: Remove emptytarget_monitor_defs()symbol target/sparc: Factorsparc_cpu_gdb_write_register()out target/ppc: Replaceldtul_p()->ldn_p()
target/mips: Replaceldtul_p()->ldn_p()
target/riscv: Replaceldtul_p()->ldn_p()
target/riscv: Remove unnecessarytarget_ulongtype uses target/i386: Replaceldtul_p()->ldn_p()
target/i386: Expand 64-bit definitions whenTARGET_LONG_BITS== 64
gdbstub: Remove ldtul*() macros
target/alpha: Expandgdb_get_regl()->gdb_get_reg64()target/hexagon: Expandgdb_get_regl()->gdb_get_reg32()target/rx: Expandgdb_get_regl()->gdb_get_reg32()target/sh4: Expandgdb_get_regl()->gdb_get_reg32()target/sparc: Expandgdb_get_regl()ingdb_get_rega()gdbstub/helpers: Convertgdb_get_regl()macro to inlined helper target/microblaze: Build 'gdbstub.c' once for system binaries target/sh4: Build 'monitor.c' once for system binaries target/sh4: Build 'gdbstub.c' once for system binaries target/or1k: Rename 'openrisc' -> 'or1k' in meson.build
Quoted 8 lines
target/or1k: Build '
gdbstub.c' once for system single binary target/alpha: Build 'gdbstub.c' once for system single binary target/avr: Build 'gdbstub.c' once for system single binary target/loongarch: Build 'gdbstub.c' once for system single binary target/m68k: Build 'gdbstub.c' once for system single binary target/rx: Build 'gdbstub.c' once for system single binary target/s390x: Build 'gdbstub.c' once for system single binary target/tricore: Build 'gdbstub.c' once for system single binary
Patches 1-49 queued, thanks.