From d1c5dd658c0ca68fa0ae219986dbf7159e741342 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Thu, 24 Aug 2006 23:11:00 +0000 Subject: [PATCH] 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. --- .../eclipse/cdt/debug/internal/core/CBreakpointManager.java | 2 +- .../cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 5f7083bcdac..e03b7f36e80 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 @@ -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 ) { diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java index ed7c84c9323..f4e17c5101f 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java @@ -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); }