Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2008-02-15 15:26:56 +0000
committerJohn Cortell2008-02-15 15:26:56 +0000
commit34a4df083218e62f55d626a78b5abbab56fbe155 (patch)
tree7651a3987bed932be1954738f5f3dfda8dbd1d12 /debug/org.eclipse.cdt.debug.core
parent26f4e54156ef6322655872e0fbee10be0a780a7f (diff)
downloadorg.eclipse.cdt-34a4df083218e62f55d626a78b5abbab56fbe155.tar.gz
org.eclipse.cdt-34a4df083218e62f55d626a78b5abbab56fbe155.tar.xz
org.eclipse.cdt-34a4df083218e62f55d626a78b5abbab56fbe155.zip
We don't handle the notification of a breakpoint created in an external translation unit. I.e., if the user imports an executable built outside of Eclipse, and the backend reports that a breakpoint has been created in one of its source files (through, say, a backend shell), CBreakpointManager doesn't handle it correctly.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.core')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
index 8c3e002ed66..9e958281698 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
@@ -28,6 +28,7 @@ import java.util.Set;
import org.eclipse.cdt.core.IAddress;
import org.eclipse.cdt.core.IAddressFactory;
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
+import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.CDebugUtils;
@@ -837,6 +838,17 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
sourceHandle = ((IStorage)sourceElement).getFullPath().toOSString();
resource = ResourcesPlugin.getWorkspace().getRoot();
}
+ else if ( sourceElement instanceof ITranslationUnit ) {
+ ITranslationUnit translationUnit = (ITranslationUnit)sourceElement;
+ sourceHandle = translationUnit.getPath().toString();
+ resource = translationUnit.getResource();
+
+ // an IExternalTranslationUnit doesn't have an IResource
+ if (resource == null) {
+ resource = getProject();
+ }
+ }
+
breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint );
}
else if ( cdiBreakpoint instanceof ICDIFunctionBreakpoint ) {

Back to the top