diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index 27766276bec..2cf2a140d9c 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -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). diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java index 81f2480e926..5dfe4500f05 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java @@ -414,4 +414,8 @@ public class CommandFactory { public MIInterpreterExecConsole createMIInterpreterExecConsole(String cmd) { return new MIInterpreterExecConsole(getMIVersion(), cmd); } + + public MIGDBSetNewConsole createMIGDBSetNewConsole() { + return new MIGDBSetNewConsole(getMIVersion()); + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetNewConsole.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetNewConsole.java new file mode 100644 index 00000000000..cfb74d4fc55 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIGDBSetNewConsole.java @@ -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$ + } + +} diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/StandardLinuxCommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/StandardLinuxCommandFactory.java index 4d85bf747d5..cc42b57e251 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/StandardLinuxCommandFactory.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/linux/StandardLinuxCommandFactory.java @@ -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]; + } + }; + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger2.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger2.java index b846f1dd9dd..cece7626fc1 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger2.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBCDIDebugger2.java @@ -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$ } diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java index 1e4a7bc8964..986c084afc4 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java @@ -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$ }