[lldb-dev] Making a new symbol provider

Zachary Turner via lldb-dev lldb-dev at lists.llvm.org
Thu Feb 11 18:56:50 PST 2016


On Thu, Feb 11, 2016 at 5:35 PM Greg Clayton <gclayton at apple.com> wrote:

>
> > On Feb 11, 2016, at 3:41 PM, Zachary Turner via lldb-dev <
> lldb-dev at lists.llvm.org> wrote:
> >
> > Hi,
> >
> > I want to make a new symbol provider to teach LLDB to understand
> microsoft PDB files.  I've been looking over the various symbol APIs, and I
> have a few questions.
> >
> > 1. Under what circumstances do I need a custom SymbolVendor?  The way
> pdb works is that generally there is 1 file that contains all the debug
> info needed for a single binary (so or executable).  Given a list of paths,
> we can then determine if there is a matching PDB in one of those paths.  Is
> it better to do this in the CalculateAbilities() function of the symbol
> file plugin (by just returning 0 if we don't find a match) or do we need to
> do something more complicated?
>
> I would suggest make a SymbolVendorPDB that only enables itself if you are
> able to find the PDB files for your COFF file. So look at your COFF file,
> and I presume somewhere in there there is a pointer to one or more PDB
> files inside that file? CalculateAbililties is the correct place to see if
> a COFF file has pointers to PDB files and making sure those files exist
> before you say that you can provide any abilities.
>
Currently we use the operating system to query the PDBs.  This could change
in the future, but for now that's how we're doing it.  The operating system
does all the work of finding, matching, and loading the PDB for us, and it
does it all in one call.  So if we put this in the symbol vendor, there's
no way to say "is there a PDB" without also saying "actually load all the
data from the PDB" at the same time.  So I'm not sure if there's a solution
to this in there, because obviously I dont' want to load it twice.

One question I had about SymbolVendor, is that I looked at
SymbolVendorELF.cpp and it seems to boil down to this notion of "symbol
file representations".  All the logic in SymbolVendorELF exists just to add
some object file representations.  What is this supposed to represent?
I've got an exe or something, what other "representation" is there other
than the exe itself?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160212/0f5489ce/attachment.html>


More information about the lldb-dev mailing list