From 64fdde094a2747e9aa729dfa4f1568c3d24ab80b Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 13 Dec 2018 11:36:42 -0800 Subject: [PATCH] Update the FreeBSD system call table to match FreeBSD 12.0. 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. --- gdb/ChangeLog | 5 ++ gdb/syscalls/freebsd.xml | 110 ++++++++++++++++++++++++++------- gdb/syscalls/update-freebsd.sh | 78 +++++++++++++++++++++++ 3 files changed, 170 insertions(+), 23 deletions(-) create mode 100755 gdb/syscalls/update-freebsd.sh diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2a1a6e2518..07c436fb08 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-12-13 John Baldwin + + * syscalls/update-freebsd.sh: New file. + * syscalls/freebsd.xml: Regenerate. + 2018-12-13 John Baldwin * NEWS: Add entry documenting system call aliases. diff --git a/gdb/syscalls/freebsd.xml b/gdb/syscalls/freebsd.xml index 810258a850..418a1ea838 100644 --- a/gdb/syscalls/freebsd.xml +++ b/gdb/syscalls/freebsd.xml @@ -1,4 +1,5 @@ - + + + + + + + + + + +EOF + +awk ' +/MAXSYSCALL/ { + next +} +/^#define/ { + sub(/^SYS_/,"",$2); + printf " \n" +} +/\/\* [0-9]* is obsolete [a-z_]* \*\// { + printf " \n", $5, $2 +} +/\/\* [0-9]* is freebsd[0-9]* [a-z_]* \*\// { + printf " \n", $4, $5, $2, $5 +}' $1 >> freebsd.xml.tmp + +cat >> freebsd.xml.tmp < +EOF + +../../move-if-change freebsd.xml.tmp freebsd.xml