aboutsummaryrefslogtreecommitdiff
path: root/gdb/features
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2022-02-11 20:12:30 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2022-02-11 20:12:30 +0800
commite74d08100dd3d1c5aee6eb67235465ebed194380 (patch)
treeae3e047cf6c2ec47d755317a569b7b4803ec621c /gdb/features
parent7c1aa0090f673e29e0b54eae9975b2c1b72a49d2 (diff)
downloadgdb-e74d08100dd3d1c5aee6eb67235465ebed194380.zip
gdb-e74d08100dd3d1c5aee6eb67235465ebed194380.tar.gz
gdb-e74d08100dd3d1c5aee6eb67235465ebed194380.tar.bz2
gdb: LoongArch: Add initial target description support
This commit adds initial target description support for LoongArch. Signed-off-by: Zhensong Liu <liuzhensong@loongson.cn> Signed-off-by: Qing zhang <zhangqing@loongson.cn> Signed-off-by: Youling Tang <tangyouling@loongson.cn> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Diffstat (limited to 'gdb/features')
-rw-r--r--gdb/features/loongarch/base32.c47
-rw-r--r--gdb/features/loongarch/base32.xml44
-rw-r--r--gdb/features/loongarch/base64.c47
-rw-r--r--gdb/features/loongarch/base64.xml44
4 files changed, 182 insertions, 0 deletions
diff --git a/gdb/features/loongarch/base32.c b/gdb/features/loongarch/base32.c
new file mode 100644
index 0000000..7105c15
--- /dev/null
+++ b/gdb/features/loongarch/base32.c
@@ -0,0 +1,47 @@
+/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
+ Original: base32.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_loongarch_base32 (struct target_desc *result, long regnum)
+{
+ struct tdesc_feature *feature;
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.loongarch.base");
+ tdesc_create_reg (feature, "r0", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r1", regnum++, 1, "general", 32, "code_ptr");
+ tdesc_create_reg (feature, "r2", regnum++, 1, "general", 32, "data_ptr");
+ tdesc_create_reg (feature, "r3", regnum++, 1, "general", 32, "data_ptr");
+ tdesc_create_reg (feature, "r4", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r5", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r6", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r7", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r8", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r9", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r10", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r11", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r12", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r13", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r14", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r15", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r16", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r17", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r18", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r19", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r20", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r21", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r22", regnum++, 1, "general", 32, "data_ptr");
+ tdesc_create_reg (feature, "r23", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r24", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r25", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r26", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r27", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r28", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r29", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r30", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "r31", regnum++, 1, "general", 32, "uint32");
+ tdesc_create_reg (feature, "pc", regnum++, 1, "general", 32, "code_ptr");
+ tdesc_create_reg (feature, "badv", regnum++, 1, "general", 32, "code_ptr");
+ return regnum;
+}
diff --git a/gdb/features/loongarch/base32.xml b/gdb/features/loongarch/base32.xml
new file mode 100644
index 0000000..5b00f8a
--- /dev/null
+++ b/gdb/features/loongarch/base32.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2022 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.loongarch.base">
+ <reg name="r0" bitsize="32" type="uint32" group="general"/>
+ <reg name="r1" bitsize="32" type="code_ptr" group="general"/>
+ <reg name="r2" bitsize="32" type="data_ptr" group="general"/>
+ <reg name="r3" bitsize="32" type="data_ptr" group="general"/>
+ <reg name="r4" bitsize="32" type="uint32" group="general"/>
+ <reg name="r5" bitsize="32" type="uint32" group="general"/>
+ <reg name="r6" bitsize="32" type="uint32" group="general"/>
+ <reg name="r7" bitsize="32" type="uint32" group="general"/>
+ <reg name="r8" bitsize="32" type="uint32" group="general"/>
+ <reg name="r9" bitsize="32" type="uint32" group="general"/>
+ <reg name="r10" bitsize="32" type="uint32" group="general"/>
+ <reg name="r11" bitsize="32" type="uint32" group="general"/>
+ <reg name="r12" bitsize="32" type="uint32" group="general"/>
+ <reg name="r13" bitsize="32" type="uint32" group="general"/>
+ <reg name="r14" bitsize="32" type="uint32" group="general"/>
+ <reg name="r15" bitsize="32" type="uint32" group="general"/>
+ <reg name="r16" bitsize="32" type="uint32" group="general"/>
+ <reg name="r17" bitsize="32" type="uint32" group="general"/>
+ <reg name="r18" bitsize="32" type="uint32" group="general"/>
+ <reg name="r19" bitsize="32" type="uint32" group="general"/>
+ <reg name="r20" bitsize="32" type="uint32" group="general"/>
+ <reg name="r21" bitsize="32" type="uint32" group="general"/>
+ <reg name="r22" bitsize="32" type="data_ptr" group="general"/>
+ <reg name="r23" bitsize="32" type="uint32" group="general"/>
+ <reg name="r24" bitsize="32" type="uint32" group="general"/>
+ <reg name="r25" bitsize="32" type="uint32" group="general"/>
+ <reg name="r26" bitsize="32" type="uint32" group="general"/>
+ <reg name="r27" bitsize="32" type="uint32" group="general"/>
+ <reg name="r28" bitsize="32" type="uint32" group="general"/>
+ <reg name="r29" bitsize="32" type="uint32" group="general"/>
+ <reg name="r30" bitsize="32" type="uint32" group="general"/>
+ <reg name="r31" bitsize="32" type="uint32" group="general"/>
+ <reg name="pc" bitsize="32" type="code_ptr" group="general"/>
+ <reg name="badv" bitsize="32" type="code_ptr" group="general"/>
+</feature>
diff --git a/gdb/features/loongarch/base64.c b/gdb/features/loongarch/base64.c
new file mode 100644
index 0000000..63eee02
--- /dev/null
+++ b/gdb/features/loongarch/base64.c
@@ -0,0 +1,47 @@
+/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
+ Original: base64.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_loongarch_base64 (struct target_desc *result, long regnum)
+{
+ struct tdesc_feature *feature;
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.loongarch.base");
+ tdesc_create_reg (feature, "r0", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r1", regnum++, 1, "general", 64, "code_ptr");
+ tdesc_create_reg (feature, "r2", regnum++, 1, "general", 64, "data_ptr");
+ tdesc_create_reg (feature, "r3", regnum++, 1, "general", 64, "data_ptr");
+ tdesc_create_reg (feature, "r4", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r5", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r6", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r7", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r8", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r9", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r10", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r11", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r12", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r13", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r14", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r15", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r16", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r17", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r18", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r19", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r20", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r21", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r22", regnum++, 1, "general", 64, "data_ptr");
+ tdesc_create_reg (feature, "r23", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r24", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r25", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r26", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r27", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r28", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r29", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r30", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "r31", regnum++, 1, "general", 64, "uint64");
+ tdesc_create_reg (feature, "pc", regnum++, 1, "general", 64, "code_ptr");
+ tdesc_create_reg (feature, "badv", regnum++, 1, "general", 64, "code_ptr");
+ return regnum;
+}
diff --git a/gdb/features/loongarch/base64.xml b/gdb/features/loongarch/base64.xml
new file mode 100644
index 0000000..bef91e5
--- /dev/null
+++ b/gdb/features/loongarch/base64.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2022 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.loongarch.base">
+ <reg name="r0" bitsize="64" type="uint64" group="general"/>
+ <reg name="r1" bitsize="64" type="code_ptr" group="general"/>
+ <reg name="r2" bitsize="64" type="data_ptr" group="general"/>
+ <reg name="r3" bitsize="64" type="data_ptr" group="general"/>
+ <reg name="r4" bitsize="64" type="uint64" group="general"/>
+ <reg name="r5" bitsize="64" type="uint64" group="general"/>
+ <reg name="r6" bitsize="64" type="uint64" group="general"/>
+ <reg name="r7" bitsize="64" type="uint64" group="general"/>
+ <reg name="r8" bitsize="64" type="uint64" group="general"/>
+ <reg name="r9" bitsize="64" type="uint64" group="general"/>
+ <reg name="r10" bitsize="64" type="uint64" group="general"/>
+ <reg name="r11" bitsize="64" type="uint64" group="general"/>
+ <reg name="r12" bitsize="64" type="uint64" group="general"/>
+ <reg name="r13" bitsize="64" type="uint64" group="general"/>
+ <reg name="r14" bitsize="64" type="uint64" group="general"/>
+ <reg name="r15" bitsize="64" type="uint64" group="general"/>
+ <reg name="r16" bitsize="64" type="uint64" group="general"/>
+ <reg name="r17" bitsize="64" type="uint64" group="general"/>
+ <reg name="r18" bitsize="64" type="uint64" group="general"/>
+ <reg name="r19" bitsize="64" type="uint64" group="general"/>
+ <reg name="r20" bitsize="64" type="uint64" group="general"/>
+ <reg name="r21" bitsize="64" type="uint64" group="general"/>
+ <reg name="r22" bitsize="64" type="data_ptr" group="general"/>
+ <reg name="r23" bitsize="64" type="uint64" group="general"/>
+ <reg name="r24" bitsize="64" type="uint64" group="general"/>
+ <reg name="r25" bitsize="64" type="uint64" group="general"/>
+ <reg name="r26" bitsize="64" type="uint64" group="general"/>
+ <reg name="r27" bitsize="64" type="uint64" group="general"/>
+ <reg name="r28" bitsize="64" type="uint64" group="general"/>
+ <reg name="r29" bitsize="64" type="uint64" group="general"/>
+ <reg name="r30" bitsize="64" type="uint64" group="general"/>
+ <reg name="r31" bitsize="64" type="uint64" group="general"/>
+ <reg name="pc" bitsize="64" type="code_ptr" group="general"/>
+ <reg name="badv" bitsize="64" type="code_ptr" group="general"/>
+</feature>