From patchwork Fri Nov 30 22:20:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 30488 Received: (qmail 89068 invoked by alias); 30 Nov 2018 22:21:07 -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 88935 invoked by uid 89); 30 Nov 2018 22:21:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=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=doctype, !doctype, DOCTYPE, !DOCTYPE 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, 30 Nov 2018 22:20:58 +0000 Received: from ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id D96D910B707 for ; Fri, 30 Nov 2018 17:20:56 -0500 (EST) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v4 3/3] Update the FreeBSD system call table to match FreeBSD 12.0. Date: Fri, 30 Nov 2018 14:20:13 -0800 Message-Id: <20181130222013.76607-4-jhb@FreeBSD.org> In-Reply-To: <20181130222013.76607-1-jhb@FreeBSD.org> References: <20181130222013.76607-1-jhb@FreeBSD.org> MIME-Version: 1.0 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 8da416e0cd..6e3b726391 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-11-30 John Baldwin + + * syscalls/update-freebsd.sh: New file. + * syscalls/freebsd.xml: Regenerate. + 2018-11-30 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