Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bundles/com.espressif.idf.debug.gdbjtag.openocd/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,14 @@
label="IDF Process Console">
</consoleFactory>
</extension>
<extension
point="org.eclipse.debug.core.statusHandlers">
<statusHandler
class="com.espressif.idf.debug.gdbjtag.openocd.ui.OpenocdStatusHandler"
code="5012"
id="com.espressif.idf.debug.gdbjtag.openocd.openocdStatusHandler"
plugin="com.espressif.idf.debug.gdbjtag.openocd">
</statusHandler>
</extension>

</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchManager;
Expand Down Expand Up @@ -446,8 +447,19 @@ else if (sessionType == SessionType.CORE)
}
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$
if (e1.getMessage().contains("Starting OpenOCD timed out.")) //$NON-NLS-1$
{
IStatus status = new Status(IStatus.OK, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED,
"Error in services launch sequence", e1.getCause()); //$NON-NLS-1$
DebugPlugin.getDefault().getStatusHandler(status).handleStatus(status, null);
throw new DebugException(Status.OK_STATUS);
}
else
{
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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class Messages
public static String TabMain_Launch_Config;

public static String TabDebugger_SettingTargetJob;

public static String OpenOCDConsole_ErrorGuideMessage;

public static String TabDebugger_noConfigOptions;
Expand All @@ -71,6 +71,10 @@ public class Messages
public static String TabDebugger_noTclPort;
public static String TabDebugger_noTelnetPort;

public static String ServerTimeoutErrorDialog_title;
public static String ServerTimeoutErrorDialog_message;
public static String ServerTimeoutErrorDialog_customAreaMessage;

// ------------------------------------------------------------------------

static
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*******************************************************************************
* Copyright 2024 Espressif Systems (Shanghai) PTE LTD. All rights reserved.
* Use is subject to license terms.
*******************************************************************************/
package com.espressif.idf.debug.gdbjtag.openocd.ui;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.dialogs.PreferencesUtil;

public class OpenocdStatusHandler implements IStatusHandler
{
private static final String ESPRESSIF_PREFERENCES_MAINPAGE_ID = "com.espressif.idf.ui.preferences.mainpage"; //$NON-NLS-1$

public Object handleStatus(IStatus status, Object source) throws CoreException
{
Display.getDefault().asyncExec(() -> {
MessageDialog dialog = new MessageDialog(Display.getCurrent().getActiveShell(),
Messages.ServerTimeoutErrorDialog_title, null, Messages.ServerTimeoutErrorDialog_message,
MessageDialog.ERROR, 0, IDialogConstants.OK_LABEL)
{
@Override
public Control createCustomArea(Composite parent)
{
Link link = new Link(parent, SWT.WRAP);
link.setText(Messages.ServerTimeoutErrorDialog_customAreaMessage);
link.addSelectionListener(new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
PreferencesUtil.createPreferenceDialogOn(parent.getShell(),
ESPRESSIF_PREFERENCES_MAINPAGE_ID, null, null).open();
}
});
return link;
}

};
dialog.open();
});
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,9 @@ TabMain_Launch_Config=Launch Configuration:


## Console Messages ##
OpenOCDConsole_ErrorGuideMessage=Please refer to the troubleshooting guide below to identify the problem.
OpenOCDConsole_ErrorGuideMessage=Please refer to the troubleshooting guide below to identify the problem.

## Timeout Exception Dialog ##
ServerTimeoutErrorDialog_customAreaMessage=To increase timeout time visit <a>the Espressif Preference Page</a>.
ServerTimeoutErrorDialog_message=Starting OpenOCD timed out. Try to increase the `GDB server launch timeout`
ServerTimeoutErrorDialog_title=Problem Occurred