mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 535143: Support multiple remote debug protocols
Change-Id: If3362e3742aa05a8577faa217b46c41dcddb792f
This commit is contained in:
parent
a1c02e2cce
commit
90627bfa83
17 changed files with 284 additions and 111 deletions
|
@ -2,14 +2,14 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core.tests;singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core.tests;singleton:=true
|
||||||
Bundle-Version: 1.0.300.qualifier
|
Bundle-Version: 1.0.400.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.tests.Activator
|
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.tests.Activator
|
||||||
Require-Bundle: org.eclipse.core.runtime,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
org.eclipse.cdt.tests.dsf.gdb;bundle-version="2.3.0",
|
org.eclipse.cdt.tests.dsf.gdb;bundle-version="2.3.0",
|
||||||
org.junit,
|
org.junit,
|
||||||
org.eclipse.cdt.debug.core,
|
org.eclipse.cdt.debug.core,
|
||||||
org.eclipse.cdt.dsf.gdb,
|
org.eclipse.cdt.dsf.gdb,
|
||||||
org.eclipse.cdt.debug.gdbjtag.core;bundle-version="9.2.1",
|
org.eclipse.cdt.debug.gdbjtag.core;bundle-version="10.6.0",
|
||||||
org.eclipse.cdt.dsf,
|
org.eclipse.cdt.dsf,
|
||||||
org.eclipse.cdt.launch,
|
org.eclipse.cdt.launch,
|
||||||
org.eclipse.debug.core
|
org.eclipse.debug.core
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<version>1.0.300-SNAPSHOT</version>
|
<version>1.0.400-SNAPSHOT</version>
|
||||||
<artifactId>org.eclipse.cdt.debug.gdbjtag.core.tests</artifactId>
|
<artifactId>org.eclipse.cdt.debug.gdbjtag.core.tests</artifactId>
|
||||||
<packaging>eclipse-test-plugin</packaging>
|
<packaging>eclipse-test-plugin</packaging>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2012, 2018 Ericsson and others.
|
* Copyright (c) 2012, 2022 Ericsson and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
* Marc Khouzam (Ericsson) - Base Implementation
|
* Marc Khouzam (Ericsson) - Base Implementation
|
||||||
* John Dallaway - GDB JTAG Implementation (bug 538282)
|
* John Dallaway - GDB JTAG Implementation (bug 538282)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.gdbjtag.core.tests.launch;
|
package org.eclipse.cdt.debug.gdbjtag.core.tests;
|
||||||
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Suite;
|
import org.junit.runners.Suite;
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2016, 2018 QNX Software System and others.
|
* Copyright (c) 2016, 2022 QNX Software System and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -12,8 +12,10 @@
|
||||||
* Elena Laskavaia (QNX Software System) - Base API and implementation
|
* Elena Laskavaia (QNX Software System) - Base API and implementation
|
||||||
* John Dallaway - GDB JTAG implementation (bug 538282)
|
* John Dallaway - GDB JTAG implementation (bug 538282)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.gdbjtag.core.tests.launch;
|
package org.eclipse.cdt.debug.gdbjtag.core.tests;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.gdbjtag.core.tests.jtagdevice.GDBJtagDeviceContributionTest;
|
||||||
|
import org.eclipse.cdt.debug.gdbjtag.core.tests.launch.GDBJtagLaunchTest;
|
||||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseParametrizedTestCase;
|
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseParametrizedTestCase;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
@ -21,7 +23,7 @@ import org.junit.runners.Suite;
|
||||||
|
|
||||||
@SuppressWarnings("restriction")
|
@SuppressWarnings("restriction")
|
||||||
@RunWith(Suite.class)
|
@RunWith(Suite.class)
|
||||||
@Suite.SuiteClasses({ GDBJtagLaunchTest.class })
|
@Suite.SuiteClasses({ GDBJtagDeviceContributionTest.class, GDBJtagLaunchTest.class })
|
||||||
|
|
||||||
public class SuiteGDBJtag {
|
public class SuiteGDBJtag {
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2022 John Dallaway and others.
|
||||||
|
*
|
||||||
|
* This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* https://www.eclipse.org/legal/epl-2.0/
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: EPL-2.0
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* John Dallaway - Initial implementation (Bug 535143)
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.gdbjtag.core.tests.jtagdevice;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConnection;
|
||||||
|
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContribution;
|
||||||
|
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContributionFactory;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
public class GDBJtagDeviceContributionTest extends TestCase {
|
||||||
|
|
||||||
|
private static final String TEST_JTAG_DEVICE_ID = "org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"; //$NON-NLS-1$
|
||||||
|
private static final String EXPECTED_PROTOCOLS = "remote,extended-remote"; //$NON-NLS-1$
|
||||||
|
private static final String EXPECTED_DEFAULT_CONNECTION = "localhost:1234"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGdbJtagDeviceContribution() {
|
||||||
|
final GDBJtagDeviceContribution contribution = GDBJtagDeviceContributionFactory.getInstance()
|
||||||
|
.findByDeviceId(TEST_JTAG_DEVICE_ID);
|
||||||
|
assertNotNull(contribution);
|
||||||
|
final IGDBJtagConnection device = (IGDBJtagConnection) contribution.getDevice();
|
||||||
|
assertArrayEquals(EXPECTED_PROTOCOLS.split(","), device.getDeviceProtocols());
|
||||||
|
assertEquals(EXPECTED_DEFAULT_CONNECTION, device.getDefaultDeviceConnection());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<component id="org.eclipse.cdt.debug.gdbjtag.core" version="2">
|
||||||
|
<resource path="src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConnection.java" type="org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConnection">
|
||||||
|
<filter id="404000815">
|
||||||
|
<message_arguments>
|
||||||
|
<message_argument value="org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConnection"/>
|
||||||
|
<message_argument value="doTarget(String, String, Collection<String>)"/>
|
||||||
|
</message_arguments>
|
||||||
|
</filter>
|
||||||
|
<filter id="404000815">
|
||||||
|
<message_arguments>
|
||||||
|
<message_argument value="org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConnection"/>
|
||||||
|
<message_argument value="getDeviceProtocols()"/>
|
||||||
|
</message_arguments>
|
||||||
|
</filter>
|
||||||
|
<filter id="404000815">
|
||||||
|
<message_arguments>
|
||||||
|
<message_argument value="org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConnection"/>
|
||||||
|
<message_argument value="setDeviceProtocols(String[])"/>
|
||||||
|
</message_arguments>
|
||||||
|
</filter>
|
||||||
|
</resource>
|
||||||
|
</component>
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true
|
||||||
Bundle-Version: 10.5.300.qualifier
|
Bundle-Version: 10.6.0.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
|
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
Require-Bundle: org.eclipse.core.runtime,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
|
|
|
@ -27,63 +27,73 @@
|
||||||
point="org.eclipse.cdt.debug.gdbjtag.core.JTagDevice">
|
point="org.eclipse.cdt.debug.gdbjtag.core.JTagDevice">
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GenericDevice"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GenericDevice"
|
||||||
default_connection="localhost:10000"
|
default_connection="localhost:1234"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"
|
||||||
name="%Generic.name">
|
name="%Generic.name"
|
||||||
|
protocols="remote,extended-remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.AbatronBDI2000"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.AbatronBDI2000"
|
||||||
default_connection="bdi2000:2001"
|
default_connection="bdi2000:2001"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.AbatronBDI2000"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.AbatronBDI2000"
|
||||||
name="%AbatronBDI2000.name">
|
name="%AbatronBDI2000.name"
|
||||||
|
protocols="remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.MacraigorUsb2Demon"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.MacraigorUsb2Demon"
|
||||||
default_connection="localhost:8888"
|
default_connection="localhost:8888"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.MacraigorUsb2Demon"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.MacraigorUsb2Demon"
|
||||||
name="%MacraigorUsb2Demon.name">
|
name="%MacraigorUsb2Demon.name"
|
||||||
|
protocols="remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.DefaultGDBJtagConnectionImpl"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.DefaultGDBJtagConnectionImpl"
|
||||||
default_connection="/dev/com1"
|
default_connection="COM1"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GenericSerial"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GenericSerial"
|
||||||
name="%GenericSerial.name">
|
name="%GenericSerial.name"
|
||||||
|
protocols="remote,extended-remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDPipe"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDPipe"
|
||||||
default_connection="| openocd --pipe"
|
default_connection="| openocd --pipe"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCD"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCD"
|
||||||
name="%OpenOCDPipe.name">
|
name="%OpenOCDPipe.name"
|
||||||
|
protocols="remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"
|
||||||
default_connection="localhost:3333"
|
default_connection="localhost:3333"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"
|
||||||
name="%OpenOCDSocket.name">
|
name="%OpenOCDSocket.name"
|
||||||
|
protocols="remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PEMicro"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PEMicro"
|
||||||
default_connection="localhost:7224"
|
default_connection="localhost:7224"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PEMicro"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PEMicro"
|
||||||
name="%PEMicro.name">
|
name="%PEMicro.name"
|
||||||
|
protocols="remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PyOCD"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PyOCD"
|
||||||
default_connection="localhost:3333"
|
default_connection="localhost:3333"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PyOCD"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.PyOCD"
|
||||||
name="%PyOCD.name">
|
name="%PyOCD.name"
|
||||||
|
protocols="remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.SeggerJLink"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.SeggerJLink"
|
||||||
default_connection="localhost:2331"
|
default_connection="localhost:2331"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.SeggerJLink"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.SeggerJLink"
|
||||||
name="%SeggerJLink.name">
|
name="%SeggerJLink.name"
|
||||||
|
protocols="remote">
|
||||||
</device>
|
</device>
|
||||||
<device
|
<device
|
||||||
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.STLink"
|
class="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.STLink"
|
||||||
default_connection="localhost:61234"
|
default_connection="localhost:61234"
|
||||||
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.STLink"
|
id="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.STLink"
|
||||||
name="%STLink.name">
|
name="%STLink.name"
|
||||||
|
protocols="remote">
|
||||||
</device>
|
</device>
|
||||||
</extension>
|
</extension>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -80,6 +80,13 @@
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<attribute name="protocols" type="string">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
The comma-separated set of GDB target types (protocols) supported by the JTAG device. If omitted, the "remote" protocol is assumed.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
</complexType>
|
</complexType>
|
||||||
</element>
|
</element>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2021 QNX Software Systems and others.
|
* Copyright (c) 2007, 2022 QNX Software Systems and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
* John Dallaway - Eliminate deprecated API (Bug 566462)
|
* John Dallaway - Eliminate deprecated API (Bug 566462)
|
||||||
* John Dallaway - Set executable file (Bug 457697)
|
* John Dallaway - Set executable file (Bug 457697)
|
||||||
* John Dallaway - Initialize memory data before connecting to target (Bug 575934)
|
* John Dallaway - Initialize memory data before connecting to target (Bug 575934)
|
||||||
|
* John Dallaway - Support multiple remote debug protocols (Bug 535143)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.gdbjtag.core;
|
package org.eclipse.cdt.debug.gdbjtag.core;
|
||||||
|
|
||||||
|
@ -421,8 +422,10 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
|
||||||
connection = String.format("%s:%d", ipAddress, portNumber); //$NON-NLS-1$
|
connection = String.format("%s:%d", ipAddress, portNumber); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String protocol = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_PROTOCOL,
|
||||||
|
IGDBJtagConstants.DEFAULT_PROTOCOL);
|
||||||
IGDBJtagConnection device = (IGDBJtagConnection) fGdbJtagDevice;
|
IGDBJtagConnection device = (IGDBJtagConnection) fGdbJtagDevice;
|
||||||
device.doRemote(connection, commands);
|
device.doTarget(protocol, connection, commands);
|
||||||
queueCommands(commands, rm);
|
queueCommands(commands, rm);
|
||||||
} else {
|
} else {
|
||||||
rm.done();
|
rm.done();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008-2010 QNX Software Systems and others.
|
* Copyright (c) 2008, 2022 QNX Software Systems and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
* Sage Electronic Engineering, LLC - bug 305943
|
* Sage Electronic Engineering, LLC - bug 305943
|
||||||
* - API generalization to become transport-independent (e.g. to
|
* - API generalization to become transport-independent (e.g. to
|
||||||
* allow connections via serial ports and pipes).
|
* allow connections via serial ports and pipes).
|
||||||
|
* John Dallaway - Support multiple remote debug protocols - bug 535143
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.debug.gdbjtag.core;
|
package org.eclipse.cdt.debug.gdbjtag.core;
|
||||||
|
@ -22,25 +23,52 @@ import java.util.Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides device specific debug commands for different hardware
|
* Provides device specific debug commands for different hardware
|
||||||
* JTAG devices. See <code>DefaultGDBJtagDeviceImpl</code> for
|
* JTAG devices. See <code>DefaultGDBJtagConnectionImpl</code> for
|
||||||
* the default implementations.
|
* the default implementation.
|
||||||
* @since 7.0
|
* @since 7.0
|
||||||
*/
|
*/
|
||||||
public interface IGDBJtagConnection {
|
public interface IGDBJtagConnection {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used during instantiation to set the supported protocol strings from XML
|
||||||
|
* @param protocols
|
||||||
|
* the array of supported protocols (default protocol first)
|
||||||
|
* @since 10.6
|
||||||
|
*/
|
||||||
|
default void setDeviceProtocols(String[] protocols) {
|
||||||
|
// not implemented
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used during instantiation to set the device default connection string from XML
|
* Used during instantiation to set the device default connection string from XML
|
||||||
* @param connection A device specific default connection string that GDB understands
|
* @param connection
|
||||||
|
* the GDB string describing the default connection to the target
|
||||||
*/
|
*/
|
||||||
public void setDefaultDeviceConnection(String connection);
|
public void setDefaultDeviceConnection(String connection);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Commands to connect to remote JTAG device
|
* Commands to connect to remote JTAG device
|
||||||
* @param connection defines the gdb string required to establish a connection to the target
|
* @param connection
|
||||||
* @param commands gdb commands to execute on the remote device (usually the target probe)
|
* the GDB string describing the connection to the target
|
||||||
|
* @param commands
|
||||||
|
* implementation should populate the collection with the gdb
|
||||||
|
* commands that will connect to the JTAG device using the remote
|
||||||
|
* protocol, or leave the collection as-is if that operation is
|
||||||
|
* either unsupported or not applicable
|
||||||
|
* @deprecated call or override {@link #doTarget(String, String, Collection)} instead
|
||||||
*/
|
*/
|
||||||
|
@Deprecated(since = "10.6")
|
||||||
public void doRemote(String connection, Collection<String> commands);
|
public void doRemote(String connection, Collection<String> commands);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supported protocols used by GDB to connect to a device
|
||||||
|
* @return the array of supported protocols (default protocol first)
|
||||||
|
* @since 10.6
|
||||||
|
*/
|
||||||
|
default String[] getDeviceProtocols() {
|
||||||
|
return new String[] { "remote" }; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Host specific default device name used by GDB to connect to a device
|
* Host specific default device name used by GDB to connect to a device
|
||||||
* @return identifier for the remote device. It is up to GDB to figure out how to interpret
|
* @return identifier for the remote device. It is up to GDB to figure out how to interpret
|
||||||
|
@ -48,4 +76,23 @@ public interface IGDBJtagConnection {
|
||||||
*/
|
*/
|
||||||
public String getDefaultDeviceConnection();
|
public String getDefaultDeviceConnection();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Commands to connect to remote JTAG device
|
||||||
|
* @param protocol
|
||||||
|
* the GDB string describing the communication protocol between host and target
|
||||||
|
* @param connection
|
||||||
|
* the GDB string required to establish a connection to the target
|
||||||
|
* @param commands
|
||||||
|
* implementation should populate the collection with the gdb
|
||||||
|
* commands that will connect to the JTAG device, or leave
|
||||||
|
* the collection as-is if that operation is either unsupported
|
||||||
|
* or not applicable
|
||||||
|
* @since 10.6
|
||||||
|
*/
|
||||||
|
default void doTarget(String protocol, String connection, Collection<String> commands) {
|
||||||
|
if ("remote".equals(protocol)) { //$NON-NLS-1$
|
||||||
|
doRemote(connection, commands);
|
||||||
|
} // else protocol not supported
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 - 2020 QNX Software Systems and others.
|
* Copyright (c) 2007, 2022 QNX Software Systems and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
|
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
|
||||||
* John Dallaway - Sort JTAG device list, bug 560186
|
* John Dallaway - Sort JTAG device list, bug 560186
|
||||||
* John Dallaway - Eliminate deprecated API, bug 566462
|
* John Dallaway - Eliminate deprecated API, bug 566462
|
||||||
|
* John Dallaway - Support multiple remote debug protocols, bug 535143
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.debug.gdbjtag.core;
|
package org.eclipse.cdt.debug.gdbjtag.core;
|
||||||
|
@ -52,6 +53,8 @@ public interface IGDBJtagConstants {
|
||||||
public static final String ATTR_STOP_AT = Activator.PLUGIN_ID + ".stopAt"; //$NON-NLS-1$
|
public static final String ATTR_STOP_AT = Activator.PLUGIN_ID + ".stopAt"; //$NON-NLS-1$
|
||||||
public static final String ATTR_SET_RESUME = Activator.PLUGIN_ID + ".setResume"; //$NON-NLS-1$
|
public static final String ATTR_SET_RESUME = Activator.PLUGIN_ID + ".setResume"; //$NON-NLS-1$
|
||||||
public static final String ATTR_RUN_COMMANDS = Activator.PLUGIN_ID + ".runCommands"; //$NON-NLS-1$
|
public static final String ATTR_RUN_COMMANDS = Activator.PLUGIN_ID + ".runCommands"; //$NON-NLS-1$
|
||||||
|
/** @since 10.6 */
|
||||||
|
public static final String ATTR_PROTOCOL = Activator.PLUGIN_ID + ".protocol"; //$NON-NLS-1$
|
||||||
/** @since 7.0 */
|
/** @since 7.0 */
|
||||||
public static final String ATTR_CONNECTION = Activator.PLUGIN_ID + ".connection"; //$NON-NLS-1$
|
public static final String ATTR_CONNECTION = Activator.PLUGIN_ID + ".connection"; //$NON-NLS-1$
|
||||||
/** @since 7.0 */
|
/** @since 7.0 */
|
||||||
|
@ -73,6 +76,8 @@ public interface IGDBJtagConstants {
|
||||||
public static final boolean DEFAULT_SET_RESUME = false;
|
public static final boolean DEFAULT_SET_RESUME = false;
|
||||||
public static final boolean DEFAULT_USE_DEFAULT_RUN = true;
|
public static final boolean DEFAULT_USE_DEFAULT_RUN = true;
|
||||||
|
|
||||||
|
/** @since 10.6 */
|
||||||
|
public static final String DEFAULT_PROTOCOL = "remote"; //$NON-NLS-1$
|
||||||
/** @since 7.0 */
|
/** @since 7.0 */
|
||||||
public static final String DEFAULT_CONNECTION = "unspecified-ip-address:unspecified-port-number"; //$NON-NLS-1$
|
public static final String DEFAULT_CONNECTION = "unspecified-ip-address:unspecified-port-number"; //$NON-NLS-1$
|
||||||
/** @since 7.0 */
|
/** @since 7.0 */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2010, 2020 Sage Electronic Engineering and others.
|
* Copyright (c) 2010, 2022 Sage Electronic Engineering and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
* - API generalization to become transport-independent (e.g. to
|
* - API generalization to become transport-independent (e.g. to
|
||||||
* allow connections via serial ports and pipes).
|
* allow connections via serial ports and pipes).
|
||||||
* John Dallaway - Eliminate deprecated API - bug 566462
|
* John Dallaway - Eliminate deprecated API - bug 566462
|
||||||
|
* John Dallaway - Support multiple remote debug protocols - bug 535143
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
|
package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
|
||||||
|
@ -26,14 +27,24 @@ import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConnection;
|
||||||
*/
|
*/
|
||||||
public class DefaultGDBJtagConnectionImpl extends DefaultGDBJtagDeviceImpl implements IGDBJtagConnection {
|
public class DefaultGDBJtagConnectionImpl extends DefaultGDBJtagDeviceImpl implements IGDBJtagConnection {
|
||||||
|
|
||||||
|
private static final String PROTOCOL_REMOTE = "remote"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
private String[] protocols = new String[0];
|
||||||
protected String connection = null;
|
protected String connection = null;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void setDeviceProtocols(String[] protocols) {
|
||||||
|
this.protocols = protocols;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void setDefaultDeviceConnection(String connection) {
|
public final void setDefaultDeviceConnection(String connection) {
|
||||||
this.connection = connection;
|
this.connection = connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated call or override {@link #doTarget(String, String, Collection)} instead */
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated(since = "10.6")
|
||||||
public void doRemote(String connection, Collection<String> commands) {
|
public void doRemote(String connection, Collection<String> commands) {
|
||||||
String cmd = ""; //$NON-NLS-1$
|
String cmd = ""; //$NON-NLS-1$
|
||||||
if (connection != null) {
|
if (connection != null) {
|
||||||
|
@ -47,6 +58,21 @@ public class DefaultGDBJtagConnectionImpl extends DefaultGDBJtagDeviceImpl imple
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doTarget(String protocol, String connection, Collection<String> commands) {
|
||||||
|
if (PROTOCOL_REMOTE.equals(protocol)) {
|
||||||
|
doRemote(connection, commands); // use legacy method which may have been overridden
|
||||||
|
} else if ((connection != null) && (protocol != null)) {
|
||||||
|
String cmd = String.format("-target-select %s %s", protocol, connection); //$NON-NLS-1$
|
||||||
|
addCmd(commands, cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getDeviceProtocols() {
|
||||||
|
return protocols;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDefaultDeviceConnection() {
|
public String getDefaultDeviceConnection() {
|
||||||
return connection;
|
return connection;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008 - 2020 QNX Software Systems and others.
|
* Copyright (c) 2008, 2022 QNX Software Systems and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
* - API generalization to become transport-independent (allow
|
* - API generalization to become transport-independent (allow
|
||||||
* connections via serial ports and pipes).
|
* connections via serial ports and pipes).
|
||||||
* John Dallaway - Eliminate deprecated API - bug 566462
|
* John Dallaway - Eliminate deprecated API - bug 566462
|
||||||
|
* John Dallaway - Support multiple remote debug protocols - bug 535143
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
|
package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ public class GDBJtagDeviceContribution {
|
||||||
private IGDBJtagDevice device;
|
private IGDBJtagDevice device;
|
||||||
private String deviceClassBundleName;
|
private String deviceClassBundleName;
|
||||||
private String deviceDefaultConnection;
|
private String deviceDefaultConnection;
|
||||||
|
private String[] deviceProtocols;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the deviceId
|
* @return the deviceId
|
||||||
|
@ -98,6 +100,7 @@ public class GDBJtagDeviceContribution {
|
||||||
try {
|
try {
|
||||||
o = Platform.getBundle(deviceClassBundleName).loadClass(deviceClassName).getConstructor().newInstance();
|
o = Platform.getBundle(deviceClassBundleName).loadClass(deviceClassName).getConstructor().newInstance();
|
||||||
if (o instanceof IGDBJtagConnection) {
|
if (o instanceof IGDBJtagConnection) {
|
||||||
|
((IGDBJtagConnection) o).setDeviceProtocols(deviceProtocols);
|
||||||
((IGDBJtagConnection) o).setDefaultDeviceConnection(deviceDefaultConnection);
|
((IGDBJtagConnection) o).setDefaultDeviceConnection(deviceDefaultConnection);
|
||||||
}
|
}
|
||||||
device = (IGDBJtagDevice) o;
|
device = (IGDBJtagDevice) o;
|
||||||
|
@ -110,4 +113,14 @@ public class GDBJtagDeviceContribution {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since 10.6 */
|
||||||
|
public void setDeviceProtocols(String[] protocols) {
|
||||||
|
deviceProtocols = protocols;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @since 10.6 */
|
||||||
|
public String[] getDeviceProtocols() {
|
||||||
|
return deviceProtocols;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2018 QNX Software Systems and others.
|
* Copyright (c) 2008, 2022 QNX Software Systems and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -15,10 +15,12 @@
|
||||||
* - API generalization to become transport-independent (allow
|
* - API generalization to become transport-independent (allow
|
||||||
* connections via serial ports and pipes).
|
* connections via serial ports and pipes).
|
||||||
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
|
* Torbjörn Svensson (STMicroelectronics) - Bug 535024
|
||||||
|
* John Dallaway - Support multiple remote debug protocols - bug 535143
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
|
package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.gdbjtag.core.Activator;
|
import org.eclipse.cdt.debug.gdbjtag.core.Activator;
|
||||||
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants;
|
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants;
|
||||||
|
@ -60,11 +62,15 @@ public class GDBJtagDeviceContributionFactory {
|
||||||
String className = getRequired(configurationElement, "class"); //$NON-NLS-1$
|
String className = getRequired(configurationElement, "class"); //$NON-NLS-1$
|
||||||
String connection = getOptional(configurationElement, "default_connection", //$NON-NLS-1$
|
String connection = getOptional(configurationElement, "default_connection", //$NON-NLS-1$
|
||||||
IGDBJtagConstants.DEFAULT_CONNECTION);
|
IGDBJtagConstants.DEFAULT_CONNECTION);
|
||||||
|
String[] protocols = getOptional(configurationElement, "protocols", //$NON-NLS-1$
|
||||||
|
IGDBJtagConstants.DEFAULT_PROTOCOL).split(","); //$NON-NLS-1$
|
||||||
GDBJtagDeviceContribution adapter = new GDBJtagDeviceContribution();
|
GDBJtagDeviceContribution adapter = new GDBJtagDeviceContribution();
|
||||||
adapter.setDeviceId(id);
|
adapter.setDeviceId(id);
|
||||||
adapter.setDeviceName(name);
|
adapter.setDeviceName(name);
|
||||||
adapter.setDeviceClassName(className);
|
adapter.setDeviceClassName(className);
|
||||||
adapter.setDeviceDefaultConnection(connection);
|
adapter.setDeviceDefaultConnection(connection);
|
||||||
|
adapter.setDeviceProtocols(
|
||||||
|
Arrays.stream(protocols).map(String::trim).filter(s -> !s.isEmpty()).toArray(String[]::new));
|
||||||
adapter.setDeviceClassBundleName(configurationElement.getContributor().getName());
|
adapter.setDeviceClassBundleName(configurationElement.getContributor().getName());
|
||||||
addContribution(adapter);
|
addContribution(adapter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2021 QNX Software Systems and others.
|
* Copyright (c) 2007, 2022 QNX Software Systems and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* are made available under the terms of the Eclipse Public License 2.0
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
* John Dallaway - Sort JTAG device list, bug 560186
|
* John Dallaway - Sort JTAG device list, bug 560186
|
||||||
* John Dallaway - Eliminate deprecated API, bug 566462
|
* John Dallaway - Eliminate deprecated API, bug 566462
|
||||||
* John Dallaway - Eliminate pixel-level sizing, bug 567662
|
* John Dallaway - Eliminate pixel-level sizing, bug 567662
|
||||||
|
* John Dallaway - Support multiple remote debug protocols, bug 535143
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.debug.gdbjtag.ui;
|
package org.eclipse.cdt.debug.gdbjtag.ui;
|
||||||
|
@ -50,10 +51,11 @@ import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||||
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
||||||
import org.eclipse.debug.ui.StringVariableSelectionDialog;
|
import org.eclipse.debug.ui.StringVariableSelectionDialog;
|
||||||
import org.eclipse.jface.layout.GridDataFactory;
|
|
||||||
import org.eclipse.jface.layout.PixelConverter;
|
import org.eclipse.jface.layout.PixelConverter;
|
||||||
|
import org.eclipse.jface.viewers.ArrayContentProvider;
|
||||||
|
import org.eclipse.jface.viewers.ComboViewer;
|
||||||
|
import org.eclipse.jface.viewers.StructuredSelection;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.custom.StackLayout;
|
|
||||||
import org.eclipse.swt.events.ModifyEvent;
|
import org.eclipse.swt.events.ModifyEvent;
|
||||||
import org.eclipse.swt.events.ModifyListener;
|
import org.eclipse.swt.events.ModifyListener;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
|
@ -82,10 +84,11 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||||
|
|
||||||
private Text gdbCommand;
|
private Text gdbCommand;
|
||||||
private Button useRemote;
|
private Button useRemote;
|
||||||
|
private Label jtagDeviceLabel;
|
||||||
private Combo jtagDevice;
|
private Combo jtagDevice;
|
||||||
private Composite remoteConnectionParameters;
|
private Label protocolLabel;
|
||||||
private StackLayout remoteConnectParmsLayout;
|
private ComboViewer protocol;
|
||||||
private Composite remoteConnectionBox;
|
private Label connectionLabel;
|
||||||
private Text connection;
|
private Text connection;
|
||||||
private String savedJtagDevice;
|
private String savedJtagDevice;
|
||||||
protected Button fUpdateThreadlistOnSuspend;
|
protected Button fUpdateThreadlistOnSuspend;
|
||||||
|
@ -205,15 +208,13 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||||
|
|
||||||
private void createRemoteControl(Composite parent) {
|
private void createRemoteControl(Composite parent) {
|
||||||
Group group = new Group(parent, SWT.NONE);
|
Group group = new Group(parent, SWT.NONE);
|
||||||
GridLayout layout = new GridLayout(2, false);
|
GridLayout layout = new GridLayout();
|
||||||
group.setLayout(layout);
|
group.setLayout(layout);
|
||||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
gd.horizontalSpan = 2;
|
|
||||||
group.setLayoutData(gd);
|
|
||||||
group.setText(Messages.getString("GDBJtagDebuggerTab.remoteGroup_Text")); //$NON-NLS-1$
|
group.setText(Messages.getString("GDBJtagDebuggerTab.remoteGroup_Text")); //$NON-NLS-1$
|
||||||
|
|
||||||
useRemote = new Button(group, SWT.CHECK);
|
useRemote = new Button(group, SWT.CHECK);
|
||||||
useRemote.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create());
|
useRemote.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
useRemote.setText(Messages.getString("GDBJtagDebuggerTab.useRemote_Text")); //$NON-NLS-1$
|
useRemote.setText(Messages.getString("GDBJtagDebuggerTab.useRemote_Text")); //$NON-NLS-1$
|
||||||
useRemote.addSelectionListener(new SelectionAdapter() {
|
useRemote.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -223,7 +224,16 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
remoteTimeoutEnabled = new Button(group, SWT.CHECK);
|
Composite comp = new Composite(group, SWT.NONE);
|
||||||
|
layout = new GridLayout();
|
||||||
|
layout.numColumns = 2;
|
||||||
|
layout.marginHeight = 0;
|
||||||
|
layout.marginLeft = new PixelConverter(group).convertHorizontalDLUsToPixels(8);
|
||||||
|
layout.marginRight = 0;
|
||||||
|
comp.setLayout(layout);
|
||||||
|
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
|
remoteTimeoutEnabled = new Button(comp, SWT.CHECK);
|
||||||
remoteTimeoutEnabled.setText(Messages.getString("GDBJtagDebuggerTab.remoteTimeout")); //$NON-NLS-1$
|
remoteTimeoutEnabled.setText(Messages.getString("GDBJtagDebuggerTab.remoteTimeout")); //$NON-NLS-1$
|
||||||
remoteTimeoutEnabled.setToolTipText(Messages.getString("GDBJtagDebuggerTab.remoteTimeoutTooltip")); //$NON-NLS-1$
|
remoteTimeoutEnabled.setToolTipText(Messages.getString("GDBJtagDebuggerTab.remoteTimeoutTooltip")); //$NON-NLS-1$
|
||||||
remoteTimeoutEnabled.addSelectionListener(new SelectionAdapter() {
|
remoteTimeoutEnabled.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@ -233,22 +243,15 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||||
updateLaunchConfigurationDialog();
|
updateLaunchConfigurationDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
remoteTimeoutValue = new Text(group, SWT.BORDER);
|
remoteTimeoutValue = new Text(comp, SWT.BORDER);
|
||||||
gd = new GridData();
|
remoteTimeoutValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
gd.widthHint = new PixelConverter(remoteTimeoutValue).convertWidthInCharsToPixels(10);
|
|
||||||
remoteTimeoutValue.setLayoutData(gd);
|
|
||||||
remoteTimeoutValue.setToolTipText(Messages.getString("GDBJtagDebuggerTab.remoteTimeoutTooltip")); //$NON-NLS-1$
|
remoteTimeoutValue.setToolTipText(Messages.getString("GDBJtagDebuggerTab.remoteTimeoutTooltip")); //$NON-NLS-1$
|
||||||
|
|
||||||
Composite comp = new Composite(group, SWT.NONE);
|
jtagDeviceLabel = new Label(comp, SWT.NONE);
|
||||||
layout = new GridLayout();
|
jtagDeviceLabel.setText(Messages.getString("GDBJtagDebuggerTab.jtagDeviceLabel")); //$NON-NLS-1$
|
||||||
layout.numColumns = 2;
|
|
||||||
comp.setLayout(layout);
|
|
||||||
comp.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).grab(true, false).create());
|
|
||||||
|
|
||||||
Label label = new Label(comp, SWT.NONE);
|
|
||||||
label.setText(Messages.getString("GDBJtagDebuggerTab.jtagDeviceLabel")); //$NON-NLS-1$
|
|
||||||
|
|
||||||
jtagDevice = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN);
|
jtagDevice = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN);
|
||||||
|
jtagDevice.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
|
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
|
||||||
.getGDBJtagDeviceContribution();
|
.getGDBJtagDeviceContribution();
|
||||||
|
@ -263,58 +266,50 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
remoteConnectionParameters = new Composite(group, SWT.NO_TRIM | SWT.NO_FOCUS);
|
protocolLabel = new Label(comp, SWT.NONE);
|
||||||
remoteConnectParmsLayout = new StackLayout();
|
protocolLabel.setText(Messages.getString("GDBJtagDebuggerTab.protocolLabel")); //$NON-NLS-1$
|
||||||
remoteConnectionParameters.setLayout(remoteConnectParmsLayout);
|
protocol = new ComboViewer(comp, SWT.READ_ONLY | SWT.DROP_DOWN);
|
||||||
remoteConnectionParameters.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).create());
|
protocol.setContentProvider(new ArrayContentProvider());
|
||||||
|
protocol.getCombo().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
//
|
connectionLabel = new Label(comp, SWT.NONE);
|
||||||
// Create entry fields for other types of connections
|
connectionLabel.setText(Messages.getString("GDBJtagDebuggerTab.connectionLabel")); //$NON-NLS-1$
|
||||||
//
|
connection = new Text(comp, SWT.BORDER);
|
||||||
|
connection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
{
|
|
||||||
remoteConnectionBox = new Composite(remoteConnectionParameters, SWT.NO_TRIM | SWT.NO_FOCUS);
|
|
||||||
layout = new GridLayout();
|
|
||||||
layout.numColumns = 2;
|
|
||||||
remoteConnectionBox.setLayout(layout);
|
|
||||||
remoteConnectionBox.setBackground(remoteConnectionParameters.getParent().getBackground());
|
|
||||||
|
|
||||||
label = new Label(remoteConnectionBox, SWT.NONE);
|
|
||||||
label.setText(Messages.getString("GDBJtagDebuggerTab.connectionLabel")); //$NON-NLS-1$
|
|
||||||
connection = new Text(remoteConnectionBox, SWT.BORDER);
|
|
||||||
gd = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
|
|
||||||
connection.setLayoutData(gd);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add watchers for user data entry
|
// Add watchers for user data entry
|
||||||
//
|
//
|
||||||
connection.addModifyListener(new ModifyListener() {
|
protocol.getCombo().addListener(SWT.Selection, e -> scheduleUpdateJob());
|
||||||
@Override
|
connection.addListener(SWT.Modify, e -> scheduleUpdateJob());
|
||||||
public void modifyText(ModifyEvent e) {
|
|
||||||
scheduleUpdateJob(); // provides much better performance for Text listeners
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param text
|
* @param text
|
||||||
*/
|
*/
|
||||||
protected void updateDeviceIpPort(String selectedDeviceName) {
|
protected void updateDeviceIpPort(String selectedDeviceName) {
|
||||||
if (selectedDeviceName.equals(savedJtagDevice)) {
|
if (!selectedDeviceName.equals(savedJtagDevice)) {
|
||||||
return;
|
resetTargetParameters(selectedDeviceName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetTargetParameters(String deviceName) {
|
||||||
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
|
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
|
||||||
.getGDBJtagDeviceContribution();
|
.getGDBJtagDeviceContribution();
|
||||||
IGDBJtagDevice selectedDevice = null;
|
IGDBJtagDevice selectedDevice = null;
|
||||||
for (int i = 0; i < availableDevices.length; i++) {
|
for (int i = 0; i < availableDevices.length; i++) {
|
||||||
String name = availableDevices[i].getDeviceName();
|
String name = availableDevices[i].getDeviceName();
|
||||||
if (name.equals(selectedDeviceName)) {
|
if (name.equals(deviceName)) {
|
||||||
selectedDevice = availableDevices[i].getDevice();
|
selectedDevice = availableDevices[i].getDevice();
|
||||||
if (selectedDevice != null) {
|
if (selectedDevice != null) {
|
||||||
if (selectedDevice instanceof IGDBJtagConnection) {
|
if (selectedDevice instanceof IGDBJtagConnection) {
|
||||||
IGDBJtagConnection connectionDevice = (IGDBJtagConnection) selectedDevice;
|
IGDBJtagConnection connectionDevice = (IGDBJtagConnection) selectedDevice;
|
||||||
connection.setText(connectionDevice.getDefaultDeviceConnection());
|
connection.setText(connectionDevice.getDefaultDeviceConnection());
|
||||||
|
String[] protocols = connectionDevice.getDeviceProtocols();
|
||||||
|
protocol.setInput(protocols);
|
||||||
|
if (0 != protocols.length) {
|
||||||
|
protocol.setSelection(new StructuredSelection(protocols[0]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
useRemoteChanged();
|
useRemoteChanged();
|
||||||
updateLaunchConfigurationDialog();
|
updateLaunchConfigurationDialog();
|
||||||
|
@ -331,24 +326,13 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||||
private void useRemoteChanged() {
|
private void useRemoteChanged() {
|
||||||
boolean enabled = useRemote.getSelection();
|
boolean enabled = useRemote.getSelection();
|
||||||
remoteTimeoutEnabled.setEnabled(enabled);
|
remoteTimeoutEnabled.setEnabled(enabled);
|
||||||
remoteTimeoutValue.setEnabled(remoteTimeoutEnabled.getSelection());
|
remoteTimeoutValue.setEnabled(enabled && remoteTimeoutEnabled.getSelection());
|
||||||
|
jtagDeviceLabel.setEnabled(enabled);
|
||||||
jtagDevice.setEnabled(enabled);
|
jtagDevice.setEnabled(enabled);
|
||||||
|
protocolLabel.setEnabled(enabled);
|
||||||
|
protocol.getCombo().setEnabled(enabled);
|
||||||
|
connectionLabel.setEnabled(enabled);
|
||||||
connection.setEnabled(enabled);
|
connection.setEnabled(enabled);
|
||||||
GDBJtagDeviceContribution selectedDeviceEntry = GDBJtagDeviceContributionFactory.getInstance()
|
|
||||||
.findByDeviceName(jtagDevice.getText());
|
|
||||||
if ((selectedDeviceEntry == null) || (selectedDeviceEntry.getDevice() == null)) {
|
|
||||||
remoteConnectParmsLayout.topControl = null;
|
|
||||||
remoteConnectionParameters.layout();
|
|
||||||
} else {
|
|
||||||
IGDBJtagDevice device = selectedDeviceEntry.getDevice();
|
|
||||||
if (device instanceof IGDBJtagConnection) {
|
|
||||||
remoteConnectParmsLayout.topControl = remoteConnectionBox;
|
|
||||||
remoteConnectionBox.getParent().layout();
|
|
||||||
} else {
|
|
||||||
remoteConnectParmsLayout.topControl = null;
|
|
||||||
remoteConnectionParameters.layout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -434,28 +418,31 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||||
String storedAddress = ""; //$NON-NLS-1$
|
String storedAddress = ""; //$NON-NLS-1$
|
||||||
int storedPort = -1;
|
int storedPort = -1;
|
||||||
String storedConnection = null;
|
String storedConnection = null;
|
||||||
|
String storedProtocol = null;
|
||||||
|
|
||||||
for (int i = 0; i < jtagDevice.getItemCount(); i++) {
|
for (int i = 0; i < jtagDevice.getItemCount(); i++) {
|
||||||
if (jtagDevice.getItem(i).equals(savedJtagDevice)) {
|
if (jtagDevice.getItem(i).equals(savedJtagDevice)) {
|
||||||
storedAddress = configuration.getAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, ""); //$NON-NLS-1$
|
storedAddress = configuration.getAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, ""); //$NON-NLS-1$
|
||||||
storedPort = configuration.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, -1);
|
storedPort = configuration.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, -1);
|
||||||
storedConnection = configuration.getAttribute(IGDBJtagConstants.ATTR_CONNECTION, (String) null);
|
storedConnection = configuration.getAttribute(IGDBJtagConstants.ATTR_CONNECTION, (String) null);
|
||||||
|
storedProtocol = configuration.getAttribute(IGDBJtagConstants.ATTR_PROTOCOL, (String) null);
|
||||||
jtagDevice.select(i);
|
jtagDevice.select(i);
|
||||||
|
resetTargetParameters(savedJtagDevice);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (null != storedProtocol) {
|
||||||
String connectionText = IGDBJtagConstants.DEFAULT_CONNECTION;
|
protocol.setSelection(new StructuredSelection(storedProtocol));
|
||||||
|
}
|
||||||
if (null != storedConnection) { // if a connection URI
|
if (null != storedConnection) { // if a connection URI
|
||||||
try {
|
try {
|
||||||
connectionText = new URI(storedConnection).getSchemeSpecificPart();
|
connection.setText(new URI(storedConnection).getSchemeSpecificPart());
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
Activator.log(e);
|
Activator.log(e);
|
||||||
}
|
}
|
||||||
} else if (storedPort != -1) { // if a legacy address:port
|
} else if (storedPort != -1) { // if a legacy address:port
|
||||||
connectionText = String.format("%s:%d", storedAddress, storedPort); //$NON-NLS-1$
|
connection.setText(String.format("%s:%d", storedAddress, storedPort)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
connection.setText(connectionText);
|
|
||||||
}
|
}
|
||||||
boolean updateThreadsOnSuspend = configuration.getAttribute(
|
boolean updateThreadsOnSuspend = configuration.getAttribute(
|
||||||
IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
|
IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
|
||||||
|
@ -505,10 +492,12 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||||
if (device instanceof IGDBJtagConnection) {
|
if (device instanceof IGDBJtagConnection) {
|
||||||
String conn = connection.getText().trim();
|
String conn = connection.getText().trim();
|
||||||
URI uri = new URI("gdb", conn, ""); //$NON-NLS-1$ //$NON-NLS-2$
|
URI uri = new URI("gdb", conn, ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
configuration.setAttribute(IGDBJtagConstants.ATTR_PROTOCOL, protocol.getCombo().getText());
|
||||||
configuration.setAttribute(IGDBJtagConstants.ATTR_CONNECTION, uri.toString());
|
configuration.setAttribute(IGDBJtagConstants.ATTR_CONNECTION, uri.toString());
|
||||||
configuration.removeAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS);
|
configuration.removeAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS);
|
||||||
configuration.removeAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER);
|
configuration.removeAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER);
|
||||||
} else {
|
} else {
|
||||||
|
configuration.removeAttribute(IGDBJtagConstants.ATTR_PROTOCOL);
|
||||||
configuration.removeAttribute(IGDBJtagConstants.ATTR_CONNECTION);
|
configuration.removeAttribute(IGDBJtagConstants.ATTR_CONNECTION);
|
||||||
}
|
}
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
|
|
|
@ -65,11 +65,12 @@ GDBJtagDebuggerTab.miProtocolLabel=Protocol Version:
|
||||||
GDBJtagDebuggerTab.verboseModeLabel=Verbose console mode
|
GDBJtagDebuggerTab.verboseModeLabel=Verbose console mode
|
||||||
GDBJtagDebuggerTab.remoteGroup_Text=Remote Target
|
GDBJtagDebuggerTab.remoteGroup_Text=Remote Target
|
||||||
GDBJtagDebuggerTab.useRemote_Text=Use remote target
|
GDBJtagDebuggerTab.useRemote_Text=Use remote target
|
||||||
GDBJtagDebuggerTab.jtagDeviceLabel=JTAG Device:
|
GDBJtagDebuggerTab.jtagDeviceLabel=Debug server:
|
||||||
GDBJtagDebuggerTab.ipAddressLabel=Host name or IP address:
|
GDBJtagDebuggerTab.ipAddressLabel=Host name or IP address:
|
||||||
GDBJtagDebuggerTab.portNumberLabel=Port number:
|
GDBJtagDebuggerTab.portNumberLabel=Port number:
|
||||||
GDBJtagDebuggerTab.connectionLabel=GDB Connection String:
|
GDBJtagDebuggerTab.protocolLabel=Protocol:
|
||||||
|
GDBJtagDebuggerTab.connectionLabel=Connection:
|
||||||
GDBJtagDebuggerTab.update_thread_list_on_suspend=Force thread list update on suspend
|
GDBJtagDebuggerTab.update_thread_list_on_suspend=Force thread list update on suspend
|
||||||
GDBJtagDebuggerTab.remoteTimeout=Remote timeout (seconds):
|
GDBJtagDebuggerTab.remoteTimeout=Timeout (seconds):
|
||||||
GDBJtagDebuggerTab.remoteTimeoutTooltip=Timeout for the remote target to respond. If unchecked, uses GDB default value. See GDB's help for "set remotetimeout num".
|
GDBJtagDebuggerTab.remoteTimeoutTooltip=Timeout for the remote target to respond. If unchecked, uses GDB default value. See GDB's help for "set remotetimeout num".
|
||||||
GDBJtagDebuggerTab.tabName=Debugger
|
GDBJtagDebuggerTab.tabName=Debugger
|
||||||
|
|
Loading…
Add table
Reference in a new issue