mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
[248593] Fixed launch for JTag to support DSF-GDB
This commit is contained in:
parent
7b1257ab5c
commit
3bc232083d
11 changed files with 544 additions and 27 deletions
|
@ -18,4 +18,3 @@ Eclipse-LazyStart: true
|
|||
Export-Package: org.eclipse.cdt.debug.gdbjtag.core,
|
||||
org.eclipse.cdt.debug.gdbjtag.core.jtagdevice
|
||||
Bundle-Vendor: %providerName
|
||||
Import-Package: com.ibm.icu.text
|
||||
|
|
|
@ -5,22 +5,27 @@
|
|||
<extension
|
||||
point="org.eclipse.debug.core.launchConfigurationTypes">
|
||||
<launchConfigurationType
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.GDBJtagLaunchConfigurationDelegate"
|
||||
delegateDescription="%launchDelegate.jtag.description"
|
||||
delegateName="%launchDelegate.jtag.name"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"
|
||||
modes="debug"
|
||||
name="%launchConfig.name"
|
||||
public="true"
|
||||
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
|
||||
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"/>
|
||||
public="true"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.debug.core.launchDelegates">
|
||||
<launchDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.GDBJtagLaunchConfigurationDelegate"
|
||||
delegateDescription="%launchDelegate.jtag.description"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.core.cdiLaunchDelegate"
|
||||
modes="debug"
|
||||
name="%launchDelegate.jtag.name"
|
||||
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
|
||||
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
|
||||
type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
|
||||
</launchDelegate>
|
||||
<launchDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.GDBJtagDSFLaunchConfigurationDelegate"
|
||||
delegateDescription="%launchDelegate.jtagDsf.description"
|
||||
id="org.eclipse.cdt.dsf.gdb.launch.jtagCLaunch"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate"
|
||||
modes="debug"
|
||||
name="%launchDelegate.jtagDsf.name"
|
||||
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
|
||||
|
|
|
@ -8,16 +8,14 @@ Bundle-Localization: plugin
|
|||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.debug.ui,
|
||||
org.eclipse.debug.core,
|
||||
org.eclipse.cdt.launch,
|
||||
org.eclipse.cdt.ui,
|
||||
org.eclipse.cdt.debug.mi.core,
|
||||
org.eclipse.cdt.debug.gdbjtag.core,
|
||||
org.eclipse.core.variables,
|
||||
org.eclipse.cdt.managedbuilder.ui,
|
||||
org.eclipse.ui.ide,
|
||||
org.eclipse.cdt.debug.core,
|
||||
org.eclipse.cdt.dsf.gdb
|
||||
org.eclipse.cdt.dsf.gdb,
|
||||
org.eclipse.cdt.dsf.gdb.ui
|
||||
Eclipse-LazyStart: true
|
||||
Bundle-Vendor: %providerName
|
||||
Export-Package: org.eclipse.cdt.debug.gdbjtag.ui
|
||||
|
|
|
@ -15,3 +15,9 @@ providerName=Eclipse CDT
|
|||
AbatronBDI2000.name=Abatron BDI2000
|
||||
MacraigorUsb2Demon.name=Macraigor USB2Demon
|
||||
Generic.name=Generic
|
||||
|
||||
launchtab.cmaintab.name=Main
|
||||
launchtab.debuggertab.name=Debugger
|
||||
launchtab.startuptab.name=Startup
|
||||
launchTab.sourceLookup.name=Source
|
||||
launchTab.common.name=Common
|
|
@ -39,5 +39,122 @@
|
|||
name="%MacraigorUsb2Demon.name">
|
||||
</device>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.debug.ui.launchConfigurationTabs">
|
||||
<tab
|
||||
class="org.eclipse.cdt.debug.gdbjtag.ui.GDBJtagCDICMainTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.cmaintab.cdi"
|
||||
name="%launchtab.cmaintab.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.cdiLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.cdt.debug.gdbjtag.ui.GDBJtagDebuggerTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.cdi"
|
||||
name="%launchtab.debuggertab.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.cdiLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
<placement
|
||||
after="org.eclipse.cdt.cdi.launch.mainTab">
|
||||
</placement>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.cdt.debug.gdbjtag.ui.GDBJtagStartupTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.startuptab.cdi"
|
||||
name="%launchtab.startuptab.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.cdiLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
<placement
|
||||
after="org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.cdi">
|
||||
</placement>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.debug.ui.sourcelookup.SourceLookupTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.sourcelookuptab.cdi"
|
||||
name="%launchTab.sourceLookup.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.cdiLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
<placement
|
||||
after="org.eclipse.cdt.debug.gdbjtag.ui.startuptab">
|
||||
</placement>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.debug.ui.CommonTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.commontab.cdi"
|
||||
name="%launchTab.common.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.cdiLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
<placement
|
||||
after="org.eclipse.debug.ui.sourceLookupTab">
|
||||
</placement>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.cdt.debug.gdbjtag.ui.GDBJtagDSFCMainTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.cmaintab.dsf"
|
||||
name="%launchtab.cmaintab.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.cdt.debug.gdbjtag.ui.GDBJtagDSFDebuggerTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.dsf"
|
||||
name="%launchtab.debuggertab.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
<placement
|
||||
after="org.eclipse.cdt.dsf.gdb.launch.mainTab">
|
||||
</placement>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.cdt.debug.gdbjtag.ui.GDBJtagStartupTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.startuptab.dsf"
|
||||
name="%launchtab.startuptab.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
<placement
|
||||
after="org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.dsf">
|
||||
</placement>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.debug.ui.sourcelookup.SourceLookupTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.sourcelookuptab.dsf"
|
||||
name="%launchTab.sourceLookup.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
<placement
|
||||
after="org.eclipse.cdt.debug.gdbjtag.ui.startuptab">
|
||||
</placement>
|
||||
</tab>
|
||||
<tab
|
||||
class="org.eclipse.debug.ui.CommonTab"
|
||||
group="org.eclipse.cdt.debug.gdbjtag.launchConfigurationTabGroup"
|
||||
id="org.eclipse.cdt.debug.gdbjtag.ui.commontab.dsf"
|
||||
name="%launchTab.common.name">
|
||||
<associatedDelegate
|
||||
delegate="org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate">
|
||||
</associatedDelegate>
|
||||
<placement
|
||||
after="org.eclipse.debug.ui.sourceLookupTab">
|
||||
</placement>
|
||||
</tab>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 - 2010 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 implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||
|
||||
import org.eclipse.cdt.launch.ui.CMainTab;
|
||||
|
||||
public class GDBJtagCDICMainTab extends CMainTab {
|
||||
|
||||
public GDBJtagCDICMainTab() {
|
||||
super(CMainTab.DONT_CHECK_PROGRAM);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 - 2010 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 implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.eclipse.cdt.dsf.gdb.internal.ui.launching.CMainTab;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||
import org.eclipse.debug.core.ILaunchDelegate;
|
||||
|
||||
public class GDBJtagDSFCMainTab extends CMainTab {
|
||||
|
||||
public GDBJtagDSFCMainTab() {
|
||||
super(CMainTab.DONT_CHECK_PROGRAM | CMainTab.INCLUDE_BUILD_SETTINGS);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.dsf.gdb.internal.ui.launching.CMainTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
|
||||
*/
|
||||
@Override
|
||||
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
|
||||
super.setDefaults(config);
|
||||
HashSet<String> set = new HashSet<String>();
|
||||
set.add(getLaunchConfigurationDialog().getMode());
|
||||
try {
|
||||
ILaunchDelegate preferredDelegate = config.getPreferredDelegate(set);
|
||||
if (preferredDelegate == null) {
|
||||
config.setPreferredLaunchDelegate(set, "org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate"); //$NON-NLS-1$
|
||||
}
|
||||
} catch (CoreException e) {}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,318 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 - 2010 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 implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.Activator;
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants;
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContribution;
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContributionFactory;
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice;
|
||||
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.core.command.factories.CommandFactoryManager;
|
||||
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
||||
import org.eclipse.debug.ui.StringVariableSelectionDialog;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.ScrolledComposite;
|
||||
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.VerifyEvent;
|
||||
import org.eclipse.swt.events.VerifyListener;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
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.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||
|
||||
private static final String TAB_NAME = "Debugger";
|
||||
private static final String TAB_ID = "org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.dsf";
|
||||
|
||||
private Text gdbCommand;
|
||||
private Button useRemote;
|
||||
private Text ipAddress;
|
||||
private Text portNumber;
|
||||
private Combo jtagDevice;
|
||||
private String savedJtagDevice;
|
||||
|
||||
|
||||
public String getName() {
|
||||
return TAB_NAME;
|
||||
}
|
||||
|
||||
public Image getImage() {
|
||||
return GDBJtagImages.getDebuggerTabImage();
|
||||
}
|
||||
|
||||
public void createControl(Composite parent) {
|
||||
ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
|
||||
sc.setExpandHorizontal(true);
|
||||
sc.setExpandVertical(true);
|
||||
setControl(sc);
|
||||
|
||||
Composite comp = new Composite(sc, SWT.NONE);
|
||||
sc.setContent(comp);
|
||||
GridLayout layout = new GridLayout();
|
||||
comp.setLayout(layout);
|
||||
|
||||
Group group = new Group(comp, SWT.NONE);
|
||||
layout = new GridLayout();
|
||||
group.setLayout(layout);
|
||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
group.setLayoutData(gd);
|
||||
group.setText(Messages.getString("GDBJtagDebuggerTab.gdbSetupGroup_Text"));
|
||||
|
||||
createCommandControl(group);
|
||||
createRemoteControl(comp);
|
||||
}
|
||||
|
||||
private void browseButtonSelected(String title, Text text) {
|
||||
FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
|
||||
dialog.setText(title);
|
||||
String str = text.getText().trim();
|
||||
int lastSeparatorIndex = str.lastIndexOf(File.separator);
|
||||
if (lastSeparatorIndex != -1)
|
||||
dialog.setFilterPath(str.substring(0, lastSeparatorIndex));
|
||||
str = dialog.open();
|
||||
if (str != null)
|
||||
text.setText(str);
|
||||
}
|
||||
|
||||
private void variablesButtonSelected(Text text) {
|
||||
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(
|
||||
getShell());
|
||||
if (dialog.open() == StringVariableSelectionDialog.OK) {
|
||||
text.append(dialog.getVariableExpression());
|
||||
}
|
||||
}
|
||||
|
||||
private void createCommandControl(Composite parent) {
|
||||
Composite comp = new Composite(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.numColumns = 3;
|
||||
comp.setLayout(layout);
|
||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.horizontalSpan = 1;
|
||||
comp.setLayoutData(gd);
|
||||
|
||||
Label label = new Label(comp, SWT.NONE);
|
||||
label.setText(Messages.getString("GDBJtagDebuggerTab.gdbCommandLabel"));
|
||||
gd = new GridData();
|
||||
gd.horizontalSpan = 3;
|
||||
label.setLayoutData(gd);
|
||||
|
||||
gdbCommand = new Text(comp, SWT.SINGLE | SWT.BORDER);
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gdbCommand.setLayoutData(gd);
|
||||
gdbCommand.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
|
||||
Button button = new Button(comp, SWT.NONE);
|
||||
button.setText(Messages.getString("GDBJtagDebuggerTab.gdbCommandBrowse"));
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
browseButtonSelected(Messages.getString("GDBJtagDebuggerTab.gdbCommandBrowse_Title"), gdbCommand);
|
||||
}
|
||||
});
|
||||
|
||||
button = new Button(comp, SWT.NONE);
|
||||
button.setText(Messages.getString("GDBJtagDebuggerTab.gdbCommandVariable"));
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
variablesButtonSelected(gdbCommand);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createRemoteControl(Composite parent) {
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout();
|
||||
group.setLayout(layout);
|
||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
group.setLayoutData(gd);
|
||||
group.setText(Messages.getString("GDBJtagDebuggerTab.remoteGroup_Text"));
|
||||
|
||||
useRemote = new Button(group, SWT.CHECK);
|
||||
useRemote.setText(Messages.getString("GDBJtagDebuggerTab.useRemote_Text"));
|
||||
useRemote.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
useRemoteChanged();
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
|
||||
Composite comp = new Composite(group, SWT.NONE);
|
||||
layout = new GridLayout();
|
||||
layout.numColumns = 2;
|
||||
comp.setLayout(layout);
|
||||
|
||||
Label label = new Label(comp, SWT.NONE);
|
||||
label.setText(Messages.getString("GDBJtagDebuggerTab.jtagDeviceLabel"));
|
||||
|
||||
jtagDevice = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN);
|
||||
|
||||
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.
|
||||
getInstance().getGDBJtagDeviceContribution();
|
||||
for (int i = 0; i < availableDevices.length; i++) {
|
||||
jtagDevice.add(availableDevices[i].getDeviceName());
|
||||
}
|
||||
|
||||
jtagDevice.select(0);
|
||||
jtagDevice.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
updateDeviceIpPort(jtagDevice.getText());
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
|
||||
label = new Label(comp, SWT.NONE);
|
||||
label.setText(Messages.getString("GDBJtagDebuggerTab.ipAddressLabel"));
|
||||
ipAddress = new Text(comp, SWT.BORDER);
|
||||
gd = new GridData();
|
||||
gd.widthHint = 100;
|
||||
ipAddress.setLayoutData(gd);
|
||||
ipAddress.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
|
||||
label = new Label(comp, SWT.NONE);
|
||||
label.setText(Messages.getString("GDBJtagDebuggerTab.portNumberLabel"));
|
||||
portNumber = new Text(comp, SWT.BORDER);
|
||||
gd = new GridData();
|
||||
gd.widthHint = 100;
|
||||
portNumber.setLayoutData(gd);
|
||||
portNumber.addVerifyListener(new VerifyListener() {
|
||||
public void verifyText(VerifyEvent e) {
|
||||
e.doit = Character.isDigit(e.character) || Character.isISOControl(e.character);
|
||||
}
|
||||
});
|
||||
portNumber.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param text
|
||||
*/
|
||||
protected void updateDeviceIpPort(String selectedDeviceName) {
|
||||
if (selectedDeviceName.equals(savedJtagDevice)) {
|
||||
return;
|
||||
}
|
||||
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
|
||||
.getGDBJtagDeviceContribution();
|
||||
IGDBJtagDevice selectedDevice = null;
|
||||
for (int i = 0; i < availableDevices.length; i++) {
|
||||
String name = availableDevices[i].getDeviceName();
|
||||
if (name.equals(selectedDeviceName)) {
|
||||
selectedDevice = availableDevices[i].getDevice();
|
||||
if (selectedDevice != null) {
|
||||
String ip = selectedDevice.getDefaultIpAddress();
|
||||
ipAddress.setText(ip);
|
||||
String port = selectedDevice.getDefaultPortNumber();
|
||||
portNumber.setText(port);
|
||||
updateLaunchConfigurationDialog();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void useRemoteChanged() {
|
||||
boolean enabled = useRemote.getSelection();
|
||||
jtagDevice.setEnabled(enabled);
|
||||
ipAddress.setEnabled(enabled);
|
||||
portNumber.setEnabled(enabled);
|
||||
}
|
||||
|
||||
public void initializeFrom(ILaunchConfiguration configuration) {
|
||||
try {
|
||||
String gdbCommandAttr = configuration.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
|
||||
gdbCommand.setText(gdbCommandAttr);
|
||||
|
||||
boolean useRemoteAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
|
||||
useRemote.setSelection(useRemoteAttr);
|
||||
useRemoteChanged();
|
||||
|
||||
String ipAddressAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS);
|
||||
ipAddress.setText(ipAddressAttr);
|
||||
|
||||
int portNumberAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER);
|
||||
portNumber.setText(String.valueOf(portNumberAttr));
|
||||
|
||||
savedJtagDevice = configuration.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, "");
|
||||
for (int i = 0; i < jtagDevice.getItemCount(); i++) {
|
||||
if (jtagDevice.getItem(i).equals(savedJtagDevice)) {
|
||||
jtagDevice.select(i);
|
||||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
Activator.getDefault().getLog().log(e.getStatus());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
|
||||
*/
|
||||
@Override
|
||||
public String getId() {
|
||||
return TAB_ID;
|
||||
}
|
||||
|
||||
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
|
||||
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbCommand.getText().trim());
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbCommand.getText().trim()); // DSF
|
||||
savedJtagDevice = jtagDevice.getText();
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, savedJtagDevice);
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, useRemote.getSelection());
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, ipAddress.getText().trim());
|
||||
try {
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, Integer.parseInt(portNumber.getText().trim()));
|
||||
} catch (NumberFormatException e) {
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
|
||||
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
|
||||
CommandFactoryManager cfManager = MIPlugin.getDefault().getCommandFactoryManager();
|
||||
CommandFactoryDescriptor defDesc = cfManager.getDefaultDescriptor(IGDBJtagConstants.DEBUGGER_ID);
|
||||
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, defDesc.getName());
|
||||
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, defDesc.getMIVersions()[0]);
|
||||
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, IMILaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT);
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS);
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 - 2008 QNX Software Systems and others.
|
||||
* Copyright (c) 2007 - 2010 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
|
||||
|
@ -57,6 +57,7 @@ import org.eclipse.swt.widgets.Text;
|
|||
public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||
|
||||
private static final String TAB_NAME = "Debugger";
|
||||
private static final String TAB_ID = "org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.cdi";
|
||||
|
||||
private CommandFactoryDescriptor[] cfDescs;
|
||||
|
||||
|
@ -387,6 +388,14 @@ public class GDBJtagDebuggerTab extends AbstractLaunchConfigurationTab {
|
|||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
|
||||
*/
|
||||
@Override
|
||||
public String getId() {
|
||||
return TAB_ID;
|
||||
}
|
||||
|
||||
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
|
||||
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbCommand.getText().trim());
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbCommand.getText().trim()); // DSF
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 QNX Software Systems and others.
|
||||
* Copyright (c) 2007 - 2010 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
|
||||
|
@ -7,16 +7,14 @@
|
|||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Andy Jin - Changes to hold tab contributions from extension, bug 248593
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||
|
||||
import org.eclipse.cdt.launch.ui.CMainTab;
|
||||
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
|
||||
import org.eclipse.debug.ui.CommonTab;
|
||||
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
|
||||
import org.eclipse.debug.ui.ILaunchConfigurationTab;
|
||||
import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
|
||||
|
||||
/**
|
||||
* @author Doug Schaefer
|
||||
|
@ -26,14 +24,7 @@ public class GDBJtagLaunchConfigurationTabGroup extends
|
|||
AbstractLaunchConfigurationTabGroup {
|
||||
|
||||
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
|
||||
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
|
||||
new CMainTab(CMainTab.DONT_CHECK_PROGRAM),
|
||||
new GDBJtagDebuggerTab(),
|
||||
new GDBJtagStartupTab(),
|
||||
new SourceLookupTab(),
|
||||
new CommonTab()
|
||||
};
|
||||
setTabs(tabs);
|
||||
setTabs(new ILaunchConfigurationTab[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 - 2008 QNX Software Systems and others.
|
||||
* Copyright (c) 2007 - 2010 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
|
||||
|
@ -8,6 +8,7 @@
|
|||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Andy Jin - Hardware debugging UI improvements, bug 229946
|
||||
* Andy Jin - Added DSF debugging, bug 248593
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||
|
@ -51,6 +52,7 @@ import org.eclipse.ui.views.navigator.ResourceComparator;
|
|||
public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
||||
|
||||
private static final String TAB_NAME = "Startup";
|
||||
private static final String TAB_ID = "org.eclipse.cdt.debug.gdbjtag.ui.startuptab";
|
||||
|
||||
Text initCommands;
|
||||
Text delay;
|
||||
|
@ -65,6 +67,7 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
|||
|
||||
Button loadSymbols;
|
||||
Text symbolsFileName;
|
||||
|
||||
Button symbolsFileBrowseWs;
|
||||
Button symbolsFileBrowse;
|
||||
Text symbolsOffset;
|
||||
|
@ -528,6 +531,14 @@ public class GDBJtagStartupTab extends AbstractLaunchConfigurationTab {
|
|||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
|
||||
*/
|
||||
@Override
|
||||
public String getId() {
|
||||
return TAB_ID;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue