Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorKen Ryall2007-08-03 04:10:17 +0000
committerKen Ryall2007-08-03 04:10:17 +0000
commit27bfb855d6e1b334e74e9e4897d6d20423f2c032 (patch)
treef0ffa928126faaff74b31d3ce1f0c2d42b09051a /debug
parent1561bd668dd829262b51623b9c72615e27d33f21 (diff)
downloadorg.eclipse.cdt-27bfb855d6e1b334e74e9e4897d6d20423f2c032.tar.gz
org.eclipse.cdt-27bfb855d6e1b334e74e9e4897d6d20423f2c032.tar.xz
org.eclipse.cdt-27bfb855d6e1b334e74e9e4897d6d20423f2c032.zip
Bug 195984.
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF3
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java35
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java11
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java11
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java21
5 files changed, 43 insertions, 38 deletions
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 da60550e9ab..9e3d7e603cc 100644
--- a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
@@ -35,6 +35,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core;bundle-version="[4.0.0,5.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.console;bundle-version="[3.1.100,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)"
+ org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.filesystem
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
index 41bf7789ed3..bbec25e7ef0 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
@@ -19,7 +19,11 @@ import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.cdt.debug.core.model.ICType;
import org.eclipse.cdt.debug.core.model.ICValue;
import org.eclipse.cdt.debug.core.model.IEnableDisableTarget;
+import org.eclipse.cdt.debug.internal.ui.views.disassembly.DisassemblyEditorInput;
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.debug.core.model.IVariable;
@@ -28,6 +32,11 @@ import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IURIEditorInput;
/**
* Utility methods for C/C++ Debug UI.
@@ -164,6 +173,32 @@ public class CDebugUIUtils {
return decorateText( variable, variable.getName() );
}
+ public static String getEditorFilePath( IEditorInput input ) throws CoreException {
+ if ( input instanceof IFileEditorInput ) {
+ return ((IFileEditorInput)input).getFile().getLocation().toOSString();
+ }
+ if ( input instanceof IStorageEditorInput ) {
+ return ((IStorageEditorInput)input).getStorage().getFullPath().toOSString();
+ }
+ if ( input instanceof IPathEditorInput ) {
+ return ((IPathEditorInput)input).getPath().toOSString();
+ }
+ if ( input instanceof DisassemblyEditorInput ) {
+ String sourceFile = ((DisassemblyEditorInput)input).getSourceFile();
+ if ( sourceFile != null ) {
+ return sourceFile;
+ }
+ return ((DisassemblyEditorInput)input).getModuleFile();
+ }
+ if ( input instanceof IURIEditorInput)
+ {
+ IPath uriPath = URIUtil.toPath(((IURIEditorInput)input).getURI());
+ if (uriPath != null)
+ return uriPath.toOSString();
+ }
+ return ""; //$NON-NLS-1$
+ }
+
public static String decorateText( Object element, String text ) {
if ( text == null )
return null;
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
index 112198b2638..8dc867fd748 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
@@ -19,6 +19,7 @@ import org.eclipse.cdt.debug.core.model.IJumpToLine;
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
import org.eclipse.cdt.debug.internal.core.model.CDebugElement;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector;
+import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.internal.ui.views.disassembly.DisassemblyEditorInput;
import org.eclipse.cdt.debug.internal.ui.views.disassembly.DisassemblyView;
@@ -40,8 +41,6 @@ import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -187,13 +186,7 @@ public class ResumeAtLineAdapter implements IResumeAtLineTarget {
}
private String getFileName( IEditorInput input ) throws CoreException {
- if ( input instanceof IFileEditorInput ) {
- return ((IFileEditorInput)input).getFile().getLocation().toOSString();
- }
- if ( input instanceof IStorageEditorInput ) {
- return ((IStorageEditorInput)input).getStorage().getFullPath().toOSString();
- }
- return null;
+ return CDebugUIUtils.getEditorFilePath(input);
}
private void runInBackground( Runnable r ) {
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
index 848a31414eb..c7c2d804ed2 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
@@ -19,6 +19,7 @@ import org.eclipse.cdt.debug.core.model.IRunToLine;
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
import org.eclipse.cdt.debug.internal.core.model.CDebugElement;
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector;
+import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.internal.ui.views.disassembly.DisassemblyEditorInput;
import org.eclipse.cdt.debug.internal.ui.views.disassembly.DisassemblyView;
@@ -43,8 +44,6 @@ import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -191,13 +190,7 @@ public class RunToLineAdapter implements IRunToLineTarget {
}
private String getFileName( IEditorInput input ) throws CoreException {
- if ( input instanceof IFileEditorInput ) {
- return ((IFileEditorInput)input).getFile().getLocation().toOSString();
- }
- if ( input instanceof IStorageEditorInput ) {
- return ((IStorageEditorInput)input).getStorage().getFullPath().toOSString();
- }
- return null;
+ return CDebugUIUtils.getEditorFilePath(input);
}
private void runInBackground( Runnable r ) {
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java
index 2f83ffd652d..ac03bcf05b3 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java
@@ -25,6 +25,7 @@ import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
+import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.internal.ui.views.disassembly.DisassemblyEditorInput;
import org.eclipse.cdt.debug.internal.ui.views.disassembly.DisassemblyView;
@@ -48,8 +49,6 @@ import org.eclipse.jface.window.Window;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.texteditor.IEditorStatusLine;
@@ -325,23 +324,7 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
}
private String getSourceHandle( IEditorInput input ) throws CoreException {
- if ( input instanceof IFileEditorInput ) {
- return ((IFileEditorInput)input).getFile().getLocation().toOSString();
- }
- if ( input instanceof IStorageEditorInput ) {
- return ((IStorageEditorInput)input).getStorage().getFullPath().toOSString();
- }
- if ( input instanceof IPathEditorInput ) {
- return ((IPathEditorInput)input).getPath().toOSString();
- }
- if ( input instanceof DisassemblyEditorInput ) {
- String sourceFile = ((DisassemblyEditorInput)input).getSourceFile();
- if ( sourceFile != null ) {
- return sourceFile;
- }
- return ((DisassemblyEditorInput)input).getModuleFile();
- }
- return ""; //$NON-NLS-1$
+ return CDebugUIUtils.getEditorFilePath(input);
}
private void toggleVariableWatchpoint( IWorkbenchPart part, IVariable variable ) throws CoreException {

Back to the top