Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2013-05-17 12:35:06 -0400
committerEugene Tarassov2013-05-17 12:35:06 -0400
commitba19261cb0d67cf5b2287fe1b1cd5d755a795d72 (patch)
tree734fff95cd88cb9d5df2ead0d62aa1e6c7fd8db0
parenta482f99bf1467edd10bbe625c8de6cccb1095246 (diff)
downloadorg.eclipse.tcf.agent-ba19261cb0d67cf5b2287fe1b1cd5d755a795d72.tar.gz
org.eclipse.tcf.agent-ba19261cb0d67cf5b2287fe1b1cd5d755a795d72.tar.xz
org.eclipse.tcf.agent-ba19261cb0d67cf5b2287fe1b1cd5d755a795d72.zip
TCF Agent: added code to print offending contexts when assert(is_all_stopped()) fails
-rw-r--r--agent/tcf/services/breakpoints.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/agent/tcf/services/breakpoints.c b/agent/tcf/services/breakpoints.c
index c056966a..33395d11 100644
--- a/agent/tcf/services/breakpoints.c
+++ b/agent/tcf/services/breakpoints.c
@@ -270,6 +270,22 @@ static int is_software_break_instruction(BreakInstruction * bi) {
return (bi->cb.access_types & mask) == CTX_BP_ACCESS_INSTRUCTION && bi->cb.length == 1 && !bi->virtual_addr;
}
+#ifndef NDEBUG
+static int check_all_stopped(Context * ctx) {
+ LINK * l;
+ Context * grp;
+ if (is_all_stopped(ctx)) return 1;
+ grp = context_get_group(ctx, CONTEXT_GROUP_STOP);
+ for (l = context_root.next; l != &context_root; l = l->next) {
+ Context * ctx = ctxl2ctxp(l);
+ if (context_get_group(ctx, CONTEXT_GROUP_STOP) != grp) continue;
+ printf("ID %s, stopped %d, exiting %d, exited %d, signal %d\n",
+ ctx->id, ctx->stopped, ctx->exiting, ctx->exited, ctx->signal);
+ }
+ return 0;
+}
+#endif
+
static void plant_instruction(BreakInstruction * bi) {
int error = 0;
size_t saved_size = bi->saved_size;
@@ -282,7 +298,7 @@ static void plant_instruction(BreakInstruction * bi) {
assert(!bi->cb.ctx->exiting);
assert(bi->valid || bi->virtual_addr);
if (bi->address_error != NULL) return;
- assert(is_all_stopped(bi->cb.ctx));
+ assert(check_all_stopped(bi->cb.ctx));
bi->saved_size = 0;
bi->cb.access_types = get_bi_access_types(bi);
@@ -334,7 +350,7 @@ static int remove_instruction(BreakInstruction * bi) {
assert(bi->planted);
assert(bi->planting_error == NULL);
assert(bi->address_error == NULL);
- assert(is_all_stopped(bi->cb.ctx));
+ assert(check_all_stopped(bi->cb.ctx));
if (bi->saved_size) {
if (!bi->cb.ctx->exited) {
int r = 0;

Back to the top