1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-17 21:25:58 +02:00

[310129] GDB (DSF) Hardware Debugging Launcher ignores startup initialization commands

This commit is contained in:
John Cortell 2010-04-22 22:38:27 +00:00
parent 86490a11d7
commit 1df371b516

View file

@ -69,11 +69,24 @@ import org.eclipse.debug.core.ILaunchConfiguration;
*/ */
public class GDBJtagDSFFinalLaunchSequence extends Sequence { public class GDBJtagDSFFinalLaunchSequence extends Sequence {
Step[] fSteps = new Step[] { /** utility method; cuts down on clutter */
private void queueCommands(List<String> commands, RequestMonitor rm) {
if (commands.size() > 0) {
fCommandControl.queueCommand(
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
}
else {
rm.done();
}
}
private Step[] fSteps = new Step[] {
/* /*
* Create the service tracker for later use * Create the service tracker for later use
*/ */
new Step() { @Override new Step() {
@Override
public void execute(RequestMonitor requestMonitor) { public void execute(RequestMonitor requestMonitor) {
fTracker = new DsfServicesTracker(Activator.getBundleContext(), fLaunch.getSession().getId()); fTracker = new DsfServicesTracker(Activator.getBundleContext(), fLaunch.getSession().getId());
requestMonitor.done(); requestMonitor.done();
@ -87,7 +100,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Fetch the GDBBackend service for later use * Fetch the GDBBackend service for later use
*/ */
new Step() { @Override new Step() {
@Override
public void execute(RequestMonitor requestMonitor) { public void execute(RequestMonitor requestMonitor) {
fGDBBackend = fTracker.getService(IGDBBackend.class); fGDBBackend = fTracker.getService(IGDBBackend.class);
if (fGDBBackend == null) { if (fGDBBackend == null) {
@ -99,7 +113,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Fetch the control service for later use * Fetch the control service for later use
*/ */
new Step() { @Override new Step() {
@Override
public void execute(RequestMonitor requestMonitor) { public void execute(RequestMonitor requestMonitor) {
fCommandControl = fTracker.getService(IGDBControl.class); fCommandControl = fTracker.getService(IGDBControl.class);
if (fCommandControl == null) { if (fCommandControl == null) {
@ -113,7 +128,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Fetch the process service for later use * Fetch the process service for later use
*/ */
new Step() { @Override new Step() {
@Override
public void execute(RequestMonitor requestMonitor) { public void execute(RequestMonitor requestMonitor) {
fProcService = fTracker.getService(IMIProcesses.class); fProcService = fTracker.getService(IMIProcesses.class);
if (fProcService == null) { if (fProcService == null) {
@ -125,7 +141,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Source the gdbinit file specified in the launch * Source the gdbinit file specified in the launch
*/ */
new Step() { @Override new Step() {
@Override
public void execute(final RequestMonitor requestMonitor) { public void execute(final RequestMonitor requestMonitor) {
try { try {
final String gdbinitFile = fGDBBackend.getGDBInitFile(); final String gdbinitFile = fGDBBackend.getGDBInitFile();
@ -157,7 +174,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Specify the arguments to the executable file * Specify the arguments to the executable file
*/ */
new Step() { @Override new Step() {
@Override
public void execute(final RequestMonitor requestMonitor) { public void execute(final RequestMonitor requestMonitor) {
try { try {
String args = fGDBBackend.getProgramArguments(); String args = fGDBBackend.getProgramArguments();
@ -177,7 +195,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Specify GDB's working directory * Specify GDB's working directory
*/ */
new Step() { @Override new Step() {
@Override
public void execute(final RequestMonitor requestMonitor) { public void execute(final RequestMonitor requestMonitor) {
IPath dir = null; IPath dir = null;
try { try {
@ -199,7 +218,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Specify environment variables if needed * Specify environment variables if needed
*/ */
new Step() { @Override new Step() {
@Override
public void execute(final RequestMonitor requestMonitor) { public void execute(final RequestMonitor requestMonitor) {
boolean clear = false; boolean clear = false;
Properties properties = new Properties(); Properties properties = new Properties();
@ -221,7 +241,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Enable non-stop mode if necessary * Enable non-stop mode if necessary
*/ */
new Step() { @Override new Step() {
@Override
public void execute(final RequestMonitor requestMonitor) { public void execute(final RequestMonitor requestMonitor) {
boolean isNonStop = false; boolean isNonStop = false;
try { try {
@ -259,7 +280,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Tell GDB to automatically load or not the shared library symbols * Tell GDB to automatically load or not the shared library symbols
*/ */
new Step() { @Override new Step() {
public void execute(RequestMonitor requestMonitor) { public void execute(RequestMonitor requestMonitor) {
try { try {
boolean autolib = fLaunch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, boolean autolib = fLaunch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB,
@ -275,7 +296,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Set the shared library paths * Set the shared library paths
*/ */
new Step() { @Override new Step() {
@Override
public void execute(final RequestMonitor requestMonitor) { public void execute(final RequestMonitor requestMonitor) {
try { try {
List<String> p = fGDBBackend.getSharedLibraryPaths(); List<String> p = fGDBBackend.getSharedLibraryPaths();
@ -310,7 +332,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Setup the source paths * Setup the source paths
*/ */
new Step() { @Override new Step() {
@Override
public void execute(RequestMonitor requestMonitor) { public void execute(RequestMonitor requestMonitor) {
CSourceLookup sourceLookup = fTracker.getService(CSourceLookup.class); CSourceLookup sourceLookup = fTracker.getService(CSourceLookup.class);
CSourceLookupDirector locator = (CSourceLookupDirector)fLaunch.getSourceLocator(); CSourceLookupDirector locator = (CSourceLookupDirector)fLaunch.getSourceLocator();
@ -325,9 +348,6 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
* Retrieve the JTag device * Retrieve the JTag device
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
Exception exception = null; Exception exception = null;
@ -343,15 +363,11 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot get Jtag device", exception)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot get Jtag device", exception)); //$NON-NLS-1$
} }
rm.done(); rm.done();
} }},
},
/* /*
* Hook up to remote target * Hook up to remote target
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
@ -359,11 +375,9 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
if (config.getAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET)) { if (config.getAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET)) {
String ipAddress = config.getAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS); String ipAddress = config.getAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS);
int portNumber = config.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER); int portNumber = config.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER);
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doRemote(ipAddress, portNumber, commands); fGdbJtagDevice.doRemote(ipAddress, portNumber, commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} else { } else {
rm.done(); rm.done();
} }
@ -371,25 +385,19 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot connect to remote target", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot connect to remote target", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Run device-specific code to reset the board * Run device-specific code to reset the board
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try { try {
if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, true)) { if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, true)) {
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doReset(commands); fGdbJtagDevice.doReset(commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} else { } else {
rm.done(); rm.done();
} }
@ -397,48 +405,36 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot reset the remote target", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot reset the remote target", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Run device-specific code to delay the startup * Run device-specific code to delay the startup
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
int defaultDelay = fGdbJtagDevice.getDefaultDelay(); int defaultDelay = fGdbJtagDevice.getDefaultDelay();
try { try {
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doDelay(config.getAttribute(IGDBJtagConstants.ATTR_DELAY, defaultDelay), commands); fGdbJtagDevice.doDelay(config.getAttribute(IGDBJtagConstants.ATTR_DELAY, defaultDelay), commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} catch (CoreException e) { } catch (CoreException e) {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot delay the remote target", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot delay the remote target", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Run device-specific code to halt the board * Run device-specific code to halt the board
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try { try {
if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, true)) { if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, true)) {
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doHalt(commands); fGdbJtagDevice.doHalt(commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} else { } else {
rm.done(); rm.done();
} }
@ -446,15 +442,11 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot halt the remote target", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot halt the remote target", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Execute any user defined init commands * Execute any user defined init commands
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
@ -474,15 +466,11 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot run user defined init commands", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot run user defined init commands", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Execute image loading * Execute image loading
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
@ -493,11 +481,9 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
if (imageFileName.length() > 0) { if (imageFileName.length() > 0) {
imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName).replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$ imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName).replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
String imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ String imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands); fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} else { } else {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Image name cannot be empty", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Image name cannot be empty", null)); //$NON-NLS-1$
rm.done(); rm.done();
@ -509,15 +495,11 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot load image", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot load image", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Execute symbol loading * Execute symbol loading
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
@ -528,11 +510,9 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
if (symbolsFileName.length() > 0) { if (symbolsFileName.length() > 0) {
symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName).replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$ symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName).replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
String symbolsOffset = "0x" + config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, ""); //$NON-NLS-1$ //$NON-NLS-2$ String symbolsOffset = "0x" + config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, ""); //$NON-NLS-1$ //$NON-NLS-2$
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands); fGdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} else { } else {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Symbol name cannot be empty", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Symbol name cannot be empty", null)); //$NON-NLS-1$
rm.done(); rm.done();
@ -549,7 +529,8 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
/* /*
* Start tracking the breakpoints once we know we are connected to the target (necessary for remote debugging) * Start tracking the breakpoints once we know we are connected to the target (necessary for remote debugging)
*/ */
new Step() { @Override new Step() {
@Override
public void execute(final RequestMonitor requestMonitor) { public void execute(final RequestMonitor requestMonitor) {
if (fSessionType != SessionType.CORE) { if (fSessionType != SessionType.CORE) {
MIBreakpointsManager bpmService = fTracker.getService(MIBreakpointsManager.class); MIBreakpointsManager bpmService = fTracker.getService(MIBreakpointsManager.class);
@ -564,20 +545,15 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
* Set the program counter * Set the program counter
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try { try {
if (config.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)) { if (config.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)) {
String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$ String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doSetPC(pcRegister, commands); fGdbJtagDevice.doSetPC(pcRegister, commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} else { } else {
rm.done(); rm.done();
} }
@ -585,26 +561,20 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot set program counter", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot set program counter", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Execute the stop script * Execute the stop script
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try { try {
if (config.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)) { if (config.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)) {
String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, ""); //$NON-NLS-1$ String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, ""); //$NON-NLS-1$
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doStopAt(stopAt, commands); fGdbJtagDevice.doStopAt(stopAt, commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} else { } else {
rm.done(); rm.done();
} }
@ -618,19 +588,14 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
* Execute the resume script * Execute the resume script
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
try { try {
if (config.getAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME)) { if (config.getAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME)) {
ArrayList<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
fGdbJtagDevice.doContinue(commands); fGdbJtagDevice.doContinue(commands);
fCommandControl.queueCommand( queueCommands(commands, rm);
new CLICommand<MIInfo>(fCommandControl.getContext(), composeCommand(commands)),
new DataRequestMonitor<MIInfo>(getExecutor(), rm));
} else { } else {
rm.done(); rm.done();
} }
@ -638,15 +603,11 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot resume the remote target", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot resume the remote target", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Run any user defined commands to start debugging * Run any user defined commands to start debugging
*/ */
new Step() { new Step() {
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.concurrent.Sequence.Step#execute(org.eclipse.cdt.dsf.concurrent.RequestMonitor)
*/
@Override @Override
public void execute(RequestMonitor rm) { public void execute(RequestMonitor rm) {
ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); ILaunchConfiguration config = fLaunch.getLaunchConfiguration();
@ -666,8 +627,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot run user defined run commands", e)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot run user defined run commands", e)); //$NON-NLS-1$
rm.done(); rm.done();
} }
} }},
},
/* /*
* Indicate that the Data Model has been filled. This will trigger the Debug view to expand. * Indicate that the Data Model has been filled. This will trigger the Debug view to expand.
@ -678,8 +638,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
fLaunch.getSession().dispatchEvent(new DataModelInitializedEvent(fCommandControl.getContext()), fLaunch.getSession().dispatchEvent(new DataModelInitializedEvent(fCommandControl.getContext()),
fCommandControl.getProperties()); fCommandControl.getProperties());
requestMonitor.done(); requestMonitor.done();
} }},
},
/* /*
* Cleanup * Cleanup
*/ */
@ -689,8 +648,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
fTracker.dispose(); fTracker.dispose();
fTracker = null; fTracker = null;
requestMonitor.done(); requestMonitor.done();
} }},
},
}; };
GdbLaunch fLaunch; GdbLaunch fLaunch;