From: Andreas Schwab <schwab@linux-m68k.org>
To: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simark@simark.ca>
Subject: Re: [PATCH][gdb] Update syscalls/{amd64,i386}-linux.xml
Date: Mon, 09 May 2022 17:40:27 +0200 [thread overview]
Message-ID: <87bkw6k93o.fsf@igel.home> (raw)
In-Reply-To: <60040d90-6b3d-7e36-7a4d-bc674b7995f2@suse.de> (Tom de Vries via Gdb-patches's message of "Mon, 9 May 2022 17:29:36 +0200")
On Mai 09 2022, Tom de Vries via Gdb-patches wrote:
> + tmp=$(mktemp)
> +
> + echo '#include <sys/syscall.h>' \
> + | gcc -E - -dD "$@" \
> + | grep -E '#define __NR_' \
> + > "$tmp"
> +
> + echo '<syscalls_info>'
> +
> + while read -r line; do
> + name=$(echo "$line" | awk '{print $2}' | sed 's/^__NR_//')
> + nr=$(echo "$line" | awk '{print $3}')
> + echo " <syscall name=\"$name\" number=\"$nr\"/>"
> + done < "$tmp"
> +
> + echo '</syscalls_info>'
> +
> + rm -f "$tmp"
There is no need for a temporary file, you can just pipe directly into
the loop.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
next prev parent reply other threads:[~2022-05-09 15:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 14:57 [PATCH][gdb/testsuite] Handle pipe2 syscall in gdb.base/catch-syscall.exp Tom de Vries via Gdb-patches
2022-05-05 11:47 ` [PATCH, v2][gdb/testsuite] " Tom de Vries via Gdb-patches
2022-05-05 11:49 ` [PATCH][gdb/tdep] Support catch syscall pipe2 for i386 Tom de Vries via Gdb-patches
2022-05-05 13:20 ` Simon Marchi via Gdb-patches
2022-05-09 10:26 ` [PATCH][gdb] Add gdb/syscalls/Makefile Tom de Vries via Gdb-patches
2022-05-09 14:41 ` Simon Marchi via Gdb-patches
2022-05-09 14:46 ` Tom de Vries via Gdb-patches
2022-05-09 10:39 ` [PATCH][gdb] Update syscalls/{amd64,i386}-linux.xml Tom de Vries via Gdb-patches
2022-05-09 14:48 ` Simon Marchi via Gdb-patches
2022-05-09 15:29 ` Tom de Vries via Gdb-patches
2022-05-09 15:40 ` Andreas Schwab [this message]
2022-05-09 15:42 ` Tom de Vries via Gdb-patches
2022-05-09 15:45 ` Andreas Schwab
2022-05-09 16:04 ` Tom de Vries via Gdb-patches
2022-05-09 17:19 ` Tom Tromey
2022-05-10 11:39 ` Tom de Vries via Gdb-patches
2022-05-12 9:00 ` Tom de Vries via Gdb-patches
2022-05-10 11:53 ` Tom de Vries via Gdb-patches
2022-05-16 16:07 ` Tom Tromey
2022-05-18 9:58 ` [committed][gdb/tdep] Add gdb/syscalls/update-linux-from-src.sh Tom de Vries via Gdb-patches
2022-05-05 13:23 ` [PATCH, v2][gdb/testsuite] Handle pipe2 syscall in gdb.base/catch-syscall.exp Simon Marchi via Gdb-patches
2022-05-09 10:18 ` Tom de Vries via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkw6k93o.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox