qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Helge Deller <deller@gmx.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v2] linux-user: Improve strace output of pread64() and pwrite64()
Date: Mon, 30 Jan 2023 10:26:45 +0100	[thread overview]
Message-ID: <521ea804-5afc-fb19-db72-e1ed73300781@vivier.eu> (raw)
In-Reply-To: <Y9Q7BlDc/VX+1SBL@p100>

Le 27/01/2023 à 21:58, Helge Deller a écrit :
> Make the strace look nicer for those two syscalls.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
> v2: Use regpairs_aligned() and target_offset64(), noticed by Laurent Vivier
> 
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index 82dc1a1e20..379536f5c9 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -3824,6 +3824,25 @@ print_rlimit64(abi_ulong rlim_addr, int last)
>       }
>   }
> 
> +#if defined(TARGET_NR_pread64) || defined(TARGET_NR_pwrite64)
> +static void
> +print_preadwrite64(CPUArchState *cpu_env, const struct syscallname *name,
> +           abi_long arg0, abi_long arg1, abi_long arg2,
> +           abi_long arg3, abi_long arg4, abi_long arg5)
> +{
> +    if (regpairs_aligned(cpu_env, TARGET_NR_pread64)) {
> +        arg3 = arg4;
> +        arg4 = arg5;
> +    }
> +    print_syscall_prologue(name);
> +    print_raw_param("%d", arg0, 0);
> +    print_pointer(arg1, 0);
> +    print_raw_param("%d", arg2, 0);
> +    qemu_log("%lld", (long long)target_offset64(arg3, arg4));

better to use:

print_raw_param("%" PRIu64, target_offset64(arg3, arg4), 1);

Thanks,
Laurent


  parent reply	other threads:[~2023-01-30  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 20:58 [PATCH v2] linux-user: Improve strace output of pread64() and pwrite64() Helge Deller
2023-01-27 22:56 ` Richard Henderson
2023-01-30  9:26 ` Laurent Vivier [this message]
2023-01-30 22:11   ` Helge Deller
2023-01-31 11:04     ` Laurent Vivier
2023-01-31 13:08       ` Helge Deller
2023-01-31 15:05         ` Laurent Vivier

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=521ea804-5afc-fb19-db72-e1ed73300781@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=deller@gmx.de \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).