[strace/strace] Add lirc ioctl decoding (PR #208)

Dmitry V. Levin notifications at github.com
Wed Feb 2 23:30:00 UTC 2022


@ldv-alt requested changes on this pull request.

Very impressive for a first time test.
See my comments above.

> @@ -339,6 +339,7 @@ ioctl_kd-success-s1024-Xverbose	+ioctl-success.sh -a20 -s1024 -Xverbose
 ioctl_kvm_run	+ioctl.test -a36 -y
 ioctl_kvm_run-v	+ioctl.test -v -a36 -y
 ioctl_kvm_run_auxstr_vcpu	+ioctl.test -a36 -y -e kvm=vcpu
+ioctl_lirc-success	+ioctl-success.sh -a30

Please add
```
ioctl_lirc	+ioctl-success.sh -a30
```
as well, this would require small changes to the test.

> +	value = 8;
+	do_ioctl(LIRC_SET_SEND_MODE, &value);
+	printf("ioctl(-1, %s, [LIRC_MODE_SCANCODE]) = %s\n",
+	       XLAT_STR(LIRC_SET_SEND_MODE), errstr);
+
+	value = 4;
+	do_ioctl(LIRC_SET_REC_MODE, &value);
+	printf("ioctl(-1, %s, [LIRC_MODE_MODE2]) = %s\n",
+	       XLAT_STR(LIRC_SET_REC_MODE), errstr);
+
+	value = 16;
+	do_ioctl(LIRC_SET_REC_MODE, &value);
+	printf("ioctl(-1, %s, [LIRC_MODE_LIRCCODE]) = %s\n",
+	       XLAT_STR(LIRC_SET_REC_MODE), errstr);
+
+	// read ioctl

/* read ioctls */

To make the test work in case of no syscall tampering,
the return value of do_ioctl should be tested and acted appropriately,
see, for eexample, tests/ioctl_gpio.c

also, please add `do_ioctl(LIRC_GET_FEATURES, 0);` or something like this to cover the `true` branch of `if (umove_or_printaddr(tcp, arg, &value))`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/strace/strace/pull/208#pullrequestreview-871216741
You are receiving this because you are subscribed to this thread.

Message ID: <strace/strace/pull/208/review/871216741 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20220202/52c4ecaf/attachment.htm>


More information about the Strace-devel mailing list