Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2008-03-28 11:15:24 -0400
committerAlain Magloire2008-03-28 11:15:24 -0400
commit1ffac28c6df938e8b2585ece83fb715ee891fca7 (patch)
tree77324415d4bebfc12a85e816e0b08b00fbc05181
parentae2edb62e6f921dcee50b2ef69eaee8cce93114b (diff)
downloadorg.eclipse.cdt-1ffac28c6df938e8b2585ece83fb715ee891fca7.tar.gz
org.eclipse.cdt-1ffac28c6df938e8b2585ece83fb715ee891fca7.tar.xz
org.eclipse.cdt-1ffac28c6df938e8b2585ece83fb715ee891fca7.zip
org.eclipse.cdt.debug.internal.core/CBreakpointManager.java
219863 nor P3 Wind regression: Address breakpoints inserted from console do not resolve location properly Patch from Elena.
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java68
1 files changed, 39 insertions, 29 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 9e958281698..4fd3f590a1c 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
@@ -820,16 +820,16 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
}
return new String[0];
}
-
+
private ICLineBreakpoint createLocationBreakpoint( ICDILocationBreakpoint cdiBreakpoint ) {
ICLineBreakpoint breakpoint = null;
try {
ICDILocator location = cdiBreakpoint.getLocator();
String file = location.getFile();
- if ( cdiBreakpoint instanceof ICDILineBreakpoint ) {
- Object sourceElement = getSourceElement( file );
- String sourceHandle = file;
- IResource resource = getProject();
+ String sourceHandle = file;
+ IResource resource = getProject();
+ if (file != null && file.length() > 0) {
+ Object sourceElement = getSourceElement(file);
if ( sourceElement instanceof IFile ) {
sourceHandle = ((IFile)sourceElement).getLocation().toOSString();
resource = (IResource)sourceElement;
@@ -848,14 +848,17 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
resource = getProject();
}
}
-
+ } else {
+ sourceHandle = getExecFileHandle();
+ }
+ if ( cdiBreakpoint instanceof ICDILineBreakpoint ) {
breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint );
}
else if ( cdiBreakpoint instanceof ICDIFunctionBreakpoint ) {
- breakpoint = createFunctionBreakpoint( cdiBreakpoint );
+ breakpoint = createFunctionBreakpoint( sourceHandle, resource,cdiBreakpoint );
}
else if ( cdiBreakpoint instanceof ICDIAddressBreakpoint ) {
- breakpoint = createAddressBreakpoint( cdiBreakpoint );
+ breakpoint = createAddressBreakpoint( sourceHandle, resource,cdiBreakpoint );
}
}
catch( CDIException e ) {
@@ -883,31 +886,38 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
return breakpoint;
}
- private ICFunctionBreakpoint createFunctionBreakpoint( ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
- ICFunctionBreakpoint breakpoint = CDIDebugModel.createFunctionBreakpoint( getExecFileHandle(),
- getProject(),
- cdiBreakpoint.getLocator().getFunction(),
- -1,
- -1,
- -1,
- cdiBreakpoint.isEnabled(),
- cdiBreakpoint.getCondition().getIgnoreCount(),
- cdiBreakpoint.getCondition().getExpression(),
- false );
+ private ICFunctionBreakpoint createFunctionBreakpoint( String sourceHandle, IResource resource, ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
+ ICDILocator location = cdiBreakpoint.getLocator();
+ int line = location.getLineNumber();
+ ICFunctionBreakpoint breakpoint = CDIDebugModel.createFunctionBreakpoint(
+ sourceHandle,
+ resource,
+ location.getFunction(),
+ -1,
+ -1,
+ line,
+ cdiBreakpoint.isEnabled(),
+ cdiBreakpoint.getCondition().getIgnoreCount(),
+ cdiBreakpoint.getCondition().getExpression(),
+ false);
return breakpoint;
}
- private ICAddressBreakpoint createAddressBreakpoint( ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
- String sourceHandle = getExecFileHandle();
+ private ICAddressBreakpoint createAddressBreakpoint( String sourceHandle, IResource resource, ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
+ String binary = getExecFileHandle();
IAddress address = getDebugTarget().getAddressFactory().createAddress( cdiBreakpoint.getLocator().getAddress() );
- ICAddressBreakpoint breakpoint = CDIDebugModel.createAddressBreakpoint( sourceHandle,
- sourceHandle,
- ResourcesPlugin.getWorkspace().getRoot(),
- address,
- cdiBreakpoint.isEnabled(),
- cdiBreakpoint.getCondition().getIgnoreCount(),
- cdiBreakpoint.getCondition().getExpression(),
- false );
+ ICDILocator location = cdiBreakpoint.getLocator();
+ int line = location.getLineNumber();
+ ICAddressBreakpoint breakpoint = CDIDebugModel.createAddressBreakpoint(
+ binary,
+ sourceHandle,
+ resource,
+ line,
+ address,
+ cdiBreakpoint.isEnabled(),
+ cdiBreakpoint.getCondition().getIgnoreCount(),
+ cdiBreakpoint.getCondition().getExpression(),
+ false);
return breakpoint;
}

Back to the top