aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2024-02-29 16:39:10 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2024-03-20 18:50:43 +0800
commit53ff349e553fa9fc446a8711e37fd252282b088b (patch)
tree3a642f766b20964deca69e60bd75217c373a0eac /gdb
parentb369b90c0d881d6fe5033269019e0f487e53a8eb (diff)
downloadfsf-binutils-gdb-53ff349e553fa9fc446a8711e37fd252282b088b.zip
fsf-binutils-gdb-53ff349e553fa9fc446a8711e37fd252282b088b.tar.gz
fsf-binutils-gdb-53ff349e553fa9fc446a8711e37fd252282b088b.tar.bz2
gdb: LoongArch: Set the correct XML syscall filename
Now, there exists syscalls/loongarch-linux.xml, let us set the correct XML syscall filename for LoongArch, otherwise GDB won't be able to find the correct XML file to open and get the syscalls definitions. It should install the package expat-devel (a library for XML parsing) and configure --with-expat (done by default if libexpat is installed and found at configure time) for compiling gdb in this case. Without this patch: (gdb) catch syscall warning: There is no XML file to open. warning: GDB will not be able to display syscall names nor to verify if any provided syscall numbers are valid. Catchpoint 1 (any syscall) Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Approved-By: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/data-directory/Makefile.in1
-rw-r--r--gdb/loongarch-linux-tdep.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index 2a40be4..edfa52c 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -53,6 +53,7 @@ GEN_SYSCALLS_FILES = \
amd64-linux.xml \
arm-linux.xml \
i386-linux.xml \
+ loongarch-linux.xml \
mips-n32-linux.xml \
mips-n64-linux.xml \
mips-o32-linux.xml \
diff --git a/gdb/loongarch-linux-tdep.c b/gdb/loongarch-linux-tdep.c
index 5ea648a..1c7a7cf 100644
--- a/gdb/loongarch-linux-tdep.c
+++ b/gdb/loongarch-linux-tdep.c
@@ -27,6 +27,10 @@
#include "target-descriptions.h"
#include "trad-frame.h"
#include "tramp-frame.h"
+#include "xml-syscall.h"
+
+/* The syscall's XML filename for LoongArch. */
+#define XML_SYSCALL_FILENAME_LOONGARCH "syscalls/loongarch-linux.xml"
/* Unpack an elf_gregset_t into GDB's register cache. */
@@ -590,6 +594,9 @@ loongarch_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->syscall_next_pc = loongarch_linux_syscall_next_pc;
+ /* Set the correct XML syscall filename. */
+ set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_LOONGARCH);
+
/* Get the syscall number from the arch's register. */
set_gdbarch_get_syscall_number (gdbarch, loongarch_linux_get_syscall_number);
}