Debugging RecursiveASTVisitor

Hi all,
I am trying to debug a strange behavior of the RecursiveASTVisiror, and trying to use gdb with the Debug+Assert binary of clang++. Unfortunately, because so much of the code of RecursiveASTVisitor is macro-expanded and because the debug symbols are trying to relate to the "non-expanded" code navigating an execution with gdb is pretty useless.

Has anyone encountered this issue in the past and has any advice on how to debug RecursiveASTVisitor?

Cheers!
Alex

Hi all,
I am trying to debug a strange behavior of the RecursiveASTVisiror, and
trying to use gdb with the Debug+Assert binary of clang++. Unfortunately,
because so much of the code of RecursiveASTVisitor is macro-expanded and
because the debug symbols are trying to relate to the "non-expanded" code
navigating an execution with gdb is pretty useless.

Has anyone encountered this issue in the past and has any advice on how to
debug RecursiveASTVisitor?

I've so far used:
llvm::outs() << ...
plus unit tests...

Cheers,
/Manuel

Thank you Manuel,
this is what I have been using so far as well, but I’m facing a problem that is a bit convoluted and was hoping there is some more “advanced” technique :slight_smile: More specifically, I think it would help if I could step through the code of the RecursiveASTVisitor within a debugger, but because most of the code is macro expanded, it doesn’t seem like the debug symbols (at least the default ones in Debug+Assert) are very useful, as they seem to be pointing to the un-expanded version of the source files.

Cheers!
Alex