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
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')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java16
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java40
2 files changed, 49 insertions, 7 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java
index b5fec0f9c..3899d653e 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -56,15 +56,19 @@ public class TCFSourceLookupParticipant extends AbstractSourceLookupParticipant
}
if (object instanceof ILineNumbers.CodeArea) {
ILineNumbers.CodeArea area = (ILineNumbers.CodeArea)object;
- if (area.directory != null && area.file != null && !isAbsolutePath(area.file)) {
- return area.directory + "/" + area.file;
- }
- return area.file;
+ return toFileName(area);
}
return null;
}
- private boolean isAbsolutePath(String fnm) {
+ public static String toFileName(ILineNumbers.CodeArea area) {
+ if (area.directory != null && area.file != null && !isAbsolutePath(area.file)) {
+ return area.directory + "/" + area.file;
+ }
+ return area.file;
+ }
+
+ private static boolean isAbsolutePath(String fnm) {
if (fnm.length() == 0) return false;
char ch = fnm.charAt(0);
if (ch == '/' || ch == '\\') return true;
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