[Lldb-commits] [PATCH] D67994: Modify lldb-test to print out ASTs from symbol file

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 3 04:17:53 PDT 2019

labath added a comment.

Maybe this is my fault since I'm the one who introduced the first bunch of arguments here IIRC, but anyway, I have a feeling all of these dumping options are getting out of hand. Looking at the argument list, you'd expect that -dump-ast, and -dump-clang-ast do something completely different, but they actually print the exact same AST, only one allows you to print a subset of it, while the other one doesn't.

Given that the ast dumping is currently incompatible with all/most of the other dumping options anyway, maybe we should turn over a clean slate, and implement a new subcommand specifically dedicated to dumping clang ast (as opposed to the internal lldb representations of types/functions/..., which is what the "symbols" subcommand started out as, and which is what most of its options are dedicated to).

OR, and this would-be super cool, if it was actually possible, we could try to make ast-dumping compatible with the existing searching options.  Currently, if you type `lldb-test symbols -find=type -name=foo` it will search for types named "foo", and print some summary of the lldb object representing that type. What if we made it so that adding `-dump-ast` to that command caused the tool to dump the *AST* of the types it has found (e.g., in addition to the previous summary)? I think that would make the behavior of the tool most natural to a new user, but I am not sure whether that would actually fit in with your goals here...



More information about the lldb-commits mailing list