1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 10:15:39 +02:00

Fix for bugs 112008 and 111828.

Applied modified patch from Matthias Spycher (matthias@coware.com).
This commit is contained in:
Mikhail Khodjaiants 2005-10-24 17:31:54 +00:00
parent fe343ab7d2
commit 47aa5eed64
2 changed files with 36 additions and 5 deletions

View file

@ -1,3 +1,13 @@
2005-10-24 Mikhail Khodjaiants
Fix for bugs 112008 and 111828.
Applied modified patch from Matthias Spycher (matthias@coware.com).
* CBreakpointManager.java
2005-09-30 Mikhail Khodjaiants
Partial fix for bug 109950: Major crash and stack overflow if two projects reference each other.
* CDebugTarget.java
* CSourceLookupDirector.java
2005-09-16 Mikhail Khodjaiants
Bug 109785: "mi_cmd_var_create: unable to create variable object" when stepping out of stack frame.
* CStackFrame.java

View file

@ -7,9 +7,12 @@
*
* Contributors:
* QNX Software Systems - Initial API and implementation
* Matthias Spycher (matthias@coware.com) - patch for bug #112008
***********************************************************************/
package org.eclipse.cdt.debug.internal.core;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
@ -70,6 +73,7 @@ import org.eclipse.debug.core.IBreakpointsListener;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
public class CBreakpointManager implements IBreakpointsListener, IBreakpointManagerListener, ICDIEventListener, IAdaptable {
@ -189,8 +193,21 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
String sourceHandle = file;
if ( !isEmpty( file ) ) {
Object sourceElement = getSourceElement( file );
sourceHandle = ( sourceElement instanceof IFile ) ? ((IFile)sourceElement).getLocation().toOSString() : ((IStorage)sourceElement).getFullPath().toOSString();
return sourceHandle.equals( ((ICLineBreakpoint)breakpoint).getSourceHandle() ) && location.getLineNumber() == ((ICLineBreakpoint)breakpoint).getLineNumber();
if ( sourceElement instanceof IFile ) {
sourceHandle = ((IFile)sourceElement).getLocation().toOSString();
}
else if ( sourceElement instanceof IStorage ) {
sourceHandle = ((IStorage)sourceElement).getFullPath().toOSString();
}
String bpSourceHandle = ((ICLineBreakpoint)breakpoint).getSourceHandle();
if ( sourceElement instanceof LocalFileStorage ) { // see bug #112008
try {
bpSourceHandle = new File( bpSourceHandle ).getCanonicalPath();
}
catch( IOException e ) {
}
}
return sourceHandle.equals( bpSourceHandle ) && location.getLineNumber() == ((ICLineBreakpoint)breakpoint).getLineNumber();
}
}
if ( breakpoint instanceof ICWatchpoint && cdiBreakpoint instanceof ICDIWatchpoint ) {
@ -658,9 +675,13 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
Object sourceElement = getSourceElement( file );
String sourceHandle = file;
IResource resource = getProject();
if ( sourceElement instanceof IFile || sourceElement instanceof IStorage ) {
sourceHandle = ( sourceElement instanceof IFile ) ? ((IFile)sourceElement).getLocation().toOSString() : ((IStorage)sourceElement).getFullPath().toOSString();
resource = ( sourceElement instanceof IFile ) ? (IResource)sourceElement : ResourcesPlugin.getWorkspace().getRoot();
if ( sourceElement instanceof IFile ) {
sourceHandle = ((IFile)sourceElement).getLocation().toOSString();
resource = (IResource)sourceElement;
}
else if ( sourceElement instanceof IStorage ) {
sourceHandle = ((IStorage)sourceElement).getFullPath().toOSString();
resource = ResourcesPlugin.getWorkspace().getRoot();
}
breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint );
// else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) {