diff mbox series

[1/2] linux-user: Show SIGCHLD in clone() strace output

Message ID 20230125135749.4594-1-deller@gmx.de (mailing list archive)
State New, archived
Headers show
Series [1/2] linux-user: Show SIGCHLD in clone() strace output | expand

Commit Message

Helge Deller Jan. 25, 2023, 1:57 p.m. UTC
When stracing a program, show up the SIGCHLD value the same
way as it's done when running strace natively, e.g.:
clone(child_stack=0xf7af0040, flags=CLONE_VM|CLONE_VFORK|SIGCHLD, ...

Signed-off-by: Helge Deller <deller@gmx.de>
---
 linux-user/strace.c | 1 +
 1 file changed, 1 insertion(+)

--
2.38.1

Comments

Helge Deller Jan. 25, 2023, 2:18 p.m. UTC | #1
On 1/25/23 14:57, Helge Deller wrote:
> When stracing a program, show up the SIGCHLD value the same
> way as it's done when running strace natively, e.g.:
> clone(child_stack=0xf7af0040, flags=CLONE_VM|CLONE_VFORK|SIGCHLD, ...
>
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   linux-user/strace.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index 82dc1a1e20..3157e4b420 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -1136,6 +1136,7 @@ UNUSED static struct flags clone_flags[] = {
>   #if defined(CLONE_IO)
>       FLAG_GENERIC(CLONE_IO),
>   #endif
> +    FLAG_TARGET(SIGCHLD),

It's actually not 100% correct, as this would trigger for other SIGxxx values too,
which have the same bits set as TARGET_SIGCHLD. Given the fact that we only support
TARGET_SIGCHLD in clone(), it would nevertheless in most cases show the correct output.

So, probably it's best to not apply this patch it as-is.

Helge
diff mbox series

Patch

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 82dc1a1e20..3157e4b420 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1136,6 +1136,7 @@  UNUSED static struct flags clone_flags[] = {
 #if defined(CLONE_IO)
     FLAG_GENERIC(CLONE_IO),
 #endif
+    FLAG_TARGET(SIGCHLD),
     FLAG_END,
 };