Message ID | 20180628034652.24152-1-f4bug@amsat.org |
---|---|
Headers | show |
Series | linux-user: strace improvements | expand |
Le 28/06/2018 à 05:46, Philippe Mathieu-Daudé a écrit : > Suggested-by: Laurent Vivier <laurent@vivier.eu> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > linux-user/strace.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/linux-user/strace.c b/linux-user/strace.c > index bd897a3f20..b43a21f48b 100644 > --- a/linux-user/strace.c > +++ b/linux-user/strace.c > @@ -63,6 +63,7 @@ UNUSED static void print_string(abi_long, int); > UNUSED static void print_buf(abi_long addr, abi_long len, int last); > UNUSED static void print_raw_param(const char *, abi_long, int); > UNUSED static void print_timeval(abi_ulong, int); > +UNUSED static void print_timezone(abi_ulong, int); > UNUSED static void print_number(abi_long, int); > UNUSED static void print_signal(abi_ulong, int); > UNUSED static void print_sockaddr(abi_ulong addr, abi_long addrlen); > @@ -1182,6 +1183,25 @@ print_timeval(abi_ulong tv_addr, int last) > gemu_log("NULL%s", get_comma(last)); > } > > +static void > +print_timezone(abi_ulong tz_addr, int last) > +{ > + if (tz_addr) { > + struct target_timezone *tz; > + > + tz = lock_user(VERIFY_READ, tz_addr, sizeof(*tz), 1); > + if (!tz) { you should use print_pointer(tz_addr, last) instead of ignoring the value. Thanks, Laurent
On 07/01/2018 04:44 PM, Laurent Vivier wrote: > Le 28/06/2018 à 05:46, Philippe Mathieu-Daudé a écrit : >> Suggested-by: Laurent Vivier <laurent@vivier.eu> >> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> >> --- >> linux-user/strace.c | 20 ++++++++++++++++++++ >> 1 file changed, 20 insertions(+) >> >> diff --git a/linux-user/strace.c b/linux-user/strace.c >> index bd897a3f20..b43a21f48b 100644 >> --- a/linux-user/strace.c >> +++ b/linux-user/strace.c >> @@ -63,6 +63,7 @@ UNUSED static void print_string(abi_long, int); >> UNUSED static void print_buf(abi_long addr, abi_long len, int last); >> UNUSED static void print_raw_param(const char *, abi_long, int); >> UNUSED static void print_timeval(abi_ulong, int); >> +UNUSED static void print_timezone(abi_ulong, int); >> UNUSED static void print_number(abi_long, int); >> UNUSED static void print_signal(abi_ulong, int); >> UNUSED static void print_sockaddr(abi_ulong addr, abi_long addrlen); >> @@ -1182,6 +1183,25 @@ print_timeval(abi_ulong tv_addr, int last) >> gemu_log("NULL%s", get_comma(last)); >> } >> >> +static void >> +print_timezone(abi_ulong tz_addr, int last) >> +{ >> + if (tz_addr) { >> + struct target_timezone *tz; >> + >> + tz = lock_user(VERIFY_READ, tz_addr, sizeof(*tz), 1); >> + if (!tz) { > > you should use print_pointer(tz_addr, last) instead of ignoring the value. I copied print_timeval(). Same applies there then. I'll update both. Thanks, Phil.