1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Move the workaround for bug 102563 into the mi plug-in so that non-gdb CDI clients can get the full path for line breakpoint locations. Fixes bug 155137.

This commit is contained in:
Ken Ryall 2006-08-24 23:11:00 +00:00
parent 8abe95052b
commit d1c5dd658c
2 changed files with 6 additions and 1 deletions

View file

@ -603,7 +603,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
ICLineBreakpoint breakpoint = (ICLineBreakpoint)breakpoints[i];
String handle = breakpoint.getSourceHandle();
IPath path = convertPath( handle );
ICDILineLocation location = cdiTarget.createLineLocation( path.lastSegment()/*path.toPortableString()*/, breakpoint.getLineNumber() );
ICDILineLocation location = cdiTarget.createLineLocation( path.toPortableString(), breakpoint.getLineNumber() );
ICDICondition condition = createCondition( breakpoint );
b = cdiTarget.setLineBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true );
} else if ( breakpoints[i] instanceof ICWatchpoint ) {

View file

@ -83,6 +83,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIFrame;
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowEndianInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
import org.eclipse.core.runtime.Path;
/**
*/
@ -864,6 +865,10 @@ public class Target extends SessionObject implements ICDITarget {
public ICDILineBreakpoint setLineBreakpoint(int type, ICDILineLocation location,
ICDICondition condition, boolean deferred) throws CDIException {
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
// See bug 102563. Only pass gdb the source file name, not the full path.
// This workaround was in CBreakpointManager in CDT 3.1 but has been moved
// here so that non-gdb CDI clients can get the full path.
location = createLineLocation( new Path(location.getFile()).lastSegment(), location.getLineNumber() );
return bMgr.setLineBreakpoint(this, type, location, condition, deferred);
}