[all-commits] [llvm/llvm-project] 951b10: [NFC] Refactor symbol table parsing.

Greg Clayton via All-commits all-commits at lists.llvm.org
Wed Nov 17 15:14:17 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 951b107eedab1829f18049443f03339dbb0db165
      https://github.com/llvm/llvm-project/commit/951b107eedab1829f18049443f03339dbb0db165
  Author: Greg Clayton <gclayton at fb.com>
  Date:   2021-11-17 (Wed, 17 Nov 2021)

  Changed paths:
    M lldb/include/lldb/Symbol/ObjectFile.h
    M lldb/include/lldb/Symbol/Symtab.h
    M lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
    M lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
    M lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    M lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
    M lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
    M lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
    M lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.h
    M lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    M lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
    M lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
    M lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
    M lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
    M lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
    M lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
    M lldb/source/Symbol/ObjectFile.cpp
    M lldb/source/Symbol/Symtab.cpp

  Log Message:
  -----------
  [NFC] Refactor symbol table parsing.

Symbol table parsing has evolved over the years and many plug-ins contained duplicate code in the ObjectFile::GetSymtab() that used to be pure virtual. With this change, the "Symbtab *ObjectFile::GetSymtab()" is no longer virtual and will end up calling a new "void ObjectFile::ParseSymtab(Symtab &symtab)" pure virtual function to actually do the parsing. This helps centralize the code for parsing the symbol table and allows the ObjectFile base class to do all of the common work, like taking the necessary locks and creating the symbol table object itself. Plug-ins now just need to parse when they are asked to parse as the ParseSymtab function will only get called once.

Differential Revision: https://reviews.llvm.org/D113965




More information about the All-commits mailing list