1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-20 15:35:24 +02:00

Bugzilla 225606

This commit is contained in:
Randy Rohrbach 2008-04-05 02:14:07 +00:00
parent 8049a7bb12
commit d25c62e763
2 changed files with 93 additions and 29 deletions

View file

@ -107,27 +107,6 @@ public interface IRegisters extends IFormattedValues {
String getLongName(); String getLongName();
} }
/**
* Retrieves register group data for given context.
* @param dmc Context to retrieve data for.
* @param rm Request completion monitor.
*/
void getRegisterGroupData(IRegisterGroupDMContext dmc, DataRequestMonitor<IRegisterGroupDMData> rm);
/**
* Retrieves register data for given context.
* @param dmc Context to retrieve data for.
* @param rm Request completion monitor.
*/
void getRegisterData(IRegisterDMContext dmc , DataRequestMonitor<IRegisterDMData> rm);
/**
* Retrieves bit field data for given context.
* @param dmc Context to retrieve data for.
* @param rm Request completion monitor.
*/
void getBitFieldData(IBitFieldDMContext dmc , DataRequestMonitor<IBitFieldDMData> rm);
/** /**
* Retrieves the list of register groups. * Retrieves the list of register groups.
* @param ctx Context for the returned data. * @param ctx Context for the returned data.
@ -151,6 +130,56 @@ public interface IRegisters extends IFormattedValues {
*/ */
void getBitFields(IDMContext ctx, DataRequestMonitor<IBitFieldDMContext[]> rm); void getBitFields(IDMContext ctx, DataRequestMonitor<IBitFieldDMContext[]> rm);
/**
* Retrieves a Register Group context. The given context could include a register
* group and an execution context or just an execution context.
* @param ctx Context for the returned data.
* @param name Name of group being requested
* @param rm Request completion monitor.
*/
void findRegisterGroup(IDMContext ctx, String name, DataRequestMonitor<IRegisterGroupDMContext> rm);
/**
* Retrieves a Register context. The given context could include a register group and an execution
* context or just an execution context.
* @param ctx Context for the returned data.
* @param name Name of register being requested
* @param rm Request completion monitor.
*/
void findRegister(IDMContext ctx, String name, DataRequestMonitor<IRegisterDMContext> rm);
/**
* Retrieves bit field context. The given context could include a register and an execution
* context or just an execution context.
* @param ctx Context for the returned data.
* @param name Name of bit field being requested
* @param rm Request completion monitor.
*/
void findBitField(IDMContext ctx, String name, DataRequestMonitor<IBitFieldDMContext> rm);
/**
* Retrieves register group data for given context.
* @param dmc Context to retrieve data for.
* @param rm Request completion monitor.
*/
void getRegisterGroupData(IRegisterGroupDMContext dmc, DataRequestMonitor<IRegisterGroupDMData> rm);
/**
* Retrieves register data for given context.
* @param dmc Context to retrieve data for.
* @param rm Request completion monitor.
*/
void getRegisterData(IRegisterDMContext dmc , DataRequestMonitor<IRegisterDMData> rm);
/**
* Retrieves bit field data for given context.
* @param dmc Context to retrieve data for.
* @param rm Request completion monitor.
*/
void getBitFieldData(IBitFieldDMContext dmc , DataRequestMonitor<IBitFieldDMData> rm);
/** /**
* Writes a register value for a given register to the target * Writes a register value for a given register to the target
* @param regCtx Context containing the register. * @param regCtx Context containing the register.

View file

@ -40,7 +40,6 @@ import org.eclipse.dd.mi.service.command.output.MIInfo;
import org.eclipse.dd.mi.service.command.output.MIRegisterValue; import org.eclipse.dd.mi.service.command.output.MIRegisterValue;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
/** /**
* *
* <p> * <p>
@ -203,7 +202,7 @@ public class MIRegisters extends AbstractDsfService implements IRegisters {
public void getModelData(IDMContext dmc, DataRequestMonitor<?> rm) { public void getModelData(IDMContext dmc, DataRequestMonitor<?> rm) {
/* /*
* This is the method which is called when actual results need to be returned. We * This is the method which is called when actual results need to be returned. We
* can be called either with a service DMC for which we return oureslves or we can * can be called either with a service DMC for which we return ourselves or we can
* be called with the DMC's we have handed out. If the latter is the case then we * be called with the DMC's we have handed out. If the latter is the case then we
* data mine by talking to the Debug Engine. * data mine by talking to the Debug Engine.
*/ */
@ -396,14 +395,16 @@ public class MIRegisters extends AbstractDsfService implements IRegisters {
* need to be flushed. These handlers maintain the state of the caches. * need to be flushed. These handlers maintain the state of the caches.
*/ */
@DsfServiceEventHandler public void eventDispatched(IRunControl.IResumedDMEvent e) { @DsfServiceEventHandler
public void eventDispatched(IRunControl.IResumedDMEvent e) {
fRegisterValueCache.setContextAvailable(e.getDMContext(), false); fRegisterValueCache.setContextAvailable(e.getDMContext(), false);
if (e.getReason() != StateChangeReason.STEP) { if (e.getReason() != StateChangeReason.STEP) {
fRegisterValueCache.reset(); fRegisterValueCache.reset();
} }
} }
@DsfServiceEventHandler public void eventDispatched( @DsfServiceEventHandler
public void eventDispatched(
IRunControl.ISuspendedDMEvent e) { IRunControl.ISuspendedDMEvent e) {
fRegisterValueCache.setContextAvailable(e.getDMContext(), true); fRegisterValueCache.setContextAvailable(e.getDMContext(), true);
fRegisterValueCache.reset(); fRegisterValueCache.reset();
@ -414,6 +415,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters {
fRegisterValueCache.reset(); fRegisterValueCache.reset();
} }
private void generateRegisterChangedEvent(IRegisterDMContext dmc ) {
getSession().dispatchEvent(new RegisterChangedDMEvent(dmc), getProperties());
}
/* /*
* These are the public interfaces for this service. * These are the public interfaces for this service.
* *
@ -562,12 +567,20 @@ public class MIRegisters extends AbstractDsfService implements IRegisters {
rm.done(); rm.done();
} }
/*
* (non-Javadoc)
* @see org.eclipse.dd.dsf.debug.service.IFormattedValues#getAvailableFormats(org.eclipse.dd.dsf.debug.service.IFormattedValues.IFormattedDataDMContext, org.eclipse.dd.dsf.concurrent.DataRequestMonitor)
*/
public void getAvailableFormats(IFormattedDataDMContext dmc, DataRequestMonitor<String[]> rm) { public void getAvailableFormats(IFormattedDataDMContext dmc, DataRequestMonitor<String[]> rm) {
rm.setData(new String[] { HEX_FORMAT, DECIMAL_FORMAT, OCTAL_FORMAT, BINARY_FORMAT, NATURAL_FORMAT }); rm.setData(new String[] { HEX_FORMAT, DECIMAL_FORMAT, OCTAL_FORMAT, BINARY_FORMAT, NATURAL_FORMAT });
rm.done(); rm.done();
} }
/*
* (non-Javadoc)
* @see org.eclipse.dd.dsf.debug.service.IFormattedValues#getFormattedValueContext(org.eclipse.dd.dsf.debug.service.IFormattedValues.IFormattedDataDMContext, java.lang.String)
*/
public FormattedValueDMContext getFormattedValueContext(IFormattedDataDMContext dmc, String formatId) { public FormattedValueDMContext getFormattedValueContext(IFormattedDataDMContext dmc, String formatId) {
if ( dmc instanceof MIRegisterDMC ) { if ( dmc instanceof MIRegisterDMC ) {
MIRegisterDMC regDmc = (MIRegisterDMC) dmc; MIRegisterDMC regDmc = (MIRegisterDMC) dmc;
@ -576,8 +589,30 @@ public class MIRegisters extends AbstractDsfService implements IRegisters {
return null; return null;
} }
private void generateRegisterChangedEvent(IRegisterDMContext dmc ) { /*
getSession().dispatchEvent(new RegisterChangedDMEvent(dmc), getProperties()); * (non-Javadoc)
* @see org.eclipse.dd.dsf.debug.service.IRegisters#findRegisterGroup(org.eclipse.dd.dsf.datamodel.IDMContext, java.lang.String, org.eclipse.dd.dsf.concurrent.DataRequestMonitor)
*/
public void findRegisterGroup(IDMContext ctx, String name, DataRequestMonitor<IRegisterGroupDMContext> rm) {
rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Finding a Register Group context not supported", null)); //$NON-NLS-1$
rm.done();
} }
/*
* (non-Javadoc)
* @see org.eclipse.dd.dsf.debug.service.IRegisters#findRegister(org.eclipse.dd.dsf.datamodel.IDMContext, java.lang.String, org.eclipse.dd.dsf.concurrent.DataRequestMonitor)
*/
public void findRegister(IDMContext ctx, String name, DataRequestMonitor<IRegisterDMContext> rm) {
rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Finding a Register context not supported", null)); //$NON-NLS-1$
rm.done();
}
/*
* (non-Javadoc)
* @see org.eclipse.dd.dsf.debug.service.IRegisters#findBitField(org.eclipse.dd.dsf.datamodel.IDMContext, java.lang.String, org.eclipse.dd.dsf.concurrent.DataRequestMonitor)
*/
public void findBitField(IDMContext ctx, String name, DataRequestMonitor<IBitFieldDMContext> rm) {
rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Finding a Register Group context not supported", null)); //$NON-NLS-1$
rm.done();
}
} }