1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Fix for bug 79454: Unable to remove a breakpoint set from the gdb console.

This commit is contained in:
Mikhail Khodjaiants 2004-12-01 21:26:41 +00:00
parent b2f25ce249
commit d249a487a0
2 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,7 @@
2004-12-01 Mikhail Khodjaiants
Fix for bug 79454: Unable to remove a breakpoint set from the gdb console.
* CBreakpointManager.java
2004-12-01 Mikhail Khodjaiants 2004-12-01 Mikhail Khodjaiants
Fix for bug 74043: Overaggressive exception reporting? Fix for bug 74043: Overaggressive exception reporting?
* CBreakpointManager.java * CBreakpointManager.java

View file

@ -48,6 +48,8 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarkerDelta; import org.eclipse.core.resources.IMarkerDelta;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
@ -616,8 +618,10 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
ICSourceLocator locator = getSourceLocator(); ICSourceLocator locator = getSourceLocator();
if ( locator != null ) { if ( locator != null ) {
Object sourceElement = locator.findSourceElement( cdiBreakpoint.getLocation().getFile() ); Object sourceElement = locator.findSourceElement( cdiBreakpoint.getLocation().getFile() );
if ( sourceElement != null && sourceElement instanceof IFile ) { if ( sourceElement instanceof IFile || sourceElement instanceof IStorage ) {
breakpoint = createLineBreakpoint( (IFile)sourceElement, cdiBreakpoint ); String sourceHandle = ( sourceElement instanceof IFile ) ? ((IFile)sourceElement).getLocation().toOSString() : ((IStorage)sourceElement).getFullPath().toOSString();
IResource resource = ( sourceElement instanceof IFile ) ? (IResource)sourceElement : ResourcesPlugin.getWorkspace().getRoot();
breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint );
} }
else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) {
breakpoint = createFunctionBreakpoint( cdiBreakpoint ); breakpoint = createFunctionBreakpoint( cdiBreakpoint );
@ -630,7 +634,7 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) {
breakpoint = createFunctionBreakpoint( cdiBreakpoint ); breakpoint = createFunctionBreakpoint( cdiBreakpoint );
} }
else if ( ! cdiBreakpoint.getLocation().getAddress().equals( BigInteger.ZERO ) ) { else if ( !cdiBreakpoint.getLocation().getAddress().equals( BigInteger.ZERO ) ) {
breakpoint = createAddressBreakpoint( cdiBreakpoint ); breakpoint = createAddressBreakpoint( cdiBreakpoint );
} }
} }
@ -641,9 +645,9 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
return breakpoint; return breakpoint;
} }
private ICLineBreakpoint createLineBreakpoint( IFile file, ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException { private ICLineBreakpoint createLineBreakpoint( String sourceHandle, IResource resource, ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException {
ICLineBreakpoint breakpoint = CDIDebugModel.createLineBreakpoint( cdiBreakpoint.getLocation().getFile(), ICLineBreakpoint breakpoint = CDIDebugModel.createLineBreakpoint( sourceHandle,
file, resource,
cdiBreakpoint.getLocation().getLineNumber(), cdiBreakpoint.getLocation().getLineNumber(),
cdiBreakpoint.isEnabled(), cdiBreakpoint.isEnabled(),
cdiBreakpoint.getCondition().getIgnoreCount(), cdiBreakpoint.getCondition().getIgnoreCount(),