Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2010-05-25 19:18:05 -0400
committereutarass2010-05-25 19:18:05 -0400
commit0f2c49d6f308553e695564875ace4815c287f6ac (patch)
tree8393d14021d8dd17a31ac7e8b995b4fda351eeba /plugins/org.eclipse.tm.tcf.debug
parent4a7fc472f6353e2e96c4abd3a0c557aaca7883c7 (diff)
downloadorg.eclipse.tcf-0f2c49d6f308553e695564875ace4815c287f6ac.tar.gz
org.eclipse.tcf-0f2c49d6f308553e695564875ace4815c287f6ac.tar.xz
org.eclipse.tcf-0f2c49d6f308553e695564875ace4815c287f6ac.zip
TCF Debugger: process "don't stop" and "don't pass" signal masks are made persistent per launch configuration
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFLaunchDelegate.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java57
2 files changed, 59 insertions, 0 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFLaunchDelegate.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFLaunchDelegate.java
index 3755352b6..173a6fb01 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFLaunchDelegate.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFLaunchDelegate.java
@@ -44,6 +44,8 @@ public class TCFLaunchDelegate extends LaunchConfigurationDelegate {
ATTR_USE_TERMINAL = ITCFConstants.ID_TCF_DEBUG_MODEL + ".UseTerminal",
ATTR_RUN_LOCAL_AGENT = ITCFConstants.ID_TCF_DEBUG_MODEL + ".RunLocalAgent",
ATTR_USE_LOCAL_AGENT = ITCFConstants.ID_TCF_DEBUG_MODEL + ".UseLocalAgent",
+ ATTR_SIGNALS_DONT_STOP = ITCFConstants.ID_TCF_DEBUG_MODEL + ".SignalsDontStop",
+ ATTR_SIGNALS_DONT_PASS = ITCFConstants.ID_TCF_DEBUG_MODEL + ".SignalsDontPath",
ATTR_PATH_MAP = ITCFConstants.ID_TCF_DEBUG_MODEL + ".PathMap";
public static class PathMapRule implements IPathMap.PathMapRule {
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
index 997e51d50..8341c83b7 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
@@ -39,6 +39,7 @@ import org.eclipse.tm.tcf.protocol.Protocol;
import org.eclipse.tm.tcf.services.IFileSystem;
import org.eclipse.tm.tcf.services.IPathMap;
import org.eclipse.tm.tcf.services.IProcesses;
+import org.eclipse.tm.tcf.services.IRunControl;
import org.eclipse.tm.tcf.services.IStreams;
import org.eclipse.tm.tcf.services.IFileSystem.FileSystemException;
import org.eclipse.tm.tcf.services.IFileSystem.IFileHandle;
@@ -101,6 +102,7 @@ public class TCFLaunch extends Launch {
private boolean last_context_exited;
private ProcessContext process;
+ private Collection<Map<String,Object>> process_signals;
private IToken process_start_command;
private String process_input_stream_id;
private int process_exit_code;
@@ -433,6 +435,57 @@ public class TCFLaunch extends Launch {
});
}
};
+ // Get process signal list
+ new LaunchStep() {
+ @Override
+ void start() {
+ ps.getSignalList(process.getID(), new IProcesses.DoneGetSignalList() {
+ public void doneGetSignalList(IToken token, Exception error, Collection<Map<String,Object>> list) {
+ if (error != null) Activator.log("Can't get process signal list", error);
+ process_signals = list;
+ done();
+ }
+ });
+ }
+ };
+ // Set process signal masks
+ String dont_stop = cfg.getAttribute(TCFLaunchDelegate.ATTR_SIGNALS_DONT_STOP, "");
+ String dont_pass = cfg.getAttribute(TCFLaunchDelegate.ATTR_SIGNALS_DONT_PASS, "");
+ final int no_stop = dont_stop.length() > 0 ? Integer.parseInt(dont_stop, 16) : 0;
+ final int no_pass = dont_pass.length() > 0 ? Integer.parseInt(dont_pass, 16) : 0;
+ if (no_stop != 0 || no_pass != 0) {
+ new LaunchStep() {
+ @Override
+ void start() {
+ final HashSet<IToken> cmds = new HashSet<IToken>();
+ final IProcesses.DoneCommand done_set_mask = new IProcesses.DoneCommand() {
+ public void doneCommand(IToken token, Exception error) {
+ cmds.remove(token);
+ if (error != null) channel.terminate(error);
+ else if (cmds.size() == 0) done();
+ }
+ };
+ cmds.add(ps.setSignalMask(process.getID(), no_stop, no_pass, done_set_mask));
+ final IRunControl rc = channel.getRemoteService(IRunControl.class);
+ if (rc != null) {
+ final IRunControl.DoneGetChildren done_get_children = new IRunControl.DoneGetChildren() {
+ public void doneGetChildren(IToken token, Exception error, String[] context_ids) {
+ if (context_ids != null) {
+ for (String id : context_ids) {
+ cmds.add(ps.setSignalMask(id, no_stop, no_pass, done_set_mask));
+ cmds.add(rc.getChildren(id, this));
+ }
+ }
+ cmds.remove(token);
+ if (error != null) channel.terminate(error);
+ else if (cmds.size() == 0) done();
+ }
+ };
+ cmds.add(rc.getChildren(process.getID(), done_get_children));
+ }
+ }
+ };
+ }
}
}
@@ -646,6 +699,10 @@ public class TCFLaunch extends Launch {
return process_exit_code;
}
+ public Collection<Map<String,Object>> getSignalList() {
+ return process_signals;
+ }
+
public void launchTCF(String mode, String id) {
assert Protocol.isDispatchThread();
this.mode = mode;

Back to the top