diff mbox series

[2/2] target/arm: Don't add system-registers.xml for user-only

Message ID 20190307201244.8971-3-richard.henderson@linaro.org
State New
Headers show
Series target/arm: gdbstub system registers refinement | expand

Commit Message

Richard Henderson March 7, 2019, 8:12 p.m. UTC
The system registers aren't that interesting for debugging
user binaries.  Avoid adding them in this case.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/arm/helper.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.17.2

Comments

Peter Maydell March 26, 2019, 1:43 p.m. UTC | #1
On Thu, 7 Mar 2019 at 20:12, Richard Henderson
<richard.henderson@linaro.org> wrote:
>

> The system registers aren't that interesting for debugging

> user binaries.  Avoid adding them in this case.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


I think a better approach would be to arrange to only
expose to the gdbstub for linux-user mode those system registers
which are marked as accessible to EL0.

thanks
-- PMM
diff mbox series

Patch

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 2607d39ad1..ca5632d26f 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -221,6 +221,7 @@  static void write_raw_cp_reg(CPUARMState *env, const ARMCPRegInfo *ri,
     }
 }
 
+#ifndef CONFIG_USER_ONLY
 static int arm_gdb_get_sysreg(CPUARMState *env, uint8_t *buf, int reg)
 {
     ARMCPU *cpu = arm_env_get_cpu(env);
@@ -243,6 +244,7 @@  static int arm_gdb_set_sysreg(CPUARMState *env, uint8_t *buf, int reg)
 {
     return 0;
 }
+#endif
 
 static bool raw_accessors_invalid(const ARMCPRegInfo *ri)
 {
@@ -6694,9 +6696,11 @@  void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu)
         gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg,
                                  19, "arm-vfp.xml", 0);
     }
+#ifndef CONFIG_USER_ONLY
     gdb_register_coprocessor(cs, arm_gdb_get_sysreg, arm_gdb_set_sysreg,
                              arm_gen_dynamic_xml(cs),
                              "system-registers.xml", 0);
+#endif
 }
 
 /* Sort alphabetically by type name, except for "any". */