[PATCH][gdb] Update syscalls/{amd64,i386}-linux.xml
Tom de Vries
tdevries@suse.de
Tue May 10 11:39:14 GMT 2022
On 5/9/22 19:19, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Tom> diff --git a/gdb/syscalls/gen-header.py b/gdb/syscalls/gen-header.py
>
> Tom> +<!-- Copyright (C) 2009-%s Free Software Foundation, Inc.
>
> Tom> +"""
> Tom> + % (time.strftime("%Y"), infname)
>
> It seems like overkill to have a python script just for a "here
> document" and "date +%Y".
>
Ack, fixed.
> Tom> +(
> Tom> + python gen-header.py "<sys/syscall.h>"
> Tom> +
> Tom> + tmp=$(mktemp)
> Tom> +
> Tom> + echo '#include <sys/syscall.h>' \
> Tom> + | gcc -E - -dD "$@" \
> Tom> + | egrep '#define __NR_' \
> Tom> + > $tmp
> Tom> +
> Tom> + echo '<syscalls_info>'
> Tom> +
> Tom> + while read line; do
> Tom> + name=$(echo $line | awk '{print $2}' | sed 's/^__NR_//')
> Tom> + nr=$(echo $line | awk '{print $3}')
> Tom> + echo " <syscall name=\"$name\" number=\"$nr\"/>"
> Tom> + done < $tmp
> Tom> +
> Tom> + echo '</syscalls_info>'
>
> Alternatively doing the whole thing in Python would also be alright.
I've done things in bash for now, that's easier for me.
Any further comments?
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-gdb-tdep-Improve-gdb-syscalls-update-linux.sh.patch
Type: text/x-patch
Size: 2817 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20220510/f68c00c1/attachment-0001.bin>
More information about the Gdb-patches
mailing list