mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 114793: Add an extension point to contribute command factories.
This commit is contained in:
parent
ad1a1771a9
commit
71d38ceea2
31 changed files with 1291 additions and 135 deletions
|
@ -1,3 +1,35 @@
|
|||
2006-02-06 Mikhail Khodjaiants
|
||||
Bug 114793: Add an extension point to contribute command factories.
|
||||
* MANIFEST.MF
|
||||
* CommandFactory.java
|
||||
+ mi/org/eclipse/cdt/debug/mi/core/command/factories (package)
|
||||
+ CommandFactoriesMessages.java
|
||||
+ CommandFactoriesMessages.properties
|
||||
+ CommandFactoryDescriptor.java
|
||||
+ CommandFactoryManager.java
|
||||
+ StandardCommandFactory.java
|
||||
+ mi/org/eclipse/cdt/debug/mi/core/command/factories/win32 (package)
|
||||
+ CygwinCommandFactory.java
|
||||
+ CygwinMIEnvironmentCD.java
|
||||
+ CygwinMIEnvironmentDirectory.java
|
||||
+ StandardWinCommandFactory.java
|
||||
+ WinCLIInfoSharedLibrary.java
|
||||
+ WinCLIInfoSharedLibraryInfo.java
|
||||
+ WinMIEnvironmentCD.java
|
||||
* CLIInfoSharedLibraryInfo.java
|
||||
+ commandFactories.exsd
|
||||
- CygwinCommandFactory.java
|
||||
* CygwinGDBCDIDebugger.java
|
||||
* CygwinGDBCDIDebugger2.java
|
||||
* CygwinGDBDebugger.java
|
||||
- CygwinMIEnvironmentCD.java
|
||||
- CygwinMIEnvironmentDirectory.java
|
||||
* GDBCDIDebugger2.java
|
||||
* IMILaunchConfigurationConstants.java
|
||||
* MIPlugin.java
|
||||
* plugin.xml
|
||||
* plugin.properties
|
||||
|
||||
2006-01-31 Mikhail Khodjaiants
|
||||
Bug 124966: GDBTypeParser.parse(String) parses incorrectly.
|
||||
Applied patch from Matthias Spycher (matthias@coware.com).
|
||||
|
|
|
@ -12,6 +12,7 @@ Export-Package: org.eclipse.cdt.debug.mi.core,
|
|||
org.eclipse.cdt.debug.mi.core.cdi.model,
|
||||
org.eclipse.cdt.debug.mi.core.cdi.model.type,
|
||||
org.eclipse.cdt.debug.mi.core.command,
|
||||
org.eclipse.cdt.debug.mi.core.command.factories,
|
||||
org.eclipse.cdt.debug.mi.core.event,
|
||||
org.eclipse.cdt.debug.mi.core.output
|
||||
Require-Bundle: org.eclipse.cdt.debug.core,
|
||||
|
|
|
@ -19,10 +19,17 @@ public class CommandFactory {
|
|||
|
||||
String fMIVersion;
|
||||
|
||||
protected CommandFactory() {
|
||||
}
|
||||
|
||||
public CommandFactory(String miVersion) {
|
||||
fMIVersion = miVersion;
|
||||
}
|
||||
|
||||
public void setMIVersion(String miVersion) {
|
||||
fMIVersion = miVersion;
|
||||
}
|
||||
|
||||
public String getMIVersion() {
|
||||
return fMIVersion;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories;
|
||||
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class CommandFactoriesMessages {
|
||||
|
||||
private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.mi.core.command.factories.CommandFactoriesMessages"; //$NON-NLS-1$
|
||||
|
||||
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||
|
||||
private CommandFactoriesMessages() {
|
||||
}
|
||||
|
||||
public static String getString( String key ) {
|
||||
try {
|
||||
return RESOURCE_BUNDLE.getString( key );
|
||||
}
|
||||
catch( MissingResourceException e ) {
|
||||
return '!' + key + '!';
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
###############################################################################
|
||||
# Copyright (c) 2006 QNX Software Systems and others.
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are made available under the terms of the Eclipse Public License v1.0
|
||||
# which accompanies this distribution, and is available at
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Contributors:
|
||||
# QNX Software Systems - initial API and implementation
|
||||
###############################################################################
|
||||
CommandFactoryDescriptor.0=Error instantiating command factory.
|
|
@ -0,0 +1,136 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
|
||||
/**
|
||||
* A command factory descriptor wrappers a configuration
|
||||
* element for a <code>commandFactory</code> extension.
|
||||
*/
|
||||
public class CommandFactoryDescriptor {
|
||||
|
||||
private final static String IDENTIFIER = "id"; //$NON-NLS-1$
|
||||
private final static String CLASS = "class"; //$NON-NLS-1$
|
||||
private final static String NAME = "name"; //$NON-NLS-1$
|
||||
private final static String DEBUGGER_ID = "debuggerID"; //$NON-NLS-1$
|
||||
private final static String MI_VERSIONS = "miVersions"; //$NON-NLS-1$
|
||||
private final static String DESCRIPTION = "description"; //$NON-NLS-1$
|
||||
private final static String PLATFORMS = "platforms"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* The configuration element of the extension.
|
||||
*/
|
||||
private IConfigurationElement fElement;
|
||||
|
||||
/**
|
||||
* The set of the platforms supported by this command factory.
|
||||
*/
|
||||
private Set fPlatforms;
|
||||
|
||||
/**
|
||||
* The mi levels supported by this command factory.
|
||||
*/
|
||||
private String[] fMIVersions = new String[0];
|
||||
|
||||
/**
|
||||
* Constructor for CommandFactoryDescriptor.
|
||||
*/
|
||||
protected CommandFactoryDescriptor( IConfigurationElement element ) {
|
||||
fElement = element;
|
||||
}
|
||||
|
||||
protected IConfigurationElement getConfigurationElement() {
|
||||
return fElement;
|
||||
}
|
||||
|
||||
public String getIdentifier() {
|
||||
return getConfigurationElement().getAttribute( IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return getConfigurationElement().getAttribute( NAME );
|
||||
}
|
||||
|
||||
public String getDebuggerIdentifier() {
|
||||
return getConfigurationElement().getAttribute( DEBUGGER_ID );
|
||||
}
|
||||
|
||||
public String[] getMIVersions() {
|
||||
if ( fMIVersions.length == 0 ) {
|
||||
String miVersions = getConfigurationElement().getAttribute( MI_VERSIONS );
|
||||
if ( miVersions == null || miVersions.trim().length() == 0 )
|
||||
miVersions = "mi"; //$NON-NLS-1$
|
||||
StringTokenizer tokenizer = new StringTokenizer( miVersions, "," ); //$NON-NLS-1$
|
||||
List list = new ArrayList( tokenizer.countTokens() );
|
||||
while( tokenizer.hasMoreTokens() ) {
|
||||
list.add( tokenizer.nextToken().trim() );
|
||||
}
|
||||
fMIVersions = (String[])list.toArray( new String[list.size()] );
|
||||
}
|
||||
return fMIVersions;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
String desc = getConfigurationElement().getAttribute( DESCRIPTION );
|
||||
if ( isEmpty( desc ) ) {
|
||||
desc =""; //$NON-NLS-1$
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
protected Set getSupportedPlatforms() {
|
||||
if ( fPlatforms == null ) {
|
||||
String platforms = getConfigurationElement().getAttribute( PLATFORMS );
|
||||
if ( platforms == null ) {
|
||||
return new HashSet( 0 );
|
||||
}
|
||||
StringTokenizer tokenizer = new StringTokenizer( platforms, "," ); //$NON-NLS-1$
|
||||
fPlatforms = new HashSet( tokenizer.countTokens() );
|
||||
while( tokenizer.hasMoreTokens() ) {
|
||||
fPlatforms.add( tokenizer.nextToken().trim() );
|
||||
}
|
||||
}
|
||||
return fPlatforms;
|
||||
}
|
||||
|
||||
public boolean supportsPlatform( String platform ) {
|
||||
Set all = getSupportedPlatforms();
|
||||
return all.isEmpty() || all.contains( platform );
|
||||
}
|
||||
|
||||
public String[] getSupportedPlatformList() {
|
||||
Set platforms = getSupportedPlatforms();
|
||||
return (String[])platforms.toArray( new String[platforms.size()] );
|
||||
}
|
||||
|
||||
public CommandFactory getCommandFactory() throws CoreException {
|
||||
Object clazz = getConfigurationElement().createExecutableExtension( CLASS );
|
||||
if ( clazz instanceof CommandFactory ) {
|
||||
return (CommandFactory)clazz;
|
||||
}
|
||||
throw new CoreException( new Status( IStatus.ERROR, MIPlugin.getUniqueIdentifier(), -1, CommandFactoriesMessages.getString( "CommandFactoryDescriptor.0" ), null ) ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
private boolean isEmpty( String str ) {
|
||||
return ( str == null || str.trim().length() == 0 );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
/**
|
||||
* Manages command factories.
|
||||
*/
|
||||
public class CommandFactoryManager {
|
||||
|
||||
private List fDescriptors = null;
|
||||
|
||||
public CommandFactoryDescriptor[] getDescriptors() {
|
||||
List factories = getDescriptorList();
|
||||
return (CommandFactoryDescriptor[])factories.toArray( new CommandFactoryDescriptor[factories.size()] );
|
||||
}
|
||||
|
||||
public CommandFactoryDescriptor getDefaultDescriptor( String debuggerID ) {
|
||||
// TODO: temporary
|
||||
CommandFactoryDescriptor[] descriptors = getDescriptors( debuggerID );
|
||||
return descriptors[0];
|
||||
}
|
||||
|
||||
public CommandFactoryDescriptor[] getDescriptors( String debuggerID ) {
|
||||
String platform = Platform.getOS();
|
||||
List all = getDescriptorList();
|
||||
ArrayList list = new ArrayList( all.size() );
|
||||
Iterator it = all.iterator();
|
||||
while( it.hasNext() ) {
|
||||
CommandFactoryDescriptor desc = (CommandFactoryDescriptor)it.next();
|
||||
if ( desc.getDebuggerIdentifier().equals( debuggerID ) && desc.supportsPlatform( platform ) ) {
|
||||
list.add( desc );
|
||||
}
|
||||
}
|
||||
return (CommandFactoryDescriptor[])list.toArray( new CommandFactoryDescriptor[list.size()] );
|
||||
}
|
||||
|
||||
public CommandFactory getCommandFactory( String factoryID ) throws CoreException {
|
||||
List all = getDescriptorList();
|
||||
Iterator it = all.iterator();
|
||||
while( it.hasNext() ) {
|
||||
CommandFactoryDescriptor desc = (CommandFactoryDescriptor)it.next();
|
||||
if ( desc.getIdentifier().equals( factoryID ) ) {
|
||||
return desc.getCommandFactory();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List getDescriptorList() {
|
||||
if ( fDescriptors == null )
|
||||
initializeDescriptorList();
|
||||
return fDescriptors;
|
||||
}
|
||||
|
||||
private synchronized void initializeDescriptorList() {
|
||||
if ( fDescriptors == null ) {
|
||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint( MIPlugin.getUniqueIdentifier(), MIPlugin.EXTENSION_POINT_COMMAND_FACTORIES );
|
||||
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
|
||||
fDescriptors = new ArrayList( infos.length );
|
||||
for( int i = 0; i < infos.length; i++ ) {
|
||||
IConfigurationElement configurationElement = infos[i];
|
||||
CommandFactoryDescriptor factory = new CommandFactoryDescriptor( configurationElement );
|
||||
fDescriptors.add( factory );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
|
||||
/**
|
||||
* The "standard" command factory.
|
||||
*/
|
||||
public class StandardCommandFactory extends CommandFactory {
|
||||
|
||||
/**
|
||||
* Constructor for StandardCommandFactory.
|
||||
*/
|
||||
public StandardCommandFactory() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for StandardCommandFactory.
|
||||
*/
|
||||
public StandardCommandFactory( String miVersion ) {
|
||||
super( miVersion );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories.win32;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory;
|
||||
|
||||
/**
|
||||
* Comment for .
|
||||
*/
|
||||
public class CygwinCommandFactory extends StandardWinCommandFactory {
|
||||
|
||||
/**
|
||||
* Constructor for CygwinCommandFactory.
|
||||
*/
|
||||
public CygwinCommandFactory() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for CygwinCommandFactory.
|
||||
*/
|
||||
public CygwinCommandFactory( String miVersion ) {
|
||||
super( miVersion );
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public MIEnvironmentDirectory createMIEnvironmentDirectory(boolean reset, String[] pathdirs) {
|
||||
return new CygwinMIEnvironmentDirectory( getMIVersion(), reset, pathdirs );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories.win32;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import org.eclipse.cdt.core.CommandLauncher;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
/**
|
||||
* CygwinMIEnvironmentCD
|
||||
*/
|
||||
public class CygwinMIEnvironmentCD extends WinMIEnvironmentCD {
|
||||
|
||||
CygwinMIEnvironmentCD( String miVersion, String path ) {
|
||||
super( miVersion, path );
|
||||
// Use the cygpath utility to convert the path
|
||||
CommandLauncher launcher = new CommandLauncher();
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream err = new ByteArrayOutputStream();
|
||||
String newPath = null;
|
||||
launcher.execute( new Path( "cygpath" ), //$NON-NLS-1$
|
||||
new String[]{ "-u", path }, //$NON-NLS-1$
|
||||
new String[0], new Path( "." ) ); //$NON-NLS-1$
|
||||
if ( launcher.waitAndRead( out, err ) == CommandLauncher.OK ) {
|
||||
newPath = out.toString();
|
||||
if ( newPath != null ) {
|
||||
newPath = newPath.trim();
|
||||
if ( newPath.length() > 0 ) {
|
||||
path = newPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
out.close();
|
||||
err.close();
|
||||
}
|
||||
catch( IOException e ) {
|
||||
// ignore.
|
||||
}
|
||||
setParameters( new String[]{ path } );
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories.win32;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.StringTokenizer;
|
|
@ -0,0 +1,49 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories.win32;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD;
|
||||
import org.eclipse.cdt.debug.mi.core.command.factories.StandardCommandFactory;
|
||||
|
||||
/**
|
||||
* Command factory for the standard gdb/mi protocol for Windows.
|
||||
*/
|
||||
public class StandardWinCommandFactory extends StandardCommandFactory {
|
||||
|
||||
/**
|
||||
* Constructor for StandardWinCommandFactory.
|
||||
*/
|
||||
public StandardWinCommandFactory() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for StandardWinCommandFactory.
|
||||
*/
|
||||
public StandardWinCommandFactory( String miVersion ) {
|
||||
super( miVersion );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createMIEnvironmentCD(java.lang.String)
|
||||
*/
|
||||
public MIEnvironmentCD createMIEnvironmentCD( String pathdir ) {
|
||||
return new WinMIEnvironmentCD( getMIVersion(), pathdir );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createCLIInfoSharedLibrary()
|
||||
*/
|
||||
public CLIInfoSharedLibrary createCLIInfoSharedLibrary() {
|
||||
return new WinCLIInfoSharedLibrary();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories.win32;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
|
||||
|
||||
/**
|
||||
* Windows version of "info shared library".
|
||||
*/
|
||||
public class WinCLIInfoSharedLibrary extends CLIInfoSharedLibrary {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.CLIInfoSharedLibrary#getMIInfo()
|
||||
*/
|
||||
public MIInfo getMIInfo() throws MIException {
|
||||
MIInfo info = null;
|
||||
MIOutput out = getMIOutput();
|
||||
if ( out != null ) {
|
||||
info = new WinCLIInfoSharedLibraryInfo( out );
|
||||
if ( info.isError() ) {
|
||||
throwMIException( info, out );
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories.win32;
|
||||
|
||||
import java.util.List;
|
||||
import org.eclipse.cdt.debug.mi.core.output.CLIInfoSharedLibraryInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIShared;
|
||||
|
||||
/**
|
||||
* Comment for .
|
||||
*/
|
||||
public class WinCLIInfoSharedLibraryInfo extends CLIInfoSharedLibraryInfo {
|
||||
|
||||
public WinCLIInfoSharedLibraryInfo( MIOutput out ) {
|
||||
super( out );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.output.CLIInfoSharedLibraryInfo#parseShared(java.lang.String, java.util.List)
|
||||
*/
|
||||
protected void parseShared( String str, List aList ) {
|
||||
// skip the header (DLL Name)
|
||||
if ( !str.startsWith( "DLL" ) ) { //$NON-NLS-1$
|
||||
String from = ""; //$NON-NLS-1$
|
||||
String to = ""; //$NON-NLS-1$
|
||||
boolean syms = true;
|
||||
int index = str.lastIndexOf( ' ' );
|
||||
if ( index > 0 ) {
|
||||
String sub = str.substring( index ).trim();
|
||||
// Go figure they do not print the "0x" to indicate hexadecimal!!
|
||||
if ( !sub.startsWith( "0x" ) ) { //$NON-NLS-1$
|
||||
sub = "0x" + sub; //$NON-NLS-1$
|
||||
}
|
||||
from = sub;
|
||||
str = str.substring( 0, index ).trim();
|
||||
}
|
||||
MIShared s = new MIShared( from, to, syms, str.trim() );
|
||||
aList.add( s );
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core.command.factories.win32;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD;
|
||||
|
||||
/**
|
||||
* Comment for .
|
||||
*/
|
||||
public class WinMIEnvironmentCD extends MIEnvironmentCD {
|
||||
|
||||
public WinMIEnvironmentCD( String miVersion, String path ) {
|
||||
super( miVersion, path );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.MICommand#parametersToString()
|
||||
*/
|
||||
protected String parametersToString() {
|
||||
String[] params = getParameters();
|
||||
if ( params != null && params.length == 1 ) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
// We need to escape the double quotes and the backslash.
|
||||
String param = params[0];
|
||||
for( int j = 0; j < param.length(); j++ ) {
|
||||
char c = param.charAt( j );
|
||||
if ( c == '"' || c == '\\' ) {
|
||||
sb.append( '\\' );
|
||||
}
|
||||
sb.append( c );
|
||||
}
|
||||
// If the string contains spaces instead of escaping
|
||||
// surround the parameter with double quotes.
|
||||
if ( containsWhitespace( param ) ) {
|
||||
sb.insert( 0, '"' );
|
||||
sb.append( '"' );
|
||||
}
|
||||
return sb.toString().trim();
|
||||
}
|
||||
return super.parametersToString();
|
||||
}
|
||||
}
|
|
@ -55,7 +55,7 @@ public class CLIInfoSharedLibraryInfo extends MIInfo {
|
|||
}
|
||||
}
|
||||
|
||||
void parseShared(String str, List aList) {
|
||||
protected void parseShared(String str, List aList) {
|
||||
if (!hasProcessHeader) {
|
||||
// Process the header and choose a type.
|
||||
if (str.startsWith("DLL")) { //$NON-NLS-1$
|
||||
|
|
|
@ -14,3 +14,8 @@ providerName=Eclipse.org
|
|||
GDBDebugger.name=gdb Debugger
|
||||
CygwinGDBDebugger.name=Cygwin gdb Debugger
|
||||
GDBServer.name=gdbserver Debugger
|
||||
GDBMIDebugger.name=gdb/mi
|
||||
|
||||
StandardLinuxCommandFactory.name=Standard
|
||||
StandardWindowsCommandFactory.name=Standard
|
||||
CygWinCommandFactory.name=CygWin
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
<plugin>
|
||||
<extension-point id="commandFactories" name="gdb/mi Command Factories" schema="schema/commandFactories.exsd"/>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.cdt.debug.core.CDebugger">
|
||||
<debugger
|
||||
platform="*"
|
||||
name="%GDBDebugger.name"
|
||||
platform="win32"
|
||||
name="%GDBMIDebugger.name"
|
||||
modes="run,core,attach"
|
||||
cpu="native"
|
||||
class="org.eclipse.cdt.debug.mi.core.GDBCDIDebugger2"
|
||||
id="org.eclipse.cdt.debug.mi.core.CDebugger">
|
||||
class="org.eclipse.cdt.debug.mi.core.CygwinGDBCDIDebugger2"
|
||||
id="org.eclipse.cdt.debug.mi.core.CDebuggerNew">
|
||||
</debugger>
|
||||
<debugger
|
||||
platform="win32"
|
||||
|
@ -28,10 +29,41 @@
|
|||
class="org.eclipse.cdt.debug.mi.core.GDBServerCDIDebugger2"
|
||||
id="org.eclipse.cdt.debug.mi.core.GDBServerCDebugger">
|
||||
</debugger>
|
||||
<debugger
|
||||
class="org.eclipse.cdt.debug.mi.core.GDBCDIDebugger2"
|
||||
cpu="native"
|
||||
id="org.eclipse.cdt.debug.mi.core.CDebugger"
|
||||
modes="run,core,attach"
|
||||
name="%GDBDebugger.name"
|
||||
platform="*"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.runtime.preferences">
|
||||
<initializer class="org.eclipse.cdt.debug.mi.core.MIPreferenceInitializer"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.cdt.debug.mi.core.commandFactories">
|
||||
<commandFactory
|
||||
class="org.eclipse.cdt.debug.mi.core.command.factories.win32.StandardWinCommandFactory"
|
||||
debuggerID="org.eclipse.cdt.debug.mi.core.CDebuggerNew"
|
||||
id="org.eclipse.cdt.debug.mi.core.standardWinCommandFactory"
|
||||
miVersions="mi,mi1,mi2"
|
||||
name="%StandardWindowsCommandFactory.name"
|
||||
platforms="win32"/>
|
||||
<commandFactory
|
||||
class="org.eclipse.cdt.debug.mi.core.command.factories.win32.CygwinCommandFactory"
|
||||
debuggerID="org.eclipse.cdt.debug.mi.core.CDebuggerNew"
|
||||
id="org.eclipse.cdt.debug.mi.core.cygwinCommandFactory"
|
||||
miVersions="mi,mi1,mi2"
|
||||
name="%CygWinCommandFactory.name"
|
||||
platforms="win32"/>
|
||||
<commandFactory
|
||||
class="org.eclipse.cdt.debug.mi.core.command.factories.StandardCommandFactory"
|
||||
debuggerID="org.eclipse.cdt.debug.mi.core.CDebuggerNew"
|
||||
id="org.eclipse.cdt.debug.mi.core.standardLinuxCommandFactory1"
|
||||
miVersions="mi,mi1,mi2"
|
||||
name="%StandardLinuxCommandFactory.name"
|
||||
platforms="linux"/>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
161
debug/org.eclipse.cdt.debug.mi.core/schema/commandFactories.exsd
Normal file
161
debug/org.eclipse.cdt.debug.mi.core/schema/commandFactories.exsd
Normal file
|
@ -0,0 +1,161 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="org.eclipse.cdt.debug.mi.core">
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.schema plugin="org.eclipse.cdt.debug.mi.core" id="commandFactories" name="gdb/mi Command Factories"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Allows the contributions of modified/extended gdb/mi command sets.
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="commandFactory" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
a fully qualified identifier of the target extension point
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
an optional identifier of the extension instance
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
an optional name of the extension instance
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="commandFactory">
|
||||
<complexType>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
specifies a unique identifier for this command factory.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="class" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
specifies a fully qualified name of a Java class that extends &lt;code&gt;CommandFactory&lt;/code&gt;
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute kind="java" basedOn="org.eclipse.cdt.debug.mi.core.command.CommandFactory"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="debuggerID" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
specifies the identifier of the debugger this command factory is contributed to.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
specifies the name of this command factory that will appear in the launch dialog.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="description" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
specifies the description of this command factory.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="platforms" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
specifies a comma separated list of supported platforms.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="miVersions" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
specifies a comma separated list of mi levels supported by this command factory.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="since"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
3.1
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="examples"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
<extension point="org.eclipse.cdt.debug.mi.core.commandFactories">
|
||||
<commandFactory
|
||||
class="org.eclipse.cdt.debug.mi.core.command.factories.win32.CygwinCommandFactory"
|
||||
debuggerID="org.eclipse.cdt.debug.mi.core.CDebuggerNew"
|
||||
id="org.eclipse.cdt.debug.mi.core.cygwinCommandFactory"
|
||||
miVersions="mi,mi1,mi2"
|
||||
name="CygWin"
|
||||
platforms="win32"/>
|
||||
</extension>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="apiInfo"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="copyright"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Copyright (c) 2004, 2005 QNX Software Systems and others.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License v1.0
|
||||
which accompanies this distribution, and is available at
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
</schema>
|
|
@ -1,37 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2005 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory;
|
||||
|
||||
/**
|
||||
* Cygwin Command Factory overrides the regular Command Factory to allow for
|
||||
* commands to take into account the cygwin environment.
|
||||
*/
|
||||
public class CygwinCommandFactory extends CommandFactory {
|
||||
|
||||
public CygwinCommandFactory(String miVersion) {
|
||||
super(miVersion);
|
||||
}
|
||||
|
||||
public MIEnvironmentDirectory createMIEnvironmentDirectory(boolean reset, String[] pathdirs) {
|
||||
return new CygwinMIEnvironmentDirectory(getMIVersion(), reset, pathdirs);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.CommandFactory#createMIEnvironmentCD(java.lang.String)
|
||||
*/
|
||||
public MIEnvironmentCD createMIEnvironmentCD(String pathdir) {
|
||||
return new CygwinMIEnvironmentCD(getMIVersion(), pathdir);
|
||||
}
|
||||
}
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.Session;
|
|||
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
|
||||
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.factories.win32.CygwinCommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
|
|
@ -13,6 +13,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.factories.win32.CygwinCommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.Session;
|
|||
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
|
||||
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.factories.win32.CygwinCommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.cdt.core.CommandLauncher;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
/**
|
||||
* CygwinMIEnvironmentCD
|
||||
*/
|
||||
public class CygwinMIEnvironmentCD extends MIEnvironmentCD {
|
||||
|
||||
/**
|
||||
* @param path
|
||||
*/
|
||||
public CygwinMIEnvironmentCD(String miVersion, String path) {
|
||||
super(miVersion, path);
|
||||
|
||||
// Use the cygpath utility to convert the path
|
||||
CommandLauncher launcher = new CommandLauncher();
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream err = new ByteArrayOutputStream();
|
||||
|
||||
String newPath = null;
|
||||
launcher.execute(
|
||||
new Path("cygpath"), //$NON-NLS-1$
|
||||
new String[] { "-u", path }, //$NON-NLS-1$
|
||||
new String[0],
|
||||
new Path(".")); //$NON-NLS-1$
|
||||
if (launcher.waitAndRead(out, err) == CommandLauncher.OK) {
|
||||
newPath = out.toString();
|
||||
if (newPath != null) {
|
||||
newPath = newPath.trim();
|
||||
if (newPath.length() > 0) {
|
||||
path = newPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
out.close();
|
||||
err.close();
|
||||
} catch (IOException e) {
|
||||
// ignore.
|
||||
}
|
||||
|
||||
setParameters(new String[]{path});
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.mi.core.command.MICommand#parametersToString()
|
||||
*/
|
||||
protected String parametersToString() {
|
||||
String[] params = getParameters();
|
||||
if (params != null && params.length == 1) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
// We need to escape the double quotes and the backslash.
|
||||
String param = params[0];
|
||||
for (int j = 0; j < param.length(); j++) {
|
||||
char c = param.charAt(j);
|
||||
if (c == '"' || c == '\\') {
|
||||
sb.append('\\');
|
||||
}
|
||||
sb.append(c);
|
||||
}
|
||||
|
||||
// If the string contains spaces instead of escaping
|
||||
// surround the parameter with double quotes.
|
||||
if (containsWhitespace(param)) {
|
||||
sb.insert(0, '"');
|
||||
sb.append('"');
|
||||
}
|
||||
return sb.toString().trim();
|
||||
}
|
||||
return super.parametersToString();
|
||||
}
|
||||
}
|
|
@ -62,7 +62,13 @@ public class GDBCDIDebugger2 extends AbstractGDBCDIDebugger {
|
|||
}
|
||||
|
||||
protected CommandFactory getCommandFactory( ILaunchConfiguration config ) throws CoreException {
|
||||
return new CommandFactory( getMIVersion( config ) );
|
||||
String factoryID = MIPlugin.getCommandFactory( config );
|
||||
CommandFactory factory = MIPlugin.getDefault().getCommandFactoryManager().getCommandFactory( factoryID );
|
||||
String miVersion = getMIVersion( config );
|
||||
if ( factory != null ) {
|
||||
factory.setMIVersion( miVersion );
|
||||
}
|
||||
return ( factory != null ) ? factory : new CommandFactory( miVersion );
|
||||
}
|
||||
|
||||
public static IPath getProjectPath( ILaunchConfiguration configuration ) throws CoreException {
|
||||
|
|
|
@ -55,6 +55,11 @@ public interface IMILaunchConfigurationConstants {
|
|||
*/
|
||||
public static final boolean DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT = false;
|
||||
|
||||
/**
|
||||
* Launch configuration attribute key. The value is a string specifying the identifier of the command factory to use.
|
||||
*/
|
||||
public static final String ATTR_DEBUGGER_COMMAND_FACTORY = MIPlugin.getUniqueIdentifier() + ".commandFactory"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* launch configuration attribute key. The value is a string specifying the protocol to
|
||||
* use. For now only "mi", "mi1", "m2", "mi3" are supported.
|
||||
|
|
|
@ -25,6 +25,7 @@ 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.MIStackListFrames;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MITargetSelect;
|
||||
import org.eclipse.cdt.debug.mi.core.command.factories.CommandFactoryManager;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.cdt.utils.pty.PTY;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
@ -46,12 +47,25 @@ public class MIPlugin extends Plugin {
|
|||
*/
|
||||
public static final String PLUGIN_ID = "org.eclipse.cdt.debug.mi.core" ; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Simple identifier constant (value <code>"commandFactories"</code>)
|
||||
* for the "gdb/mi command factories" extension point.
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
public static final String EXTENSION_POINT_COMMAND_FACTORIES = "commandFactories"; //$NON-NLS-1$
|
||||
|
||||
//The shared instance.
|
||||
private static MIPlugin plugin;
|
||||
|
||||
// GDB command
|
||||
private static final String GDB = "gdb"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* The singleton command factory manager.
|
||||
*/
|
||||
private CommandFactoryManager fCommandFactoryManager;
|
||||
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
|
@ -529,4 +543,21 @@ public class MIPlugin extends Plugin {
|
|||
}
|
||||
return miVersion;
|
||||
}
|
||||
|
||||
public static String getCommandFactory( ILaunchConfiguration config ) {
|
||||
String commandFactory = ""; //$NON-NLS-1$
|
||||
try {
|
||||
commandFactory = config.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, "" ); //$NON-NLS-1$
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
}
|
||||
return commandFactory;
|
||||
}
|
||||
|
||||
public CommandFactoryManager getCommandFactoryManager() {
|
||||
if ( fCommandFactoryManager == null ) {
|
||||
fCommandFactoryManager = new CommandFactoryManager();
|
||||
}
|
||||
return fCommandFactoryManager;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2006-02-06 Mikhail Khodjaiants
|
||||
Bug 114793: Add an extension point to contribute command factories.
|
||||
* MIUIMessages.properties
|
||||
+ StandardGDBDebuggerPage.java
|
||||
* plugin.xml
|
||||
|
||||
2006-02-03 Mikhail Khodjaiants
|
||||
The "ICDebuggerPage" interface and "AbstractCDebuggerPage" class are added.
|
||||
All extensions of the "CDebuggerPage" extension point must implement "ICDebuggerPage".
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
debuggerID="org.eclipse.cdt.debug.mi.core.GDBServerCDebugger"
|
||||
id="org.eclipse.cdt.debug.mi.GDBServerDebuggerPage">
|
||||
</debuggerPage>
|
||||
<debuggerPage
|
||||
class="org.eclipse.cdt.debug.mi.internal.ui.StandardGDBDebuggerPage"
|
||||
debuggerID="org.eclipse.cdt.debug.mi.core.CDebuggerNew"
|
||||
id="org.eclipse.cdt.debug.mi.GDBDebuggerPageNew"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
|
|
|
@ -21,8 +21,21 @@ GDBDebuggerPage.7=B&rowse...
|
|||
GDBDebuggerPage.8=GDB Command File
|
||||
GDBDebuggerPage.9=(Warning: Some commands in this file may interfere with the startup operation of the debugger, for example "run".)
|
||||
GDBDebuggerPage.10=Shared Libraries
|
||||
GDBDebuggerPage.11=MI Protocol:
|
||||
GDBDebuggerPage.11=Protocol:
|
||||
GDBDebuggerPage.12=Default
|
||||
StandardGDBDebuggerPage.0=Debugger executable must be specified.
|
||||
StandardGDBDebuggerPage.1=GDB Debugger Options
|
||||
StandardGDBDebuggerPage.2=Main
|
||||
StandardGDBDebuggerPage.3=GDB debugger:
|
||||
StandardGDBDebuggerPage.4=&Browse...
|
||||
StandardGDBDebuggerPage.5=GDB Debugger
|
||||
StandardGDBDebuggerPage.6=GDB command file:
|
||||
StandardGDBDebuggerPage.7=B&rowse...
|
||||
StandardGDBDebuggerPage.8=GDB Command File
|
||||
StandardGDBDebuggerPage.9=(Warning: Some commands in this file may interfere with the startup operation of the debugger, for example "run".)
|
||||
StandardGDBDebuggerPage.10=Shared Libraries
|
||||
StandardGDBDebuggerPage.11=Protocol:
|
||||
StandardGDBDebuggerPage.12=GDB command set:
|
||||
GDBServerDebuggerPage.0=TCP
|
||||
GDBServerDebuggerPage.1=Serial
|
||||
GDBServerDebuggerPage.10=Connection
|
||||
|
|
|
@ -0,0 +1,402 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.internal.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
|
||||
import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
||||
import org.eclipse.cdt.debug.mi.core.command.factories.CommandFactoryDescriptor;
|
||||
import org.eclipse.cdt.debug.mi.ui.IMILaunchConfigurationComponent;
|
||||
import org.eclipse.cdt.debug.mi.ui.MIUIUtils;
|
||||
import org.eclipse.cdt.debug.ui.AbstractCDebuggerPage;
|
||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.TabFolder;
|
||||
import org.eclipse.swt.widgets.TabItem;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
/**
|
||||
* The dynamic tab for gdb-based debugger implementations.
|
||||
*/
|
||||
public class StandardGDBDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||
|
||||
private final static String DEFAULT_MI_VERSION = "mi"; //$NON-NLS-1$
|
||||
|
||||
protected TabFolder fTabFolder;
|
||||
|
||||
protected Text fGDBCommandText;
|
||||
|
||||
protected Text fGDBInitText;
|
||||
|
||||
protected Combo fCommandFactoryCombo;
|
||||
|
||||
protected Combo fProtocolCombo;
|
||||
|
||||
private IMILaunchConfigurationComponent fSolibBlock;
|
||||
|
||||
private CommandFactoryDescriptor[] fCommandFactoryDescriptors;
|
||||
|
||||
private boolean fIsInitializing = false;
|
||||
|
||||
public void createControl( Composite parent ) {
|
||||
Composite comp = new Composite( parent, SWT.NONE );
|
||||
comp.setLayout( new GridLayout() );
|
||||
comp.setLayoutData( new GridData( GridData.FILL_BOTH ) );
|
||||
fTabFolder = new TabFolder( comp, SWT.NONE );
|
||||
fTabFolder.setLayoutData( new GridData( GridData.FILL_BOTH | GridData.GRAB_VERTICAL ) );
|
||||
createTabs( fTabFolder );
|
||||
fTabFolder.setSelection( 0 );
|
||||
setControl( parent );
|
||||
}
|
||||
|
||||
public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) {
|
||||
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb" ); //$NON-NLS-1$
|
||||
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, IMILaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT );
|
||||
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, MIPlugin.getDefault().getCommandFactoryManager().getDefaultDescriptor( getDebuggerIdentifier() ).getIdentifier() );
|
||||
if ( fSolibBlock != null )
|
||||
fSolibBlock.setDefaults( configuration );
|
||||
}
|
||||
|
||||
public boolean isValid( ILaunchConfiguration launchConfig ) {
|
||||
boolean valid = fGDBCommandText.getText().length() != 0;
|
||||
if ( valid ) {
|
||||
setErrorMessage( null );
|
||||
setMessage( null );
|
||||
}
|
||||
else {
|
||||
setErrorMessage( MIUIMessages.getString( "StandardGDBDebuggerPage.0" ) ); //$NON-NLS-1$
|
||||
setMessage( null );
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
public void initializeFrom( ILaunchConfiguration configuration ) {
|
||||
setInitializing( true );
|
||||
String gdbCommand = "gdb"; //$NON-NLS-1$
|
||||
String gdbInit = IMILaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT;
|
||||
try {
|
||||
gdbCommand = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb" ); //$NON-NLS-1$
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
}
|
||||
try {
|
||||
gdbInit = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, IMILaunchConfigurationConstants.DEBUGGER_GDB_INIT_DEFAULT );
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
}
|
||||
if ( fSolibBlock != null )
|
||||
fSolibBlock.initializeFrom( configuration );
|
||||
fGDBCommandText.setText( gdbCommand );
|
||||
fGDBInitText.setText( gdbInit );
|
||||
|
||||
String debuggerID = getDebuggerIdentifier();
|
||||
fCommandFactoryDescriptors = MIPlugin.getDefault().getCommandFactoryManager().getDescriptors( debuggerID );
|
||||
Arrays.sort( fCommandFactoryDescriptors,
|
||||
new Comparator() {
|
||||
public int compare( Object arg0, Object arg1 ) {
|
||||
return ((CommandFactoryDescriptor)arg0).getName().compareTo( ((CommandFactoryDescriptor)arg1).getName() );
|
||||
}
|
||||
} );
|
||||
String[] descLabels = new String[fCommandFactoryDescriptors.length];
|
||||
String commandFactoryId = MIPlugin.getCommandFactory( configuration );
|
||||
int index = -1;
|
||||
for( int i = 0; i < fCommandFactoryDescriptors.length; ++i ) {
|
||||
descLabels[i] = fCommandFactoryDescriptors[i].getName();
|
||||
if ( fCommandFactoryDescriptors[i].getIdentifier().equals( commandFactoryId ) )
|
||||
index = i;
|
||||
}
|
||||
fCommandFactoryCombo.setItems( descLabels );
|
||||
if ( index >= 0 ) {
|
||||
fCommandFactoryCombo.select( index );
|
||||
String[] miVersions = fCommandFactoryDescriptors[index].getMIVersions();
|
||||
fProtocolCombo.setItems( miVersions );
|
||||
if ( miVersions.length == 0 ) {
|
||||
miVersions = new String[] { DEFAULT_MI_VERSION };
|
||||
}
|
||||
String mi = DEFAULT_MI_VERSION;
|
||||
try {
|
||||
mi = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, DEFAULT_MI_VERSION );
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
// use default
|
||||
}
|
||||
int miIndex = 0;
|
||||
for ( int i = 0; i < miVersions.length; ++i ) {
|
||||
if ( miVersions.equals( mi ) ) {
|
||||
miIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fProtocolCombo.select( miIndex );
|
||||
}
|
||||
|
||||
setInitializing( false );
|
||||
}
|
||||
|
||||
public void performApply( ILaunchConfigurationWorkingCopy configuration ) {
|
||||
String str = fGDBCommandText.getText();
|
||||
str.trim();
|
||||
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, str );
|
||||
str = fGDBInitText.getText();
|
||||
str.trim();
|
||||
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, str );
|
||||
str = fCommandFactoryCombo.getText();
|
||||
int index = fCommandFactoryCombo.indexOf( str );
|
||||
str = fCommandFactoryDescriptors[index].getIdentifier();
|
||||
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, str );
|
||||
str = fProtocolCombo.getText();
|
||||
configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, str );
|
||||
if ( fSolibBlock != null )
|
||||
fSolibBlock.performApply( configuration );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return MIUIMessages.getString( "StandardGDBDebuggerPage.1" ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getShell()
|
||||
*/
|
||||
protected Shell getShell() {
|
||||
return super.getShell();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
|
||||
*/
|
||||
protected void updateLaunchConfigurationDialog() {
|
||||
super.updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.util.Observer#update(java.util.Observable, java.lang.Object)
|
||||
*/
|
||||
public void update( Observable o, Object arg ) {
|
||||
if ( !isInitializing() )
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
public IMILaunchConfigurationComponent createSolibBlock( Composite parent ) {
|
||||
IMILaunchConfigurationComponent block = MIUIUtils.createGDBSolibBlock( MIUIUtils.createSolibSearchPathBlock( null ), true, true );
|
||||
block.createControl( parent );
|
||||
return block;
|
||||
}
|
||||
|
||||
public void createTabs( TabFolder tabFolder ) {
|
||||
createMainTab( tabFolder );
|
||||
createSolibTab( tabFolder );
|
||||
}
|
||||
|
||||
public void createMainTab( TabFolder tabFolder ) {
|
||||
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
|
||||
tabItem.setText( MIUIMessages.getString( "StandardGDBDebuggerPage.2" ) ); //$NON-NLS-1$
|
||||
Composite comp = ControlFactory.createCompositeEx( tabFolder, 1, GridData.FILL_BOTH );
|
||||
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
|
||||
comp.setFont( tabFolder.getFont() );
|
||||
tabItem.setControl( comp );
|
||||
Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL );
|
||||
((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false;
|
||||
subComp.setFont( tabFolder.getFont() );
|
||||
Label label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "StandardGDBDebuggerPage.3" ) ); //$NON-NLS-1$
|
||||
GridData gd = new GridData();
|
||||
// gd.horizontalSpan = 2;
|
||||
label.setLayoutData( gd );
|
||||
fGDBCommandText = ControlFactory.createTextField( subComp, SWT.SINGLE | SWT.BORDER );
|
||||
fGDBCommandText.addModifyListener( new ModifyListener() {
|
||||
|
||||
public void modifyText( ModifyEvent evt ) {
|
||||
if ( !isInitializing() )
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
} );
|
||||
Button button = createPushButton( subComp, MIUIMessages.getString( "StandardGDBDebuggerPage.4" ), null ); //$NON-NLS-1$
|
||||
button.addSelectionListener( new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected( SelectionEvent evt ) {
|
||||
handleGDBButtonSelected();
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
private void handleGDBButtonSelected() {
|
||||
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
||||
dialog.setText( MIUIMessages.getString( "StandardGDBDebuggerPage.5" ) ); //$NON-NLS-1$
|
||||
String gdbCommand = fGDBCommandText.getText().trim();
|
||||
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
||||
if ( lastSeparatorIndex != -1 ) {
|
||||
dialog.setFilterPath( gdbCommand.substring( 0, lastSeparatorIndex ) );
|
||||
}
|
||||
String res = dialog.open();
|
||||
if ( res == null ) {
|
||||
return;
|
||||
}
|
||||
fGDBCommandText.setText( res );
|
||||
}
|
||||
} );
|
||||
label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "StandardGDBDebuggerPage.6" ) ); //$NON-NLS-1$
|
||||
gd = new GridData();
|
||||
// gd.horizontalSpan = 2;
|
||||
label.setLayoutData( gd );
|
||||
fGDBInitText = ControlFactory.createTextField( subComp, SWT.SINGLE | SWT.BORDER );
|
||||
gd = new GridData( GridData.FILL_HORIZONTAL );
|
||||
fGDBInitText.setLayoutData( gd );
|
||||
fGDBInitText.addModifyListener( new ModifyListener() {
|
||||
|
||||
public void modifyText( ModifyEvent evt ) {
|
||||
if ( !isInitializing() )
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
} );
|
||||
button = createPushButton( subComp, MIUIMessages.getString( "StandardGDBDebuggerPage.7" ), null ); //$NON-NLS-1$
|
||||
button.addSelectionListener( new SelectionAdapter() {
|
||||
|
||||
public void widgetSelected( SelectionEvent evt ) {
|
||||
handleGDBInitButtonSelected();
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
private void handleGDBInitButtonSelected() {
|
||||
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
||||
dialog.setText( MIUIMessages.getString( "StandardGDBDebuggerPage.8" ) ); //$NON-NLS-1$
|
||||
String gdbCommand = fGDBInitText.getText().trim();
|
||||
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
||||
if ( lastSeparatorIndex != -1 ) {
|
||||
dialog.setFilterPath( gdbCommand.substring( 0, lastSeparatorIndex ) );
|
||||
}
|
||||
String res = dialog.open();
|
||||
if ( res == null ) {
|
||||
return;
|
||||
}
|
||||
fGDBInitText.setText( res );
|
||||
}
|
||||
} );
|
||||
label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "StandardGDBDebuggerPage.9" ), //$NON-NLS-1$
|
||||
200, SWT.DEFAULT, SWT.WRAP );
|
||||
gd = new GridData( GridData.FILL_HORIZONTAL );
|
||||
gd.horizontalSpan = 3;
|
||||
gd.widthHint = 200;
|
||||
label.setLayoutData( gd );
|
||||
|
||||
Composite options = ControlFactory.createCompositeEx( subComp, 2, GridData.FILL_HORIZONTAL );
|
||||
gd = new GridData( GridData.FILL_HORIZONTAL );
|
||||
gd.horizontalSpan = 3;
|
||||
options.setLayoutData( gd );
|
||||
createCommandFactoryCombo( options );
|
||||
createProtocolCombo( options );
|
||||
}
|
||||
|
||||
public void createSolibTab( TabFolder tabFolder ) {
|
||||
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
|
||||
tabItem.setText( MIUIMessages.getString( "StandardGDBDebuggerPage.10" ) ); //$NON-NLS-1$
|
||||
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
|
||||
comp.setFont( tabFolder.getFont() );
|
||||
tabItem.setControl( comp );
|
||||
fSolibBlock = createSolibBlock( comp );
|
||||
if ( fSolibBlock instanceof Observable )
|
||||
((Observable)fSolibBlock).addObserver( this );
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
if ( fSolibBlock != null ) {
|
||||
if ( fSolibBlock instanceof Observable )
|
||||
((Observable)fSolibBlock).deleteObserver( this );
|
||||
fSolibBlock.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
|
||||
*/
|
||||
public void activated( ILaunchConfigurationWorkingCopy workingCopy ) {
|
||||
// Override the default behavior
|
||||
}
|
||||
|
||||
protected boolean isInitializing() {
|
||||
return fIsInitializing;
|
||||
}
|
||||
|
||||
private void setInitializing( boolean isInitializing ) {
|
||||
fIsInitializing = isInitializing;
|
||||
}
|
||||
|
||||
protected void createCommandFactoryCombo( Composite parent ) {
|
||||
Label label = new Label( parent, SWT.NONE );
|
||||
label.setText( MIUIMessages.getString( "StandardGDBDebuggerPage.12" ) ); //$NON-NLS-1$
|
||||
fCommandFactoryCombo = new Combo( parent, SWT.READ_ONLY | SWT.DROP_DOWN );
|
||||
fCommandFactoryCombo.addSelectionListener( new SelectionListener() {
|
||||
|
||||
public void widgetDefaultSelected( SelectionEvent e ) {
|
||||
if ( !isInitializing() )
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
public void widgetSelected( SelectionEvent e ) {
|
||||
if ( !isInitializing() )
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
protected void createProtocolCombo( Composite parent ) {
|
||||
Label label = new Label( parent, SWT.NONE );
|
||||
label.setText( MIUIMessages.getString( "StandardGDBDebuggerPage.11" ) ); //$NON-NLS-1$
|
||||
fProtocolCombo = new Combo( parent, SWT.READ_ONLY | SWT.DROP_DOWN );
|
||||
fProtocolCombo.addSelectionListener( new SelectionListener() {
|
||||
|
||||
public void widgetDefaultSelected( SelectionEvent e ) {
|
||||
if ( !isInitializing() )
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
public void widgetSelected( SelectionEvent e ) {
|
||||
if ( !isInitializing() )
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
protected String getCurrentCommandFactoryID() {
|
||||
String name = fCommandFactoryCombo.getText();
|
||||
for ( int i = 0; i < fCommandFactoryDescriptors.length; ++i ) {
|
||||
if ( fCommandFactoryDescriptors[i].getName().equals( name ) ) {
|
||||
return fCommandFactoryDescriptors[i].getIdentifier();
|
||||
}
|
||||
}
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue