1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Avoid duplicating fields in FinalLaunchSequence sub-classes

(add protected accessors)

Change-Id: I7e4e7ada8ce0f25a94ccec0ffd4311f05f9c4043
Signed-off-by: Xavier Raynaud <xavier.raynaud@kalray.eu>
Reviewed-on: https://git.eclipse.org/r/19241
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Xavier Raynaud 2013-12-03 11:17:59 +01:00 committed by Marc Khouzam
parent 16083fee1e
commit 778e234e67
5 changed files with 53 additions and 50 deletions

View file

@ -14,6 +14,7 @@
* Marc Khouzam (Ericsson) - No longer call method to check non-stop for GDB < 7.0 (Bug 365471) * Marc Khouzam (Ericsson) - No longer call method to check non-stop for GDB < 7.0 (Bug 365471)
* Mathias Kunter - Support for different charsets (bug 370462) * Mathias Kunter - Support for different charsets (bug 370462)
* Anton Gorenkov - A preference to use RTTI for variable types determination (Bug 377536) * Anton Gorenkov - A preference to use RTTI for variable types determination (Bug 377536)
* Xavier Raynaud (Kalray) - Avoid duplicating fields in sub-classes (add protected accessors)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.gdb.launching; package org.eclipse.cdt.dsf.gdb.launching;
@ -75,6 +76,24 @@ public class FinalLaunchSequence extends ReflectionSequence {
fAttributes = attributes; fAttributes = attributes;
} }
/**
* Gets the DsfSession of this launch sequence.
* @return the {@link DsfSession}
* @since 4.3
*/
protected DsfSession getSession() {
return fSession;
}
/**
* Gets the launch configuration attributes, as a {@link Map}.
* @return the launch configuration attributes
* @since 4.3
*/
protected Map<String, Object> getAttributes() {
return fAttributes;
}
@Override @Override
protected String[] getExecutionOrder(String group) { protected String[] getExecutionOrder(String group) {
if (GROUP_TOP_LEVEL.equals(group)) { if (GROUP_TOP_LEVEL.equals(group)) {

View file

@ -8,6 +8,7 @@
* Contributors: * Contributors:
* Marc Khouzam (Ericsson) - initial API and implementation (Bug 365471) * Marc Khouzam (Ericsson) - initial API and implementation (Bug 365471)
* Marc Khouzam (Ericsson) - Support for different charsets (bug 370462) * Marc Khouzam (Ericsson) - Support for different charsets (bug 370462)
* Xavier Raynaud (Kalray) - Avoid duplicating fields in sub-classes (add protected accessors)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.gdb.launching; package org.eclipse.cdt.dsf.gdb.launching;
@ -43,11 +44,9 @@ public class FinalLaunchSequence_7_0 extends FinalLaunchSequence {
private IGDBControl fCommandControl; private IGDBControl fCommandControl;
private CommandFactory fCommandFactory; private CommandFactory fCommandFactory;
private DsfSession fSession;
public FinalLaunchSequence_7_0(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) { public FinalLaunchSequence_7_0(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) {
super(session, attributes, rm); super(session, attributes, rm);
fSession = session;
} }
@Override @Override
@ -75,7 +74,7 @@ public class FinalLaunchSequence_7_0 extends FinalLaunchSequence {
*/ */
@Execute @Execute
public void stepInitializeFinalLaunchSequence_7_0(RequestMonitor rm) { public void stepInitializeFinalLaunchSequence_7_0(RequestMonitor rm) {
DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fSession.getId()); DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), getSession().getId());
fCommandControl = tracker.getService(IGDBControl.class); fCommandControl = tracker.getService(IGDBControl.class);
tracker.dispose(); tracker.dispose();

View file

@ -8,6 +8,7 @@
* Contributors: * Contributors:
* Ericsson - initial API and implementation * Ericsson - initial API and implementation
* Marc Khouzam (Ericsson) - Use new FinalLaunchSequence_7_0 as base class (Bug 365471) * Marc Khouzam (Ericsson) - Use new FinalLaunchSequence_7_0 as base class (Bug 365471)
* Xavier Raynaud (Kalray) - Avoid duplicating fields in sub-classes (add protected accessors)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.gdb.launching; package org.eclipse.cdt.dsf.gdb.launching;
@ -38,15 +39,9 @@ import org.eclipse.core.runtime.Status;
public class FinalLaunchSequence_7_2 extends FinalLaunchSequence_7_0 { public class FinalLaunchSequence_7_2 extends FinalLaunchSequence_7_0 {
private IGDBControl fGdbControl; private IGDBControl fGdbControl;
private DsfSession fSession;
// The launchConfiguration attributes
private Map<String, Object> fAttributes;
public FinalLaunchSequence_7_2(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) { public FinalLaunchSequence_7_2(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) {
super(session, attributes, rm); super(session, attributes, rm);
fSession = session;
fAttributes = attributes;
} }
@Override @Override
@ -72,7 +67,7 @@ public class FinalLaunchSequence_7_2 extends FinalLaunchSequence_7_0 {
*/ */
@Execute @Execute
public void stepInitializeFinalLaunchSequence_7_2(RequestMonitor rm) { public void stepInitializeFinalLaunchSequence_7_2(RequestMonitor rm) {
DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fSession.getId()); DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), getSession().getId());
fGdbControl = tracker.getService(IGDBControl.class); fGdbControl = tracker.getService(IGDBControl.class);
tracker.dispose(); tracker.dispose();
@ -90,7 +85,7 @@ public class FinalLaunchSequence_7_2 extends FinalLaunchSequence_7_0 {
*/ */
@Execute @Execute
public void stepDetachOnFork(final RequestMonitor rm) { public void stepDetachOnFork(final RequestMonitor rm) {
boolean debugOnFork = CDebugUtils.getAttribute(fAttributes, boolean debugOnFork = CDebugUtils.getAttribute(getAttributes(),
IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT); IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);

View file

@ -94,11 +94,6 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
} }
} }
// The launchConfiguration attributes
private Map<String, Object> fAttributes;
private DsfSession fSession;
private IGDBControl fCommandControl; private IGDBControl fCommandControl;
private IGDBBackend fGDBBackend; private IGDBBackend fGDBBackend;
private IMIProcesses fProcService; private IMIProcesses fProcService;
@ -112,8 +107,6 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
*/ */
public GDBJtagDSFFinalLaunchSequence(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) { public GDBJtagDSFFinalLaunchSequence(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) {
super(session, attributes, rm); super(session, attributes, rm);
fSession = session;
fAttributes = attributes;
} }
public GDBJtagDSFFinalLaunchSequence(DsfExecutor executor, GdbLaunch launch, SessionType sessionType, boolean attach, RequestMonitorWithProgress rm) { public GDBJtagDSFFinalLaunchSequence(DsfExecutor executor, GdbLaunch launch, SessionType sessionType, boolean attach, RequestMonitorWithProgress rm) {
@ -199,7 +192,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
*/ */
@Execute @Execute
public void stepInitializeJTAGFinalLaunchSequence(RequestMonitor rm) { public void stepInitializeJTAGFinalLaunchSequence(RequestMonitor rm) {
fTracker = new DsfServicesTracker(Activator.getBundleContext(), fSession.getId()); fTracker = new DsfServicesTracker(Activator.getBundleContext(), getSession().getId());
fGDBBackend = fTracker.getService(IGDBBackend.class); fGDBBackend = fTracker.getService(IGDBBackend.class);
if (fGDBBackend == null) { if (fGDBBackend == null) {
rm.done(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot obtain GDBBackend service", null)); //$NON-NLS-1$ rm.done(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot obtain GDBBackend service", null)); //$NON-NLS-1$
@ -262,20 +255,20 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
@Execute @Execute
public void stepLoadSymbols(final RequestMonitor rm) { public void stepLoadSymbols(final RequestMonitor rm) {
try { try {
if (CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)) {
String symbolsFileName = null; String symbolsFileName = null;
// New setting in Helios. Default is true. Check for existence // New setting in Helios. Default is true. Check for existence
// in order to support older launch configs // in order to support older launch configs
if (fAttributes.containsKey(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS) && if (getAttributes().containsKey(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS) &&
CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS)) { CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS)) {
IPath programFile = fGDBBackend.getProgramPath(); IPath programFile = fGDBBackend.getProgramPath();
if (programFile != null) { if (programFile != null) {
symbolsFileName = programFile.toOSString(); symbolsFileName = programFile.toOSString();
} }
} }
else { else {
symbolsFileName = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME); symbolsFileName = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME);
if (symbolsFileName.length() > 0) { if (symbolsFileName.length() > 0) {
symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName); symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName);
} else { } else {
@ -292,7 +285,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
// Escape windows path separator characters TWICE, once for Java and once for GDB. // Escape windows path separator characters TWICE, once for Java and once for GDB.
symbolsFileName = symbolsFileName.replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$ symbolsFileName = symbolsFileName.replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
String symbolsOffset = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET); String symbolsOffset = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET);
if (symbolsOffset.length() > 0) { if (symbolsOffset.length() > 0) {
symbolsOffset = "0x" + symbolsOffset; symbolsOffset = "0x" + symbolsOffset;
} }
@ -317,16 +310,16 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
@Execute @Execute
public void stepConnectToTarget(final RequestMonitor rm) { public void stepConnectToTarget(final RequestMonitor rm) {
try { try {
if (CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET)) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET)) {
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
if (fGdbJtagDevice instanceof IGDBJtagConnection) { if (fGdbJtagDevice instanceof IGDBJtagConnection) {
URI uri = new URI(CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_CONNECTION, IGDBJtagConstants.DEFAULT_CONNECTION)); URI uri = new URI(CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_CONNECTION, IGDBJtagConstants.DEFAULT_CONNECTION));
IGDBJtagConnection device = (IGDBJtagConnection)fGdbJtagDevice; IGDBJtagConnection device = (IGDBJtagConnection)fGdbJtagDevice;
device.doRemote(uri.getSchemeSpecificPart(), commands); device.doRemote(uri.getSchemeSpecificPart(), commands);
} else { } else {
// Handle legacy network device contributions that don't understand URIs // Handle legacy network device contributions that don't understand URIs
String ipAddress = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS); String ipAddress = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS);
int portNumber = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER); int portNumber = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER);
fGdbJtagDevice.doRemote(ipAddress, portNumber, commands); fGdbJtagDevice.doRemote(ipAddress, portNumber, commands);
} }
queueCommands(commands, rm); queueCommands(commands, rm);
@ -345,7 +338,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
/** @since 8.2 */ /** @since 8.2 */
@Execute @Execute
public void stepResetBoard(final RequestMonitor rm) { public void stepResetBoard(final RequestMonitor rm) {
if (CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)) {
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doReset(commands); fGdbJtagDevice.doReset(commands);
queueCommands(commands, rm); queueCommands(commands, rm);
@ -362,7 +355,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
public void stepDelayStartup(final RequestMonitor rm) { public void stepDelayStartup(final RequestMonitor rm) {
int defaultDelay = fGdbJtagDevice.getDefaultDelay(); int defaultDelay = fGdbJtagDevice.getDefaultDelay();
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doDelay(CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_DELAY, defaultDelay), commands); fGdbJtagDevice.doDelay(CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_DELAY, defaultDelay), commands);
queueCommands(commands, rm); queueCommands(commands, rm);
} }
@ -372,7 +365,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
/** @since 8.2 */ /** @since 8.2 */
@Execute @Execute
public void stepHaltBoard(final RequestMonitor rm) { public void stepHaltBoard(final RequestMonitor rm) {
if (CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)) {
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doHalt(commands); fGdbJtagDevice.doHalt(commands);
queueCommands(commands, rm); queueCommands(commands, rm);
@ -388,7 +381,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
@Execute @Execute
public void stepUserInitCommands(final RequestMonitor rm) { public void stepUserInitCommands(final RequestMonitor rm) {
try { try {
String userCmd = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS); String userCmd = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS);
userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd); userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd);
if (userCmd.length() > 0) { if (userCmd.length() > 0) {
String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$ String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$
@ -418,18 +411,18 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
public void stepLoadImage(final RequestMonitor rm) { public void stepLoadImage(final RequestMonitor rm) {
try { try {
String imageFileName = null; String imageFileName = null;
if (CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE)) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE)) {
// New setting in Helios. Default is true. Check for existence // New setting in Helios. Default is true. Check for existence
// in order to support older launch configs // in order to support older launch configs
if (fAttributes.containsKey(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE) && if (getAttributes().containsKey(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE) &&
CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE)) { CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE)) {
IPath programFile = fGDBBackend.getProgramPath(); IPath programFile = fGDBBackend.getProgramPath();
if (programFile != null) { if (programFile != null) {
imageFileName = programFile.toOSString(); imageFileName = programFile.toOSString();
} }
} }
else { else {
imageFileName = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME); imageFileName = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME);
if (imageFileName.length() > 0) { if (imageFileName.length() > 0) {
imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName); imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName);
} else { } else {
@ -446,9 +439,9 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
// Escape windows path separator characters TWICE, once for Java and once for GDB. // Escape windows path separator characters TWICE, once for Java and once for GDB.
imageFileName = imageFileName.replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$ imageFileName = imageFileName.replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
String imageOffset = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); String imageOffset = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET);
if (imageOffset.length() > 0) { if (imageOffset.length() > 0) {
imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); //$NON-NLS-2$ imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); //$NON-NLS-2$
} }
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands); fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands);
@ -483,7 +476,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
public void stepSetArguments(RequestMonitor rm) { public void stepSetArguments(RequestMonitor rm) {
try { try {
String args = CDebugUtils.getAttribute( String args = CDebugUtils.getAttribute(
fAttributes, getAttributes(),
ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
""); //$NON-NLS-1$ ""); //$NON-NLS-1$
@ -544,8 +537,8 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
/** @since 8.2 */ /** @since 8.2 */
@Execute @Execute
public void stepSetProgramCounter(final RequestMonitor rm) { public void stepSetProgramCounter(final RequestMonitor rm) {
if (CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)) {
String pcRegister = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_PC_REGISTER, CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_PC_REGISTER)); String pcRegister = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_PC_REGISTER, CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_PC_REGISTER));
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doSetPC(pcRegister, commands); fGdbJtagDevice.doSetPC(pcRegister, commands);
queueCommands(commands, rm); queueCommands(commands, rm);
@ -560,8 +553,8 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
/** @since 8.2 */ /** @since 8.2 */
@Execute @Execute
public void stepStopScript(final RequestMonitor rm) { public void stepStopScript(final RequestMonitor rm) {
if (CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)) {
String stopAt = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT); String stopAt = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT);
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doStopAt(stopAt, commands); fGdbJtagDevice.doStopAt(stopAt, commands);
queueCommands(commands, rm); queueCommands(commands, rm);
@ -576,7 +569,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
/** @since 8.2 */ /** @since 8.2 */
@Execute @Execute
public void stepResumeScript(final RequestMonitor rm) { public void stepResumeScript(final RequestMonitor rm) {
if (CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME)) { if (CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME)) {
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doContinue(commands); fGdbJtagDevice.doContinue(commands);
queueCommands(commands, rm); queueCommands(commands, rm);
@ -592,7 +585,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
@Execute @Execute
public void stepUserDebugCommands(final RequestMonitor rm) { public void stepUserDebugCommands(final RequestMonitor rm) {
try { try {
String userCmd = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS); String userCmd = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS);
if (userCmd.length() > 0) { if (userCmd.length() > 0) {
userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd); userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd);
String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$ String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$
@ -616,7 +609,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence {
private IGDBJtagDevice getGDBJtagDevice () { private IGDBJtagDevice getGDBJtagDevice () {
IGDBJtagDevice gdbJtagDevice = null; IGDBJtagDevice gdbJtagDevice = null;
String jtagDeviceName = CDebugUtils.getAttribute(fAttributes, IGDBJtagConstants.ATTR_JTAG_DEVICE, IGDBJtagConstants.DEFAULT_JTAG_DEVICE); String jtagDeviceName = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_JTAG_DEVICE, IGDBJtagConstants.DEFAULT_JTAG_DEVICE);
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance().getGDBJtagDeviceContribution(); GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance().getGDBJtagDeviceContribution();
for (GDBJtagDeviceContribution availableDevice : availableDevices) { for (GDBJtagDeviceContribution availableDevice : availableDevices) {
if (jtagDeviceName.equals(availableDevice.getDeviceName())) { if (jtagDeviceName.equals(availableDevice.getDeviceName())) {

View file

@ -31,11 +31,8 @@ import org.eclipse.core.runtime.Status;
*/ */
public class GDBJtagDSFFinalLaunchSequence_7_2 extends GDBJtagDSFFinalLaunchSequence { public class GDBJtagDSFFinalLaunchSequence_7_2 extends GDBJtagDSFFinalLaunchSequence {
private DsfSession fSession;
public GDBJtagDSFFinalLaunchSequence_7_2(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) { public GDBJtagDSFFinalLaunchSequence_7_2(DsfSession session, Map<String, Object> attributes, RequestMonitorWithProgress rm) {
super(session, attributes, rm); super(session, attributes, rm);
fSession = session;
} }
@Override @Override
@ -60,7 +57,7 @@ public class GDBJtagDSFFinalLaunchSequence_7_2 extends GDBJtagDSFFinalLaunchSequ
*/ */
@Execute @Execute
public void stepInitializeJTAGSequence_7_2(RequestMonitor rm) { public void stepInitializeJTAGSequence_7_2(RequestMonitor rm) {
DsfServicesTracker tracker = new DsfServicesTracker(Activator.getBundleContext(), fSession.getId()); DsfServicesTracker tracker = new DsfServicesTracker(Activator.getBundleContext(), getSession().getId());
IGDBControl gdbControl = tracker.getService(IGDBControl.class); IGDBControl gdbControl = tracker.getService(IGDBControl.class);
IGDBProcesses procService = tracker.getService(IGDBProcesses.class); IGDBProcesses procService = tracker.getService(IGDBProcesses.class);
tracker.dispose(); tracker.dispose();