[Lldb-commits] [PATCH] D143652: [WIP][lldb][DWARFASTParserClang] Attach linkage name to ctors/dtors if missing

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 9 07:26:42 PST 2023


Michael137 created this revision.
Michael137 added reviewers: aprantl, labath, aeubanks.
Herald added a reviewer: shafik.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

**Summary**

This patch addresses the case where we have a `DW_AT_external`
subprogram for a constructor (and/or destructor) that doesn't carry
a `DW_AT_linkage_name` attribute. The corresponding DIE(s) that
represent the definition will have a linkage name, but if the name
contains constructs that LLDBs fallback mechanism for guessing mangled
names to resolve external symbols doesn't support (e.g., abi-tags)
then we end up failing to resolve the function call.

We address this by trying to find the linkage name before we create
the constructor/destructor decl, which will get attached using
an `AsmLabelAttr` to make symbol resolution easier.

**Testing**

- Added API test


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143652

Files:
  lldb/include/lldb/Symbol/Function.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/test/API/lang/cpp/external_ctor_dtor_lookup/Makefile
  lldb/test/API/lang/cpp/external_ctor_dtor_lookup/TestExternalCtorDtorLookup.py
  lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.h
  lldb/test/API/lang/cpp/external_ctor_dtor_lookup/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143652.496122.patch
Type: text/x-patch
Size: 5633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230209/bdd3c741/attachment.bin>


More information about the lldb-commits mailing list