From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 5DB07384F01F; Thu, 12 May 2022 08:58:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DB07384F01F 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/tdep] Improve gdb/syscalls/update-linux.sh X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: de51bd9106f64eb26c587c384382a2c7da7a78ae X-Git-Newrev: 59eb8e236c0a80258951d5fac57903db7a1cc7e0 Message-Id: <20220512085855.5DB07384F01F@sourceware.org> Date: Thu, 12 May 2022 08:58:55 +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: Thu, 12 May 2022 08:58:55 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D59eb8e236c0a= 80258951d5fac57903db7a1cc7e0 commit 59eb8e236c0a80258951d5fac57903db7a1cc7e0 Author: Tom de Vries Date: Thu May 12 10:58:50 2022 +0200 [gdb/tdep] Improve gdb/syscalls/update-linux.sh =20 Fix two things in update-linux.sh: - remove use of unnecessary tmp file - inline gen-header.py into update-linux.sh =20 Tested on x86_64-linux. Diff: --- gdb/syscalls/gen-header.py | 32 -------------------------------- gdb/syscalls/update-linux.sh | 33 +++++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 42 deletions(-) diff --git a/gdb/syscalls/gen-header.py b/gdb/syscalls/gen-header.py deleted file mode 100644 index 78ccdddbff6..00000000000 --- a/gdb/syscalls/gen-header.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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/update-linux.sh b/gdb/syscalls/update-linux.sh index a6719077dc5..e26ec4e92cb 100755 --- a/gdb/syscalls/update-linux.sh +++ b/gdb/syscalls/update-linux.sh @@ -36,25 +36,38 @@ if [ ! -f "$f" ]; then exit 1 fi =20 +year=3D$(date +%Y) + ( - python gen-header.py "" + cat < + =20 - echo '#include ' \ - | gcc -E - -dD "$@" \ - | grep -E '#define __NR_' \ - > "$tmp" + + + + + +EOF =20 echo '' =20 - while read -r line; do + echo '#include ' \ + | gcc -E - -dD "$@" \ + | grep -E '#define __NR_' \ + | 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" + done =20 echo '' - - rm -f "$tmp" ) > "$f"