1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Added support for refresh preferences and properties.

This commit is contained in:
Mikhail Khodjaiants 2004-11-08 23:36:57 +00:00
parent f8dc81e5cc
commit 92f36abdce
7 changed files with 75 additions and 10 deletions

View file

@ -1,3 +1,12 @@
2004-11-08 Mikhail Khodjaiants
Added support for refresh preferences and properties.
* IMIConstants.java
* MIPlugin.java
* MIPreferenceInitializer.java: new
* RegisterManager.java
* SharedLibraryManager.java
* plugin.xml
2004-11-08 Alain Magloire 2004-11-08 Alain Magloire
Implement new Interface ICDIFunctionFinished. Implement new Interface ICDIFunctionFinished.
It returns the return value of the function. It returns the return value of the function.

View file

@ -19,7 +19,9 @@ import java.util.Map;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterDescriptor; import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup; import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup;
import org.eclipse.cdt.debug.mi.core.IMIConstants;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MIPlugin;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Register; import org.eclipse.cdt.debug.mi.core.cdi.model.Register;
import org.eclipse.cdt.debug.mi.core.cdi.model.RegisterDescriptor; import org.eclipse.cdt.debug.mi.core.cdi.model.RegisterDescriptor;
@ -49,6 +51,7 @@ public class RegisterManager extends Manager {
public RegisterManager(Session session) { public RegisterManager(Session session) {
super(session, true); super(session, true);
regsMap = new Hashtable(); regsMap = new Hashtable();
setAutoUpdate( MIPlugin.getDefault().getPluginPreferences().getBoolean( IMIConstants.PREF_REGISTERS_AUTO_REFRESH ) );
} }
synchronized List getRegistersList(Target target) { synchronized List getRegistersList(Target target) {
@ -70,7 +73,6 @@ public class RegisterManager extends Manager {
return getRegisterDescriptors(target); return getRegisterDescriptors(target);
} }
public ICDIRegisterDescriptor[] getRegisterDescriptors(Target target) throws CDIException { public ICDIRegisterDescriptor[] getRegisterDescriptors(Target target) throws CDIException {
Session session = (Session)getSession();
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIDataListRegisterNames registers = factory.createMIDataListRegisterNames(); MIDataListRegisterNames registers = factory.createMIDataListRegisterNames();

View file

@ -20,8 +20,10 @@ import java.util.Map;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration; import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration;
import org.eclipse.cdt.debug.mi.core.IMIConstants;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MIFormat; import org.eclipse.cdt.debug.mi.core.MIFormat;
import org.eclipse.cdt.debug.mi.core.MIPlugin;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.SharedLibrary; import org.eclipse.cdt.debug.mi.core.cdi.model.SharedLibrary;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
@ -55,6 +57,7 @@ public class SharedLibraryManager extends Manager {
public SharedLibraryManager (Session session) { public SharedLibraryManager (Session session) {
super(session, true); super(session, true);
sharedMap = new Hashtable(); sharedMap = new Hashtable();
setAutoUpdate( MIPlugin.getDefault().getPluginPreferences().getBoolean( IMIConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH ) );
} }
synchronized List getSharedList(Target target) { synchronized List getSharedList(Target target) {

View file

@ -48,5 +48,9 @@
id="org.eclipse.cdt.debug.mi.core.GDBServerCDebugger"> id="org.eclipse.cdt.debug.mi.core.GDBServerCDebugger">
</debugger> </debugger>
</extension> </extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer class="org.eclipse.cdt.debug.mi.core.MIPreferenceInitializer"/>
</extension>
</plugin> </plugin>

View file

@ -52,4 +52,26 @@ public interface IMIConstants
* The maximum value the MI request timeout can have. * The maximum value the MI request timeout can have.
*/ */
public static final int MAX_REQUEST_TIMEOUT = Integer.MAX_VALUE; public static final int MAX_REQUEST_TIMEOUT = Integer.MAX_VALUE;
/**
* Boolean preference controlling whether the shared library manager will be
* refreshed every time when the execution of program stops.
*/
public static final String PREF_SHARED_LIBRARIES_AUTO_REFRESH = PLUGIN_ID + ".SharedLibraries.auto_refresh"; //$NON-NLS-1$
/**
* 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 the register manager will be
* refreshed every time when the execution of program stops.
*/
public static final String PREF_REGISTERS_AUTO_REFRESH = PLUGIN_ID + ".Registers.auto_refresh"; //$NON-NLS-1$
/**
* The default value of the for <code>PREF_REGISTERS_AUTO_REFRESH</code> property
*/
public static final boolean DEF_PREF_REGISTERS_AUTO_REFRESH = true;
} }

View file

@ -17,7 +17,6 @@ import java.io.OutputStream;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.MissingResourceException; import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.command.CLICommand; import org.eclipse.cdt.debug.mi.core.command.CLICommand;
@ -26,6 +25,7 @@ import org.eclipse.cdt.debug.mi.core.command.MITargetAttach;
import org.eclipse.cdt.debug.mi.core.command.MITargetSelect; import org.eclipse.cdt.debug.mi.core.command.MITargetSelect;
import org.eclipse.cdt.debug.mi.core.output.MIInfo; import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.utils.pty.PTY; import org.eclipse.cdt.utils.pty.PTY;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Plugin;
@ -370,14 +370,6 @@ public class MIPlugin extends Plugin {
super.start(context); super.start(context);
} }
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#initializeDefaultPluginPrefrences()
*/
protected void initializeDefaultPluginPreferences() {
getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_TIMEOUT, IMIConstants.DEF_REQUEST_TIMEOUT);
getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, IMIConstants.DEF_REQUEST_LAUNCH_TIMEOUT);
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#shutdown() * @see org.eclipse.core.runtime.Plugin#shutdown()
*/ */

View file

@ -0,0 +1,33 @@
/**********************************************************************
* Copyright (c) 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
public class MIPreferenceInitializer extends AbstractPreferenceInitializer {
/**
* Constructor for MIPreferenceInitializer.
*/
public MIPreferenceInitializer() {
super();
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
public void initializeDefaultPreferences() {
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_REGISTERS_AUTO_REFRESH, IMIConstants.DEF_PREF_REGISTERS_AUTO_REFRESH);
MIPlugin.getDefault().getPluginPreferences().setDefault(IMIConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, IMIConstants.DEF_PREF_SHARED_LIBRARIES_AUTO_REFRESH);
}
}