mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 23:15:24 +02:00
Patch for bug 232415
This commit is contained in:
parent
ea0fa709a3
commit
ac64a3cfd7
1 changed files with 21 additions and 2 deletions
|
@ -41,6 +41,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
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);
|
String hostPath = (String) attributes.get(ICBreakpoint.SOURCE_HANDLE);
|
||||||
|
|
||||||
if (hostPath != null) {
|
if (hostPath != null) {
|
||||||
|
|
||||||
ISourceLookupDMContext srcDmc = DMContexts.getAncestorOfType(dmc, ISourceLookupDMContext.class);
|
ISourceLookupDMContext srcDmc = DMContexts.getAncestorOfType(dmc, ISourceLookupDMContext.class);
|
||||||
if (srcDmc != null) {
|
if (srcDmc != null) {
|
||||||
fSourceLookup.getDebuggerPath(srcDmc, hostPath,
|
fSourceLookup.getDebuggerPath(srcDmc, hostPath,
|
||||||
new DataRequestMonitor<String>(getExecutor(), rm) {
|
new DataRequestMonitor<String>(getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
attributes.put(ATTR_DEBUGGER_PATH, getData());
|
attributes.put(ATTR_DEBUGGER_PATH, adjustDebuggerPath(getData()));
|
||||||
rm.done();
|
rm.done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Source lookup not available for given context, use the host
|
// Source lookup not available for given context, use the host
|
||||||
// path for the debugger path.
|
// path for the debugger path.
|
||||||
attributes.put(ATTR_DEBUGGER_PATH, hostPath);
|
attributes.put(ATTR_DEBUGGER_PATH, adjustDebuggerPath(hostPath));
|
||||||
rm.done();
|
rm.done();
|
||||||
}
|
}
|
||||||
} else {
|
} 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.
|
* Determine the set of modified attributes.
|
||||||
* Elementary set operations in full action :-)
|
* Elementary set operations in full action :-)
|
||||||
|
|
Loading…
Add table
Reference in a new issue