public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: syscalls: Add some tips for LoongArch xml files
@ 2024-03-21  1:55 Tiezhu Yang
  2024-03-21 13:20 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Tiezhu Yang @ 2024-03-21  1:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pedro Alves

In commit a08dc2aa004b (gdb: syscalls: Add loongarch-linux.xml.in),
it needs special handling when generating xml file. This should at
least be mentioned in the file comment rather than git log to help
the next person who regenerates this file understand what needs to
be done, suggested by Pedro Alves, thank you.

At the beginning, I only added the tips in loongarch-linux.xml.in,
after executing the command "make" to generate loongarch-linux.xml
from loongarch-linux.xml.in, it generates the same tips in the file
loongarch-linux.xml automatically, so update loongarch-linux.xml.in
and loongarch-linux.xml together.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 gdb/syscalls/loongarch-linux.xml    | 24 +++++++++++++++++++++++-
 gdb/syscalls/loongarch-linux.xml.in | 23 ++++++++++++++++++++++-
 2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/gdb/syscalls/loongarch-linux.xml b/gdb/syscalls/loongarch-linux.xml
index 91e7bbc9691..6e85dbd7166 100644
--- a/gdb/syscalls/loongarch-linux.xml
+++ b/gdb/syscalls/loongarch-linux.xml
@@ -9,7 +9,29 @@
 
      <sys/syscall.h>
 
-     The file mentioned above belongs to the Linux Kernel.  -->
+     The file mentioned above belongs to the Linux Kernel.
+
+     Note that the system header file /usr/include/asm-generic/unistd.h
+     may be different with the latest upstream Linux kernel uapi header
+     file include/uapi/asm-generic/unistd.h, it is better to copy the
+     upstream header file into the system header file when generating
+     loongarch-linux.xml.in.
+
+     There exist some __NR3264_ prefixed syscall numbers, replace them
+     with digital numbers according to /usr/include/asm-generic/unistd.h
+     and sort them by syscall number manually, maybe we can modify the
+     script to do it automatically in the future.
+
+     <syscall name="fcntl" number="__NR3264_fcntl"/>
+     <syscall name="statfs" number="__NR3264_statfs"/>
+     <syscall name="fstatfs" number="__NR3264_fstatfs"/>
+     <syscall name="truncate" number="__NR3264_truncate"/>
+     <syscall name="ftruncate" number="__NR3264_ftruncate"/>
+     <syscall name="lseek" number="__NR3264_lseek"/>
+     <syscall name="sendfile" number="__NR3264_sendfile"/>
+     <syscall name="mmap" number="__NR3264_mmap"/>
+     <syscall name="fadvise64" number="__NR3264_fadvise64"/>
+-->
 <syscalls_info>
   <syscall name="io_setup" number="0" groups="memory"/>
   <syscall name="io_destroy" number="1" groups="memory"/>
diff --git a/gdb/syscalls/loongarch-linux.xml.in b/gdb/syscalls/loongarch-linux.xml.in
index e6e17b3f2b6..cf38f311abe 100644
--- a/gdb/syscalls/loongarch-linux.xml.in
+++ b/gdb/syscalls/loongarch-linux.xml.in
@@ -11,8 +11,29 @@
 
      <sys/syscall.h>
 
-     The file mentioned above belongs to the Linux Kernel.  -->
+     The file mentioned above belongs to the Linux Kernel.
 
+     Note that the system header file /usr/include/asm-generic/unistd.h
+     may be different with the latest upstream Linux kernel uapi header
+     file include/uapi/asm-generic/unistd.h, it is better to copy the
+     upstream header file into the system header file when generating
+     loongarch-linux.xml.in.
+
+     There exist some __NR3264_ prefixed syscall numbers, replace them
+     with digital numbers according to /usr/include/asm-generic/unistd.h
+     and sort them by syscall number manually, maybe we can modify the
+     script to do it automatically in the future.
+
+     <syscall name="fcntl" number="__NR3264_fcntl"/>
+     <syscall name="statfs" number="__NR3264_statfs"/>
+     <syscall name="fstatfs" number="__NR3264_fstatfs"/>
+     <syscall name="truncate" number="__NR3264_truncate"/>
+     <syscall name="ftruncate" number="__NR3264_ftruncate"/>
+     <syscall name="lseek" number="__NR3264_lseek"/>
+     <syscall name="sendfile" number="__NR3264_sendfile"/>
+     <syscall name="mmap" number="__NR3264_mmap"/>
+     <syscall name="fadvise64" number="__NR3264_fadvise64"/>
+-->
 
 <syscalls_info>
   <syscall name="io_setup" number="0"/>
-- 
2.42.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: syscalls: Add some tips for LoongArch xml files
  2024-03-21  1:55 [PATCH] gdb: syscalls: Add some tips for LoongArch xml files Tiezhu Yang
@ 2024-03-21 13:20 ` Pedro Alves
  2024-03-21 14:19   ` Tiezhu Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2024-03-21 13:20 UTC (permalink / raw)
  To: Tiezhu Yang, gdb-patches

On 2024-03-21 01:55, Tiezhu Yang wrote:
> In commit a08dc2aa004b (gdb: syscalls: Add loongarch-linux.xml.in),
> it needs special handling when generating xml file. This should at
> least be mentioned in the file comment rather than git log to help
> the next person who regenerates this file understand what needs to
> be done, suggested by Pedro Alves, thank you.
> 
> At the beginning, I only added the tips in loongarch-linux.xml.in,
> after executing the command "make" to generate loongarch-linux.xml
> from loongarch-linux.xml.in, it generates the same tips in the file
> loongarch-linux.xml automatically, so update loongarch-linux.xml.in
> and loongarch-linux.xml together.
> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>

Thanks!

Approved-by: Pedro Alves <pedro@palves.net>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: syscalls: Add some tips for LoongArch xml files
  2024-03-21 13:20 ` Pedro Alves
@ 2024-03-21 14:19   ` Tiezhu Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Tiezhu Yang @ 2024-03-21 14:19 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches



On 3/21/24 21:20, Pedro Alves wrote:
> On 2024-03-21 01:55, Tiezhu Yang wrote:
>> In commit a08dc2aa004b (gdb: syscalls: Add loongarch-linux.xml.in),
>> it needs special handling when generating xml file. This should at
>> least be mentioned in the file comment rather than git log to help
>> the next person who regenerates this file understand what needs to
>> be done, suggested by Pedro Alves, thank you.
>>
>> At the beginning, I only added the tips in loongarch-linux.xml.in,
>> after executing the command "make" to generate loongarch-linux.xml
>> from loongarch-linux.xml.in, it generates the same tips in the file
>> loongarch-linux.xml automatically, so update loongarch-linux.xml.in
>> and loongarch-linux.xml together.
>>
>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> 
> Thanks!
> 
> Approved-by: Pedro Alves <pedro@palves.net>

Pushed.

Thanks,
Tiezhu


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-21 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21  1:55 [PATCH] gdb: syscalls: Add some tips for LoongArch xml files Tiezhu Yang
2024-03-21 13:20 ` Pedro Alves
2024-03-21 14:19   ` Tiezhu Yang

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).