From patchwork Fri Nov 9 20:04:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 30099 Received: (qmail 35401 invoked by alias); 9 Nov 2018 20:04:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 35219 invoked by uid 89); 9 Nov 2018 20:04:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=442, 364, 956, 341 X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Nov 2018 20:04:48 +0000 Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8B43E10B716 for ; Fri, 9 Nov 2018 15:04:46 -0500 (EST) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v3 3/3] Update the FreeBSD system call table to match FreeBSD 12.0. Date: Fri, 9 Nov 2018 12:04:32 -0800 Message-Id: <20181109200432.84491-4-jhb@FreeBSD.org> In-Reply-To: <20181109200432.84491-1-jhb@FreeBSD.org> References: <20181109200432.84491-1-jhb@FreeBSD.org> X-IsSubscribed: yes 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 002ea3253c..2f2b02d1c0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-11-09 John Baldwin + + * syscalls/update-freebsd.sh: New file. + * syscalls/freebsd.xml: Regenerate. + 2018-11-09 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