3 # Copyright (C) 2022-2024 Free Software Foundation, Inc.
5 # This file is part of GDB.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # Used to generate .xml.in files, like so:
22 # ./update-linux.sh amd64-linux.xml.in
23 # ./update-linux.sh i386-linux.xml.in -m32
27 echo "file argument needed"
34 if [ ! -f "$f" ]; then
44 <!-- Copyright (C) 2009-$year Free Software Foundation, Inc.
46 Copying and distribution of this file, with or without modification,
47 are permitted in any medium without royalty provided the copyright
48 notice and this notice are preserved. -->
50 <!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
52 <!-- This file was generated using the following file:
56 The file mentioned above belongs to the Linux Kernel. -->
61 echo '<syscalls_info>'
63 echo '#include <sys/syscall.h>' \
65 |
grep -E '#define __NR_' \
66 |
while read -r line
; do
67 name
=$
(echo "$line" |
awk '{print $2}' |
sed 's/^__NR_//')
68 nr
=$
(echo "$line" |
awk '{print $3}')
69 echo " <syscall name=\"$name\" number=\"$nr\"/>"
72 echo '</syscalls_info>'