Skip to main content

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

JDT uses the the Standard Debug Model. CDT's CDI-GDB debugger does, too. DSF-GDB does not. The default debugger in CDT is DSF-GDB.

IWatchExpression objects are created by a DSF-GDB session but their use is superficial. They're not used to evaluate the expression as they are in JDT and CDI. In fact, there are numerous methods in IWatchExpression that are applicable only to Standard Debug Model sessions.

You have two options for supporting CDT. Support only CDI, or add code that will evaluate the expression in a DSF specific way (when dealing with a DSF session).

John

At 07:24 AM 2/15/2011, Tobias Tost wrote:
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

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev





Back to the top