Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-04-13 17:48:26 +0000
committereutarass2011-04-13 17:48:26 +0000
commitfe358b89bb145699cf90dac26754311d9a0d37f6 (patch)
treea23716137e0cd47d5fcf86c12baff54d7a38726f
parent38fa85688271cb1ac60f0b453fbed7c3e6d5cde3 (diff)
downloadorg.eclipse.tcf.agent-fe358b89bb145699cf90dac26754311d9a0d37f6.tar.gz
org.eclipse.tcf.agent-fe358b89bb145699cf90dac26754311d9a0d37f6.tar.xz
org.eclipse.tcf.agent-fe358b89bb145699cf90dac26754311d9a0d37f6.zip
TCF Agent: fixed incorrect handling of errors returned by context_resume()
-rw-r--r--services/breakpoints.c2
-rw-r--r--services/runctrl.c23
2 files changed, 22 insertions, 3 deletions
diff --git a/services/breakpoints.c b/services/breakpoints.c
index 8c273d88..ec3a7305 100644
--- a/services/breakpoints.c
+++ b/services/breakpoints.c
@@ -2079,6 +2079,8 @@ static void safe_skip_breakpoint(void * arg) {
ctx->stopped_by_bp = 0;
ctx->stopped_by_cb = NULL;
ctx->stopped_by_exception = 1;
+ ctx->pending_intercept = 1;
+ loc_free(ctx->exception_description);
ctx->exception_description = loc_strdup(errno_to_str(error));
send_context_changed_event(ctx);
}
diff --git a/services/runctrl.c b/services/runctrl.c
index ed4bfd4d..390f55c7 100644
--- a/services/runctrl.c
+++ b/services/runctrl.c
@@ -1270,6 +1270,7 @@ static void stop_all_timer(void * args) {
}
static void sync_run_state() {
+ int err_cnt = 0;
LINK * l;
LINK p;
@@ -1300,7 +1301,10 @@ static void sync_run_state() {
EXT(grp)->intercept_group = 1;
continue;
}
- if (ext->step_mode) {
+ if (ext->step_mode == RM_RESUME || ext->step_mode == RM_REVERSE_RESUME) {
+ ext->step_continue_mode = ext->step_mode;
+ }
+ else {
if (ext->step_channel == NULL) {
if (update_step_machine_state(ctx) < 0) {
ext->step_error = get_error_report(errno);
@@ -1325,7 +1329,7 @@ static void sync_run_state() {
/* Stop or continue contexts as needed */
list_init(&p);
l = context_root.next;
- while (run_ctrl_lock_cnt == 0 && l != &context_root) {
+ while (err_cnt == 0 && run_ctrl_lock_cnt == 0 && l != &context_root) {
Context * ctx = ctxl2ctxp(l);
Context * grp = context_get_group(ctx, CONTEXT_GROUP_INTERCEPT);
ContextExtensionRC * ext = EXT(ctx);
@@ -1354,15 +1358,18 @@ static void sync_run_state() {
ctx->stopped_by_bp = 0;
ctx->stopped_by_cb = NULL;
ctx->stopped_by_exception = 1;
+ ctx->pending_intercept = 1;
+ loc_free(ctx->exception_description);
ctx->exception_description = loc_strdup(errno_to_str(error));
send_context_changed_event(ctx);
+ err_cnt++;
}
}
}
/* Resume contexts with resume mode other then RM_RESUME */
l = p.next;
- while (run_ctrl_lock_cnt == 0 && l != &p) {
+ while (err_cnt == 0 && run_ctrl_lock_cnt == 0 && l != &p) {
Context * ctx = link2ctx(l);
ContextExtensionRC * ext = EXT(ctx);
l = l->next;
@@ -1373,12 +1380,22 @@ static void sync_run_state() {
ctx->stopped_by_bp = 0;
ctx->stopped_by_cb = NULL;
ctx->stopped_by_exception = 1;
+ ctx->pending_intercept = 1;
+ loc_free(ctx->exception_description);
ctx->exception_description = loc_strdup(errno_to_str(error));
send_context_changed_event(ctx);
+ err_cnt++;
}
}
if (safe_event_pid_count > 0 || run_ctrl_lock_cnt > 0) return;
+ if (err_cnt > 0) {
+ if (run_safe_events_posted < 4) {
+ run_safe_events_posted++;
+ post_event(run_safe_events, NULL);
+ }
+ return;
+ }
send_event_context_suspended();
}

Back to the top