Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMircea Gherzan2018-12-13 09:19:11 -0500
committerMircea Gherzan2018-12-20 09:33:40 -0500
commitb4146f1beef845e7b73d9ccb43c2d85dd6c2b623 (patch)
tree1ec532434eeee077dc38be5b3ff2d0ec50f7d798 /agent/tcf/services/stacktrace.c
parent4344a6fa90d6074b54ef9db633e57e887881085f (diff)
downloadorg.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/services/stacktrace.c')
-rw-r--r--agent/tcf/services/stacktrace.c4
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);
}

Back to the top