mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
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:
parent
48de646280
commit
a650683871
11 changed files with 25 additions and 26 deletions
|
@ -766,9 +766,9 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data)
|
|||
#endif
|
||||
}
|
||||
|
||||
static gchar *loongarch32_gdb_arch_name(CPUState *cs)
|
||||
static const gchar *loongarch32_gdb_arch_name(CPUState *cs)
|
||||
{
|
||||
return g_strdup("loongarch32");
|
||||
return "loongarch32";
|
||||
}
|
||||
|
||||
static void loongarch32_cpu_class_init(ObjectClass *c, void *data)
|
||||
|
@ -780,9 +780,9 @@ static void loongarch32_cpu_class_init(ObjectClass *c, void *data)
|
|||
cc->gdb_arch_name = loongarch32_gdb_arch_name;
|
||||
}
|
||||
|
||||
static gchar *loongarch64_gdb_arch_name(CPUState *cs)
|
||||
static const gchar *loongarch64_gdb_arch_name(CPUState *cs)
|
||||
{
|
||||
return g_strdup("loongarch64");
|
||||
return "loongarch64";
|
||||
}
|
||||
|
||||
static void loongarch64_cpu_class_init(ObjectClass *c, void *data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue