[Lldb-commits] [lldb] r349175 - [NativePDB] Fix local-variables.cpp test.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 14 11:18:16 PST 2018


Ahh, so I misinterpreted what you originally said.  There is one Clang AST *per
SymboFile*.  In PDB land, compile units are often called "modules" so it's
easy to get confused.  So in my original response, what I actually meant
was that there's no notion of a per compile-unit AST.  But that also had
nothing to do with your question, which was about LLDB modules :)

So anyway, yea the command already supports that as you noted, and
specifying the module basename would also have worked here so that there
would always only be 1 module dumped (turns out, there's only 1 module
dumped anyway because we don't have PDBs for any of the system libraries,
so DumpClangAST is a no-op in those cases).

On Fri, Dec 14, 2018 at 11:00 AM Pavel Labath <pavel at labath.sk> wrote:

> On 14/12/2018 19:52, Zachary Turner wrote:
> > I don't know if there's a good way to do that.  Because debuggers need
> > to be able to see across multiple translation units, this is implemented
> > internally as constructing one giant AST that contains everything for
> > the entire program.  LLDB has no notion of a per-module AST, so it would
> > be hard to make this work.
> >
>
> That's not how it's implemented now. The code actually iterates through
> all the modules and dumps each one in turn.
>
>        result.GetOutputStream().Printf("Dumping clang ast for %" PRIu64
>                                        " modules.\n",
>                                        (uint64_t)num_modules);
>        for (size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
>          if (m_interpreter.WasInterrupted())
>            break;
>          Module *m =
> target->GetImages().GetModulePointerAtIndex(image_idx);
>          SymbolFile *sf = m->GetSymbolVendor()->GetSymbolFile();
>          sf->DumpClangAST(result.GetOutputStream());
>        }
>
>
> In fact, it looks like this command already supports specifying the
> exact module to dump (either by basename or full path).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181214/720030a6/attachment.html>


More information about the lldb-commits mailing list