From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 8241A394CC37; Mon, 9 May 2022 15:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8241A394CC37 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb] Update syscalls/{amd64,i386}-linux.xml X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: d9ab2743baf47aedb40afba1a0d1a5bd2b1a755d X-Git-Newrev: f3c75b2cbe88aa1f637d08317614bbeb2cbeecea Message-Id: <20220509152226.8241A394CC37@sourceware.org> Date: Mon, 9 May 2022 15:22:26 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2022 15:22:26 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df3c75b2cbe88= aa1f637d08317614bbeb2cbeecea commit f3c75b2cbe88aa1f637d08317614bbeb2cbeecea Author: Tom de Vries Date: Mon May 9 17:22:23 2022 +0200 [gdb] Update syscalls/{amd64,i386}-linux.xml =20 - 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.xm= l.in. - Regenerate syscalls/{amd64,i386}-linux.xml using syscalls/Makefile. =20 In gdb/syscalls/i386-linux.xml.in, updating has the following notable e= ffect: ... - - - + + ... =20 I've verified in ./arch/x86/entry/syscalls/syscall_32.tbl that the numb= ers are correct. =20 Tested on x86_64-linux. Diff: --- gdb/syscalls/amd64-linux.xml | 69 +++++++++++++++++++++- gdb/syscalls/amd64-linux.xml.in | 70 +++++++++++++++++++++- gdb/syscalls/gen-header.py | 32 ++++++++++ gdb/syscalls/i386-linux.xml | 126 ++++++++++++++++++++++++++++++++++++= +-- gdb/syscalls/i386-linux.xml.in | 127 ++++++++++++++++++++++++++++++++++++= ++-- gdb/syscalls/update-linux.sh | 60 +++++++++++++++++++ 6 files changed, 470 insertions(+), 14 deletions(-) diff --git a/gdb/syscalls/amd64-linux.xml b/gdb/syscalls/amd64-linux.xml index 481431d3121..231308b72b7 100644 --- a/gdb/syscalls/amd64-linux.xml +++ b/gdb/syscalls/amd64-linux.xml @@ -6,8 +6,8 @@ are permitted in any medium without royalty provided the copyright notice and this notice are preserved. --> @@ -308,4 +308,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/syscalls/amd64-linux.xml.in b/gdb/syscalls/amd64-linux.xml= .in index 3b0834b874b..404d445988e 100644 --- a/gdb/syscalls/amd64-linux.xml.in +++ b/gdb/syscalls/amd64-linux.xml.in @@ -8,11 +8,12 @@ =20 =20 + @@ -311,4 +312,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/syscalls/gen-header.py b/gdb/syscalls/gen-header.py new file mode 100644 index 00000000000..78ccdddbff6 --- /dev/null +++ b/gdb/syscalls/gen-header.py @@ -0,0 +1,32 @@ +# Copyright (C) 2013-2022 Free Software Foundation, Inc. + +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + +import sys +import time + +infname =3D sys.argv[1] + +print( + """\ + + + + + + + +""" + % (time.strftime("%Y"), infname) +) diff --git a/gdb/syscalls/i386-linux.xml b/gdb/syscalls/i386-linux.xml index 4a7a2345186..c4b28111388 100644 --- a/gdb/syscalls/i386-linux.xml +++ b/gdb/syscalls/i386-linux.xml @@ -6,8 +6,8 @@ are permitted in any medium without royalty provided the copyright notice and this notice are preserved. --> @@ -231,9 +231,8 @@ - - - + + @@ -334,5 +333,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/syscalls/i386-linux.xml.in b/gdb/syscalls/i386-linux.xml.in index 13c4d1d99d4..549b59565f3 100644 --- a/gdb/syscalls/i386-linux.xml.in +++ b/gdb/syscalls/i386-linux.xml.in @@ -8,11 +8,12 @@ =20 =20 + @@ -234,9 +235,8 @@ - - - + + @@ -337,5 +337,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb/syscalls/update-linux.sh b/gdb/syscalls/update-linux.sh new file mode 100755 index 00000000000..a6719077dc5 --- /dev/null +++ b/gdb/syscalls/update-linux.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Copyright (C) 2022 Free Software Foundation, Inc. +# +# This file is part of GDB. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Used to generate .xml.in files, like so: +# +# ./update-linux.sh amd64-linux.xml.in +# ./update-linux.sh i386-linux.xml.in -m32 + + +if [ $# -lt 1 ]; then + echo "file argument needed" + exit 1 +fi + +f=3D"$1" +shift + +if [ ! -f "$f" ]; then + echo "cannot find $f" + exit 1 +fi + +( + python gen-header.py "" + + tmp=3D$(mktemp) + + echo '#include ' \ + | gcc -E - -dD "$@" \ + | grep -E '#define __NR_' \ + > "$tmp" + + echo '' + + while read -r line; do + name=3D$(echo "$line" | awk '{print $2}' | sed 's/^__NR_//') + nr=3D$(echo "$line" | awk '{print $3}') + echo " " + done < "$tmp" + + echo '' + + rm -f "$tmp" +) > "$f"