[
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
|
Hi,
Thank you for the fast answer. I thought that the CDI interface was more or less a derelict interface to be replaced completely by DSF once DSF got mature?
With CDI, I am not able to start debugging the project - I get a crash in CDebugTarget in method
private void getSourceLookupPath( LinkedHashSet<String> list, ISourceContainer[] containers)
...
if ( container instanceof FolderSourceContainer ) {
IContainer folderContainer = ((FolderSourceContainer)container).getContainer();
if ( folderContainer != null && folderContainer.exists() ) {
pathToAdd = folderContainer.getLocation().toPortableString(); <<<<<---
}
}
because folderContainer.getLocation() returns null.
IPath localLocation(IPath workspacePath, IResource resource) in FileStoreRoot returns null because localRoot is not set. I have project that consists of virtual folders and files, only. Plugins installed are:
GDB Common
Version: 7.0.0.201009241320
Build id: 201009241320
Eclipse C/C++ Development Tools and SDK
Version: 7.0.1.201009241320
Build id: 201009241320
I wanted to avoid getting into DSF because it seams quite complicated to get into due to its asynchronous model. But well, looks like I don't have much of a choice, do I? ;)
Kind Regards,
T.
> Date: Tue, 15 Feb 2011 08:31:59 -0600
> From: John Cortell <rat042@xxxxxxxxxxxxx>
>
> 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. :(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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