Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2014-03-18 15:25:54 -0400
committerEugene Tarassov2014-03-18 15:25:54 -0400
commitccabe23ae600151d6981090d925bc738f1f45a37 (patch)
tree4f8c524269d1efeea51a28bd94d760246701bb70 /plugins/org.eclipse.tcf.debug
parent12a8119c41c8f81a2fc44add033efb39ddfbdc3e (diff)
downloadorg.eclipse.tcf-ccabe23ae600151d6981090d925bc738f1f45a37.tar.gz
org.eclipse.tcf-ccabe23ae600151d6981090d925bc738f1f45a37.tar.xz
org.eclipse.tcf-ccabe23ae600151d6981090d925bc738f1f45a37.zip
TCF Debugger: ElfLoader changed to stop only relevant contexts instead of stopping everything
Diffstat (limited to 'plugins/org.eclipse.tcf.debug')
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/ElfLoader.java52
1 files changed, 36 insertions, 16 deletions
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/ElfLoader.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/ElfLoader.java
index e43e42ac2..5d1ffd1fb 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/ElfLoader.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/ElfLoader.java
@@ -386,6 +386,24 @@ public class ElfLoader implements Runnable {
return path + '/' + name;
}
+ private boolean should_stop(String id) {
+ /* We should suspend only contexts in same run control group as target context */
+ String target_id = (String)args.get(TCFLaunchDelegate.FILES_CONTEXT_ID);
+ if (target_id == null) return false;
+ IRunControl.RunControlContext ctx = contexts.get(id);
+ if (ctx == null) return false;
+ if (!ctx.hasState()) return false;
+ if (id.equals(target_id)) return true;
+ String group = ctx.getRCGroup();
+ if (group == null) return false;
+ IRunControl.RunControlContext target_ctx = contexts.get(target_id);
+ if (target_ctx == null) return false;
+ String target_group = target_ctx.getRCGroup();
+ if (target_group == null) return false;
+ if (target_group.equals(group)) return true;
+ return false;
+ }
+
public void run() {
/* Wait for pending commands */
if (cmds.size() > 0) return;
@@ -409,25 +427,27 @@ public class ElfLoader implements Runnable {
return;
}
- /* Suspend everything */
if (errors.size() == 0 && running.size() > 0) {
- if (System.currentTimeMillis() - start_time < 5000) {
- for (final String id : running) {
- IRunControl.RunControlContext ctx = contexts.get(id);
- if (ctx != null) {
- cmds.add(ctx.suspend(new IRunControl.DoneCommand() {
- @Override
- public void doneCommand(IToken token, Exception error) {
- cmds.remove(token);
- if (error != null && running.contains(id)) errors.add(error);
- run();
- }
- }));
- }
+ /* Suspend target context */
+ for (final String id : running) {
+ if (!should_stop(id)) continue;
+ if (System.currentTimeMillis() - start_time < 5000) {
+ cmds.add(contexts.get(id).suspend(new IRunControl.DoneCommand() {
+ @Override
+ public void doneCommand(IToken token, Exception error) {
+ cmds.remove(token);
+ if (error != null && running.contains(id)) errors.add(error);
+ run();
+ }
+ }));
+ }
+ else {
+ String name = contexts.get(id).getName();
+ if (name == null) name = id;
+ errors.add(new Exception("Cannot stop " + name));
}
- if (cmds.size() > 0) return;
}
- errors.add(new Exception("Cannot stop the target"));
+ if (cmds.size() > 0) return;
}
if (errors.size() == 0 && mem_ctx == null) {

Back to the top