Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2019-02-16 13:22:17 -0500
committerEugene Tarassov2019-02-16 13:22:17 -0500
commit533946489480c2e3a2619b2d0186736404334b2a (patch)
treea2b000d63054bd4b9023c3e8959999ba56f3e599
parenta5ad3417297bfe1c3e69a4faeb7acecf1038d3e0 (diff)
downloadorg.eclipse.tcf.agent-533946489480c2e3a2619b2d0186736404334b2a.tar.gz
org.eclipse.tcf.agent-533946489480c2e3a2619b2d0186736404334b2a.tar.xz
org.eclipse.tcf.agent-533946489480c2e3a2619b2d0186736404334b2a.zip
TCF Agent: ARM Linux: r_debug.r_brk can have bit 0 set to 1 to indicate Thumb ISA
-rw-r--r--agent/machine/arm/tcf/cpudefs-mdep.c4
-rw-r--r--agent/system/GNU/Linux/tcf/context-linux.c13
2 files changed, 15 insertions, 2 deletions
diff --git a/agent/machine/arm/tcf/cpudefs-mdep.c b/agent/machine/arm/tcf/cpudefs-mdep.c
index 69226744..82528666 100644
--- a/agent/machine/arm/tcf/cpudefs-mdep.c
+++ b/agent/machine/arm/tcf/cpudefs-mdep.c
@@ -235,7 +235,7 @@ static int set_debug_regs(Context * ctx, int * step_over_hw_bp) {
if (ptrace(PTRACE_SETHBPREGS, pid, 1, &vr) < 0) return -1;
}
else if (cb != NULL) {
- if (i < bps->bp_cnt && cb->address == pc) {
+ if (i < bps->bp_cnt && ((uint32_t)cb->address & ~0x1) == pc) {
/* Skipping the breakpoint */
*step_over_hw_bp = 1;
}
@@ -408,7 +408,7 @@ int cpu_bp_on_suspend(Context * ctx, int * triggered) {
if (bps->bp_cnt > 0) {
for (i = 0; i < bps->bp_cnt; i++) {
ContextBreakpoint * cb = bps->hw_bps[i];
- if (cb != NULL && cb->address == pc && (ext->armed & (1u << i))) {
+ if (cb != NULL && ((uint32_t)cb->address & ~0x1) == pc && (ext->armed & (1u << i))) {
ext->triggered_hw_bps[cb_cnt++] = cb;
}
}
diff --git a/agent/system/GNU/Linux/tcf/context-linux.c b/agent/system/GNU/Linux/tcf/context-linux.c
index c9e500fb..2c2cbc0f 100644
--- a/agent/system/GNU/Linux/tcf/context-linux.c
+++ b/agent/system/GNU/Linux/tcf/context-linux.c
@@ -1730,6 +1730,18 @@ static int expression_identifier_callback(Context * ctx, int frame, char * name,
default: assert(0);
}
v->remote = 1;
+#if defined(__arm__)
+ {
+ /* On ARM, r_debug.r_brk can have bit 0 set to 1 to indicate Thumb ISA.
+ * We need to clear the bit to make a valid breakpoint address. */
+ size_t size = (size_t)v->size;
+ uint8_t * buf = (uint8_t *)tmp_alloc(size);
+ if (context_read_mem(ctx, v->address, buf, size) < 0) exception(errno);
+ buf[v->big_endian ? size - 1 : 0] &= ~1;
+ v->value = buf;
+ v->remote = 0;
+ }
+#endif
return 1;
}
if (strcmp(name, "$loader_state") == 0) {
@@ -1739,6 +1751,7 @@ static int expression_identifier_callback(Context * ctx, int frame, char * name,
case 8: v->address += 24; break;
default: assert(0);
}
+ v->type_class = TYPE_CLASS_INTEGER;
v->remote = 1;
return 1;
}

Back to the top