[PATCH] tests/ipc_sem: don't match address of sem buffer

Andreas Schwab schwab at suse.de
Thu Mar 12 10:13:49 UTC 2015


"Dmitry V. Levin" <ldv-u2l5PoMzF/Vg9hUCZPvPmw at public.gmane.org> writes:

> On Wed, Mar 11, 2015 at 01:07:15PM +0100, Andreas Schwab wrote:
>> On architectures where the semctl call is implemented by the ipc syscall
>> the glibc wrapper passes a pointer to a local variable, so the value of
>> the fourth argument is unknown.
>
> Wouldn't it be better to fix the parser, e.g.
>
> --- a/ipc.c
> +++ b/ipc.c
> @@ -281,7 +281,16 @@ int sys_semctl(struct tcb *tcp)
>  	if (entering(tcp)) {
>  		tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
>  		PRINTCTL(semctl_flags, tcp->u_arg[2], "SEM_???");
> -		tprintf(", %#lx", tcp->u_arg[3]);
> +		tprints(", ");
> +		if (indirect_ipccall(tcp)) {
> +			if (current_wordsize == sizeof(int)) {
> +				printnum_int(tcp, tcp->u_arg[3], "%#x");
> +			} else {
> +				printnum_long(tcp, tcp->u_arg[3], "%#lx");
> +			}

That prints [...] instead of just the number, though.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




More information about the Strace-devel mailing list