Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] How to get correct DebugElement from CDT Debug context

Hello,

I am trying to evalute some variable's context by IWatchExpression and IWatchExpressionManager. Sadly, I'm not able to do this successfully because of a different DebugContext-Behaviour. 

With JDE, this will be a valid IDebugElement:

IAdaptable object = DebugUITools.getDebugContext();

i.e. a StackFrame. Sadly, CDT returns a AbstractDMVMNode, which is no DebugElement at all and thus I'm not able to use it as expression context. I was hoping that something like this would do the trick:

IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
IWatchExpression watchExpr = expressionManager.newWatchExpression("Foo");
IAdaptable object = DebugUITools.getDebugContext();
IDebugElement context = null;
if (object instanceof IDebugElement) {
    context = (IDebugElement) object;
} else if (object instanceof ILaunch) {
    context = ((ILaunch) object).getDebugTarget();
}
watchExpr.setExpressionContext(context);
watchExpr.evaluate();

How am I supposed to use this expression-interface? Even if things like AbstractVMNode or GdbExpressionVMProvider would not be internal, I don't get the architecture figured to a degree that I would know what I had to do without an IDebugElement to use as context. :(

Thanks in advance,

Tobias

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
NSM-LOEWEN ENTERTAINMENT GmbH
Saarlandstrasse 240, 55411 Bingen am Rhein
Postanschrift: Postfach 1564, 55385 Bingen
Tel.: +49 6721 407-0
E-Mail: info@xxxxxxxxx
Web: http://www.loewen.de 
Geschaeftsfuehrer: Christian Arras (Vorsitzender), Willi Granold
Vorsitz im Aufsichtsrat: Dr. Theo Waigel
Amtsgericht Mainz, HRB 23327 
USt-Id.-Nr. DE 148266135



Back to the top