mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
211923. Make the memory space support in gdb/mi optional, via a global pref.
This commit is contained in:
parent
d5eb584400
commit
ad701b9da6
5 changed files with 34 additions and 4 deletions
|
@ -50,8 +50,10 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration;
|
|||
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
|
||||
import org.eclipse.cdt.debug.mi.core.CoreProcess;
|
||||
import org.eclipse.cdt.debug.mi.core.IMIConstants;
|
||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
||||
import org.eclipse.cdt.debug.mi.core.MIInferior;
|
||||
import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||
import org.eclipse.cdt.debug.mi.core.RxThread;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
|
||||
|
@ -1288,6 +1290,11 @@ public class Target extends SessionObject implements ICDITarget, ICDIBreakpointM
|
|||
}
|
||||
|
||||
public String[] getMemorySpaces() {
|
||||
return new String[] { CODE_MEMORY_SPACE, DATA_MEMORY_SPACE };
|
||||
if (MIPlugin.getDefault().getPluginPreferences().getBoolean(IMIConstants.PREF_ENABLE_MEMORY_SPACES)) {
|
||||
return new String[] { CODE_MEMORY_SPACE, DATA_MEMORY_SPACE };
|
||||
}
|
||||
else {
|
||||
return new String[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,4 +63,18 @@ public interface IMIConstants
|
|||
* The default value of the for <code>PREF_SHARED_LIBRARIES_AUTO_REFRESH</code> property
|
||||
*/
|
||||
public static final boolean DEF_PREF_SHARED_LIBRARIES_AUTO_REFRESH = true;
|
||||
|
||||
/**
|
||||
* Boolean preference controlling whether memory spaces will be supported.
|
||||
* gdb has implicit awareness of two memory spaces: "code" and "data". Most
|
||||
* users don't need that capability, though, and so we expose it in the UI
|
||||
* only if the user turns it on.
|
||||
*/
|
||||
public static final String PREF_ENABLE_MEMORY_SPACES = PLUGIN_ID + ".PREF_ENABLE_MEMORY_SPACES"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* The default value of the for <code>PREF_ENABLE_MEMORY_SPACES</code> property
|
||||
*/
|
||||
public static final boolean DEF_PREF_ENABLE_MEMORY_SPACES = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,5 +28,6 @@ public class MIPreferenceInitializer extends AbstractPreferenceInitializer {
|
|||
MIPlugin.getDefault().getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_TIMEOUT, IMIConstants.DEF_REQUEST_TIMEOUT);
|
||||
MIPlugin.getDefault().getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, IMIConstants.DEF_REQUEST_LAUNCH_TIMEOUT);
|
||||
MIPlugin.getDefault().getPluginPreferences().setDefault(IMIConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, IMIConstants.DEF_PREF_SHARED_LIBRARIES_AUTO_REFRESH);
|
||||
MIPlugin.getDefault().getPluginPreferences().setDefault(IMIConstants.PREF_ENABLE_MEMORY_SPACES, IMIConstants.DEF_PREF_ENABLE_MEMORY_SPACES);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -326,6 +326,8 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
|||
private MIIntegerFieldEditor fLaunchTimeoutText;
|
||||
|
||||
private BooleanFieldEditor fRefreshSolibsButton;
|
||||
|
||||
private BooleanFieldEditor fMemorySpacesButton;
|
||||
|
||||
private MIPreferenceStore fMICorePreferenceStore = new MIPreferenceStore( MIPlugin.getDefault().getPluginPreferences() );
|
||||
|
||||
|
@ -358,6 +360,8 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
|||
composite.setLayoutData( data );
|
||||
createSpacer( composite, 1 );
|
||||
createCommunicationPreferences( composite );
|
||||
createSpacer( composite, 1 );
|
||||
fMemorySpacesButton = createCheckbox(IMIConstants.PREF_ENABLE_MEMORY_SPACES, PreferenceMessages.getString( "MIPreferencePage.7" ), composite ); //$NON-NLS-1$
|
||||
return composite;
|
||||
}
|
||||
|
||||
|
@ -398,6 +402,7 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
|||
fDebugTimeoutText.loadDefault();
|
||||
fLaunchTimeoutText.loadDefault();
|
||||
fRefreshSolibsButton.loadDefault();
|
||||
fMemorySpacesButton.loadDefault();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -429,7 +434,7 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
|||
fDebugTimeoutText.setPropertyChangeListener( this );
|
||||
fLaunchTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, PreferenceMessages.getString( "MIPreferencePage.3" ), spacingComposite ); //$NON-NLS-1$
|
||||
fLaunchTimeoutText.setPropertyChangeListener( this );
|
||||
fRefreshSolibsButton = createRefreshField( IMIConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, PreferenceMessages.getString( "MIPreferencePage.6" ), spacingComposite ); //$NON-NLS-1$
|
||||
fRefreshSolibsButton = createCheckbox( IMIConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, PreferenceMessages.getString( "MIPreferencePage.6" ), spacingComposite ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -439,6 +444,7 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
|||
fDebugTimeoutText.store();
|
||||
fLaunchTimeoutText.store();
|
||||
fRefreshSolibsButton.store();
|
||||
fMemorySpacesButton.store();
|
||||
}
|
||||
|
||||
private MIIntegerFieldEditor createTimeoutField( String preference, String label, Composite parent ) {
|
||||
|
@ -457,14 +463,14 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
|||
return toText;
|
||||
}
|
||||
|
||||
private BooleanFieldEditor createRefreshField( String preference, String label, Composite parent ) {
|
||||
private BooleanFieldEditor createCheckbox( String preference, String label, Composite parent ) {
|
||||
BooleanFieldEditor field = new BooleanFieldEditor( preference, label, parent );
|
||||
field.setPage( this );
|
||||
field.setPreferenceStore( new MIPreferenceStore( MIPlugin.getDefault().getPluginPreferences() ) );
|
||||
field.load();
|
||||
return field;
|
||||
}
|
||||
|
||||
|
||||
protected MIPreferenceStore getMICorePreferenceStore() {
|
||||
return fMICorePreferenceStore;
|
||||
}
|
||||
|
@ -476,6 +482,7 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
|||
fDebugTimeoutText.dispose();
|
||||
fLaunchTimeoutText.dispose();
|
||||
fRefreshSolibsButton.dispose();
|
||||
fMemorySpacesButton.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,3 +16,4 @@ MIPreferencePage.2=&Debugger timeout (ms):
|
|||
MIPreferencePage.3=&Launch timeout (ms):
|
||||
MIPreferencePage.4=Value must be an integer between {0} and {1}.
|
||||
MIPreferencePage.6=Automatically refresh modules
|
||||
MIPreferencePage.7=Distinct code and data memory spaces
|
||||
|
|
Loading…
Add table
Reference in a new issue