mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 196154: "Run to Line" command fails with native windows paths
This commit is contained in:
parent
8ff177d648
commit
f38c9abf74
2 changed files with 15 additions and 8 deletions
|
@ -1517,15 +1517,18 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
|||
/**
|
||||
* See bug 232415
|
||||
*
|
||||
* @param path the absolute path to the source file
|
||||
* @return
|
||||
* @param path
|
||||
* the absolute path to the source file
|
||||
* @return the simple filename if running on Windows and [path] is not an
|
||||
* absolute UNIX one. Otherwise, [path] is returned
|
||||
*/
|
||||
private String adjustDebuggerPath(String path) {
|
||||
static 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);
|
||||
path = path.replace('\\', '/');
|
||||
result = path.substring(path.lastIndexOf('/') + 1);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -1119,6 +1119,10 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I
|
|||
*/
|
||||
public void runToLine(IExecutionDMContext context, String sourceFile,
|
||||
int lineNumber, boolean skipBreakpoints, RequestMonitor rm) {
|
||||
|
||||
// Hack around a MinGW bug; see 196154
|
||||
sourceFile = MIBreakpointsManager.adjustDebuggerPath(sourceFile);
|
||||
|
||||
runToLocation(context, sourceFile + ":" + Integer.toString(lineNumber), skipBreakpoints, rm); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue