mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
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.
This commit is contained in:
parent
ae2edb62e6
commit
1ffac28c6d
1 changed files with 39 additions and 29 deletions
|
@ -820,16 +820,16 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
}
|
}
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICLineBreakpoint createLocationBreakpoint( ICDILocationBreakpoint cdiBreakpoint ) {
|
private ICLineBreakpoint createLocationBreakpoint( ICDILocationBreakpoint cdiBreakpoint ) {
|
||||||
ICLineBreakpoint breakpoint = null;
|
ICLineBreakpoint breakpoint = null;
|
||||||
try {
|
try {
|
||||||
ICDILocator location = cdiBreakpoint.getLocator();
|
ICDILocator location = cdiBreakpoint.getLocator();
|
||||||
String file = location.getFile();
|
String file = location.getFile();
|
||||||
if ( cdiBreakpoint instanceof ICDILineBreakpoint ) {
|
String sourceHandle = file;
|
||||||
Object sourceElement = getSourceElement( file );
|
IResource resource = getProject();
|
||||||
String sourceHandle = file;
|
if (file != null && file.length() > 0) {
|
||||||
IResource resource = getProject();
|
Object sourceElement = getSourceElement(file);
|
||||||
if ( sourceElement instanceof IFile ) {
|
if ( sourceElement instanceof IFile ) {
|
||||||
sourceHandle = ((IFile)sourceElement).getLocation().toOSString();
|
sourceHandle = ((IFile)sourceElement).getLocation().toOSString();
|
||||||
resource = (IResource)sourceElement;
|
resource = (IResource)sourceElement;
|
||||||
|
@ -848,14 +848,17 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
resource = getProject();
|
resource = getProject();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
sourceHandle = getExecFileHandle();
|
||||||
|
}
|
||||||
|
if ( cdiBreakpoint instanceof ICDILineBreakpoint ) {
|
||||||
breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint );
|
breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint );
|
||||||
}
|
}
|
||||||
else if ( cdiBreakpoint instanceof ICDIFunctionBreakpoint ) {
|
else if ( cdiBreakpoint instanceof ICDIFunctionBreakpoint ) {
|
||||||
breakpoint = createFunctionBreakpoint( cdiBreakpoint );
|
breakpoint = createFunctionBreakpoint( sourceHandle, resource,cdiBreakpoint );
|
||||||
}
|
}
|
||||||
else if ( cdiBreakpoint instanceof ICDIAddressBreakpoint ) {
|
else if ( cdiBreakpoint instanceof ICDIAddressBreakpoint ) {
|
||||||
breakpoint = createAddressBreakpoint( cdiBreakpoint );
|
breakpoint = createAddressBreakpoint( sourceHandle, resource,cdiBreakpoint );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
catch( CDIException e ) {
|
||||||
|
@ -883,31 +886,38 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
return breakpoint;
|
return breakpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICFunctionBreakpoint createFunctionBreakpoint( ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
|
private ICFunctionBreakpoint createFunctionBreakpoint( String sourceHandle, IResource resource, ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
|
||||||
ICFunctionBreakpoint breakpoint = CDIDebugModel.createFunctionBreakpoint( getExecFileHandle(),
|
ICDILocator location = cdiBreakpoint.getLocator();
|
||||||
getProject(),
|
int line = location.getLineNumber();
|
||||||
cdiBreakpoint.getLocator().getFunction(),
|
ICFunctionBreakpoint breakpoint = CDIDebugModel.createFunctionBreakpoint(
|
||||||
-1,
|
sourceHandle,
|
||||||
-1,
|
resource,
|
||||||
-1,
|
location.getFunction(),
|
||||||
cdiBreakpoint.isEnabled(),
|
-1,
|
||||||
cdiBreakpoint.getCondition().getIgnoreCount(),
|
-1,
|
||||||
cdiBreakpoint.getCondition().getExpression(),
|
line,
|
||||||
false );
|
cdiBreakpoint.isEnabled(),
|
||||||
|
cdiBreakpoint.getCondition().getIgnoreCount(),
|
||||||
|
cdiBreakpoint.getCondition().getExpression(),
|
||||||
|
false);
|
||||||
return breakpoint;
|
return breakpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICAddressBreakpoint createAddressBreakpoint( ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
|
private ICAddressBreakpoint createAddressBreakpoint( String sourceHandle, IResource resource, ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
|
||||||
String sourceHandle = getExecFileHandle();
|
String binary = getExecFileHandle();
|
||||||
IAddress address = getDebugTarget().getAddressFactory().createAddress( cdiBreakpoint.getLocator().getAddress() );
|
IAddress address = getDebugTarget().getAddressFactory().createAddress( cdiBreakpoint.getLocator().getAddress() );
|
||||||
ICAddressBreakpoint breakpoint = CDIDebugModel.createAddressBreakpoint( sourceHandle,
|
ICDILocator location = cdiBreakpoint.getLocator();
|
||||||
sourceHandle,
|
int line = location.getLineNumber();
|
||||||
ResourcesPlugin.getWorkspace().getRoot(),
|
ICAddressBreakpoint breakpoint = CDIDebugModel.createAddressBreakpoint(
|
||||||
address,
|
binary,
|
||||||
cdiBreakpoint.isEnabled(),
|
sourceHandle,
|
||||||
cdiBreakpoint.getCondition().getIgnoreCount(),
|
resource,
|
||||||
cdiBreakpoint.getCondition().getExpression(),
|
line,
|
||||||
false );
|
address,
|
||||||
|
cdiBreakpoint.isEnabled(),
|
||||||
|
cdiBreakpoint.getCondition().getIgnoreCount(),
|
||||||
|
cdiBreakpoint.getCondition().getExpression(),
|
||||||
|
false);
|
||||||
return breakpoint;
|
return breakpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue