Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Ryall2009-11-10 22:06:46 +0000
committerKen Ryall2009-11-10 22:06:46 +0000
commitdcd0c58abf7d19267f1bc22f75a3dc80fb0fe1ea (patch)
tree07f66e5bb83ae16b1304a96b1f1fb20ab32712d1
parentf3ca785ec59566481b5e1d4bacbb760c9f7adf48 (diff)
downloadorg.eclipse.cdt-dcd0c58abf7d19267f1bc22f75a3dc80fb0fe1ea.tar.gz
org.eclipse.cdt-dcd0c58abf7d19267f1bc22f75a3dc80fb0fe1ea.tar.xz
org.eclipse.cdt-dcd0c58abf7d19267f1bc22f75a3dc80fb0fe1ea.zip
Bug 159955, enable the source not found editor for DSF.
-rw-r--r--debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF2
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupParticipant.java4
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceNotFoundElement.java51
-rw-r--r--debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF2
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java12
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java15
6 files changed, 35 insertions, 51 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF
index e6ad328d1f..e12e89e9cf 100644
--- a/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF
@@ -20,7 +20,7 @@ Export-Package: org.eclipse.cdt.debug.core,
org.eclipse.cdt.debug.internal.core.breakpoints;x-internal:=true,
org.eclipse.cdt.debug.internal.core.executables;x-internal:=true,
org.eclipse.cdt.debug.internal.core.model;x-internal:=true,
- org.eclipse.cdt.debug.internal.core.sourcelookup;x-internal:=true
+ org.eclipse.cdt.debug.internal.core.sourcelookup;x-friends:="org.eclipse.cdt.dsf.ui"
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.debug.core;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupParticipant.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupParticipant.java
index 25ac60362a..94b9aa24d7 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupParticipant.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLookupParticipant.java
@@ -94,7 +94,7 @@ public class CSourceLookupParticipant extends AbstractSourceLookupParticipant {
if ( name == null || name.length() == 0 )
{
if (object instanceof IDebugElement)
- return new Object[] { new CSourceNotFoundElement( (IDebugElement) object ) };
+ return new Object[] { new CSourceNotFoundElement((IDebugElement) object, ((IDebugElement) object).getLaunch().getLaunchConfiguration(), name) };
else
return new Object[] { gfNoSource };
}
@@ -121,7 +121,7 @@ public class CSourceLookupParticipant extends AbstractSourceLookupParticipant {
if (new File(name).exists()) {
foundElements = new AbsolutePathSourceContainer().findSourceElements(name);
} else {
- foundElements = new Object[] { new CSourceNotFoundElement((IDebugElement) object) };
+ foundElements = new Object[] { new CSourceNotFoundElement((IDebugElement) object, ((IDebugElement) object).getLaunch().getLaunchConfiguration(), name) };
}
}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceNotFoundElement.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceNotFoundElement.java
index 1140de86f1..a651b43b1a 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceNotFoundElement.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceNotFoundElement.java
@@ -11,54 +11,37 @@
package org.eclipse.cdt.debug.internal.core.sourcelookup;
-import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.ILaunchConfiguration;
/**
- * Wrapper for debug elements that have missing source, for example a stack frame
- * whose source file can not be located. Used to enable the CSourceNotFoundEditor
- * that will let you find the missing file.
- *
+ * Wrapper for debug elements that have missing source, for example a stack
+ * frame whose source file can not be located. Used to enable the
+ * CSourceNotFoundEditor that will let you find the missing file.
+ *
*/
-public class CSourceNotFoundElement implements IDebugElement{
+public class CSourceNotFoundElement {
- private IDebugElement element;
+ private IAdaptable element;
+ private ILaunchConfiguration launch;
+ private String file;
- public IDebugElement getElement() {
+ public IAdaptable getElement() {
return element;
}
- public CSourceNotFoundElement(IDebugElement element)
- {
+ public CSourceNotFoundElement(IAdaptable element, ILaunchConfiguration launch, String file) {
this.element = element;
+ this.launch = launch;
+ this.file = file;
}
- public IDebugTarget getDebugTarget() {
- return element.getDebugTarget();
- }
-
- public ILaunch getLaunch() {
- return element.getLaunch();
- }
-
- public String getModelIdentifier() {
- return element.getModelIdentifier();
- }
-
- public Object getAdapter(Class adapter) {
- return element.getAdapter(adapter);
+ public ILaunchConfiguration getLaunch() {
+ return launch;
}
public String getFile() {
- ICStackFrame frame = (ICStackFrame)((IAdaptable)element).getAdapter( ICStackFrame.class );
- if ( frame != null ) {
- return frame.getFile().trim();
- }
- return "";
+ return file;
}
-
-
+
}
diff --git a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
index ce9f023873..10664129a1 100644
--- a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
@@ -13,7 +13,7 @@ Export-Package:
org.eclipse.cdt.debug.internal.ui.editors;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.preferences;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.propertypages;x-internal:=true,
- org.eclipse.cdt.debug.internal.ui.sourcelookup;x-internal:=true,
+ org.eclipse.cdt.debug.internal.ui.sourcelookup;x-friends:="org.eclipse.cdt.dsf.ui",
org.eclipse.cdt.debug.internal.ui.views;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.views.disassembly;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.views.executables;x-internal:=true,
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java
index 94feb2d63f..42281eaf04 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditor.java
@@ -12,7 +12,6 @@
package org.eclipse.cdt.debug.internal.ui.sourcelookup;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
@@ -31,14 +30,13 @@ import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
@@ -57,6 +55,8 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Editor that lets you select a replacement for the missing source file
* and modifies the source locator accordingly.
@@ -72,8 +72,8 @@ public class CSourceNotFoundEditor extends CommonSourceNotFoundEditor {
public static final String UID_EDIT_LOOKUP_BUTTON = UID_CLASS_NAME+ "editLookupButton"; //$NON-NLS-1$
private String missingFile;
- private ILaunch launch;
- private IDebugElement context;
+ private ILaunchConfiguration launch;
+ private IAdaptable context;
private ITranslationUnit tunit;
private Button disassemblyButton;
@@ -238,7 +238,7 @@ public class CSourceNotFoundEditor extends CommonSourceNotFoundEditor {
String memento = null;
String type = null;
- ILaunchConfigurationWorkingCopy configuration = launch.getLaunchConfiguration().getWorkingCopy();
+ ILaunchConfigurationWorkingCopy configuration = launch.getWorkingCopy();
memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String) null);
type = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String) null);
if (type == null) {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
index 8f26b78e04..ff65bcd994 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
@@ -21,6 +21,9 @@ import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceNotFoundElement;
+import org.eclipse.cdt.debug.internal.ui.sourcelookup.CSourceNotFoundEditorInput;
+import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
@@ -55,9 +58,7 @@ import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.ISourcePresentation;
-import org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditorInput;
import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@@ -183,7 +184,7 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
return Status.OK_STATUS;
}
- private SourceLookupResult performLookup() {
+ private SourceLookupResult performLookup() {
IDMContext dmc = fFrameData.fDmc;
SourceLookupResult result = new SourceLookupResult(dmc , null, null, null);
String editorId = null;
@@ -191,8 +192,8 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
Object sourceElement = fSourceLookup.getSourceElement(dmc);
if (sourceElement == null) {
- editorInput = new CommonSourceNotFoundEditorInput(dmc);
- editorId = IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR;
+ editorInput = new CSourceNotFoundEditorInput(new CSourceNotFoundElement(dmc, fSourceLookup.getLaunchConfiguration(), fFrameData.fFile));
+ editorId = ICDebugUIConstants.CSOURCENOTFOUND_EDITOR_ID;
} else {
ISourcePresentation presentation= null;
if (fSourceLookup instanceof ISourcePresentation) {
@@ -217,8 +218,8 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
editorInput = new FileStoreEditorInput(fileStore);
editorId = getEditorIdForFilename(fileStore.getName());
} catch (CoreException e) {
- editorInput = new CommonSourceNotFoundEditorInput(dmc);
- editorId = IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR;
+ editorInput = new CSourceNotFoundEditorInput(new CSourceNotFoundElement(dmc, fSourceLookup.getLaunchConfiguration(), fFrameData.fFile));
+ editorId = ICDebugUIConstants.CSOURCENOTFOUND_EDITOR_ID;
}
} else if (sourceElement instanceof LocalFileStorage) {
File file = ((LocalFileStorage)sourceElement).getFile();

Back to the top