hw/core/cpu: Return static value with gdb_arch_name()

All implementations of gdb_arch_name() returns dynamic duplicates of
static strings. It's also unlikely that there will be an implementation
of gdb_arch_name() that returns a truly dynamic value due to the nature
of the function returning a well-known identifiers. Qualify the value
gdb_arch_name() with const and make all of its implementations return
static strings.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230912224107.29669-8-akihiko.odaki@daynix.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20231009164104.369749-15-alex.bennee@linaro.org>
This commit is contained in:
Akihiko Odaki authored and Alex Bennée committed 2023-10-11 08:46:33 +01:00
1 parent 48de646280
commit a650683871
11 files changed
+25 -26

No files matched your search

+1 -2
View File
@@ -380,10 +380,9 @@ static const char *get_feature_xml(const char *p, const char **newp,
"<target>");
if (cc->gdb_arch_name) {
g_autofree gchar *arch = cc->gdb_arch_name(cpu);
g_string_append_printf(xml,
"<architecture>%s</architecture>",
arch);
cc->gdb_arch_name(cpu));
}
g_string_append(xml, "<xi:include href=\"");
g_string_append(xml, cc->gdb_core_xml_file);