libsel4debug: use SEL4_PRIx_word to print regs Signed-off-by: Axel Heider <axelheider@gmx.de>
diff --git a/libsel4debug/src/register_dump.c b/libsel4debug/src/register_dump.c index e5a59b3..4d598a5 100644 --- a/libsel4debug/src/register_dump.c +++ b/libsel4debug/src/register_dump.c
@@ -18,18 +18,18 @@ void sel4debug_dump_registers_prefix(seL4_CPtr tcb, char *prefix) { - seL4_UserContext context; - int error; + seL4_UserContext context; /* basically an array of seL4_Word */ const int num_regs = sizeof(context) / sizeof(seL4_Word); - - error = seL4_TCB_ReadRegisters(tcb, false, 0, num_regs, &context); + int error = seL4_TCB_ReadRegisters(tcb, false, 0, num_regs, &context); if (error) { - ZF_LOGE("Failed to read registers for tcb 0x%lx, error %d", (long) tcb, error); + ZF_LOGE("Failed to read registers for tcb 0x%"SEL4_PRIx_word", error %d", + tcb, error); return; } printf("%sRegister dump:\n", prefix); - for (int i = 0; i < num_regs; i++) { - printf("%s%s:\t0x%lx\n", prefix, register_names[i], (long) ((seL4_Word * )&context)[i]); + for (unsigned int i = 0; i < num_regs; i++) { + printf("%s%s:\t0x%"SEL4_PRIx_word"\n", + prefix, register_names[i], ((seL4_Word *)&context)[i]); } }