* [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement
@ 2019-03-07 20:12 Richard Henderson
2019-03-07 20:12 ` [Qemu-devel] [PATCH 1/2] target/arm: Put system registers in "system" group Richard Henderson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Richard Henderson @ 2019-03-07 20:12 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell
This was working toward fixing
https://bugs.linaro.org/show_bug.cgi?id=4274
although I don't think I'm entirely successful. I would argue,
however, that gdb's behaviour in this is odd. Why are registers
that are clearly marked "system" being added to "general" simply
because they have integer type?
In the meantime, we don't really need to present these registers
to the user for CONFIG_USER_ONLY.
r~
Richard Henderson (2):
target/arm: Put system registers in "system" group
target/arm: Don't add system-registers.xml for user-only
target/arm/gdbstub.c | 2 +-
target/arm/helper.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
--
2.17.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 1/2] target/arm: Put system registers in "system" group
2019-03-07 20:12 [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement Richard Henderson
@ 2019-03-07 20:12 ` Richard Henderson
2019-03-07 20:12 ` [Qemu-devel] [PATCH 2/2] target/arm: Don't add system-registers.xml for user-only Richard Henderson
2019-03-08 15:59 ` [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement Peter Maydell
2 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2019-03-07 20:12 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell
The system group is predefined within gdb. While the spec
seems to allow arbitrary group names, that seems to mess up
the addition of all registers to any groups.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/gdbstub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c
index 0c64c0292e..67c8874b3b 100644
--- a/target/arm/gdbstub.c
+++ b/target/arm/gdbstub.c
@@ -113,7 +113,7 @@ static void arm_gen_one_xml_reg_tag(GString *s, DynamicGDBXMLInfo *dyn_xml,
{
g_string_append_printf(s, "<reg name=\"%s\"", ri->name);
g_string_append_printf(s, " bitsize=\"%d\"", bitsize);
- g_string_append_printf(s, " group=\"cp_regs\"/>");
+ g_string_append_printf(s, " group=\"system\"/>");
dyn_xml->num_cpregs++;
dyn_xml->cpregs_keys[dyn_xml->num_cpregs - 1] = ri_key;
}
--
2.17.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 2/2] target/arm: Don't add system-registers.xml for user-only
2019-03-07 20:12 [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement Richard Henderson
2019-03-07 20:12 ` [Qemu-devel] [PATCH 1/2] target/arm: Put system registers in "system" group Richard Henderson
@ 2019-03-07 20:12 ` Richard Henderson
2019-03-08 15:59 ` [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement Peter Maydell
2 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2019-03-07 20:12 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell
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(+)
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". */
--
2.17.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement
2019-03-07 20:12 [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement Richard Henderson
2019-03-07 20:12 ` [Qemu-devel] [PATCH 1/2] target/arm: Put system registers in "system" group Richard Henderson
2019-03-07 20:12 ` [Qemu-devel] [PATCH 2/2] target/arm: Don't add system-registers.xml for user-only Richard Henderson
@ 2019-03-08 15:59 ` Peter Maydell
2019-03-08 16:11 ` Richard Henderson
2 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2019-03-08 15:59 UTC (permalink / raw)
To: Richard Henderson; +Cc: QEMU Developers
On Thu, 7 Mar 2019 at 20:12, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> This was working toward fixing
>
> https://bugs.linaro.org/show_bug.cgi?id=4274
>
> although I don't think I'm entirely successful. I would argue,
> however, that gdb's behaviour in this is odd. Why are registers
> that are clearly marked "system" being added to "general" simply
> because they have integer type?
Yeah, this does seem to me like it might be a bug on
gdb's end -- are you following up with them?
> In the meantime, we don't really need to present these registers
> to the user for CONFIG_USER_ONLY.
Reasonable enough, I guess, though a few sysregs are
visible to EL0.
thanks
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement
2019-03-08 15:59 ` [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement Peter Maydell
@ 2019-03-08 16:11 ` Richard Henderson
0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2019-03-08 16:11 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Developers
On 3/8/19 7:59 AM, Peter Maydell wrote:
> On Thu, 7 Mar 2019 at 20:12, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> This was working toward fixing
>>
>> https://bugs.linaro.org/show_bug.cgi?id=4274
>>
>> although I don't think I'm entirely successful. I would argue,
>> however, that gdb's behaviour in this is odd. Why are registers
>> that are clearly marked "system" being added to "general" simply
>> because they have integer type?
>
> Yeah, this does seem to me like it might be a bug on
> gdb's end -- are you following up with them?
Yes.
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-03-08 16:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-07 20:12 [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement Richard Henderson
2019-03-07 20:12 ` [Qemu-devel] [PATCH 1/2] target/arm: Put system registers in "system" group Richard Henderson
2019-03-07 20:12 ` [Qemu-devel] [PATCH 2/2] target/arm: Don't add system-registers.xml for user-only Richard Henderson
2019-03-08 15:59 ` [Qemu-devel] [PATCH 0/2] target/arm: gdbstub system registers refinement Peter Maydell
2019-03-08 16:11 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).