These members will be used to help plugins to identify registers. Signed-off-by: Akihiko Odaki <akihiko.od...@daynix.com> --- target/ppc/gdbstub.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index 19c4935260..ac4ed12371 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -323,7 +323,7 @@ void ppc_gdb_gen_spr_feature(PowerPCCPU *cpu) PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); CPUPPCState *env = &cpu->env; GString *xml; - char *spr_name; + const char **regs; unsigned int num_regs = 0; int i; @@ -350,6 +350,7 @@ void ppc_gdb_gen_spr_feature(PowerPCCPU *cpu) return; } + regs = g_new(const char *, num_regs); xml = g_string_new("<?xml version=\"1.0\"?>"); g_string_append(xml, "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">"); g_string_append(xml, "<feature name=\"org.qemu.power.spr\">"); @@ -361,9 +362,8 @@ void ppc_gdb_gen_spr_feature(PowerPCCPU *cpu) continue; } - spr_name = g_ascii_strdown(spr->name, -1); - g_string_append_printf(xml, "<reg name=\"%s\"", spr_name); - g_free(spr_name); + regs[spr->gdb_id] = g_ascii_strdown(spr->name, -1); + g_string_append_printf(xml, "<reg name=\"%s\"", regs[spr->gdb_id]); g_string_append_printf(xml, " bitsize=\"%d\"", TARGET_LONG_BITS); g_string_append(xml, " group=\"spr\"/>"); @@ -371,6 +371,8 @@ void ppc_gdb_gen_spr_feature(PowerPCCPU *cpu) g_string_append(xml, "</feature>"); + pcc->gdb_spr.name = "org.qemu.power.spr"; + pcc->gdb_spr.regs = regs; pcc->gdb_spr.num_regs = num_regs; pcc->gdb_spr.xmlname = "power-spr.xml"; pcc->gdb_spr.xml = g_string_free(xml, false); -- 2.41.0