aboutsummaryrefslogtreecommitdiff
path: root/gdb/syscalls
AgeCommit message (Collapse)AuthorFilesLines
2024-04-02Run isortTom Tromey1-1/+1
This patch is the result of running 'isort .' in the gdb directory. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2024-03-21gdb: syscalls: Add some tips for LoongArch xml filesTiezhu Yang2-2/+45
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>
2024-03-20gdb: syscalls: Add loongarch case in update-linux-from-src.shTiezhu Yang1-0/+4
It shows that "Don't know how to generate loongarch-linux.xml.in" when using the script update-linux-from-src.sh to regenerate the syscall group info against Linux kernel, just add loongarch case. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-03-20gdb: syscalls: Generate loongarch-linux.xmlTiezhu Yang1-0/+327
Make use of the command "make" to generate loongarch-linux.xml from loongarch-linux.xml.in. Like this: $ git clone https://sourceware.org/git/binutils-gdb.git gdb.git $ cd gdb.git/gdb/syscalls/ $ make Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-03-20gdb: syscalls: Add loongarch-linux.xml.inTiezhu Yang1-0/+331
There is no syscall.tbl for LoongArch because it uses generic syscalls, so it can not generate loongarch-linux.xml.in automatically through the script update-linux-from-src.sh, make use of the script update-linux.sh to generate loongarch-linux.xml.in. Like this: $ git clone https://sourceware.org/git/binutils-gdb.git gdb.git $ cd gdb.git/gdb/syscalls/ $ touch loongarch-linux.xml.in $ ./update-linux.sh loongarch-linux.xml.in 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"/> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-03-20gdb: syscalls: Update .xml files for some archsTiezhu Yang11-0/+123
Make use of the command "make" to regenerate .xml files from .xml.in files. Like this: $ git clone https://sourceware.org/git/binutils-gdb.git gdb.git $ cd gdb.git/gdb/syscalls/ $ make Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-03-20gdb: syscalls: Update .xml.in files for some archsTiezhu Yang11-0/+123
Make use of the script update-linux-from-src.sh to regenerate the Linux syscall group info against Linux git commit d206a76d7d27 which will be released in v6.8. Like this: $ git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux.git $ git clone https://sourceware.org/git/binutils-gdb.git gdb.git $ cd gdb.git/gdb/syscalls/ $ ./update-linux-from-src.sh ~/linux.git/ Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-03-20gdb: syscalls: Update linux-defaults.xml.inTiezhu Yang1-0/+3
Make use of the script update-linux-defaults.sh to regenerate the Linux syscall group info against strace git commit 8c480270653d which will be released in v6.8. Like this: $ git clone https://github.com/strace/strace.git strace.git $ git clone https://sourceware.org/git/binutils-gdb.git gdb.git $ cd gdb.git/gdb/syscalls/ $ ./update-linux-defaults.sh ~/strace.git/ Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-01-12Update copyright year range in header of all files managed by GDBAndrew Burgess40-41/+41
This commit is the result of the following actions: - Running gdb/copyright.py to update all of the copyright headers to include 2024, - Manually updating a few files the copyright.py script told me to update, these files had copyright headers embedded within the file, - Regenerating gdbsupport/Makefile.in to refresh it's copyright date, - Using grep to find other files that still mentioned 2023. If these files were updated last year from 2022 to 2023 then I've updated them this year to 2024. I'm sure I've probably missed some dates. Feel free to fix them up as you spot them.
2023-09-22Update the NetBSD system call table to add memfd_create(2) and epoll(2).Frederic Cambus1-1/+6
Generated from sys/sys/syscall.h revision 1.324.
2023-08-25Update FreeBSD system calls for the upcoming 14.0-RELEASEJohn Baldwin1-1/+15
This matches the current set of system calls at the start of the stable/14 branch (commit 29a16ce065dbc28bc9e87c9bfadb08bb58b137e4).
2023-03-28gdb: use dynamic year in update-freebsd.shEnze Li1-1/+3
When running update-freebsd.sh on FreeBSD, I see the following modification in freebsd.xml, -<!-- Copyright (C) 2009-2023 Free Software Foundation, Inc. +<!-- Copyright (C) 2009-2020 Free Software Foundation, Inc. It means that each time, when we running the update-freebsd.sh on FreeBSD, we have to correct the year of copyright manually. So fix this issue by using dynamic year. Tested by regenerating freebsd.xml on FreeBSD/amd64. Reviewed-By: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-03-17Update the NetBSD system call table to add eventfd(2) and timerfd(2).Frederic Cambus1-0/+4
Generated from sys/sys/syscall.h revision 1.321.
2023-02-27Regenerate Linux syscall group infoPedro Alves15-856/+1001
This commit makes use of the new script to regenerate the Linux syscall group info against strace git hash e88e5e9ae6da68f22d15f9be3193b1412ac9aa02. Like so: $ cd gdb/syscalls/ $ ./update-linux-defaults.sh ~/strace.git/ Generating linux-defaults.xml.in $ make for f in aarch64-linux.xml amd64-linux.xml arm-linux.xml bfin-linux.xml \ i386-linux.xml mips-n32-linux.xml mips-n64-linux.xml \ mips-o32-linux.xml ppc64-linux.xml ppc-linux.xml s390-linux.xml \ s390x-linux.xml sparc64-linux.xml sparc-linux.xml; do \ xsltproc --output $f apply-defaults.xsl $f.in; \ done The result is that a lot more syscalls end up assigned to groups. Some lose their group info, but that just mirrors what strace does. The gdb/syscalls/linux-defaults.xml.in file shows a large diff because the new version is ASCII sorted, while the current version was somewhat (but not consistently) sorted by "family" of syscalls. If I sort the old file and diff against the new, the difference is like this: <syscall name="accept4" groups="network"/> <syscall name="accept" groups="network"/> <syscall name="access" groups="file"/> <syscall name="acct" groups="file"/> - <syscall name="arch_prctl" groups="process"/> <syscall name="bind" groups="network"/> + <syscall name="bpf" groups="descriptor"/> <syscall name="break" groups="memory"/> <syscall name="brk" groups="memory"/> + <syscall name="bsd43_fstatfs" groups="descriptor"/> + <syscall name="bsd43_fstat" groups="descriptor"/> + <syscall name="bsd43_killpg" groups="process"/> + <syscall name="bsd43_kill" groups="process"/> + <syscall name="bsd43_lstat" groups="file"/> + <syscall name="bsd43_madvise" groups="memory"/> + <syscall name="bsd43_mincore" groups="memory"/> + <syscall name="bsd43_mmap" groups="descriptor,memory"/> + <syscall name="bsd43_mprotect" groups="memory"/> + <syscall name="bsd43_mremap" groups="memory"/> + <syscall name="bsd43_munmap" groups="memory"/> + <syscall name="bsd43_oldfstat" groups="descriptor"/> + <syscall name="bsd43_oldstat" groups="file"/> + <syscall name="bsd43_quotactl" groups="file"/> + <syscall name="bsd43_sbreak" groups="memory"/> + <syscall name="bsd43_sbrk" groups="memory"/> + <syscall name="bsd43_statfs" groups="file"/> + <syscall name="bsd43_stat" groups="file"/> + <syscall name="cacheflush" groups="memory"/> <syscall name="chdir" groups="file"/> <syscall name="chmod" groups="file"/> <syscall name="chown32" groups="file"/> <syscall name="chown" groups="file"/> <syscall name="chroot" groups="file"/> + <syscall name="clone2" groups="process"/> + <syscall name="clone3" groups="process"/> <syscall name="clone" groups="process"/> <syscall name="close" groups="descriptor"/> <syscall name="connect" groups="network"/> + <syscall name="copy_file_range" groups="descriptor"/> <syscall name="creat" groups="descriptor,file"/> <syscall name="dup2" groups="descriptor"/> <syscall name="dup3" groups="descriptor"/> @@ -28,14 +52,17 @@ <syscall name="epoll_create1" groups="descriptor"/> <syscall name="epoll_create" groups="descriptor"/> <syscall name="epoll_ctl" groups="descriptor"/> + <syscall name="epoll_pwait2" groups="descriptor"/> <syscall name="epoll_pwait" groups="descriptor"/> <syscall name="epoll_wait" groups="descriptor"/> <syscall name="eventfd2" groups="descriptor"/> <syscall name="eventfd" groups="descriptor"/> + <syscall name="execveat" groups="descriptor,file,process"/> <syscall name="execve" groups="file,process"/> <syscall name="execv" groups="file,process"/> <syscall name="exit_group" groups="process"/> <syscall name="exit" groups="process"/> + <syscall name="faccessat2" groups="descriptor,file"/> <syscall name="faccessat" groups="descriptor,file"/> <syscall name="fadvise64_64" groups="descriptor"/> <syscall name="fadvise64" groups="descriptor"/> @@ -57,7 +84,11 @@ <syscall name="flock" groups="descriptor"/> <syscall name="fork" groups="process"/> <syscall name="fremovexattr" groups="descriptor"/> + <syscall name="fsconfig" groups="descriptor,file"/> <syscall name="fsetxattr" groups="descriptor"/> + <syscall name="fsmount" groups="descriptor"/> + <syscall name="fsopen" groups="descriptor"/> + <syscall name="fspick" groups="descriptor,file"/> <syscall name="fstat64" groups="descriptor"/> <syscall name="fstatat64" groups="descriptor,file"/> <syscall name="fstatfs64" groups="descriptor"/> @@ -72,16 +103,26 @@ <syscall name="getdents" groups="descriptor"/> <syscall name="get_mempolicy" groups="memory"/> <syscall name="getpeername" groups="network"/> + <syscall name="getpmsg" groups="network"/> <syscall name="getsockname" groups="network"/> <syscall name="getsockopt" groups="network"/> <syscall name="getxattr" groups="file"/> - <syscall name="inotify_add_watch" groups="descriptor"/> + <syscall name="inotify_add_watch" groups="descriptor,file"/> <syscall name="inotify_init1" groups="descriptor"/> <syscall name="inotify_init" groups="descriptor"/> <syscall name="inotify_rm_watch" groups="descriptor"/> <syscall name="ioctl" groups="descriptor"/> + <syscall name="io_destroy" groups="memory"/> + <syscall name="io_setup" groups="memory"/> + <syscall name="io_uring_enter" groups="descriptor,signal"/> + <syscall name="io_uring_register" groups="descriptor,memory"/> + <syscall name="io_uring_setup" groups="descriptor"/> <syscall name="ipc" groups="ipc"/> - <syscall name="kill" groups="signal"/> + <syscall name="kexec_file_load" groups="descriptor"/> + <syscall name="kill" groups="signal,process"/> + <syscall name="landlock_add_rule" groups="descriptor"/> + <syscall name="landlock_create_ruleset" groups="descriptor"/> + <syscall name="landlock_restrict_self" groups="descriptor"/> <syscall name="lchown32" groups="file"/> <syscall name="lchown" groups="file"/> <syscall name="lgetxattr" groups="file"/> @@ -98,19 +139,31 @@ <syscall name="lstat" groups="file"/> <syscall name="madvise" groups="memory"/> <syscall name="mbind" groups="memory"/> + <syscall name="memfd_create" groups="descriptor"/> + <syscall name="memfd_secret" groups="descriptor"/> <syscall name="migrate_pages" groups="memory"/> <syscall name="mincore" groups="memory"/> <syscall name="mkdirat" groups="descriptor,file"/> <syscall name="mkdir" groups="file"/> <syscall name="mknodat" groups="descriptor,file"/> <syscall name="mknod" groups="file"/> + <syscall name="mlock2" groups="memory"/> <syscall name="mlockall" groups="memory"/> <syscall name="mlock" groups="memory"/> <syscall name="mmap2" groups="descriptor,memory"/> <syscall name="mmap" groups="descriptor,memory"/> + <syscall name="mount_setattr" groups="descriptor,file"/> <syscall name="mount" groups="file"/> + <syscall name="move_mount" groups="descriptor,file"/> <syscall name="move_pages" groups="memory"/> <syscall name="mprotect" groups="memory"/> + <syscall name="mq_getsetattr" groups="descriptor"/> + <syscall name="mq_notify" groups="descriptor"/> + <syscall name="mq_open" groups="descriptor"/> + <syscall name="mq_timedreceive" groups="descriptor"/> + <syscall name="mq_timedreceive_time64" groups="descriptor"/> + <syscall name="mq_timedsend" groups="descriptor"/> + <syscall name="mq_timedsend_time64" groups="descriptor"/> <syscall name="mremap" groups="memory"/> <syscall name="msgctl" groups="ipc"/> <syscall name="msgget" groups="ipc"/> @@ -126,45 +179,98 @@ <syscall name="oldfstat" groups="descriptor"/> <syscall name="oldlstat" groups="file"/> <syscall name="oldstat" groups="file"/> + <syscall name="oldumount" groups="file"/> + <syscall name="openat2" groups="descriptor,file"/> <syscall name="openat" groups="descriptor,file"/> <syscall name="open_by_handle_at" groups="descriptor"/> <syscall name="open" groups="descriptor,file"/> + <syscall name="open_tree" groups="descriptor,file"/> + <syscall name="osf_fstatfs64" groups="descriptor"/> + <syscall name="osf_fstatfs" groups="descriptor"/> + <syscall name="osf_fstat" groups="descriptor"/> + <syscall name="osf_lstat" groups="file"/> + <syscall name="osf_mincore" groups="memory"/> + <syscall name="osf_mremap" groups="memory"/> + <syscall name="osf_old_fstat" groups="descriptor"/> + <syscall name="osf_old_killpg" groups="process"/> + <syscall name="osf_old_lstat" groups="file"/> + <syscall name="osf_old_stat" groups="file"/> + <syscall name="osf_sbrk" groups="memory"/> + <syscall name="osf_select" groups="descriptor"/> + <syscall name="osf_shmat" groups="ipc,memory"/> + <syscall name="osf_sigprocmask" groups="signal"/> + <syscall name="osf_statfs64" groups="file"/> + <syscall name="osf_statfs" groups="file"/> + <syscall name="osf_stat" groups="file"/> + <syscall name="osf_utimes" groups="file"/> + <syscall name="osf_wait4" groups="process"/> <syscall name="pause" groups="signal"/> <syscall name="perf_event_open" groups="descriptor"/> + <syscall name="pidfd_getfd" groups="descriptor"/> + <syscall name="pidfd_open" groups="descriptor"/> + <syscall name="pidfd_send_signal" groups="descriptor,signal,process"/> <syscall name="pipe2" groups="descriptor"/> <syscall name="pipe" groups="descriptor"/> <syscall name="pivot_root" groups="file"/> + <syscall name="pkey_mprotect" groups="memory"/> <syscall name="poll" groups="descriptor"/> + <syscall name="posix_fstatfs" groups="descriptor"/> + <syscall name="posix_fstat" groups="descriptor"/> + <syscall name="posix_kill" groups="process"/> + <syscall name="posix_lstat" groups="file"/> + <syscall name="posix_madvise" groups="memory"/> + <syscall name="posix_mmap" groups="descriptor,memory"/> + <syscall name="posix_munmap" groups="memory"/> + <syscall name="posix_sbreak" groups="memory"/> + <syscall name="posix_SGI_madvise" groups="memory"/> + <syscall name="posix_SGI_mmap" groups="descriptor,memory"/> + <syscall name="posix_SGI_mprotect" groups="memory"/> + <syscall name="posix_SGI_msync" groups="memory"/> + <syscall name="posix_SGI_munmap" groups="memory"/> + <syscall name="posix_statfs" groups="file"/> + <syscall name="posix_stat" groups="file"/> <syscall name="ppoll" groups="descriptor"/> + <syscall name="ppoll_time64" groups="descriptor"/> <syscall name="pread64" groups="descriptor"/> <syscall name="pread" groups="descriptor"/> + <syscall name="preadv2" groups="descriptor"/> <syscall name="preadv" groups="descriptor"/> + <syscall name="process_madvise" groups="descriptor"/> + <syscall name="process_mrelease" groups="descriptor"/> <syscall name="pselect6" groups="descriptor"/> + <syscall name="pselect6_time64" groups="descriptor"/> + <syscall name="putpmsg" groups="network"/> <syscall name="pwrite64" groups="descriptor"/> <syscall name="pwrite" groups="descriptor"/> + <syscall name="pwritev2" groups="descriptor"/> <syscall name="pwritev" groups="descriptor"/> + <syscall name="quotactl_fd" groups="descriptor"/> <syscall name="quotactl" groups="file"/> <syscall name="readahead" groups="descriptor"/> <syscall name="readdir" groups="descriptor"/> - <syscall name="read" groups="descriptor"/> <syscall name="readlinkat" groups="descriptor,file"/> <syscall name="readlink" groups="file"/> + <syscall name="read" groups="descriptor"/> <syscall name="readv" groups="descriptor"/> <syscall name="recvfrom" groups="network"/> - <syscall name="recv" groups="network"/> + <syscall name="recvmmsg_time64" groups="network"/> <syscall name="recvmmsg" groups="network"/> <syscall name="recvmsg" groups="network"/> + <syscall name="recv" groups="network"/> <syscall name="remap_file_pages" groups="memory"/> <syscall name="removexattr" groups="file"/> + <syscall name="renameat2" groups="descriptor,file"/> <syscall name="renameat" groups="descriptor,file"/> <syscall name="rename" groups="file"/> + <syscall name="riscv_flush_icache" groups="memory"/> <syscall name="rmdir" groups="file"/> <syscall name="rt_sigaction" groups="signal"/> <syscall name="rt_sigpending" groups="signal"/> <syscall name="rt_sigprocmask" groups="signal"/> - <syscall name="rt_sigqueueinfo" groups="signal"/> + <syscall name="rt_sigqueueinfo" groups="signal,process"/> <syscall name="rt_sigreturn" groups="signal"/> <syscall name="rt_sigsuspend" groups="signal"/> + <syscall name="rt_sigtimedwait_time64" groups="signal"/> <syscall name="rt_sigtimedwait" groups="signal"/> <syscall name="rt_tgsigqueueinfo" groups="process,signal"/> <syscall name="select" groups="descriptor"/> @@ -172,12 +278,14 @@ <syscall name="semget" groups="ipc"/> <syscall name="semop" groups="ipc"/> <syscall name="semtimedop" groups="ipc"/> + <syscall name="semtimedop_time64" groups="ipc"/> <syscall name="sendfile64" groups="descriptor,network"/> <syscall name="sendfile" groups="descriptor,network"/> - <syscall name="send" groups="network"/> <syscall name="sendmmsg" groups="network"/> <syscall name="sendmsg" groups="network"/> + <syscall name="send" groups="network"/> <syscall name="sendto" groups="network"/> + <syscall name="set_mempolicy_home_node" groups="memory"/> <syscall name="set_mempolicy" groups="memory"/> <syscall name="setns" groups="descriptor"/> <syscall name="setsockopt" groups="network"/> @@ -198,38 +306,78 @@ <syscall name="sigreturn" groups="signal"/> <syscall name="sigsuspend" groups="signal"/> <syscall name="socketcall" groups="descriptor"/> - <syscall name="socket" groups="network"/> <syscall name="socketpair" groups="network"/> + <syscall name="socket" groups="network"/> <syscall name="splice" groups="descriptor"/> <syscall name="ssetmask" groups="signal"/> <syscall name="stat64" groups="file"/> <syscall name="statfs64" groups="file"/> <syscall name="statfs" groups="file"/> <syscall name="stat" groups="file"/> + <syscall name="statx" groups="descriptor,file"/> + <syscall name="svr4_fstatfs" groups="descriptor"/> + <syscall name="svr4_fstat" groups="descriptor"/> + <syscall name="svr4_fstatvfs" groups="descriptor"/> + <syscall name="svr4_fxstat" groups="descriptor"/> + <syscall name="svr4_kill" groups="process"/> + <syscall name="svr4_lstat" groups="file"/> + <syscall name="svr4_lxstat" groups="file"/> + <syscall name="svr4_mincore" groups="memory"/> + <syscall name="svr4_mmap" groups="descriptor,memory"/> + <syscall name="svr4_mprotect" groups="memory"/> + <syscall name="svr4_munmap" groups="memory"/> + <syscall name="svr4_sbreak" groups="memory"/> + <syscall name="svr4_statfs" groups="file"/> + <syscall name="svr4_stat" groups="file"/> + <syscall name="svr4_statvfs" groups="file"/> + <syscall name="svr4_xstat" groups="file"/> <syscall name="swapoff" groups="file"/> <syscall name="swapon" groups="file"/> <syscall name="symlinkat" groups="descriptor,file"/> <syscall name="symlink" groups="file"/> + <syscall name="sync_file_range2" groups="descriptor"/> <syscall name="sync_file_range" groups="descriptor"/> <syscall name="syncfs" groups="descriptor"/> + <syscall name="sysv_brk" groups="memory"/> + <syscall name="sysv_fstatfs" groups="descriptor"/> + <syscall name="sysv_fstat" groups="descriptor"/> + <syscall name="sysv_fstatvfs" groups="descriptor"/> + <syscall name="sysv_fxstat" groups="descriptor"/> + <syscall name="sysv_kill" groups="process"/> + <syscall name="sysv_lstat" groups="file"/> + <syscall name="sysv_lxstat" groups="file"/> + <syscall name="sysv_madvise" groups="memory"/> + <syscall name="sysv_mmap64" groups="descriptor,memory"/> + <syscall name="sysv_mmap" groups="descriptor,memory"/> + <syscall name="sysv_mprotect" groups="memory"/> + <syscall name="sysv_msync" groups="memory"/> + <syscall name="sysv_munmap" groups="memory"/> + <syscall name="sysv_quotactl" groups="file"/> + <syscall name="sysv_statfs" groups="file"/> + <syscall name="sysv_stat" groups="file"/> + <syscall name="sysv_statvfs" groups="file"/> + <syscall name="sysv_xstat" groups="file"/> <syscall name="tee" groups="descriptor"/> - <syscall name="tgkill" groups="signal"/> + <syscall name="tgkill" groups="signal,process"/> <syscall name="timerfd_create" groups="descriptor"/> + <syscall name="timerfd_gettime64" groups="descriptor"/> <syscall name="timerfd_gettime" groups="descriptor"/> - <syscall name="timerfd" groups="descriptor"/> + <syscall name="timerfd_settime64" groups="descriptor"/> <syscall name="timerfd_settime" groups="descriptor"/> - <syscall name="tkill" groups="signal"/> + <syscall name="timerfd" groups="descriptor"/> + <syscall name="tkill" groups="signal,process"/> <syscall name="truncate64" groups="file"/> <syscall name="truncate" groups="file"/> <syscall name="umount2" groups="file"/> <syscall name="umount" groups="file"/> <syscall name="unlinkat" groups="descriptor,file"/> <syscall name="unlink" groups="file"/> - <syscall name="unshare" groups="process"/> <syscall name="uselib" groups="file"/> - <syscall name="utime" groups="file"/> + <syscall name="userfaultfd" groups="descriptor"/> <syscall name="utimensat" groups="descriptor,file"/> + <syscall name="utimensat_time64" groups="descriptor,file"/> <syscall name="utimes" groups="file"/> + <syscall name="utime" groups="file"/> <syscall name="vfork" groups="process"/> <syscall name="vmsplice" groups="descriptor"/> <syscall name="wait4" groups="process"/> Change-Id: I679d59d42fb2a914bf7a99e4c558e9696e5adff1
2023-02-27Autogenerate gdb/syscalls/linux-defaults.xml.in (groups) from strace sourcesPedro Alves1-0/+91
I noticed that "catch syscall group:process" doesn't catch clone3, while it does catch clone. The catch syscall group information is recorded in the gdb/syscalls/linux-defaults.xml.in file, which says: <!-- The group field information was based on strace. --> So I looked at the strace sources, to confirm that clone3 is in fact recorded in the "process" group there too, and to check what other syscalls might be missing groups. After some digging, I found that strace records the group info in C arrays, with entries like: ... [ 61] = { 4, TP, SEN(wait4), "wait4" }, [ 62] = { 2, TS|TP, SEN(kill), "kill" }, [ 63] = { 1, 0, SEN(uname), "uname" }, ... You can see the current master's table for Linux x86-64 here: https://github.com/strace/strace/blob/e88e5e9ae6da68f22d15f9be3193b1412ac9aa02/src/linux/x86_64/syscallent.h The column with TS|TP above is what defines each syscall's groups. So I wrote a script that extracts this information and generates linux-defaults.xml.in. Approved-By: Simon Marchi <simon.marchi@efficios.com> Change-Id: I679d59d42fb2a914bf7a99e4c558e9696e5adff1
2023-01-01manual copyright year range of various GDB files to add 2023Joel Brobecker1-1/+1
This commit updates the following file... gdb/doc/gdb.texinfo gdb/doc/refcard.tex gdb/syscalls/update-netbsd.sh ... by hand as instructed by the gdb/copyright.py script. The update by hand is needed because the copyright headers to update are actually nested inside those files, rather than located at the start of the file.
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker39-39/+39
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-05-18[gdb/tdep] Add gdb/syscalls/update-linux-from-src.shTom de Vries23-38/+1230
Add a new script gdb/syscalls/update-linux-from-src.sh, that can be used to generate *-linux.xml.in files from linux kernel sources, like so: ... $ ./update-linux-from-src.sh ~/upstream/linux-stable.git Skipping aarch64-linux.xml.in, no syscall.tbl Generating amd64-linux.xml.in Skipping arm-linux.xml.in, use arm-linux.py instead Skipping bfin-linux.xml.in, no longer supported Generating i386-linux.xml.in Generating mips-n32-linux.xml.in Generating mips-n64-linux.xml.in Generating mips-o32-linux.xml.in Generating ppc64-linux.xml.in Generating ppc-linux.xml.in Generating s390-linux.xml.in Generating s390x-linux.xml.in Generating sparc64-linux.xml.in Generating sparc-linux.xml.in ... Update *-linux.xml.in and *-linux.xml using linux kernel tag v5.18-rc6.
2022-05-12[gdb/tdep] Improve gdb/syscalls/update-linux.shTom de Vries2-42/+23
Fix two things in update-linux.sh: - remove use of unnecessary tmp file - inline gen-header.py into update-linux.sh Tested on x86_64-linux.
2022-05-11[gdb/tdep] Update syscalls/{ppc64,ppc}-linux.xmlTom de Vries4-22/+538
Regenerate syscalls/{ppc64,ppc}-linux.xml on a system with 5.14 kernel.
2022-05-09[gdb] Update syscalls/{amd64,i386}-linux.xmlTom de Vries6-14/+470
- Add a script syscalls/gen-header.py, based on syscalls/arm-linux.py. - Add a script syscalls/update-linux.sh (alongside update-freebsd.sh and update-netbsd.sh). - Use syscalls/update-linux.sh to update syscalls/{amd64,i386}-linux.xml.in. - Regenerate syscalls/{amd64,i386}-linux.xml using syscalls/Makefile. In gdb/syscalls/i386-linux.xml.in, updating has the following notable effect: ... - <syscall name="madvise1" number="220"/> - <syscall name="getdents64" number="221"/> - <syscall name="fcntl64" number="222"/> + <syscall name="getdents64" number="220"/> + <syscall name="fcntl64" number="221"/> ... I've verified in ./arch/x86/entry/syscalls/syscall_32.tbl that the numbers are correct. Tested on x86_64-linux.
2022-05-09[gdb] Add gdb/syscalls/MakefileTom de Vries2-0/+348
Add a Makefile in gdb/syscalls that can be used to translate gdb/syscalls/*.xml.in into gdb/syscalls/*.xml. Calling make reveals that bfin-linux.xml is missing, so add it. Tested on x86_64-linux.
2022-05-09[gdb/tdep] Support catch syscall pipe2 for i386Tom de Vries2-0/+2
With test-case gdb.base/catch-syscall.exp and target board unix/-m32, we run into: ... (gdb) catch syscall pipe2^M Unknown syscall name 'pipe2'.^M (gdb) FAIL: gdb.base/catch-syscall.exp: determine pipe syscall: catch syscall pipe2 ... Fix this by: - adding a pipe2 entry in gdb/syscalls/i386-linux.xml.in, and - regenerating gdb/syscalls/i386-linux.xml using "xsltproc --output i386-linux.xml apply-defaults.xsl i386-linux.xml.in". Tested on x86_64-linux with native and unix/-m32. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29056
2022-01-01Manual copyright year update of various GDB filesJoel Brobecker1-1/+1
This commit updates the copyright year in some files where we have a copyright year outside of the copyright year, and thus are not included in gdb's copyright.py script.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker35-35/+35
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-07-23Update the NetBSD system call table to match NetBSD-current.Frederic Cambus1-1/+17
Generated from sys/sys/syscall.h revision 1.319. We can safely remove the _lwp_gettid syscall, which was never exposed in libc and never made it into a release. gdb/ChangeLog: 2021-07-23 Frederic Cambus <fred@statdns.com> * syscalls/netbsd.xml: Regenerate.
2021-05-07gdb: re-format Python files using black 21.4b0Simon Marchi1-13/+16
Re-format all Python files using black [1] version 21.4b0. The goal is that from now on, we keep all Python files formatted using black. And that we never have to discuss formatting during review (for these files at least) ever again. One change is needed in gdb.python/py-prettyprint.exp, because it matches the string representation of an exception, which shows source code. So the change in formatting must be replicated in the expected regexp. To document our usage of black I plan on adding this to the "GDB Python Coding Standards" wiki page [2]: --8<-- All Python source files under the `gdb/` directory must be formatted using black version 21.4b0. This specific version can be installed using: $ pip3 install 'black == 21.4b0' All you need to do to re-format files is run `black <file/directory>`, and black will re-format any Python file it finds in there. It runs quite fast, so the simplest is to do: $ black gdb/ from the top-level. If you notice that black produces changes unrelated to your patch, it's probably because someone forgot to run it before you. In this case, don't include unrelated hunks in your patch. Push an obvious patch fixing the formatting and rebase your work on top of that. -->8-- Once this is merged, I plan on setting a up an `ignoreRevsFile` config so that git-blame ignores this commit, as described here: https://github.com/psf/black#migrating-your-code-style-without-ruining-git-blame I also plan on working on a git commit hook (checked in the repo) to automatically check the formatting of the Python files on commit. [1] https://pypi.org/project/black/ [2] https://sourceware.org/gdb/wiki/Internals%20GDB-Python-Coding-Standards gdb/ChangeLog: * Re-format all Python files using black. gdb/testsuite/ChangeLog: * Re-format all Python files using black. * gdb.python/py-prettyprint.exp (run_lang_tests): Adjust. Change-Id: I28588a22c2406afd6bc2703774ddfff47cd61919
2021-04-21update-netbsd.sh: fix script name, update year range in copyright.Frederic Cambus1-2/+2
Fix the script name and year range in update-netbsd.sh. gdb/ChangeLog 2021-04-21 Frederic Cambus <fred@statdns.com> * syscalls/update-netbsd.sh: Fix script name display in usage, and update year range in generated copyright notices.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker35-35/+35
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-08-03Update FreeBSD system calls for 13.0-CURRENT.John Baldwin1-2/+15
This matches the current set of system calls in the FreeBSD head development branch as of r363367. Some of these system calls were also included in 12.1 release. gdb/ChangeLog: * syscalls/freebsd.xml: Regenerate.
2020-08-03Fix script name in usage and generated year range.John Baldwin1-2/+2
gdb/ChangeLog: * syscalls/update-freebsd.sh: Fix usage and year range.
2020-04-29Add definitions of system calls to catch in native NetBSD targetsKamil Rytarowski2-0/+539
All platforms on NetBSD use a shared system call table, so use a single XML file to describe the system calls available on each NetBSD platform. gdb/ChangeLog: * syscalls/update-netbsd.sh: New file. * syscalls/netbsd.xml: Regenerate. * data-directory/Makefile.in: Register `netbsd.xml' in `SYSCALLS_FILES'
2020-04-28gdb: fix shellcheck warning in update-freebsd.shSimon Marchi1-1/+1
shellcheck reports: In update-freebsd.sh line 72: }' $1 >> freebsd.xml.tmp ^-- SC2086: Double quote to prevent globbing and word splitting. Did you mean: }' "$1" >> freebsd.xml.tmp For more information: https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... Add double quotes to fix it. gdb/ChangeLog: * syscalls/update-freebsd.sh: Add double quotes.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker33-33/+33
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker33-33/+33
This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
2018-12-13Update the FreeBSD system call table to match FreeBSD 12.0.John Baldwin2-23/+165
Add a script to generate the FreeBSD XML system call table from the sys/sys/syscall.h file in the kernel source tree. For ABI compatiblity system calls used by older binaries (such as freebsd11_kevent()), the original system call name is used as an alias. Run this script against the current syscall.h file in FreeBSD's head branch which is expected to be the file used in 12.0 (head is currently in code freeze as part of the 12.0 release process). gdb/ChangeLog: * syscalls/update-freebsd.sh: New file. * syscalls/freebsd.xml: Regenerate.
2018-12-13Add an optional "alias" attribute to syscall entries.John Baldwin1-0/+1
When setting a syscall catchpoint by name, catch syscalls whose name or alias matches the requested string. When the ABI of a system call is changed in the FreeBSD kernel, this is implemented by leaving a compatibility system call using the old ABI at the existing "slot" and allocating a new system call for the version using the new ABI. For example, new fields were added to the 'struct kevent' used by the kevent() system call in FreeBSD 12. The previous kevent() system call in FreeBSD 12 kernels is now called freebsd11_kevent() and is still used by older binaries compiled against the older ABI. The freebsd11_kevent() system call can be tagged with an "alias" attribute of "kevent" permitting 'catch syscall kevent' to catch both system calls and providing the expected user behavior for both old and new binaries. It also provides the expected behavior if GDB is compiled on an older host (such as a FreeBSD 11 host). gdb/ChangeLog: * NEWS: Add entry documenting system call aliases. * break-catch-syscall.c (catch_syscall_split_args): Pass 'result' to get_syscalls_by_name. * gdbarch.sh (UNKNOWN_SYSCALL): Remove. * gdbarch.h: Regenerate. * syscalls/gdb-syscalls.dtd (syscall): Add alias attribute. * xml-syscall.c [!HAVE_LIBEXPAT] (get_syscalls_by_name): Rename from get_syscall_by_name. Now accepts a pointer to a vector of integers and returns a bool. [HAVE_LIBEXPAT] (struct syscall_desc): Add alias member. (syscall_create_syscall_desc): Add alias parameter and pass it to syscall_desc constructor. (syscall_start_syscall): Handle alias attribute. (syscall_attr): Add alias attribute. (xml_get_syscalls_by_name): Rename from xml_get_syscall_number. Now accepts a pointer to a vector of integers and returns a bool. Add syscalls whose alias or name matches the requested name. (get_syscalls_by_name): Rename from get_syscall_by_name. Now accepts a pointer to a vector of integers and returns a bool. * xml-syscall.h (get_syscalls_by_name): Likewise. gdb/doc/ChangeLog: * gdb.texinfo (Set Catchpoints): Add an anchor for 'catch syscall'. (Native): Add a FreeBSD subsection. (FreeBSD): Document use of system call aliases for compatibility system calls.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker32-32/+32
gdb/ChangeLog: Update copyright year range in all GDB files
2017-01-01update copyright year range in GDB filesJoel Brobecker32-32/+32
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-07-23Implement catch syscall groupGabriel Krisman Bertazi30-2446/+6972
Implement support to add catchpoints for a group of related syscalls using the syntax: (gdb) catch syscall group:<group> or (gdb) catch syscall g:<group> Several groups are predefined in the xml files for all architectures supported by GDB over Linux. They are based on the groups defined by strace. gdb/ * xml-syscall.c (get_syscalls_by_group): New. (get_syscall_group_names): New. (struct syscall_group_desc): New structure to store group data. (struct syscalls_info): Include field to store the group list. (sysinfo_free_syscall_group_desc): New. (free_syscalls_info): Free group list. (syscall_group_create_syscall_group_desc): New. (syscall_group_add_syscall): New. (syscall_create_syscall_desc): Add syscall to its groups. (syscall_start_syscall): Load group attribute. (syscall_group_get_group_by_name): New. (xml_list_syscalls_by_group): New. (xml_list_of_groups): New. * xml-syscall.h (get_syscalls_by_group): Export function to retrieve a list of syscalls filtered by the group name. (get_syscall_group_names): Export function to retrieve the list of syscall groups. * break-catch-syscall.c (catch_syscall_split_args): Verify if argument is a syscall group and expand it to a list of syscalls when creating catchpoints. (catch_syscall_completer): Add word completion for system call groups. * configure.ac: Include dependency for xsltproc when building in maintainer-mode. * break-catch-syscall.c (_initialize_breakpoint): Update catch syscall command documentation. * NEWS: Include section about catching groups of syscalls. * configure: Regenerate. * data-directory/Makefile.in: Generate syscall xml when building in maintainer mode. * syscalls/gdb-syscalls.dtd: Include group attribute to the syscall element. * syscalls/apply-defaults.xsl: New. * syscalls/linux-defaults.xml.in: New. * syscalls/aarch64-linux.xml: Rename to aarch64-linux.xml.in. * syscalls/amd64-linux.xml: Rename to amd64-linux.xml.in. * syscalls/arm-linux.xml: Rename to arm-linux.xml.in. * syscalls/bfin-linux.xml: Rename to bfin-linux.xml.in. * syscalls/i386-linux.xml: Rename to i386-linux.xml.in. * syscalls/mips-n32-linux.xml: Rename to mips-n32-linux.xml.in. * syscalls/mips-n64-linux.xml: Rename to mips-n64-linux.xml.in. * syscalls/mips-o32-linux.xml: Rename to mips-o32-linux.xml.in. * syscalls/ppc-linux.xml: Rename to ppc-linux.xml.in. * syscalls/ppc64-linux.xml: Rename to ppc64-linux.xml.in. * syscalls/s390-linux.xml: Rename to s390-linux.xml.in. * syscalls/s390x-linux.xml: Rename to s390x-linux.xml.in. * syscalls/sparc-linux.xml: Rename to sparc-linux.xml.in. * syscalls/sparc64-linux.xml: Rename to sparc64-linux.xml.in. * syscalls/aarch64-linux.xml: Regenerate. * syscalls/amd64-linux.xml: Regenerate. * syscalls/arm-linux.xml: Regenerate. * syscalls/i386-linux.xml: Regenerate. * syscalls/mips-n32-linux.xml: Regenerate. * syscalls/mips-n64-linux.xml: Regenerate. * syscalls/mips-o32-linux.xml: Regenerate. * syscalls/ppc-linux.xml: Regenerate. * syscalls/ppc64-linux.xml: Regenerate. * syscalls/s390-linux.xml: Regenerate. * syscalls/s390x-linux.xml: Regenerate. * syscalls/sparc-linux.xml: Regenerate. * syscalls/sparc64-linux.xml: Regenerate. gdb/testsuite/ * gdb.base/catch-syscall.exp (do_syscall_tests): Add call to test_catch_syscall_group. (test_catch_syscall_group): New. gdb/doc/ * gdb.texinfo (Set Catchpoints): Add 'group' argument to catch syscall.
2016-06-24Add support for catching system calls to native FreeBSD targets.John Baldwin1-0/+410
All platforms on FreeBSD use a shared system call table, so use a single XML file to describe the system calls available on each FreeBSD platform. Recent versions of FreeBSD include the identifier of the current system call when reporting a system call entry or exit event in the ptrace_lwpinfo structure obtained via PT_LWPINFO in fbsd_wait. As such, FreeBSD native targets do not use the gdbarch method to fetch the system call code. In addition, FreeBSD register sets fetched via ptrace do not include an equivalent of 'orig_rax' (on amd64 for example), so the system call code cannot be extracted from the available registers during a system call exit. However, GDB assumes that system call catch points are not supported if the gdbarch method is not present. As a workaround, FreeBSD ABIs install a dummy gdbarch method that throws an internal_error if it is ever invoked. gdb/ChangeLog: * configure.ac: Check for support for system call LWP fields on FreeBSD. * config.in, configure: Rebuild. * data-directory/Makefile.in (SYSCALLS_FILES): Add freebsd.xml. * fbsd-nat.c (fbsd_wait) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]: Report system call events. [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE] (fbsd_set_syscall_catchpoint): New function. (fbsd_nat_add_target) [HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE]: Set "to_set_syscall_catchpoint" to "fbsd_set_syscall_catchpoint". * fbsd-tdep.c: Include xml-syscall.h (fbsd_get_syscall_number): New function. (fbsd_init_abi): Set XML system call file name. Add "get_syscall_number" gdbarch method. * syscalls/freebsd.xml: New file.
2016-03-17S390: Add syscall info for syscalls up to 374Andreas Arnez2-0/+50
Represent new Linux syscalls for s390 and s390x in GDB's syscall info. Add the syscalls from 355 (userfaultfd) up to 374 (mlock2) as well as the previously reserved NUMA syscalls 268-270, 287, and 310. gdb/ChangeLog: * syscalls/s390-linux.xml: Add NUMA syscalls and new syscalls up to 374. * syscalls/s390x-linux.xml: Likewise.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker16-16/+16
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-06-17S390: Add syscall info for syscalls from 344 up to 354Andreas Arnez2-0/+22
Represent new Linux syscalls for s390 and s390x in GDB's syscall info. Add the syscalls from 344 (finit_module) up to 354 (execveat). gdb/ChangeLog: * syscalls/s390-linux.xml: Add syscalls 344 through 354. * syscalls/s390x-linux.xml: Likewise.
2015-03-18Support catch syscall on aarch64 linuxYao Qi1-0/+271
Hi, This patch is to support catch syscall on aarch64 linux. We implement gdbarch method get_syscall_number for aarch64-linux, and add aarch64-linux.xml file, which looks straightforward, however the changes to test case doesn't. First of all, we enable catch-syscall.exp on aarch64-linux target, but skip the multi_arch testing on current stage. I plan to touch multi arch debugging on aarch64-linux later. Then, when I run catch-syscall.exp on aarch64-linux, gcc errors that SYS_pipe isn't defined. We find that aarch64 kernel only has pipe2 syscall and libc already convert pipe to pipe2. As a result, I change catch-syscall.c to use SYS_pipe if it is defined, otherwise use SYS_pipe2 instead. The vector all_syscalls in catch-syscall.exp can't be pre-determined, so I add a new proc setup_all_syscalls to fill it, according to the availability of SYS_pipe. Regression tested on {x86_64, aarch64}-linux x {native, gdbserver}. gdb: 2015-03-18 Yao Qi <yao.qi@linaro.org> PR tdep/18107 * aarch64-linux-tdep.c: Include xml-syscall.h (aarch64_linux_get_syscall_number): New function. (aarch64_linux_init_abi): Call set_gdbarch_get_syscall_number. * syscalls/aarch64-linux.xml: New file. gdb/testsuite: 2015-03-18 Yao Qi <yao.qi@linaro.org> PR tdep/18107 * gdb.base/catch-syscall.c [!SYS_pipe] (pipe2_syscall): New variable. * gdb.base/catch-syscall.exp: Don't skip it on aarch64*-*-linux* target. Remove elements in all_syscalls. (test_catch_syscall_multi_arch): Skip it on aarch64*-linux* target. (setup_all_syscalls): New proc.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker15-15/+15
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-01-22gdb/ChangeLog:Andreas Arnez2-0/+629
* syscalls/s390x-linux.xml: New file. * syscalls/s390-linux.xml: New file. * s390-linux-tdep.c (XML_SYSCALL_FILENAME_S390): New macro. (XML_SYSCALL_FILENAME_S390X): Likewise. (op_svc): New enum value for SVC opcode. (s390_sigtramp_frame_sniffer): Replace literal by 'op_svc'. (s390_linux_get_syscall_number): New function. (s390_gdbarch_init): Register '*get_syscall_number' and the syscall xml file name. * data-directory/Makefile.in (SYSCALLS_FILES): Add "s390-linux.xml" and "s390x-linux.xml". * NEWS: Announce new feature. gdb/testsuite/ChangeLog: * gdb.base/catch-syscall.exp: Activate test on s390*-linux.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker13-13/+13
2013-08-22Adding missing files from my last commit.Sergio Durigan Junior2-0/+458
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker11-11/+11
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.