diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java index 0575af778..94c2a374a 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/LaunchConfigurationDelegate.java @@ -15,7 +15,12 @@ package com.espressif.idf.debug.gdbjtag.openocd.dsf; +import java.io.BufferedReader; import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; import java.util.concurrent.Callable; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; @@ -36,6 +41,7 @@ import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; import org.eclipse.cdt.dsf.service.DsfServicesTracker; import org.eclipse.cdt.dsf.service.DsfSession; +import org.eclipse.cdt.utils.spawner.ProcessFactory; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; @@ -44,12 +50,14 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.core.runtime.jobs.Job; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.model.ISourceLocator; +import org.eclipse.embedcdt.core.StringUtils; import org.eclipse.embedcdt.debug.gdbjtag.core.DebugUtils; import org.eclipse.embedcdt.debug.gdbjtag.core.dsf.AbstractGnuMcuLaunchConfigurationDelegate; import org.eclipse.embedcdt.debug.gdbjtag.core.dsf.GnuMcuServerServicesLaunchSequence; @@ -60,21 +68,23 @@ import com.espressif.idf.core.util.StringUtil; import com.espressif.idf.debug.gdbjtag.openocd.Activator; import com.espressif.idf.debug.gdbjtag.openocd.Configuration; +import com.espressif.idf.debug.gdbjtag.openocd.ui.Messages; /** - * This class is referred in the plugin.xml as an - * "org.eclipse.debug.core.launchDelegates" extension point. + * This class is referred in the plugin.xml as an "org.eclipse.debug.core.launchDelegates" extension point. * * It inherits directly from the GDB Hardware Debug plug-in. * * */ @SuppressWarnings("restriction") -public class LaunchConfigurationDelegate extends AbstractGnuMcuLaunchConfigurationDelegate { +public class LaunchConfigurationDelegate extends AbstractGnuMcuLaunchConfigurationDelegate +{ // ------------------------------------------------------------------------ private final static String NON_STOP_FIRST_VERSION = "6.8.50"; //$NON-NLS-1$ + private final int STATUS_DLL_NOT_FOUND = -1073741515; ILaunchConfiguration fConfig = null; @SuppressWarnings("unused") @@ -86,9 +96,11 @@ public class LaunchConfigurationDelegate extends AbstractGnuMcuLaunchConfigurati // ------------------------------------------------------------------------ @Override - protected IDsfDebugServicesFactory newServiceFactory(ILaunchConfiguration config, String version) { + protected IDsfDebugServicesFactory newServiceFactory(ILaunchConfiguration config, String version) + { - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.newServiceFactory(" + config.getName() + "," + version + ") " + this); } @@ -98,9 +110,11 @@ protected IDsfDebugServicesFactory newServiceFactory(ILaunchConfiguration config // return new GdbJtagDebugServicesFactory(version); } - protected IDsfDebugServicesFactory newServiceFactory(ILaunchConfiguration config, String version, String mode) { + protected IDsfDebugServicesFactory newServiceFactory(ILaunchConfiguration config, String version, String mode) + { - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.newServiceFactory(" + config.getName() + "," + version + "," + mode + ") " + this); } @@ -119,14 +133,17 @@ public void doNotIngoreGdbClient() { fIgnoreGdbClient = false; } + /** * This method is called first when starting a debug session. */ @Override protected GdbLaunch createGdbLaunch(ILaunchConfiguration configuration, String mode, ISourceLocator locator) - throws CoreException { + throws CoreException + { - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.createGdbLaunch(" + configuration.getName() + "," + mode + ") " + this); } @@ -144,22 +161,122 @@ protected GdbLaunch createGdbLaunch(ILaunchConfiguration configuration, String m } @Override - protected String getGDBVersion(ILaunchConfiguration config) throws CoreException { + protected String getGDBVersion(ILaunchConfiguration config) throws CoreException + { String gdbClientCommand = Configuration.getGdbClientCommand(config, null); - String version = DebugUtils.getGDBVersion(config, gdbClientCommand); - if (Activator.getInstance().isDebugging()) { + String version = getGDBVersion(config, gdbClientCommand); + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.getGDBVersion " + version); } return version; } + private String getGDBVersion(final ILaunchConfiguration configuration, String gdbClientCommand) throws CoreException + { + + String[] cmdArray = new String[2]; + cmdArray[0] = gdbClientCommand; + cmdArray[1] = "--version"; + + final Process process; + try + { + process = ProcessFactory.getFactory().exec(cmdArray, DebugUtils.getLaunchEnvironment(configuration)); + } + catch (IOException e) + { + throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED, + "Error while launching command: " + StringUtils.join(cmdArray, " "), e.getCause()));//$NON-NLS-2$ + } + + // Start a timeout job to make sure we don't get stuck waiting for + // an answer from a gdb that is hanging + // Bug 376203 + Job timeoutJob = new Job("GDB version timeout job") //$NON-NLS-1$ + { + { + setSystem(true); + } + + @Override + protected IStatus run(IProgressMonitor arg) + { + // Took too long. Kill the gdb process and + // let things clean up. + process.destroy(); + return Status.OK_STATUS; + } + }; + timeoutJob.schedule(10000); + + InputStream stream = null; + StringBuilder cmdOutput = new StringBuilder(200); + try + { + stream = process.getInputStream(); + Reader r = new InputStreamReader(stream); + BufferedReader reader = new BufferedReader(r); + + String line; + while ((line = reader.readLine()) != null) + { + cmdOutput.append(line); + cmdOutput.append('\n'); // $NON-NLS-1$ + } + } + catch (IOException e) + { + throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED, + "Error reading GDB STDOUT after sending: " + StringUtils.join(cmdArray, " ") + ", response: " + + cmdOutput, + e.getCause()));// $NON-NLS-1$ + } finally + { + // If we get here we are obviously not stuck so we can cancel the + // timeout job. + // Note that it may already have executed, but that is not a + // problem. + timeoutJob.cancel(); + + // Cleanup to avoid leaking pipes + // Close the stream we used, and then destroy the process + // Bug 345164 + if (stream != null) + { + try + { + stream.close(); + } + catch (IOException e) + { + } + } + process.destroy(); + } + + String gdbVersion = LaunchUtils.getGDBVersionFromText(cmdOutput.toString()); + if (gdbVersion == null || gdbVersion.isEmpty()) + { + String errorMessage = process.exitValue() == STATUS_DLL_NOT_FOUND ? Messages.DllNotFound_ExceptionMessage + : cmdOutput.toString(); + throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED, + "Could not determine GDB version after sending: " + StringUtils.join(cmdArray, " ") + + ", response: \n" + errorMessage + "\nERROR CODE:" + process.exitValue(), + null));// $NON-NLS-1$ // $NON-NLS-2$ + } + + return gdbVersion; + } + public void launchWithoutGdbClient(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { fDoStartGdbClient = false; launch(config, mode, launch, monitor); } + /** * After Launch.initialise(), call here to effectively launch. * @@ -167,22 +284,26 @@ public void launchWithoutGdbClient(ILaunchConfiguration config, String mode, ILa */ @Override public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) - throws CoreException { + throws CoreException + { - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println( "openocd.LaunchConfigurationDelegate.launch(" + config.getName() + "," + mode + ") " + this); } org.eclipse.cdt.launch.LaunchUtils.enableActivity("org.eclipse.cdt.debug.dsfgdbActivity", true); //$NON-NLS-1$ - if (monitor == null) { + if (monitor == null) + { monitor = new NullProgressMonitor(); } if (config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "").isEmpty()) //$NON-NLS-1$ { setProgramNameAtr(config); } - if (mode.equals(ILaunchManager.DEBUG_MODE) || mode.equals(ILaunchManager.RUN_MODE)) { + if (mode.equals(ILaunchManager.DEBUG_MODE) || mode.equals(ILaunchManager.RUN_MODE)) + { launchDebugger(config, launch, monitor); } } @@ -192,7 +313,8 @@ private void setProgramNameAtr(ILaunchConfiguration config) throws CoreException ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); IProject project = config.getMappedResources()[0].getProject(); String programName = ""; //$NON-NLS-1$ - GenericJsonReader jsonReader = new GenericJsonReader(IDFUtil.getBuildDir(project) + File.separator + IDFConstants.PROECT_DESCRIPTION_JSON); + GenericJsonReader jsonReader = new GenericJsonReader( + IDFUtil.getBuildDir(project) + File.separator + IDFConstants.PROECT_DESCRIPTION_JSON); String value = jsonReader.getValue("app_elf"); //$NON-NLS-1$ if (!StringUtil.isEmpty(value)) { @@ -203,27 +325,33 @@ private void setProgramNameAtr(ILaunchConfiguration config) throws CoreException } private void launchDebugger(ILaunchConfiguration config, ILaunch launch, IProgressMonitor monitor) - throws CoreException { + throws CoreException + { - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.launchDebugger(" + config.getName() + ") " + this); } int totalWork = 10; - if (fDoStartGdbServer) { + if (fDoStartGdbServer) + { // Extra units due to server console totalWork += 1; } monitor.beginTask(LaunchMessages.getString("GdbLaunchDelegate.0"), totalWork); //$NON-NLS-1$ - if (monitor.isCanceled()) { + if (monitor.isCanceled()) + { cleanupLaunch(launch); return; } - try { + try + { launchDebugSession(config, launch, monitor); - } finally { + } finally + { monitor.done(); } } @@ -231,9 +359,11 @@ private void launchDebugger(ILaunchConfiguration config, ILaunch launch, IProgre /** @since 4.1 */ @Override protected void launchDebugSession(final ILaunchConfiguration config, ILaunch l, IProgressMonitor monitor) - throws CoreException { + throws CoreException + { - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println( "openocd.LaunchConfigurationDelegate.launchDebugSession(" + config.getName() + ") " + this); } @@ -243,7 +373,8 @@ protected void launchDebugSession(final ILaunchConfiguration config, ILaunch l, // -------------------------------------------------------------------- - if (monitor.isCanceled()) { + if (monitor.isCanceled()) + { cleanupLaunch(l); return; } @@ -253,11 +384,16 @@ protected void launchDebugSession(final ILaunchConfiguration config, ILaunch l, final GdbLaunch launch = (GdbLaunch) l; - if (sessionType == SessionType.REMOTE) { + if (sessionType == SessionType.REMOTE) + { monitor.subTask(LaunchMessages.getString("GdbLaunchDelegate.1")); //$NON-NLS-1$ - } else if (sessionType == SessionType.CORE) { + } + else if (sessionType == SessionType.CORE) + { monitor.subTask(LaunchMessages.getString("GdbLaunchDelegate.2")); //$NON-NLS-1$ - } else { + } + else + { assert sessionType == SessionType.LOCAL : "Unexpected session type: " + sessionType.toString(); //$NON-NLS-1$ monitor.subTask(LaunchMessages.getString("GdbLaunchDelegate.3")); //$NON-NLS-1$ } @@ -271,7 +407,8 @@ protected void launchDebugSession(final ILaunchConfiguration config, ILaunch l, // the path of any executable we can attach to. // - In local single process, GDB has the ability to find the executable // automatically. - if (!attach) { + if (!attach) + { checkBinaryDetails(config); } @@ -285,7 +422,8 @@ protected void launchDebugSession(final ILaunchConfiguration config, ILaunch l, // First make sure non-stop is supported, if the user want to use this // mode - if (LaunchUtils.getIsNonStopMode(config) && !isNonStopSupportedInGdbVersion(gdbVersion)) { + if (LaunchUtils.getIsNonStopMode(config) && !isNonStopSupportedInGdbVersion(gdbVersion)) + { cleanupLaunch(launch); throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED, "Non-stop mode is not supported for GDB " + gdbVersion + ", GDB " + NON_STOP_FIRST_VERSION //$NON-NLS-1$ //$NON-NLS-2$ @@ -293,7 +431,8 @@ protected void launchDebugSession(final ILaunchConfiguration config, ILaunch l, null)); } - if (LaunchUtils.getIsPostMortemTracing(config) && !isPostMortemTracingSupportedInGdbVersion(gdbVersion)) { + if (LaunchUtils.getIsPostMortemTracing(config) && !isPostMortemTracingSupportedInGdbVersion(gdbVersion)) + { cleanupLaunch(launch); throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED, "Post-mortem tracing is not supported for GDB " + gdbVersion + ", GDB " + NON_STOP_FIRST_VERSION //$NON-NLS-1$ //$NON-NLS-2$ @@ -320,46 +459,63 @@ protected void launchDebugSession(final ILaunchConfiguration config, ILaunch l, Sequence serverServicesLaunchSequence = getServerServicesSequence(launch.getSession(), launch, subMonServer); - try { + try + { // Execute on DSF thread and wait for it. launch.getSession().getExecutor().execute(serverServicesLaunchSequence); serverServicesLaunchSequence.get(); succeed = true; - } catch (InterruptedException e1) { + } + catch (InterruptedException e1) + { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ - } catch (ExecutionException e1) { + } + catch (ExecutionException e1) + { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in services launch sequence", e1.getCause())); //$NON-NLS-1$ - } catch (CancellationException e1) { + } + catch (CancellationException e1) + { // Launch aborted, so exit cleanly - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.launchDebugger() aborted, so exit cleanly"); } return; - } finally { - if (!succeed) { + } finally + { + if (!succeed) + { cleanupLaunch(launch); } } - if (fDoStartGdbServer) { + if (fDoStartGdbServer) + { // This contributes 1 work units to the monitor ((Launch) launch).initializeServerConsole(monitor); // Wait for the server to be available, or to know it failed. IStatus serverStatus; - try { - Callable callable = new Callable() { + try + { + Callable callable = new Callable() + { @Override - public IStatus call() throws CoreException { + public IStatus call() throws CoreException + { DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), launch.getSession().getId()); GdbServerBackend backend = tracker.getService(GdbServerBackend.class); - if (backend != null) { + if (backend != null) + { return backend.getServerExitStatus(); - } else { + } + else + { throw new CoreException( new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not start GDB server.")); } @@ -369,9 +525,12 @@ public IStatus call() throws CoreException { // Wait to get the server status. Being endless should not be a // problem, the timeout will kill it if too long. serverStatus = null; - while (serverStatus == null) { - if (monitor.isCanceled()) { - if (Activator.getInstance().isDebugging()) { + while (serverStatus == null) + { + if (monitor.isCanceled()) + { + if (Activator.getInstance().isDebugging()) + { System.out.println( "openocd.LaunchConfigurationDelegate.launchDebugSession() sleep cancelled" + this); } @@ -380,36 +539,47 @@ public IStatus call() throws CoreException { } Thread.sleep(10); serverStatus = launch.getSession().getExecutor().submit(callable).get(); - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.print('!'); } } - if (serverStatus != Status.OK_STATUS) { - if ("TERMINATED".equals(serverStatus.getMessage())) { + if (serverStatus != Status.OK_STATUS) + { + if ("TERMINATED".equals(serverStatus.getMessage())) + { cleanupLaunch(launch); return; } - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.launchDebugger() " + serverStatus); } throw new CoreException(serverStatus); } - } catch (InterruptedException e) { + } + catch (InterruptedException e) + { Activator.log(e); - } catch (ExecutionException e) { + } + catch (ExecutionException e) + { Activator.log(e); } - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println( "openocd.LaunchConfigurationDelegate.launchDebugSession() * Server start confirmed. *"); } } - if (!fDoStartGdbClient) { - if (Activator.getInstance().isDebugging()) { + if (!fDoStartGdbClient) + { + if (Activator.getInstance().isDebugging()) + { System.out.println( "openocd.LaunchConfigurationDelegate.launchDebugSession() No GDB client, abruptly return."); } @@ -425,25 +595,35 @@ public IStatus call() throws CoreException { launch.getSession().getExecutor().execute(servicesLaunchSequence); // boolean succeed = false; - try { + try + { servicesLaunchSequence.get(); succeed = true; - } catch (InterruptedException e1) { + } + catch (InterruptedException e1) + { throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ - } catch (ExecutionException e1) { + } + catch (ExecutionException e1) + { throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in services launch sequence", e1.getCause())); //$NON-NLS-1$ - } catch (CancellationException e1) { + } + catch (CancellationException e1) + { // Launch aborted, so exit cleanly return; - } finally { - if (!succeed) { + } finally + { + if (!succeed) + { cleanupLaunch(launch); } } - if (monitor.isCanceled()) { + if (monitor.isCanceled()) + { cleanupLaunch(launch); return; } @@ -472,44 +652,59 @@ public IStatus call() throws CoreException { final IProgressMonitor subMon2 = new SubProgressMonitor(monitor, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); - Query completeLaunchQuery = new Query() { + Query completeLaunchQuery = new Query() + { @Override - protected void execute(final DataRequestMonitor rm) { + protected void execute(final DataRequestMonitor rm) + { DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), launch.getSession().getId()); IGDBControl control = tracker.getService(IGDBControl.class); tracker.dispose(); - control.completeInitialization( - new RequestMonitorWithProgress(ImmediateExecutor.getInstance(), subMon2) { - @Override - protected void handleCompleted() { - if (isCanceled()) { - rm.cancel(); - } else { - rm.setStatus(getStatus()); - } - rm.done(); - } - }); + control.completeInitialization(new RequestMonitorWithProgress(ImmediateExecutor.getInstance(), subMon2) + { + @Override + protected void handleCompleted() + { + if (isCanceled()) + { + rm.cancel(); + } + else + { + rm.setStatus(getStatus()); + } + rm.done(); + } + }); } }; launch.getSession().getExecutor().execute(completeLaunchQuery); succeed = false; - try { + try + { completeLaunchQuery.get(); succeed = true; - } catch (InterruptedException e1) { + } + catch (InterruptedException e1) + { throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ - } catch (ExecutionException e1) { + } + catch (ExecutionException e1) + { throw new DebugException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in final launch sequence", e1.getCause())); //$NON-NLS-1$ - } catch (CancellationException e1) { + } + catch (CancellationException e1) + { // Launch aborted, so exit cleanly return; - } finally { - if (!succeed) { + } finally + { + if (!succeed) + { // finalLaunchSequence failed. Shutdown the session so that all // started // services including any GDB process are shutdown. (bug 251486) @@ -523,26 +718,35 @@ protected void handleCompleted() { * Perform some local validations before starting the debug session. */ @Override - protected IPath checkBinaryDetails(final ILaunchConfiguration config) throws CoreException { + protected IPath checkBinaryDetails(final ILaunchConfiguration config) throws CoreException + { boolean doStartServer = true; - try { + try + { doStartServer = Configuration.getDoStartGdbServer(config); - } catch (CoreException e) { + } + catch (CoreException e) + { ; } - if (doStartServer) { + if (doStartServer) + { // If we should start the server, there must be a configuration // present, otherwise refuse to start. String configOptions = ""; - try { + try + { configOptions = Configuration.getGdbServerOtherConfig(config); - } catch (CoreException e) { + } + catch (CoreException e) + { ; } - if (configOptions.isEmpty()) { + if (configOptions.isEmpty()) + { throw new CoreException( new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Missing mandatory configuration. " + "Fill-in the 'Config options:' field in the Debugger tab.")); //$NON-NLS-1$ @@ -557,18 +761,22 @@ protected IPath checkBinaryDetails(final ILaunchConfiguration config) throws Cor * Get a custom launch sequence, that inserts a GDB server starter. */ @Override - protected Sequence getServicesSequence(DsfSession session, ILaunch launch, IProgressMonitor progressMonitor) { + protected Sequence getServicesSequence(DsfSession session, ILaunch launch, IProgressMonitor progressMonitor) + { - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.getServicesSequence()"); } return new ServicesLaunchSequence(session, (GdbLaunch) launch, progressMonitor); } - protected Sequence getServerServicesSequence(DsfSession session, ILaunch launch, IProgressMonitor progressMonitor) { + protected Sequence getServerServicesSequence(DsfSession session, ILaunch launch, IProgressMonitor progressMonitor) + { - if (Activator.getInstance().isDebugging()) { + if (Activator.getInstance().isDebugging()) + { System.out.println("openocd.LaunchConfigurationDelegate.getServerServicesSequence()"); } diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/Messages.java b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/Messages.java index 8ad68ea45..b38179da6 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/Messages.java +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/Messages.java @@ -22,7 +22,8 @@ import com.espressif.idf.debug.gdbjtag.openocd.Activator; -public class Messages { +public class Messages +{ // ------------------------------------------------------------------------ @@ -36,7 +37,7 @@ public class Messages { public static String McuPage_executable_label; public static String McuPage_executable_folder; - + public static String BreakPointPage_RadioGroupTitle; public static String BreakPointPage_BtnStartHeapTrace; public static String BreakPointPage_BtnStopHeapTrace; @@ -55,36 +56,48 @@ public class Messages { public static String MissingDebugConfigurationTitle; public static String DebugConfigurationNotFoundMsg; public static String AppLvlTracingJob; + + public static String DllNotFound_ExceptionMessage; // ------------------------------------------------------------------------ - static { + static + { // initialise resource bundle NLS.initializeMessages(MESSAGES, Messages.class); } private static ResourceBundle RESOURCE_BUNDLE; - - static { - try { + static + { + try + { RESOURCE_BUNDLE = ResourceBundle.getBundle(MESSAGES); - } catch (MissingResourceException e) { + } + catch (MissingResourceException e) + { Activator.log(e); } } - private Messages() { + private Messages() + { } - public static String getString(String key) { - try { + public static String getString(String key) + { + try + { return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { + } + catch (MissingResourceException e) + { return '!' + key + '!'; } } - public static ResourceBundle getResourceBundle() { + public static ResourceBundle getResourceBundle() + { return RESOURCE_BUNDLE; } diff --git a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties index 57bd5be58..1ec66882b 100644 --- a/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties +++ b/bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/ui/messages.properties @@ -396,4 +396,6 @@ StartupTabEnableVerboseOutput=Enable verbose output MissingDebugConfigurationTitle=Missing debug configuration OpenOcdFailedMsg=OpenOCD was not started DebugConfigurationNotFoundMsg=No matching debug configuration was found for the selected project. Do you want to create it? -AppLvlTracingJob=Launching application level tracing \ No newline at end of file +AppLvlTracingJob=Launching application level tracing + +DllNotFound_ExceptionMessage=some required DLL(s) not found \ No newline at end of file