Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-03-04 20:01:48 +0000
committereutarass2011-03-04 20:01:48 +0000
commit03cf8b7d4f222b7de450d77e53b4610501b77847 (patch)
tree53089f941acc02bcd87332135b54a6c42772273f /plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model
parent3017248ae86989b4fe9dc60a3976c07eb66f776d (diff)
downloadorg.eclipse.tcf-03cf8b7d4f222b7de450d77e53b4610501b77847.tar.gz
org.eclipse.tcf-03cf8b7d4f222b7de450d77e53b4610501b77847.tar.xz
org.eclipse.tcf-03cf8b7d4f222b7de450d77e53b4610501b77847.zip
Bug 338653: [cdt] Add support for CDT launch config types
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java40
1 files changed, 39 insertions, 1 deletions
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 28be2e711..4740cc6c1 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
@@ -536,7 +536,43 @@ public class TCFLaunch extends Launch {
}
};
}
- if (local_file.length() != 0 || remote_file.length() != 0) {
+ final String attach_to_process = getAttribute("attach_to_process");
+ if (attach_to_process != null) {
+ final IProcesses ps = channel.getRemoteService(IProcesses.class);
+ if (ps == null) throw new Exception("Target does not provide Processes service");
+ // Attach the process
+ new LaunchStep() {
+ @Override
+ void start() {
+ IProcesses.DoneGetContext done = new IProcesses.DoneGetContext() {
+ public void doneGetContext(IToken token, final Exception error, final ProcessContext process) {
+ if (error != null) {
+ channel.terminate(error);
+ }
+ else {
+ process.attach(new IProcesses.DoneCommand() {
+ public void doneCommand(IToken token, final Exception error) {
+ if (error != null) {
+ channel.terminate(error);
+ }
+ else {
+ context_filter = new HashSet<String>();
+ context_filter.add(process.getID());
+ TCFLaunch.this.process = process;
+ ps.addListener(prs_listener);
+ connectProcessStreams();
+ done();
+ }
+ }
+ });
+ }
+ }
+ };
+ ps.getContext(attach_to_process, done);
+ }
+ };
+ }
+ else if (local_file.length() != 0 || remote_file.length() != 0) {
final IProcesses ps = channel.getRemoteService(IProcesses.class);
if (ps == null) throw new Exception("Target does not provide Processes service");
final boolean append = cfg.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
@@ -587,6 +623,8 @@ public class TCFLaunch extends Launch {
});
}
else {
+ context_filter = new HashSet<String>();
+ context_filter.add(process.getID());
TCFLaunch.this.process = process;
ps.addListener(prs_listener);
connectProcessStreams();

Back to the top