mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Fix #146725 - Erreneous error message during GDB startup
gdb set new-console is not implemented on Linux and should not be used
This commit is contained in:
parent
9d683d0275
commit
d80185bcd5
6 changed files with 61 additions and 8 deletions
|
@ -2,6 +2,14 @@
|
|||
Bug 145758: Unable to use the default command factories.
|
||||
* MANIFEST.MF
|
||||
|
||||
2006-08-22 Mikhail Khodjaiants
|
||||
Bug 146725: Erroneous error message during GDB startup.
|
||||
* CygwinGDBCDIDebugger2.java
|
||||
* GDBCDIDebugger2.java
|
||||
* CommandFactory.java
|
||||
+ MIGDBSetNewConsole.java
|
||||
* StandardLinuxCommandFactory.java
|
||||
|
||||
2006-08-22 Mikhail Khodjaiants
|
||||
Bug 153894: Variable View: Can not format 'short int' to Hex.
|
||||
Applied patch from James Blackburn (jamesblackburn+eclipse@gmail.com).
|
||||
|
|
|
@ -414,4 +414,8 @@ public class CommandFactory {
|
|||
public MIInterpreterExecConsole createMIInterpreterExecConsole(String cmd) {
|
||||
return new MIInterpreterExecConsole(getMIVersion(), cmd);
|
||||
}
|
||||
|
||||
public MIGDBSetNewConsole createMIGDBSetNewConsole() {
|
||||
return new MIGDBSetNewConsole(getMIVersion());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package org.eclipse.cdt.debug.mi.core.command;
|
||||
|
||||
public class MIGDBSetNewConsole extends MIGDBSet {
|
||||
|
||||
public MIGDBSetNewConsole(String miVersion) {
|
||||
super(miVersion, new String[] {"new-console"}); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
}
|
|
@ -11,6 +11,7 @@
|
|||
package org.eclipse.cdt.debug.mi.core.command.factories.linux;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIGDBSetNewConsole;
|
||||
import org.eclipse.cdt.debug.mi.core.command.factories.StandardCommandFactory;
|
||||
|
||||
/**
|
||||
|
@ -38,4 +39,34 @@ public class StandardLinuxCommandFactory extends StandardCommandFactory {
|
|||
public CLIInfoSharedLibrary createCLIInfoSharedLibrary() {
|
||||
return new LinuxCLIInfoSharedLibrary();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createMIGDBSetNewConsole()
|
||||
*/
|
||||
public MIGDBSetNewConsole createMIGDBSetNewConsole() {
|
||||
// Suppress "set new-console" - returns error on Linux
|
||||
return new MIGDBSetNewConsole( getMIVersion() ) {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOperation()
|
||||
*/
|
||||
public String getOperation() {
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.MICommand#getOptions()
|
||||
*/
|
||||
public String[] getOptions() {
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.MICommand#getParameters()
|
||||
*/
|
||||
public String[] getParameters() {
|
||||
return new String[0];
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ package org.eclipse.cdt.debug.mi.core;
|
|||
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.Session;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIGDBSet;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIGDBSetNewConsole;
|
||||
import org.eclipse.cdt.debug.mi.core.command.factories.win32.CygwinCommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
@ -41,9 +41,9 @@ public class CygwinGDBCDIDebugger2 extends GDBCDIDebugger2 {
|
|||
MISession miSession = getMISession( session );
|
||||
try {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIGDBSet set = factory.createMIGDBSet( new String[]{ "new-console" } ); //$NON-NLS-1$
|
||||
miSession.postCommand( set );
|
||||
MIInfo info = set.getMIInfo();
|
||||
MIGDBSetNewConsole newConsole = factory.createMIGDBSetNewConsole();
|
||||
miSession.postCommand( newConsole );
|
||||
MIInfo info = newConsole.getMIInfo();
|
||||
if ( info == null ) {
|
||||
throw new MIException( MIPlugin.getResourceString( "src.common.No_answer" ) ); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.text.MessageFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||
|
@ -23,7 +24,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager;
|
|||
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLITargetAttach;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIGDBSet;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIGDBSetNewConsole;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
|
@ -120,9 +121,9 @@ public class GDBCDIDebugger2 extends AbstractGDBCDIDebugger {
|
|||
MISession miSession = getMISession( session );
|
||||
try {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIGDBSet set = factory.createMIGDBSet( new String[]{ "new-console" } ); //$NON-NLS-1$
|
||||
miSession.postCommand( set );
|
||||
MIInfo info = set.getMIInfo();
|
||||
MIGDBSetNewConsole newConsole = factory.createMIGDBSetNewConsole();
|
||||
miSession.postCommand( newConsole );
|
||||
MIInfo info = newConsole.getMIInfo();
|
||||
if ( info == null ) {
|
||||
throw new MIException( MIPlugin.getResourceString( "src.common.No_answer" ) ); //$NON-NLS-1$
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue