public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: gdb-patches@sourceware.org
Subject: [PATCH v1 7/7] gdb: LoongArch: Set the correct XML syscall filename
Date: Thu, 29 Feb 2024 16:39:10 +0800	[thread overview]
Message-ID: <20240229083910.9991-8-yangtiezhu@loongson.cn> (raw)
In-Reply-To: <20240229083910.9991-1-yangtiezhu@loongson.cn>

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>
---
 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 = \
 	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"
 
 /* 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);
 }
-- 
2.42.0


  parent reply	other threads:[~2024-02-29  8:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29  8:39 [PATCH v1 0/7] gdb: Modify some code about syscalls XML Tiezhu Yang
2024-02-29  8:39 ` [PATCH v1 1/7] gdb: syscalls: Update linux-defaults.xml.in Tiezhu Yang
2024-02-29  8:39 ` [PATCH v1 2/7] gdb: syscalls: Update .xml.in files for some archs Tiezhu Yang
2024-02-29  8:39 ` [PATCH v1 3/7] gdb: syscalls: Update .xml " Tiezhu Yang
2024-02-29  8:39 ` [PATCH v1 4/7] gdb: syscalls: Add loongarch-linux.xml.in Tiezhu Yang
2024-03-20 20:51   ` Pedro Alves
2024-03-21  2:02     ` Tiezhu Yang
2024-02-29  8:39 ` [PATCH v1 5/7] gdb: syscalls: Generate loongarch-linux.xml Tiezhu Yang
2024-02-29  8:39 ` [PATCH v1 6/7] gdb: syscalls: Add loongarch case in update-linux-from-src.sh Tiezhu Yang
2024-02-29  8:39 ` Tiezhu Yang [this message]
2024-03-13  1:18 ` [PING] [PATCH v1 0/7] gdb: Modify some code about syscalls XML Tiezhu Yang
2024-03-18  9:27 ` Tiezhu Yang
2024-03-19 16:29   ` [PING] " John Baldwin
2024-03-20 10:53     ` Tiezhu Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240229083910.9991-8-yangtiezhu@loongson.cn \
    --to=yangtiezhu@loongson.cn \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).