gdb: LoongArch: Add Makefile, configure and NEWS
authorTiezhu Yang <yangtiezhu@loongson.cn>
Fri, 11 Feb 2022 12:17:56 +0000 (20:17 +0800)
committerTiezhu Yang <yangtiezhu@loongson.cn>
Fri, 11 Feb 2022 12:17:56 +0000 (20:17 +0800)
This commit adds Makefile, configure and NEWS 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>
gdb/Makefile.in
gdb/NEWS
gdb/configure.host
gdb/configure.nat
gdb/configure.tgt
gdb/features/Makefile

index bf19db453437476cf3a0d4118a26be7ddb3f2fc2..70cef6e28b5f108c0a4a53d9bfe39c5945e8f084 100644 (file)
@@ -745,6 +745,7 @@ ALL_TARGET_OBS = \
        arch/arm-get-next-pcs.o \
        arch/arm-linux.o \
        arch/i386.o \
+       arch/loongarch.o \
        arch/ppc-linux-common.o \
        arm-bsd-tdep.o \
        arm-fbsd-tdep.o \
@@ -794,6 +795,8 @@ ALL_TARGET_OBS = \
        linux-record.o \
        linux-tdep.o \
        lm32-tdep.o \
+       loongarch-linux-tdep.o \
+       loongarch-tdep.o \
        m32c-tdep.o \
        m32r-linux-tdep.o \
        m32r-tdep.o \
@@ -1357,6 +1360,7 @@ HFILES_NO_SRCDIR = \
        linux-record.h \
        linux-tdep.h \
        location.h \
+       loongarch-tdep.h \
        m2-lang.h \
        m32r-tdep.h \
        m68k-tdep.h \
@@ -1491,6 +1495,7 @@ HFILES_NO_SRCDIR = \
        arch/arc.h \
        arch/arm.h \
        arch/i386.h \
+       arch/loongarch.h \
        arch/ppc-linux-common.h \
        arch/ppc-linux-tdesc.h \
        arch/riscv.h \
@@ -2232,6 +2237,9 @@ ALLDEPFILES = \
        linux-record.c \
        linux-tdep.c \
        lm32-tdep.c \
+       loongarch-linux-nat.c \
+       loongarch-linux-tdep.c \
+       loongarch-tdep.c \
        m32r-linux-nat.c \
        m32r-linux-tdep.c \
        m32r-tdep.c \
index b4a515120db4950b5692d429c5294d9a23091f95..e173d38c3a1a75b68b8ed7856af281a464bbfef9 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -114,6 +114,10 @@ info win
   This command now includes information about the width of the tui
   windows in its output.
 
+* New targets
+
+GNU/Linux/LoongArch    loongarch*-*-linux*
+
 * Python API
 
   ** New function gdb.add_history(), which takes a gdb.Value object
index be40cc814fc5bad27c2c44f78bff034def83b392..da71675b201b11ea5236c1818e01ab37423585c0 100644 (file)
@@ -58,6 +58,7 @@ arc*)                 gdb_host_cpu=arc ;;
 arm*)                  gdb_host_cpu=arm ;;
 hppa*)                 gdb_host_cpu=pa ;;
 i[34567]86*)           gdb_host_cpu=i386 ;;
+loongarch*)            gdb_host_cpu=loongarch ;;
 m68*)                  gdb_host_cpu=m68k ;;
 mips*)                 gdb_host_cpu=mips ;;
 powerpc* | rs6000)     gdb_host_cpu=powerpc ;;
@@ -117,6 +118,8 @@ i[34567]86-*-cygwin*)       gdb_host=cygwin ;;
 
 ia64-*-linux*)         gdb_host=linux ;;
 
+loongarch*-linux*)     gdb_host=linux ;;
+
 m68*-*-linux*)         gdb_host=linux ;;
 m68*-*-netbsd* | m68*-*-knetbsd*-gnu)
                        gdb_host=nbsdelf ;;
index 20ce8050a9692e87678863d7eba900f35d2b8eae..b45519fd1164d153df65772b7085c2674a345dbb 100644 (file)
@@ -258,6 +258,10 @@ case ${gdb_host} in
                # Host: Intel IA-64 running GNU/Linux
                NATDEPFILES="${NATDEPFILES} ia64-linux-nat.o"
                ;;
+           loongarch)
+               # Host: LoongArch, running GNU/Linux.
+               NATDEPFILES="${NATDEPFILES} loongarch-linux-nat.o linux-nat-trad.o"
+               ;;
            m32r)
                # Host: M32R based machine running GNU/Linux
                NATDEPFILES="${NATDEPFILES} m32r-linux-nat.o"
index 56cdfef937b2ea5fa01788adcc227d58946855dd..65f3bf6387da45c56fa3f27c4b4f5cfde185d206 100644 (file)
@@ -91,6 +91,11 @@ ia64*-*-*)
        cpu_obs="ia64-tdep.o"
        ;;
 
+loongarch*-*-*)
+       # Target: LoongArch baremetal
+       cpu_obs="loongarch-tdep.o arch/loongarch.o"
+       ;;
+
 riscv*-*-*)
        cpu_obs="riscv-tdep.o riscv-none-tdep.o arch/riscv.o \
                 ravenscar-thread.o riscv-ravenscar-thread.o";;
@@ -341,6 +346,12 @@ lm32-*-*)
        gdb_target_obs="lm32-tdep.o" 
        ;;
 
+loongarch*-*-linux*)
+       # Target: LoongArch running Linux
+       gdb_target_obs="loongarch-linux-tdep.o glibc-tdep.o \
+                       linux-tdep.o solib-svr4.o"
+       ;;
+
 m32c-*-*)
        # Target: Renesas M32C family
        gdb_target_obs="m32c-tdep.o"
index bd39abda1086d78d89b59d217b1fd6914028d93d..68e17d0085d345c09080d21936a1784ab86accf4 100644 (file)
@@ -173,6 +173,7 @@ GDB = false
 aarch64-feature = 1
 arm-feature = 1
 i386-feature = 1
+loongarch-feature = 1
 riscv-feature = 1
 tic6x-feature = 1
 
@@ -226,6 +227,8 @@ FEATURE_XMLFILES = aarch64-core.xml \
        i386/64bit-pkeys.xml \
        i386/64bit-sse.xml \
        i386/x32-core.xml \
+       loongarch/base32.xml \
+       loongarch/base64.xml \
        riscv/rv32e-xregs.xml \
        riscv/32bit-cpu.xml \
        riscv/32bit-fpu.xml \