mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Bug 445360 - Restore calling of old methods in case they are overridden
Change-Id: I4cdf35a09a7f15dba2213d7c881c6d3975ff2840 Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com> Reviewed-on: https://git.eclipse.org/r/34578 Tested-by: Hudson CI Reviewed-by: Teodor Madan <teodor.madan@freescale.com> Tested-by: Teodor Madan <teodor.madan@freescale.com> Reviewed-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
This commit is contained in:
parent
3ac977929a
commit
7fda3c26d0
1 changed files with 28 additions and 13 deletions
|
@ -373,6 +373,13 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend, IMIBa
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Process launchGDBProcess() throws CoreException {
|
||||||
|
// Keep calling deprecated getGDBCommandLine() in case it was overridden
|
||||||
|
String command = getGDBCommandLine();
|
||||||
|
// Keep calling deprecated launchGDBProcess(String) in case it was overridden
|
||||||
|
return launchGDBProcess(command);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch GDB process.
|
* Launch GDB process.
|
||||||
* Allow subclass to override.
|
* Allow subclass to override.
|
||||||
|
@ -380,6 +387,13 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend, IMIBa
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
protected Process launchGDBProcess(String commandLine) throws CoreException {
|
protected Process launchGDBProcess(String commandLine) throws CoreException {
|
||||||
|
// Backwards-compatibility check
|
||||||
|
// If the commandLine parameter is not the same as the command line array we provide
|
||||||
|
// it implies that the commandLine was modified by an extender and should be used as
|
||||||
|
// is. If it is the same, we can use the command line array instead using the more robust
|
||||||
|
// non-deprecated call to launchGDBProcess.
|
||||||
|
String unmodifiedCmdLine = StringUtil.join(getGDBCommandLineArray(), " ").trim(); //$NON-NLS-1$
|
||||||
|
if (unmodifiedCmdLine.equals(commandLine.trim()) == false) {
|
||||||
Process proc = null;
|
Process proc = null;
|
||||||
try {
|
try {
|
||||||
proc = ProcessFactory.getFactory().exec(commandLine, LaunchUtils.getLaunchEnvironment(fLaunchConfiguration));
|
proc = ProcessFactory.getFactory().exec(commandLine, LaunchUtils.getLaunchEnvironment(fLaunchConfiguration));
|
||||||
|
@ -387,9 +401,12 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend, IMIBa
|
||||||
String message = "Error while launching command " + commandLine; //$NON-NLS-1$
|
String message = "Error while launching command " + commandLine; //$NON-NLS-1$
|
||||||
throw new CoreException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, message, e));
|
throw new CoreException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, message, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
return proc;
|
return proc;
|
||||||
}
|
}
|
||||||
|
// End of Backwards-compatibility check
|
||||||
|
|
||||||
|
return launchGDBProcess(getGDBCommandLineArray());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch GDB process with command and arguments.
|
* Launch GDB process with command and arguments.
|
||||||
|
@ -573,10 +590,8 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend, IMIBa
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] commandLine = getGDBCommandLineArray();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fProcess = launchGDBProcess(commandLine);
|
fProcess = launchGDBProcess();
|
||||||
// Need to do this on the executor for thread-safety
|
// Need to do this on the executor for thread-safety
|
||||||
getExecutor().submit(
|
getExecutor().submit(
|
||||||
new DsfRunnable() {
|
new DsfRunnable() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue