1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 240507

This previous change was a mistake.  I added the ability to build an expression with a process
as a parent, or any other ExecutionContext, but it does not make sense to have
an expression refer to a processor or a core.  I may make sense to have an
expression refer to a process and not a thread, but currently, the Expression
Service does not handle this properly even at the thread level (vs frame
level).

Therefore, I'm removing this patch and will open a new bug about the Expression
Service.
This commit is contained in:
Marc Khouzam 2008-07-12 02:36:12 +00:00
parent 635936b6ea
commit 432390d270

View file

@ -31,8 +31,8 @@ import org.eclipse.dd.dsf.debug.service.IExpressions;
import org.eclipse.dd.dsf.debug.service.IFormattedValues; import org.eclipse.dd.dsf.debug.service.IFormattedValues;
import org.eclipse.dd.dsf.debug.service.IRunControl; import org.eclipse.dd.dsf.debug.service.IRunControl;
import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryChangedEvent; import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryChangedEvent;
import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryDMContext;
import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterDMContext; import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterDMContext;
import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.dd.dsf.debug.service.IRunControl.StateChangeReason; import org.eclipse.dd.dsf.debug.service.IRunControl.StateChangeReason;
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext; import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
import org.eclipse.dd.dsf.debug.service.command.CommandCache; import org.eclipse.dd.dsf.debug.service.command.CommandCache;
@ -138,13 +138,29 @@ public class ExpressionService extends AbstractDsfService implements IExpression
* @param relExpr * @param relExpr
* The relative expression if this expression was created as a child * The relative expression if this expression was created as a child
* @param execCtx * @param execCtx
* The parent execution context for this ExpressionDMC. * The parent thread context for this ExpressionDMC.
* It could be a thread, a process, a processor, etc
*/ */
public MIExpressionDMC(String sessionId, String expression, String relExpr, IExecutionDMContext execCtx) { public MIExpressionDMC(String sessionId, String expression, String relExpr, IMIExecutionDMContext execCtx) {
this(sessionId, expression, relExpr, (IDMContext)execCtx); this(sessionId, expression, relExpr, (IDMContext)execCtx);
} }
/**
* ExpressionDMC Constructor for expression to be evaluated in context of
* a memory space.
*
* @param sessionId
* The session ID in which this context is created.
* @param expression
* The expression to be described by this ExpressionDMC
* @param relExpr
* The relative expression if this expression was created as a child
* @param memoryCtx
* The parent memory space context for this ExpressionDMC.
*/
public MIExpressionDMC(String sessionId, String expression, String relExpr, IMemoryDMContext memoryCtx) {
this(sessionId, expression, relExpr, (IDMContext)memoryCtx);
}
private MIExpressionDMC(String sessionId, String expr, String relExpr, IDMContext parent) { private MIExpressionDMC(String sessionId, String expr, String relExpr, IDMContext parent) {
super(sessionId, new IDMContext[] { parent }); super(sessionId, new IDMContext[] { parent });
exprInfo = new ExpressionInfo(expr, relExpr); exprInfo = new ExpressionInfo(expr, relExpr);
@ -478,19 +494,21 @@ public class ExpressionService extends AbstractDsfService implements IExpression
* Create an expression context. * Create an expression context.
*/ */
public IExpressionDMContext createExpression(IDMContext ctx, String expression, String relExpr) { public IExpressionDMContext createExpression(IDMContext ctx, String expression, String relExpr) {
// First, try to find a frame context to which this expression will apply
IFrameDMContext frameDmc = DMContexts.getAncestorOfType(ctx, IFrameDMContext.class); IFrameDMContext frameDmc = DMContexts.getAncestorOfType(ctx, IFrameDMContext.class);
if (frameDmc != null) { if (frameDmc != null) {
return new MIExpressionDMC(getSession().getId(), expression, relExpr, frameDmc); return new MIExpressionDMC(getSession().getId(), expression, relExpr, frameDmc);
} }
// If there is not frame, we look for the first execution context. IMIExecutionDMContext execCtx = DMContexts.getAncestorOfType(ctx, IMIExecutionDMContext.class);
// It could be a thread, a process, a core, etc
IExecutionDMContext execCtx = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class);
if (execCtx != null) { if (execCtx != null) {
return new MIExpressionDMC(getSession().getId(), expression, relExpr, execCtx); return new MIExpressionDMC(getSession().getId(), expression, relExpr, execCtx);
} }
IMemoryDMContext memoryCtx = DMContexts.getAncestorOfType(ctx, IMemoryDMContext.class);
if (memoryCtx != null) {
return new MIExpressionDMC(getSession().getId(), expression, relExpr, memoryCtx);
}
// Don't care about the relative expression at this point // Don't care about the relative expression at this point
return new InvalidContextExpressionDMC(getSession().getId(), expression, ctx); return new InvalidContextExpressionDMC(getSession().getId(), expression, ctx);
} }