[PATCH v2] Add decoding for parametered ioctls

Dmitry V. Levin ldv at altlinux.org
Wed Jan 21 20:16:16 UTC 2015


On Wed, Jan 21, 2015 at 08:53:00PM +0100, Gabriel Laskar wrote:
> Some ioctls from evdev, hiddev, mixer, uinput, spi and joystick are
> parametered by a size or a number that is variable. These changes add
> the display of these ones, and their parameters.
[...]
> @@ -398,13 +398,16 @@ sys_ioctl(struct tcb *tcp)
>  	if (entering(tcp)) {
>  		printfd(tcp, tcp->u_arg[0]);
>  		tprints(", ");
> -		iop = ioctl_lookup(tcp->u_arg[1]);
> -		if (iop) {
> -			tprints(iop->symbol);
> -			while ((iop = ioctl_next_match(iop)))
> -				tprintf(" or %s", iop->symbol);
> -		} else
> -			ioctl_print_code(tcp->u_arg[1]);
> +		if (!ioctl_decode_command_number(tcp->u_arg[1])) {
> +			iop = ioctl_lookup(tcp->u_arg[1]);
> +			if (iop) {
> +				tprints(iop->symbol);
> +				while ((iop = ioctl_next_match(iop)))
> +					tprintf(" or %s", iop->symbol);
> +			} else {
> +				ioctl_print_code("%#lx", tcp->u_arg[1]);

ioctl_print_code() takes only one argument.

[...]
> +		default:
> +			return 0;
> +	}
> +>>>>>>> Add decoding for parametered ioctls
> +}
> +
>  int
>  ioctl_decode(struct tcb *tcp, unsigned int code, long arg)
>  {

Have you tried to compile this code containing merge markers?


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


More information about the Strace-devel mailing list