Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2017-11-22 12:45:33 -0500
committerEugene Tarassov2017-11-22 12:45:33 -0500
commit935ac2fab08a015be58cb840e8b486f75a8f8179 (patch)
tree075c00d5d8895278baf7e6c47924e4023e16c7d4
parentf23c820b8740dbd5fd45b51198fd06bd69abeea6 (diff)
downloadorg.eclipse.tcf.agent-935ac2fab08a015be58cb840e8b486f75a8f8179.tar.gz
org.eclipse.tcf.agent-935ac2fab08a015be58cb840e8b486f75a8f8179.tar.xz
org.eclipse.tcf.agent-935ac2fab08a015be58cb840e8b486f75a8f8179.zip
TCF Agent: fixed inconsistencies between format specification and argument types in trace() invocations
-rw-r--r--agent/machine/a64/tcf/stack-crawl-a64.c2
-rw-r--r--agent/system/GNU/Linux/tcf/context-linux.c42
-rw-r--r--agent/tcf/framework/channel_lws.c9
-rw-r--r--agent/tcf/services/breakpoints.c2
-rw-r--r--agent/tcf/services/sysmon.c6
5 files changed, 28 insertions, 33 deletions
diff --git a/agent/machine/a64/tcf/stack-crawl-a64.c b/agent/machine/a64/tcf/stack-crawl-a64.c
index c087eaff..68227e8e 100644
--- a/agent/machine/a64/tcf/stack-crawl-a64.c
+++ b/agent/machine/a64/tcf/stack-crawl-a64.c
@@ -1026,7 +1026,7 @@ static int trace_instructions(void) {
unsigned t = 0;
BranchData * b = NULL;
if (chk_loaded(REG_ID_SP) < 0) return -1;
- trace(LOG_STACK, "Stack crawl: pc 0x%" PRIx64 ", sp 0x%" PRIx64,
+ trace(LOG_STACK, "Stack crawl: pc %#" PRIx64 ", sp %#" PRIx64,
pc_data.o ? pc_data.v : (uint64_t)0,
reg_data[REG_ID_SP].o ? reg_data[REG_ID_SP].v : (uint64_t)0);
for (t = 0; t < MAX_INST; t++) {
diff --git a/agent/system/GNU/Linux/tcf/context-linux.c b/agent/system/GNU/Linux/tcf/context-linux.c
index b962f52d..d4eb5e6b 100644
--- a/agent/system/GNU/Linux/tcf/context-linux.c
+++ b/agent/system/GNU/Linux/tcf/context-linux.c
@@ -692,14 +692,14 @@ int context_write_mem(Context * ctx, ContextAddress address, void * buf, size_t
assert(is_dispatch_thread());
assert(!ctx->exited);
trace(LOG_CONTEXT,
- "context: write memory ctx %#" PRIxPTR ", id %s, address %#lx, size %zu",
- (uintptr_t)ctx, ctx->id, address, size);
+ "context: write memory ctx %#" PRIxPTR ", id %s, address %#" PRIx64 ", size %zu",
+ (uintptr_t)ctx, ctx->id, (uint64_t)address, size);
mem_err_info.error = 0;
if (size == 0) return 0;
if (address + size < address) {
trace(LOG_CONTEXT,
- "context: write past the end of memory: ctx %#" PRIxPTR ", id %s, addr %#lx, size %ld",
- (uintptr_t)ctx, ctx->id, address, size);
+ "context: write past the end of memory: ctx %#" PRIxPTR ", id %s, addr %#" PRIx64 ", size %u",
+ (uintptr_t)ctx, ctx->id, (uint64_t)address, (unsigned)size);
errno = EFAULT;
return -1;
}
@@ -714,8 +714,8 @@ int context_write_mem(Context * ctx, ContextAddress address, void * buf, size_t
error = errno;
if (error != ESRCH || ctx != ctx->mem) {
trace(LOG_CONTEXT,
- "context: ptrace(PTRACE_PEEKDATA, ...) failed: ctx %#" PRIxPTR ", id %s, addr %#lx, error %d %s",
- (uintptr_t)ctx, ctx->id, word_addr, error, errno_to_str(error));
+ "context: ptrace(PTRACE_PEEKDATA, ...) failed: ctx %#" PRIxPTR ", id %s, addr %#" PRIx64 ", error %d %s",
+ (uintptr_t)ctx, ctx->id, (uint64_t)word_addr, error, errno_to_str(error));
}
break;
}
@@ -732,8 +732,8 @@ int context_write_mem(Context * ctx, ContextAddress address, void * buf, size_t
error = errno;
if (error != ESRCH || ctx != ctx->mem) {
trace(LOG_ALWAYS,
- "error: ptrace(PTRACE_POKEDATA, ...) failed: ctx %#" PRIxPTR ", id %s, addr %#lx, error %d %s",
- (uintptr_t)ctx, ctx->id, word_addr, error, errno_to_str(error));
+ "error: ptrace(PTRACE_POKEDATA, ...) failed: ctx %#" PRIxPTR ", id %s, addr %#" PRIx64 ", error %d %s",
+ (uintptr_t)ctx, ctx->id, (uint64_t)word_addr, error, errno_to_str(error));
}
break;
}
@@ -792,14 +792,14 @@ int context_read_mem(Context * ctx, ContextAddress address, void * buf, size_t s
assert(is_dispatch_thread());
assert(!ctx->exited);
trace(LOG_CONTEXT,
- "context: read memory ctx %#" PRIxPTR ", id %s, address %#lx, size %zu",
- (uintptr_t)ctx, ctx->id, address, size);
+ "context: read memory ctx %#" PRIxPTR ", id %s, address %#" PRIx64 ", size %zu",
+ (uintptr_t)ctx, ctx->id, (uint64_t)address, size);
mem_err_info.error = 0;
if (size == 0) return 0;
if ((address + size) < address) {
trace(LOG_CONTEXT,
- "context: read past the end of memory: ctx %#" PRIxPTR ", id %s, addr %#lx, size %ld",
- (uintptr_t)ctx, ctx->id, address, size);
+ "context: read past the end of memory: ctx %#" PRIxPTR ", id %s, addr %#" PRIx64 ", size %u",
+ (uintptr_t)ctx, ctx->id, (uint64_t)address, (unsigned)size);
errno = EFAULT;
return -1;
}
@@ -811,8 +811,8 @@ int context_read_mem(Context * ctx, ContextAddress address, void * buf, size_t s
error = errno;
if (error != ESRCH || ctx != ctx->mem) {
trace(LOG_CONTEXT,
- "context: ptrace(PTRACE_PEEKDATA, ...) failed: ctx %#" PRIxPTR ", id %s, addr %#lx, error %d %s",
- (uintptr_t)ctx, ctx->id, word_addr, error, errno_to_str(error));
+ "context: ptrace(PTRACE_PEEKDATA, ...) failed: ctx %#" PRIxPTR ", id %s, addr %#" PRIx64 ", error %d %s",
+ (uintptr_t)ctx, ctx->id, (uint64_t)word_addr, error, errno_to_str(error));
}
break;
}
@@ -1585,16 +1585,16 @@ static void event_pid_stopped(pid_t pid, int signal, int event, int syscall) {
ext->syscall_pc = pc1;
ext->syscall_enter = 1;
ext->syscall_exit = 0;
- trace(LOG_EVENTS, "event: pid %d enter sys call %d, PC = %#lx",
- pid, ext->syscall_id, ext->syscall_pc);
+ trace(LOG_EVENTS, "event: pid %d enter sys call %d, PC = %#" PRIx64,
+ pid, ext->syscall_id, (uint64_t)ext->syscall_pc);
}
else {
if (ext->syscall_pc != pc1) {
- trace(LOG_ALWAYS, "Invalid PC at sys call exit: pid %d, sys call %d, PC %#lx, expected PC %#lx",
- ext->pid, ext->syscall_id, pc1, ext->syscall_pc);
+ trace(LOG_ALWAYS, "Invalid PC at sys call exit: pid %d, sys call %d, PC %#" PRIx64 ", expected PC %#" PRIx64,
+ ext->pid, ext->syscall_id, (uint64_t)pc1, (uint64_t)ext->syscall_pc);
}
- trace(LOG_EVENTS, "event: pid %d exit sys call %d, PC = %#lx",
- pid, ext->syscall_id, pc1);
+ trace(LOG_EVENTS, "event: pid %d exit sys call %d, PC = %#" PRIx64,
+ pid, ext->syscall_id, (uint64_t)pc1);
switch (ext->syscall_id) {
#ifdef __NR_mmap
case __NR_mmap:
@@ -1619,7 +1619,7 @@ static void event_pid_stopped(pid_t pid, int signal, int event, int syscall) {
ext->syscall_id = 0;
ext->syscall_pc = 0;
}
- trace(LOG_EVENTS, "event: pid %d stopped at PC = %#lx", pid, pc1);
+ trace(LOG_EVENTS, "event: pid %d stopped at PC = %#" PRIx64, pid, (uint64_t)pc1);
}
cpu_bp_on_suspend(ctx, &cb_found);
diff --git a/agent/tcf/framework/channel_lws.c b/agent/tcf/framework/channel_lws.c
index f7bb5427..444d828a 100644
--- a/agent/tcf/framework/channel_lws.c
+++ b/agent/tcf/framework/channel_lws.c
@@ -300,7 +300,7 @@ static void lws_add_channel_property(SessionData * data, char * name, char * val
data->prop_cnt++;
}
-static void lws_parse_http_header(SessionData * data, struct lws *wsi) {
+static void lws_parse_http_header(SessionData * data, struct lws * wsi) {
int n = 0, len;
char * prop_name;
char * prop_value;
@@ -332,9 +332,7 @@ static void lws_parse_http_header(SessionData * data, struct lws *wsi) {
}
}
-static int lws_tcf_callback(struct lws *wsi, enum lws_callback_reasons reason,
- void *user, void *in, size_t len)
-{
+static int lws_tcf_callback(struct lws * wsi, enum lws_callback_reasons reason, void * user, void *in, size_t len) {
struct lws_pollargs *pa = (struct lws_pollargs *)in;
WSIUserData * userdata = (WSIUserData *) user;
@@ -1254,8 +1252,7 @@ static ChannelServer * channel_server_create(PeerServer * ps) {
/* LWS service thread */
-static void * lws_service_thread(void * x)
-{
+static void * lws_service_thread(void * x) {
struct lws_context_creation_info context_creation_info;
int vhost_created = 0;
diff --git a/agent/tcf/services/breakpoints.c b/agent/tcf/services/breakpoints.c
index 8c384777..971f7666 100644
--- a/agent/tcf/services/breakpoints.c
+++ b/agent/tcf/services/breakpoints.c
@@ -3031,7 +3031,7 @@ static void safe_restore_breakpoint(void * arg) {
safe_skip_breakpoint(arg);
return;
}
- trace(LOG_ALWAYS, "Skip breakpoint error: wrong PC %#" PRIx64, pc);
+ trace(LOG_ALWAYS, "Skip breakpoint error: wrong PC %#" PRIx64, (uint64_t)pc);
}
}
ext->stepping_over_bp = NULL;
diff --git a/agent/tcf/services/sysmon.c b/agent/tcf/services/sysmon.c
index ccfe9630..a8f549ad 100644
--- a/agent/tcf/services/sysmon.c
+++ b/agent/tcf/services/sysmon.c
@@ -59,8 +59,7 @@ typedef struct kinfo_proc kinfo_proc;
/*
* Get kernel process information for all processes.
*/
-static int get_allprocesses(kinfo_proc **kprocs, int *nprocs)
-{
+static int get_allprocesses(kinfo_proc **kprocs, int *nprocs) {
size_t len;
kinfo_proc * kp;
int mib_name[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL};
@@ -85,8 +84,7 @@ static int get_allprocesses(kinfo_proc **kprocs, int *nprocs)
/*
* Get kernel process information for a specified pid.
*/
-static kinfo_proc *get_process(pid_t pid)
-{
+static kinfo_proc *get_process(pid_t pid) {
kinfo_proc * kp;
int mib_name[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, 0};
int mib_len = 4;

Back to the top