diff options
author | Mircea Gherzan | 2018-12-13 14:19:11 +0000 |
---|---|---|
committer | Mircea Gherzan | 2018-12-20 14:33:40 +0000 |
commit | b4146f1beef845e7b73d9ccb43c2d85dd6c2b623 (patch) | |
tree | 1ec532434eeee077dc38be5b3ff2d0ec50f7d798 /agent/tcf | |
parent | 4344a6fa90d6074b54ef9db633e57e887881085f (diff) | |
download | org.eclipse.tcf.agent-b4146f1beef845e7b73d9ccb43c2d85dd6c2b623.tar.gz org.eclipse.tcf.agent-b4146f1beef845e7b73d9ccb43c2d85dd6c2b623.tar.xz org.eclipse.tcf.agent-b4146f1beef845e7b73d9ccb43c2d85dd6c2b623.zip |
TCF Agent: fix and improve the stack trace logging
Do not try to read registers of size zero (containers/groups).
Log the maximum number of frame along with the context ID for the
unwind.
Change-Id: I94b655393e5210323647c15a35a92ccb973948f8
Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
Diffstat (limited to 'agent/tcf')
-rw-r--r-- | agent/tcf/services/stacktrace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/agent/tcf/services/stacktrace.c b/agent/tcf/services/stacktrace.c index 41e6e2d7..4434300c 100644 --- a/agent/tcf/services/stacktrace.c +++ b/agent/tcf/services/stacktrace.c @@ -258,7 +258,7 @@ static void trace_stack(Context * ctx, StackTrace * stack, int max_frames) { add_frame(stack, &down); } - trace(LOG_STACK, "Stack trace, ctx %s", ctx->id); + trace(LOG_STACK, "Stack trace, ctx %s, max_frames %d", ctx->id, max_frames); while (stack->frame_cnt < max_frames) { int frame_idx = stack->frame_cnt - 1; StackFrame * frame = stack->frames + frame_idx; @@ -268,7 +268,7 @@ static void trace_stack(Context * ctx, StackTrace * stack, int max_frames) { RegisterDefinition * def; trace(LOG_STACK, "Frame %d", stack->frame_cnt - 1); for (def = get_reg_definitions(ctx); def->name != NULL; def++) { - if (def->no_read || def->read_once || def->bits) continue; + if (def->no_read || def->read_once || def->bits || !def->size) continue; if (read_reg_value(frame, def, &v) != 0) continue; trace(LOG_STACK, " %-8s %16" PRIx64, def->name, v); } |