]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: syscalls: Add some tips for LoongArch xml files
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 21 Mar 2024 01:55:10 +0000 (09:55 +0800)
committerTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 21 Mar 2024 14:07:44 +0000 (22:07 +0800)
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>
Approved-by: Pedro Alves <pedro@palves.net>
gdb/syscalls/loongarch-linux.xml
gdb/syscalls/loongarch-linux.xml.in

index 91e7bbc96918861a9e5c1aff1ec7865a5c33cf6f..6e85dbd7166762ac074f1deb9dd0f686f95d2fc7 100644 (file)
@@ -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"/>
index e6e17b3f2b61c14fbaa814c66a271378bba27a7d..cf38f311abe969184aad9cdec08519a278ae991d 100644 (file)
 
      <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"/>