Skip to main content
summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorEugene Tarassov2012-06-05 00:46:25 +0000
committerEugene Tarassov2012-06-05 00:46:25 +0000
commit9b866f6a9bba589e1e3e04213d39fcd7d67b67ce (patch)
tree89bd83069dd1b3eb930c12b3ce21dd47600a812a /agent
parent192dcf43fe4499c92e193182078dc2c24ccbbf1e (diff)
downloadorg.eclipse.tcf.agent-9b866f6a9bba589e1e3e04213d39fcd7d67b67ce.tar.gz
org.eclipse.tcf.agent-9b866f6a9bba589e1e3e04213d39fcd7d67b67ce.tar.xz
org.eclipse.tcf.agent-9b866f6a9bba589e1e3e04213d39fcd7d67b67ce.zip
Bug 381529 - [PATCH] Implement new register property "Offset"
Diffstat (limited to 'agent')
-rw-r--r--agent/tcf/services/registers.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/agent/tcf/services/registers.c b/agent/tcf/services/registers.c
index e4dc1bd7..13ed4764 100644
--- a/agent/tcf/services/registers.c
+++ b/agent/tcf/services/registers.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
@@ -63,6 +63,8 @@ static void write_boolean_member(OutputStream * out, const char * name, int val)
static void write_context(OutputStream * out, char * id,
Context * ctx, int frame, RegisterDefinition * reg_def) {
+ RegisterDefinition * parent_reg_def = NULL;
+
assert(!ctx->exited);
write_stream(out, '{');
@@ -200,6 +202,18 @@ static void write_context(OutputStream * out, char * id,
json_write_string(out, "PC");
}
+ parent_reg_def = reg_def->parent;
+ while (parent_reg_def != NULL && parent_reg_def->size == 0) parent_reg_def = parent_reg_def->parent;
+ if (parent_reg_def != NULL) {
+ if (reg_def->offset >= parent_reg_def->offset &&
+ reg_def->offset + reg_def->size < parent_reg_def->offset + parent_reg_def->size) {
+ write_stream(out, ',');
+ json_write_string(out, "Offset");
+ write_stream(out, ':');
+ json_write_uint64(out, reg_def->offset - parent_reg_def->offset);
+ }
+ }
+
write_stream(out, '}');
write_stream(out, 0);
}

Back to the top