summaryrefslogtreecommitdiffstats
path: root/target-s390x/cpu.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-12-03 13:14:41 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:29:55 -0600
commitcd283efc7fb48e56fffc207a93288c1ffa21a84e (patch)
tree0d4fb046cf2d39009dc4086a76c90145a7c27199 /target-s390x/cpu.c
parentfabaf10ab58cd8302bb9cd5a3010384285648769 (diff)
downloadhqemu-cd283efc7fb48e56fffc207a93288c1ffa21a84e.zip
hqemu-cd283efc7fb48e56fffc207a93288c1ffa21a84e.tar.gz
gdb: provide the name of the architecture in the target.xml
This patch provides the name of the architecture in the target.xml if available. This allows the remote gdb to detect the target architecture on its own - so there is no need to specify it manually (e.g. if gdb is started without a binary) using "set arch *arch_name*". The name of the architecture is provided by a callback that can be implemented by all architectures. The arm implementation has special handling for iwmmxt and returns arm otherwise. This can be extended if necessary. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> [rework to use a callback] Message-Id: <1449144881-130935-1-git-send-email-borntraeger@de.ibm.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x/cpu.c')
-rw-r--r--target-s390x/cpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index e5a3f65..792310e 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -325,6 +325,11 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
}
#endif
+static gchar *s390_gdb_arch_name(CPUState *cs)
+{
+ return g_strdup("s390:64-bit");
+}
+
static void s390_cpu_class_init(ObjectClass *oc, void *data)
{
S390CPUClass *scc = S390_CPU_CLASS(oc);
@@ -360,6 +365,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
cc->gdb_num_core_regs = S390_NUM_CORE_REGS;
cc->gdb_core_xml_file = "s390x-core64.xml";
+ cc->gdb_arch_name = s390_gdb_arch_name;
/*
* Reason: s390_cpu_initfn() calls cpu_exec_init(), which saves
OpenPOWER on IntegriCloud