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

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 14 11:01:07 PST 2018


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).


More information about the lldb-commits mailing list