[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 16/24] target/ppc: Fill new members of GDBFeature
From: |
Akihiko Odaki |
Subject: |
[RFC PATCH 16/24] target/ppc: Fill new members of GDBFeature |
Date: |
Mon, 31 Jul 2023 17:43:43 +0900 |
These members will be used to help plugins to identify registers.
Signed-off-by: Akihiko Odaki <akihiko.odaki@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
- [RFC PATCH 06/24] hw/core/cpu: Replace gdb_core_xml_file with gdb_core_feature, (continued)
- [RFC PATCH 06/24] hw/core/cpu: Replace gdb_core_xml_file with gdb_core_feature, Akihiko Odaki, 2023/07/31
- [RFC PATCH 08/24] target/ppc: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/07/31
- [RFC PATCH 07/24] target/arm: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/07/31
- [RFC PATCH 09/24] target/riscv: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/07/31
- [RFC PATCH 10/24] gdbstub: Use GDBFeature for gdb_register_coprocessor, Akihiko Odaki, 2023/07/31
- [RFC PATCH 11/24] gdbstub: Use GDBFeature for GDBRegisterState, Akihiko Odaki, 2023/07/31
- [RFC PATCH 12/24] gdbstub: Simplify XML lookup, Akihiko Odaki, 2023/07/31
- [RFC PATCH 13/24] hw/core/cpu: Remove gdb_get_dynamic_xml member, Akihiko Odaki, 2023/07/31
- [RFC PATCH 14/24] gdbstub: Add members to identify registers to GDBFeature, Akihiko Odaki, 2023/07/31
- [RFC PATCH 15/24] target/arm: Fill new members of GDBFeature, Akihiko Odaki, 2023/07/31
- [RFC PATCH 16/24] target/ppc: Fill new members of GDBFeature,
Akihiko Odaki <=
- [RFC PATCH 17/24] target/riscv: Fill new members of GDBFeature, Akihiko Odaki, 2023/07/31
- [RFC PATCH 18/24] hw/core/cpu: Add a parameter to gdb_read_register/gdb_write_register, Akihiko Odaki, 2023/07/31
- [RFC PATCH 20/24] gdbstub: Expose functions to read registers, Akihiko Odaki, 2023/07/31
- [RFC PATCH 19/24] gdbstub: Hide gdb_has_xml, Akihiko Odaki, 2023/07/31
- [RFC PATCH 21/24] plugins: Allow to read registers, Akihiko Odaki, 2023/07/31
- [RFC PATCH 22/24] contrib/plugins: Allow to log registers, Akihiko Odaki, 2023/07/31
- [RFC PATCH 23/24] plugins: Support C++, Akihiko Odaki, 2023/07/31
- [RFC PATCH 24/24] contrib/plugins: Add cc plugin, Akihiko Odaki, 2023/07/31