mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
2004-10-24 Alain Magloire
Changes in ICDITarget.evaluateExpressionToString() * org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
This commit is contained in:
parent
815b892f7f
commit
9dffa53757
5 changed files with 43 additions and 19 deletions
|
@ -1,3 +1,7 @@
|
|||
2004-10-24 Alain Magloire
|
||||
Changes in ICDITarget.evaluateExpressionToString()
|
||||
* org/eclipse/cdt/debug/mi/core/cdi/model/Target.java
|
||||
|
||||
2004-10-20 Alain Magloire
|
||||
Use the new ICDIDebugger interface
|
||||
|
||||
|
|
|
@ -142,10 +142,10 @@ public class ExpressionManager extends Manager implements ICDIExpressionManager{
|
|||
public ICDIExpression createExpression(ICDIStackFrame frame, String name) throws CDIException {
|
||||
Expression expression = null;
|
||||
Session session = (Session)getSession();
|
||||
Target target = (Target)frame.getTarget();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
ICDIThread currentThread = target.getCurrentThread();
|
||||
ICDIThread currentThread = currentTarget.getCurrentThread();
|
||||
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
|
||||
Target target = (Target)frame.getTarget();
|
||||
session.setCurrentTarget(target);
|
||||
target.setCurrentThread(frame.getThread(), false);
|
||||
frame.getThread().setCurrentStackFrame(frame, false);
|
||||
|
|
|
@ -457,10 +457,10 @@ public class SourceManager extends Manager implements ICDISourceManager {
|
|||
|
||||
public String getDetailTypeName(ICDIStackFrame frame, String typename) throws CDIException {
|
||||
Session session = (Session)getSession();
|
||||
Target target = (Target)frame.getTarget();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
ICDIThread currentThread = target.getCurrentThread();
|
||||
ICDIThread currentThread = currentTarget.getCurrentThread();
|
||||
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
|
||||
Target target = (Target)frame.getTarget();
|
||||
session.setCurrentTarget(target);
|
||||
target.setCurrentThread(frame.getThread(), false);
|
||||
frame.getThread().setCurrentStackFrame(frame, false);
|
||||
|
@ -490,10 +490,10 @@ public class SourceManager extends Manager implements ICDISourceManager {
|
|||
Target currentTarget = session.getCurrentTarget();
|
||||
ICDIThread currentThread = null;
|
||||
ICDIStackFrame currentFrame = null;
|
||||
session.setCurrentTarget(target);
|
||||
if (frame != null) {
|
||||
currentThread = target.getCurrentThread();
|
||||
currentThread = currentTarget.getCurrentThread();
|
||||
currentFrame = currentThread.getCurrentStackFrame();
|
||||
session.setCurrentTarget(target);
|
||||
target.setCurrentThread(frame.getThread(), false);
|
||||
frame.getThread().setCurrentStackFrame(frame, false);
|
||||
}
|
||||
|
|
|
@ -151,10 +151,10 @@ public class VariableManager extends Manager implements ICDIVariableManager {
|
|||
public void checkType(StackFrame frame, String type) throws CDIException {
|
||||
if (type != null && type.length() > 0) {
|
||||
Session session = (Session)getSession();
|
||||
Target target = (Target)frame.getTarget();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
ICDIThread currentThread = target.getCurrentThread();
|
||||
ICDIThread currentThread = currentTarget.getCurrentThread();
|
||||
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
|
||||
Target target = (Target)frame.getTarget();
|
||||
session.setCurrentTarget(target);
|
||||
target.setCurrentThread(frame.getThread(), false);
|
||||
frame.getThread().setCurrentStackFrame(frame, false);
|
||||
|
@ -238,7 +238,7 @@ public class VariableManager extends Manager implements ICDIVariableManager {
|
|||
Target target = (Target)argObj.getTarget();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
if (stack != null) {
|
||||
currentThread = target.getCurrentThread();
|
||||
currentThread = currentTarget.getCurrentThread();
|
||||
currentFrame = currentThread.getCurrentStackFrame();
|
||||
target.setCurrentThread(stack.getThread(), false);
|
||||
stack.getThread().setCurrentStackFrame(stack, false);
|
||||
|
@ -276,10 +276,10 @@ public class VariableManager extends Manager implements ICDIVariableManager {
|
|||
public ICDIArgumentObject[] getArgumentObjects(ICDIStackFrame frame) throws CDIException {
|
||||
List argObjects = new ArrayList();
|
||||
Session session = (Session) getSession();
|
||||
Target target = (Target)frame.getTarget();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
ICDIThread currentThread = target.getCurrentThread();
|
||||
ICDIThread currentThread = currentTarget.getCurrentThread();
|
||||
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
|
||||
Target target = (Target)frame.getTarget();
|
||||
target.setCurrentThread(frame.getThread(), false);
|
||||
frame.getThread().setCurrentStackFrame(frame, false);
|
||||
try {
|
||||
|
@ -406,10 +406,10 @@ public class VariableManager extends Manager implements ICDIVariableManager {
|
|||
public ICDIVariableObject[] getLocalVariableObjects(ICDIStackFrame frame) throws CDIException {
|
||||
List varObjects = new ArrayList();
|
||||
Session session = (Session) getSession();
|
||||
Target target = (Target)frame.getTarget();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
ICDIThread currentThread = target.getCurrentThread();
|
||||
ICDIThread currentThread = currentTarget.getCurrentThread();
|
||||
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
|
||||
Target target = (Target)frame.getTarget();
|
||||
target.setCurrentThread(frame.getThread(), false);
|
||||
frame.getThread().setCurrentStackFrame(frame, false);
|
||||
try {
|
||||
|
@ -471,7 +471,7 @@ public class VariableManager extends Manager implements ICDIVariableManager {
|
|||
Target target = (Target)varObj.getTarget();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
if (stack != null) {
|
||||
currentThread = target.getCurrentThread();
|
||||
currentThread = currentTarget.getCurrentThread();
|
||||
currentFrame = currentThread.getCurrentStackFrame();
|
||||
target.setCurrentThread(stack.getThread(), false);
|
||||
stack.getThread().setCurrentStackFrame(stack, false);
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
|||
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIRuntimeOptions;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
|
||||
|
@ -627,12 +628,27 @@ public class Target implements ICDITarget {
|
|||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#evaluateExpressionToString(String)
|
||||
*/
|
||||
public String evaluateExpressionToString(String expressionText)
|
||||
throws CDIException {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIDataEvaluateExpression evaluate =
|
||||
factory.createMIDataEvaluateExpression(expressionText);
|
||||
public String evaluateExpressionToString(String expressionText) throws CDIException {
|
||||
Session session = (Session)getSession();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
ICDIThread currentThread = currentTarget.getCurrentThread();
|
||||
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
|
||||
return evaluateExpressionToString(currentFrame, expressionText);
|
||||
}
|
||||
|
||||
public String evaluateExpressionToString(ICDIStackFrame frame, String expressionText) throws CDIException {
|
||||
Session session = (Session)getSession();
|
||||
Target currentTarget = session.getCurrentTarget();
|
||||
ICDIThread currentThread = currentTarget.getCurrentThread();
|
||||
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
|
||||
Target target = (Target)frame.getTarget();
|
||||
session.setCurrentTarget(target);
|
||||
target.setCurrentThread(frame.getThread(), false);
|
||||
frame.getThread().setCurrentStackFrame(frame, false);
|
||||
try {
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
MIDataEvaluateExpression evaluate =
|
||||
factory.createMIDataEvaluateExpression(expressionText);
|
||||
miSession.postCommand(evaluate);
|
||||
MIDataEvaluateExpressionInfo info =
|
||||
evaluate.getMIDataEvaluateExpressionInfo();
|
||||
|
@ -642,6 +658,10 @@ public class Target implements ICDITarget {
|
|||
return info.getExpression();
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
} finally {
|
||||
session.setCurrentTarget(currentTarget);
|
||||
target.setCurrentThread(currentThread, false);
|
||||
currentThread.setCurrentStackFrame(currentFrame, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue