On 25.11.2016 23:41, Christos Zoulas wrote: > In article <o1aegv$210$1%blaine.gmane.org@localhost>, > Christos Zoulas <christos%astron.com@localhost> wrote: >> In article <20161125200105.5DBB4FBAE%cvs.NetBSD.org@localhost>, >> Kamil Rytarowski <source-changes-d%NetBSD.org@localhost> wrote: >>> -=-=-=-=-=- >>> >>> Module Name: src >>> Committed By: kamil >>> Date: Fri Nov 25 20:01:05 UTC 2016 >>> >>> Modified Files: >>> src/tests/kernel: t_ptrace_wait.c >>> >>> Log Message: >>> Fix several printf(3)-like functions usage with printing integers >>> >>> Integers as hex shall no be printed with PRIx8, but with plain "x". >> >> I would use %#x... > > And I am not sure that passing 'int x; ptrace(.., &x, ...);' is right when > reading/writing 1 byte. It works on x86 if you initialize x = 0, but > it will will not work on sparc64, I think. Perhaps you need to pass > 'uint8_t x; ptrace(, ..., &x, ...);' Then the printf format is right :-) > > christos > PT_READ_D and PT_READ_I read single int according to documentation. In tests io_read_d* io_read_i* data blocks are printed with appropriate PRIxN. I cannot spot a mistake in the tests. I'm going to replace %x with %#x.
Attachment:
signature.asc
Description: OpenPGP digital signature