[Lldb-commits] [PATCH] D56537: ObjectFilePECOFF: Create a "container" section spanning the entire module image

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 12 07:04:55 PST 2019


clayborg accepted this revision.
clayborg added inline comments.
This revision is now accepted and ready to land.


================
Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:1370
 
-    auto section = section_list->GetSectionAtIndex(section_idx);
+    auto section = section_list->FindSectionByID(section_id);
     if (!section)
----------------
labath wrote:
> clayborg wrote:
> > How fast is this? Do we need a local cache so we aren't looking up a section for each symbol? Maybe a locally cached vector since sections are represented by indexes? 
> It's not particularly fast (linear search), but the number of sections is generally small. FindSectionByID is also used in other places for Symtab construction (e.g. ObjectFileELF; ObjectFileMachO does some complicated thing, which I believe involves caching), so it doesn't seem to be too bad. If it turns out we need to speed up the lookup here, then I think it should be done a bit more generically, so that all users can benefit from this.
I think this is actually ok because PECOFF files generally don't have many (if any) symbols in them. Unless we did the symbol table out of another location in the file that isn't the standard PECOFF symbol table.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D56537





More information about the lldb-commits mailing list