[Lldb-commits] [Diffusion] rL245090: Move all clang type system DWARF type parsing into ClangASTContext.cpp.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 27 15:57:30 PDT 2015


> On Aug 27, 2015, at 2:12 PM, Zachary Turner <zturner at google.com> wrote:
> 
> If I'm following this discussion correctly, Greg are you saying that ClangASTContext could be renamed to DwarfASTContext?  And that for other types of Debug info we could have PascalASTContext and PdbASTContext?

No. ClangASTContext _is_ a type system so it inherits from TypeSystem. It also can parse DWARF so it could inherit from DWARFASTParser so that it would implement the needed functions for parsing DWARF and TypeSystem could have a virtual function:

class TypeSystem
{
    virtual DWARFASTParser *GetDWARFASTParser()
    {
        return nullptr;
    }
}

Then the ClangASTContext could return a valid pointer to this so it can parse DWARF... 

> 
> If that's the case, then it seems there is a lot of code inside of ClangASTContext (aka DwarfASTContext) which is not specific to DWARF, and there's no reason that other ASTContext classes shouldn't be able to reuse it.
> 
> On Thu, Aug 27, 2015 at 2:08 PM via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> On Thu, Aug 27, 2015 at 12:56:57PM -0700, Greg Clayton via lldb-commits wrote:
> > >
> > > Our Delphi compiler generates an alternate debug format as well - it took me all of yesterday to fix merge conflicts and I've still not got things working properly.  Greg, can you please move the DWARF dependencies back into the SymbolFileDWARF plugin?  Thanks!
> >
> > Sorry to not be clear on this: thing are correctly organized and won't be changing.
> >
> > You will need to merge your stuff correctly into the current world.
> 
> The issue is that you have added DWARF to ClangASTContext.  How is
> another debug format plugin supposed to work in ClangASTContext now?
> 
> The design had been that support for debug formats goes in plugins
> inside source/Plugins/SymbolFile.  This was a clean interface that
> allowed support for other debug formats to exist by installing their
> plugin.  Now main lldb code is polluted with DWARF code which depends on
> a plugin.

I can probably clean this up by making a DWARFASTParser a plug-in type and move all DWARF parsing code over into it and place that inside the DWARF plug-in folder. I see if I can do that quick to get the code organization back to how we want it.

Greg


More information about the lldb-commits mailing list