mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
call "set new-console" for windows platform
This commit is contained in:
parent
c642c08e59
commit
97d28868c4
1 changed files with 18 additions and 0 deletions
|
@ -8,7 +8,10 @@ package org.eclipse.cdt.debug.mi.core;
|
|||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICDISession;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.CSession;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CygwinCommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIGDBSet;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
|
@ -32,6 +35,21 @@ public class CygwinGDBDebugger extends GDBDebugger {
|
|||
throws CDIException {
|
||||
CSession session = (CSession) super.createLaunchSession(config, exe);
|
||||
session.getMISession().setCommandFactory(commandFactory);
|
||||
// For windows we need to start the inferior in a new console window
|
||||
// to separate the Inferior std{in,out,err} from gdb std{in,out,err}
|
||||
MISession mi = session.getMISession();
|
||||
try {
|
||||
CommandFactory factory = mi.getCommandFactory();
|
||||
MIGDBSet set = factory.createMIGDBSet(new String[]{"new-console"});
|
||||
mi.postCommand(set);
|
||||
MIInfo info = set.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new MIException("No answer");
|
||||
}
|
||||
} catch (MIException e) {
|
||||
// We ignore this exception, for example
|
||||
// on GNU/Linux the new-console is an error.
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue