[Lldb-commits] [PATCH] D53368: [Symbol] Search symbols with name and type in a symbol file

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 29 11:17:13 PST 2018


zturner added a comment.

In D53368#1313124 <https://reviews.llvm.org/D53368#1313124>, @labath wrote:

> I've recently started looking at adding a new symbol file format (breakpad symbols). While researching the best way to achieve that, I started comparing the operation of PDB and DWARF symbol files. I noticed a very important difference there, and I think that is the cause of our problems here. In the DWARF implementation, a symbol file is an overlay on top of an object file - it takes the data contained by the object file and presents it in a more structured way.
>
> However, that is not the case with PDB (both implementations). These take the debug information from a completely different file, which is not backed by an ObjectFile instance, and then present that. Since the SymbolFile interface requires them to be backed by an object file, they both pretend they are backed by the original EXE file, but in reality the data comes from elsewhere.


Don't DWARF DWP files work this way as well?  How is support for this implemented in LLDB?

> If we had an ObjectFilePDB (which not also not ideal, though in a way it is a better fit to the current lldb organization), then this could expose the PDB symtab via the existing ObjectFile interface and we could reuse the existing mechanism for merging symtabs from two object files.
> 
> I am asking this because now I am facing a choice in how to implement breakpad symbols. I could go the PDB way, and read the symbols without an intervening object file, or I could create an ObjectFileBreakpad and then (possibly) a SymbolFileBreakpad sitting on top of that.

What `SymbolFile` interface provided a new method such as `GetSymtab()` while `ObjectFile` provides a method called `HasExternalSymtab()`.  When you call `ObjectFilePECOFF::GetSymtab()`, it could first check if `HasExternalSymtab()` is true, and if so it could call the SymbolFile plugin and return that


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53368/new/

https://reviews.llvm.org/D53368





More information about the lldb-commits mailing list