Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2012-05-14 22:53:07 +0000
committerEugene Tarassov2012-05-14 22:53:07 +0000
commit4b9931fadaef1bd2e714c64d120d322b81fdc138 (patch)
tree2bf99f92169782f67698ff4d53f32eadf8ae28a8 /agent/system
parent1e4057597b5ef9a85d4c5cc267b76f70ccb582ac (diff)
downloadorg.eclipse.tcf.agent-4b9931fadaef1bd2e714c64d120d322b81fdc138.tar.gz
org.eclipse.tcf.agent-4b9931fadaef1bd2e714c64d120d322b81fdc138.tar.xz
org.eclipse.tcf.agent-4b9931fadaef1bd2e714c64d120d322b81fdc138.zip
TCF Agent: x86 debug registers are exposed through Registers service
Diffstat (limited to 'agent/system')
-rw-r--r--agent/system/GNU/Linux/tcf/context-linux.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/agent/system/GNU/Linux/tcf/context-linux.c b/agent/system/GNU/Linux/tcf/context-linux.c
index bbf39566..ecd15180 100644
--- a/agent/system/GNU/Linux/tcf/context-linux.c
+++ b/agent/system/GNU/Linux/tcf/context-linux.c
@@ -347,8 +347,13 @@ static int flush_regs(Context * ctx) {
return 0;
}
- trace(LOG_ALWAYS, "error: writing registers failed: ctx %#lx, id %s, error %d %s",
- ctx, ctx->id, err, errno_to_str(err));
+ {
+ RegisterDefinition * def = get_reg_definitions(ctx);
+ while (def->name != NULL && (def->offset > i || def->offset + def->size <= i)) def++;
+ trace(LOG_ALWAYS, "error: writing register %s failed: ctx %#lx, id %s, error %d %s",
+ def->name ? def->name : "?", ctx, ctx->id, err, errno_to_str(err));
+ if (def->name) err = set_fmt_errno(err, "Cannot write register %s", def->name);
+ }
errno = err;
return -1;
}
@@ -1290,11 +1295,10 @@ static void event_pid_stopped(pid_t pid, int signal, int event, int syscall) {
cpu_bp_on_suspend(ctx, &cb_found);
if (signal == SIGTRAP && event == 0 && !syscall) {
- size_t break_size = 0;
- get_break_instruction(ctx, &break_size);
ctx->stopped_by_bp = is_breakpoint_address(ctx, pc1 + TRAP_OFFSET);
- ext->end_of_step = !ctx->stopped_by_cb && !ctx->stopped_by_bp && ext->pending_step;
if (ctx->stopped_by_bp) set_regs_PC(ctx, pc1 + TRAP_OFFSET);
+ else ctx->stopped_by_bp = is_breakpoint_address(ctx, pc1);
+ ext->end_of_step = !ctx->stopped_by_cb && !ctx->stopped_by_bp && ext->pending_step;
}
ext->pending_step = 0;
send_context_stopped_event(ctx);

Back to the top