[Lldb-commits] [PATCH] D134518: [lldb][COFF] Skip forwarder export symbols in symtab

Alvin Wong via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 22 23:57:11 PDT 2022


alvinhochun created this revision.
alvinhochun added reviewers: labath, DavidSpickett, mstorsjo.
Herald added a project: All.
alvinhochun requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Forwarder exports do not point to a real function or variable. Instead
they point to a string describing which DLL and symbol to forward to.
Any imports which uses them will be redirected by the loader
transparently, therefore it is not necessary for LLDB to know about them
when debugging.

Depends on D134426 <https://reviews.llvm.org/D134426>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134518

Files:
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp


Index: lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
===================================================================
--- lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -868,6 +868,18 @@
     llvm::cantFail(entry.getOrdinal(ordinal));
     symbol.SetID(ordinal);
 
+    bool is_forwarder;
+    llvm::cantFail(entry.isForwarder(is_forwarder));
+    if (is_forwarder) {
+      // Forwarder exports are redirected by the loader transparently, so LLDB
+      // has no use for them.
+      LLDB_LOG(log,
+               "ObjectFilePECOFF::AppendFromExportTable - skipping forwarder "
+               "symbol '{0}'",
+               sym_name);
+      continue;
+    }
+
     uint32_t function_rva;
     if (auto err = entry.getExportRVA(function_rva)) {
       LLDB_LOG(log,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134518.462399.patch
Type: text/x-patch
Size: 864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220923/43a0a767/attachment-0001.bin>


More information about the lldb-commits mailing list