[PATCH] Factor out printing of 64bit syscall argument

Dmitry V. Levin ldv at altlinux.org
Wed Nov 4 16:21:53 UTC 2009


On Wed, Nov 04, 2009 at 05:01:31PM +0100, Andreas Schwab wrote:
> "Dmitry V. Levin" <ldv-u2l5PoMzF/Vg9hUCZPvPmw at public.gmane.org> writes:
> > On Wed, Nov 04, 2009 at 12:55:46PM +0100, Andreas Schwab wrote:
> >> This patch refactors the printing of 64bit syscall arguments.
> >
> > I like the change, but I have two questions about particular hunks of
> > the patch.
> >
> >> @@ -631,7 +625,6 @@ sys_lseek64(struct tcb *tcp)
> >>  {
> >>  	if (entering(tcp)) {
> >>  		long long offset;
> >> -		ALIGN64 (tcp, 1);	/* FreeBSD aligns off_t args */
> >>  		offset = LONG_LONG(tcp->u_arg [1], tcp->u_arg[2]);
> >>  		if (tcp->u_arg[3] == SEEK_SET)
> >>  			tprintf("%ld, %llu, ", tcp->u_arg[0], offset);
> >
> > Why printllval() is not used here?
> 
> Accidentally dropped the ball here.

I expect that LONG_LONG macro should no longer be used beyond the
printllval() definition, except some dead ifdef'ed code in io.c.

> >> -#elif defined ARM || defined POWERPC
> >> -			LONG_LONG(tcp->u_arg[2], tcp->u_arg[3]),
> >> -			LONG_LONG(tcp->u_arg[4], tcp->u_arg[5]));
> >> +		int argn;
> >> +		tprintf("%ld, ", tcp->u_arg[0]);
> >> +		argn = printllval(tcp, "%lld, ", 1);
> >> +		argn = printllval(tcp, "%lld, ", argn);
> >> +#if defined ARM || defined POWERPC
> >>  		printxval(advise, tcp->u_arg[1], "POSIX_FADV_???");
> >>  #else
> >> -			LONG_LONG(tcp->u_arg[1], tcp->u_arg[2]),
> >> -			LONG_LONG(tcp->u_arg[3], tcp->u_arg[4]));
> >> -		printxval(advise, tcp->u_arg[5], "POSIX_FADV_???");
> >> +		printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
> >>  #endif
> >>  	}
> >>  	return 0;
> >
> > I'm afraid that this change breaks ARM because printxval() does no
> > special handling for ARM.
> 
> I guess you mean printllval?  Yes, that breaks ARM.

Yes, I meant printllval().


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20091104/69808770/attachment.bin>


More information about the Strace-devel mailing list