Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Using the CDT parser for debug expressions?

Title: Using the CDT parser for debug expressions?
I have a question for the folks who have more experience with CDT language parsing than I:

The EDC debugger needs to parse and then evaluate C/C++ expressions. The JDT debugger does this for java expressions using an ASTEvaluationEngine. It looks like it can take a snippet of Java code and create a CompilationUnit, which extends ASTNode. The CompilationUnit accepts a visitor (ASTInstructionCompiler) which produces a compiled version of the _expression_ that the debugger can evaluate. This is all done in org.eclipse.jdt.internal.debug.eval.ast.engine and org.eclipse.jdt.internal.debug.eval.ast.instructions

So I'm wondering if I can take the same approach in CDT. It would need to parse a snippet of code but would usually have a translation unit and project context to consider too.

Thanks for your thoughts,

- Ken

Back to the top