aboutsummaryrefslogtreecommitdiff
path: root/gdb/features
diff options
context:
space:
mode:
authorFeiyang Chen <chenfeiyang@loongson.cn>2024-01-25 16:32:36 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2024-02-06 18:40:19 +0800
commite4d74c01e77365f1327e4e567e7579cdd3bf74f6 (patch)
tree57a80ffa2ea61b4754b9d71f89fcee012966bf05 /gdb/features
parent1e9569f383a3d5a88ee07d0c2401bd95613c222e (diff)
downloadbinutils-e4d74c01e77365f1327e4e567e7579cdd3bf74f6.zip
binutils-e4d74c01e77365f1327e4e567e7579cdd3bf74f6.tar.gz
binutils-e4d74c01e77365f1327e4e567e7579cdd3bf74f6.tar.bz2
gdb: LoongArch: Add LBT extension support
Loongson Binary Translation (LBT) is used to accelerate binary translation, which contains 4 scratch registers (scr0 to scr3), x86/ARM eflags (eflags) and x87 fpu stack pointer (ftop). This patch support gdb to fetch/store these registers. Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn> # Framework Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> # Detail Optimizes Signed-off-by: Hui Li <lihui@loongson.cn> # Error Fixes Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Diffstat (limited to 'gdb/features')
-rw-r--r--gdb/features/Makefile1
-rw-r--r--gdb/features/loongarch/lbt.c19
-rw-r--r--gdb/features/loongarch/lbt.xml16
3 files changed, 36 insertions, 0 deletions
diff --git a/gdb/features/Makefile b/gdb/features/Makefile
index 7c33c09..ddf4ec2 100644
--- a/gdb/features/Makefile
+++ b/gdb/features/Makefile
@@ -239,6 +239,7 @@ FEATURE_XMLFILES = aarch64-core.xml \
loongarch/fpu.xml \
loongarch/lsx.xml \
loongarch/lasx.xml \
+ loongarch/lbt.xml \
riscv/rv32e-xregs.xml \
riscv/32bit-cpu.xml \
riscv/32bit-fpu.xml \
diff --git a/gdb/features/loongarch/lbt.c b/gdb/features/loongarch/lbt.c
new file mode 100644
index 0000000..869c862
--- /dev/null
+++ b/gdb/features/loongarch/lbt.c
@@ -0,0 +1,19 @@
+/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
+ Original: lbt.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_loongarch_lbt (struct target_desc *result, long regnum)
+{
+ struct tdesc_feature *feature;
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.loongarch.lbt");
+ tdesc_create_reg (feature, "scr0", regnum++, 1, "lbt", 64, "uint64");
+ tdesc_create_reg (feature, "scr1", regnum++, 1, "lbt", 64, "uint64");
+ tdesc_create_reg (feature, "scr2", regnum++, 1, "lbt", 64, "uint64");
+ tdesc_create_reg (feature, "scr3", regnum++, 1, "lbt", 64, "uint64");
+ tdesc_create_reg (feature, "eflags", regnum++, 1, "lbt", 32, "uint32");
+ tdesc_create_reg (feature, "ftop", regnum++, 1, "lbt", 32, "uint32");
+ return regnum;
+}
diff --git a/gdb/features/loongarch/lbt.xml b/gdb/features/loongarch/lbt.xml
new file mode 100644
index 0000000..6526ee6
--- /dev/null
+++ b/gdb/features/loongarch/lbt.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2022-2024 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.lbt">
+ <reg name="scr0" bitsize="64" type="uint64" group="lbt"/>
+ <reg name="scr1" bitsize="64" type="uint64" group="lbt"/>
+ <reg name="scr2" bitsize="64" type="uint64" group="lbt"/>
+ <reg name="scr3" bitsize="64" type="uint64" group="lbt"/>
+ <reg name="eflags" bitsize="32" type="uint32" group="lbt"/>
+ <reg name="ftop" bitsize="32" type="uint32" group="lbt"/>
+</feature>