From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7873) id 660913858412; Wed, 20 Mar 2024 10:51:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 660913858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710931913; bh=MT1kF2vivr7Mj5Y6W/3dTxlaQ8oT8o4P9HdriZGd+cU=; h=From:To:Subject:Date:From; b=ndAP2ldVfrDaxFvd4DjuPkV7Blq2V05F0vgWd9M7q+rTMXodY590vwEGLhrT8xzFh NqV84ey27bkmzj0cOBEglsfcKpTIFVwlqDxC9aovp0Mkdj3ZOfAZ7J9F8mrhzqj+ER jb1mJtEgSgS1z1SZCqQtpK/az5J9pRcSxoC0sgL4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tiezhu Yang To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: LoongArch: Set the correct XML syscall filename X-Act-Checkin: binutils-gdb X-Git-Author: Tiezhu Yang X-Git-Refname: refs/heads/master X-Git-Oldrev: b369b90c0d881d6fe5033269019e0f487e53a8eb X-Git-Newrev: 53ff349e553fa9fc446a8711e37fd252282b088b Message-Id: <20240320105153.660913858412@sourceware.org> Date: Wed, 20 Mar 2024 10:51:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D53ff349e553f= a9fc446a8711e37fd252282b088b commit 53ff349e553fa9fc446a8711e37fd252282b088b Author: Tiezhu Yang Date: Thu Feb 29 16:39:10 2024 +0800 gdb: LoongArch: Set the correct XML syscall filename =20 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. =20 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. =20 Without this patch: =20 (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) =20 Signed-off-by: Tiezhu Yang Approved-By: John Baldwin Diff: --- gdb/data-directory/Makefile.in | 1 + gdb/loongarch-linux-tdep.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in index 2a40be4ade0..edfa52c2217 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in @@ -53,6 +53,7 @@ GEN_SYSCALLS_FILES =3D \ 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 5ea648acd81..1c7a7cf222c 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" =20 /* Unpack an elf_gregset_t into GDB's register cache. */ =20 @@ -590,6 +594,9 @@ loongarch_linux_init_abi (struct gdbarch_info info, str= uct gdbarch *gdbarch) =20 tdep->syscall_next_pc =3D loongarch_linux_syscall_next_pc; =20 + /* 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_num= ber); }