diff options
author | Sanimir Agovic | 2017-12-18 12:58:55 +0000 |
---|---|---|
committer | Sanimir Agovic | 2017-12-18 15:30:47 +0000 |
commit | 35a5fb7746bf2d8270cc9e914e750937577e7f10 (patch) | |
tree | ff975fe52ff05dd67348fc117c68012357838c55 /agent/system/Darwin/tcf/context-darwin.c | |
parent | 2a51404ff978b309188531863f5205e92df6dda6 (diff) | |
download | org.eclipse.tcf.agent-35a5fb7746bf2d8270cc9e914e750937577e7f10.tar.gz org.eclipse.tcf.agent-35a5fb7746bf2d8270cc9e914e750937577e7f10.tar.xz org.eclipse.tcf.agent-35a5fb7746bf2d8270cc9e914e750937577e7f10.zip |
darwin: fix print format specifiers
Change-Id: Ic4dcdb10a99f4c0e90ce4a6bf1485c52cd6a3ee7
Signed-off-by: Sanimir Agovic <sanimir@subpath.org>
Diffstat (limited to 'agent/system/Darwin/tcf/context-darwin.c')
-rw-r--r-- | agent/system/Darwin/tcf/context-darwin.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/agent/system/Darwin/tcf/context-darwin.c b/agent/system/Darwin/tcf/context-darwin.c index 6d791523..2b631d62 100644 --- a/agent/system/Darwin/tcf/context-darwin.c +++ b/agent/system/Darwin/tcf/context-darwin.c @@ -126,8 +126,8 @@ int context_has_state(Context * ctx) { } int context_stop(Context * ctx) { - trace(LOG_CONTEXT, "context:%s suspending ctx %#lx, id %s", - ctx->pending_intercept ? "" : " temporary", ctx, ctx->id); + trace(LOG_CONTEXT, "context:%s suspending ctx %#" PRIxPTR ", id %s", + ctx->pending_intercept ? "" : " temporary", (uintptr_t)ctx, ctx->id); assert(is_dispatch_thread()); assert(!ctx->exited); assert(!ctx->stopped); @@ -138,8 +138,8 @@ int context_stop(Context * ctx) { ctx->exiting = 1; return 0; } - trace(LOG_ALWAYS, "error: tkill(SIGSTOP) failed: ctx %#lx, id %s, error %d %s", - ctx, ctx->id, err, errno_to_str(err)); + trace(LOG_ALWAYS, "error: tkill(SIGSTOP) failed: ctx %#" PRIxPTR ", id %s, error %d %s", + (uintptr_t)ctx, ctx->id, err, errno_to_str(err)); errno = err; return -1; } @@ -182,7 +182,8 @@ int context_continue(Context * ctx) { assert(signal != SIGTRAP); } - trace(LOG_CONTEXT, "context: resuming ctx %#lx, id %s, with signal %d", ctx, ctx->id, signal); + trace(LOG_CONTEXT, "context: resuming ctx %#" PRIxPTR ", id %s, with signal %d", + (uintptr_t)ctx, ctx->id, signal); #if defined(__i386__) if (EXT(ctx)->regs->__eflags & 0x100) { EXT(ctx)->regs->__eflags &= ~0x100; @@ -198,8 +199,8 @@ int context_continue(Context * ctx) { unsigned int state_count; if (thread_set_state(EXT(ctx)->pid, x86_THREAD_STATE32, EXT(ctx)->regs, &state_count) != KERN_SUCCESS) { int err = errno; - trace(LOG_ALWAYS, "error: thread_set_state failed: ctx %#lx, id %s, error %d %s", - ctx, ctx->id, err, errno_to_str(err)); + trace(LOG_ALWAYS, "error: thread_set_state failed: ctx %#" PRIxPTR ", id %s, error %d %s", + (uintptr_t)ctx, ctx->id, err, errno_to_str(err)); errno = err; return -1; } @@ -211,8 +212,8 @@ int context_continue(Context * ctx) { send_context_started_event(ctx); return 0; } - trace(LOG_ALWAYS, "error: ptrace(PT_CONTINUE, ...) failed: ctx %#lx, id %s, error %d %s", - ctx, ctx->id, err, errno_to_str(err)); + trace(LOG_ALWAYS, "error: ptrace(PT_CONTINUE, ...) failed: ctx %#" PRIxPTR ", id %s, error %d %s", + (uintptr_t)ctx, ctx->id, err, errno_to_str(err)); errno = err; return -1; } @@ -236,13 +237,13 @@ int context_single_step(Context * ctx) { if (skip_breakpoint(ctx, 1)) return 0; if (syscall_never_returns(ctx)) return context_continue(ctx); - trace(LOG_CONTEXT, "context: single step ctx %#lx, id %S", ctx, ctx->id); + trace(LOG_CONTEXT, "context: single step ctx %#" PRIxPTR ", id %s", (uintptr_t)ctx, ctx->id); if (EXT(ctx)->regs_dirty) { unsigned int state_count; if (thread_set_state(EXT(ctx)->pid, x86_THREAD_STATE32, EXT(ctx)->regs, &state_count) != KERN_SUCCESS) { int err = errno; - trace(LOG_ALWAYS, "error: thread_set_state failed: ctx %#lx, id %s, error %d %s", - ctx, ctx->id, err, errno_to_str(err)); + trace(LOG_ALWAYS, "error: thread_set_state failed: ctx %#" PRIxPTR ", id %s, error %d %s", + (uintptr_t)ctx, ctx->id, err, errno_to_str(err)); errno = err; return -1; } @@ -255,8 +256,8 @@ int context_single_step(Context * ctx) { send_context_started_event(ctx); return 0; } - trace(LOG_ALWAYS, "error: ptrace(PT_STEP, ...) failed: ctx %#lx, id %s, error %d %s", - ctx, ctx->id, err, errno_to_str(err)); + trace(LOG_ALWAYS, "error: ptrace(PT_STEP, ...) failed: ctx %#" PRIxPTR ", id %s, error %d %s", + (uintptr_t)ctx, ctx->id, err, errno_to_str(err)); errno = err; return -1; } @@ -523,11 +524,12 @@ static void event_pid_exited(pid_t pid, int status, int signal) { if (EXT(ctx->parent)->pid == pid) ctx = ctx->parent; assert(EXT(ctx)->attach_callback == NULL); if (ctx->exited) { - trace(LOG_EVENTS, "event: ctx %#lx, pid %d, exit status %d unexpected, stopped %d, exited %d", - ctx, pid, status, ctx->stopped, ctx->exited); + trace(LOG_EVENTS, "event: ctx %#" PRIxPTR ", pid %d, exit status %d unexpected, stopped %d, exited %d", + (uintptr_t)ctx, pid, status, ctx->stopped, ctx->exited); } else { - trace(LOG_EVENTS, "event: ctx %#lx, pid %d, exit status %d, term signal %d", ctx, pid, status, signal); + trace(LOG_EVENTS, "event: ctx %#" PRIxPTR ", pid %d, exit status %d, term signal %d", + (uintptr_t)ctx, pid, status, signal); ctx->exiting = 1; if (ctx->stopped) send_context_started_event(ctx); if (!list_is_empty(&ctx->children)) { |