From ac64a3cfd735be9497fb7be089618e75ff49f0db Mon Sep 17 00:00:00 2001 From: Francois Chouinard Date: Thu, 22 May 2008 20:04:22 +0000 Subject: [PATCH] Patch for bug 232415 --- .../dd/mi/service/MIBreakpointsManager.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpointsManager.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpointsManager.java index 39f71bcdcb4..89eaa934ee0 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpointsManager.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpointsManager.java @@ -41,6 +41,7 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.Job; @@ -1327,20 +1328,21 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo String hostPath = (String) attributes.get(ICBreakpoint.SOURCE_HANDLE); if (hostPath != null) { + ISourceLookupDMContext srcDmc = DMContexts.getAncestorOfType(dmc, ISourceLookupDMContext.class); if (srcDmc != null) { fSourceLookup.getDebuggerPath(srcDmc, hostPath, new DataRequestMonitor(getExecutor(), rm) { @Override protected void handleSuccess() { - attributes.put(ATTR_DEBUGGER_PATH, getData()); + attributes.put(ATTR_DEBUGGER_PATH, adjustDebuggerPath(getData())); rm.done(); } }); } else { // Source lookup not available for given context, use the host // path for the debugger path. - attributes.put(ATTR_DEBUGGER_PATH, hostPath); + attributes.put(ATTR_DEBUGGER_PATH, adjustDebuggerPath(hostPath)); rm.done(); } } else { @@ -1350,6 +1352,23 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo } } + /** + * See bug232415 + * + * @param path the absolute path to the source file + * @return + */ + private String adjustDebuggerPath(String path) { + String result = path; + // Make it MinGW-specific + if (Platform.getOS().startsWith("win")) { //$NON-NLS-1$ + if (!path.startsWith("/")) { //$NON-NLS-1$ + result = path.substring(path.lastIndexOf('\\') + 1); + } + } + return result; + } + /** * Determine the set of modified attributes. * Elementary set operations in full action :-)