Skip to content

Commit 89f6a91

Browse files
authored
fix in saving openocd timeout preference (#477)
1 parent 7d09be9 commit 89f6a91

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

bundles/com.espressif.idf.debug.gdbjtag.openocd/src/com/espressif/idf/debug/gdbjtag/openocd/dsf/GdbServerBackend.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,27 @@
1515
package com.espressif.idf.debug.gdbjtag.openocd.dsf;
1616

1717
import ilg.gnumcueclipse.core.StringUtils;
18+
import ilg.gnumcueclipse.core.preferences.ScopedPreferenceStoreWithoutDefaults;
1819
import ilg.gnumcueclipse.debug.gdbjtag.dsf.GnuMcuGdbServerBackend;
1920

2021
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
2122
import org.eclipse.cdt.dsf.service.DsfSession;
2223
import org.eclipse.core.runtime.CoreException;
2324
import org.eclipse.core.runtime.IStatus;
2425
import org.eclipse.core.runtime.Status;
26+
import org.eclipse.core.runtime.preferences.InstanceScope;
2527
import org.eclipse.debug.core.ILaunchConfiguration;
28+
import org.eclipse.jface.preference.IPreferenceStore;
2629
import org.osgi.framework.BundleContext;
2730

2831
import com.espressif.idf.debug.gdbjtag.openocd.Activator;
2932
import com.espressif.idf.debug.gdbjtag.openocd.Configuration;
33+
import com.espressif.idf.ui.UIPlugin;
3034

3135
public class GdbServerBackend extends GnuMcuGdbServerBackend {
3236

3337
// ------------------------------------------------------------------------
3438

35-
// protected int fGdbServerLaunchTimeout = 25;
3639
protected boolean fDoStartGdbClient;
3740

3841
// ------------------------------------------------------------------------
@@ -139,7 +142,8 @@ public String getServerCommandName() {
139142

140143
@Override
141144
public int getServerLaunchTimeoutSeconds() {
142-
return Activator.getInstance().getPreferenceStore().getInt(Activator.GDB_SERVER_LAUNCH_TIMEOUT);
145+
IPreferenceStore preferenceStore = new ScopedPreferenceStoreWithoutDefaults(InstanceScope.INSTANCE, UIPlugin.PLUGIN_ID);
146+
return preferenceStore.getInt(Activator.GDB_SERVER_LAUNCH_TIMEOUT);
143147
}
144148

145149
public String getServerName() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
EspresssifPreferencesPage_IDFSpecificPrefs=ESP-IDF Specific Preferences.
2-
GDBServerTimeoutPage_TimeoutField=GDB server launch timeout(ms)
2+
GDBServerTimeoutPage_TimeoutField=GDB server launch timeout(s)
33
SerialMonitorPage_Field_NumberOfCharsInLine=Console Line Width (maximum characters):
44
SerialMonitorPage_Field_NumberOfLines=Limit Console Output (number of lines):
55
SerialMonitorPage_GroupHeading=Serial Monitor Setting

0 commit comments

Comments
 (0)