llvm-project/lldb/packages/Python/lldbsuite/test
Michael Buch 88d3c1db45 [lldb][ClangExpression] Add asm() label to all FunctionDecls we create from DWARF
When resolving symbols during IR execution, lldb makes a last effort attempt
to resolve external symbols from object files by approximate name matching.
It currently uses `CPlusPlusNameParser` to parse the demangled function name
and arguments for the unresolved symbol and its candidates. However, this
hand-rolled C++ parser doesn’t support ABI tags which, depending on the demangler,
get demangled into `[abi:tag]`. This lack of parsing support causes lldb to never
consider a candidate mangled function name that has ABI tags.

The issue reproduces by calling an ABI-tagged template function from the
expression evaluator. This is particularly problematic with the recent
addition of ABI tags to numerous libcxx APIs.

The issue stems from the fact that `clang::CodeGen` emits function
function calls using the mangled name inferred from the `FunctionDecl`
LLDB constructs from DWARF. Debug info often lacks information for
us to construct a perfect FunctionDecl resulting in subtle mangled
name inaccuracies.

This patch side-steps the problem of inaccurate `FunctionDecl`s by
attaching an `asm()` label to each `FunctionDecl` LLDB creates from DWARF.
`clang::CodeGen` consults this label to get the mangled name as one of
the first courses of action when emitting a function call.

LLDB already does this for C++ member functions as of
[675767a591](https://reviews.llvm.org/D40283)

**Testing**

* Added API tests

Differential Revision: https://reviews.llvm.org/D131974
2022-08-17 09:02:43 +01:00
..
builders [lldb] Use the just-built libc++ for testing the LLDB data formatters 2022-07-11 14:49:24 -07:00
make [lldb][ClangExpression] Add asm() label to all FunctionDecls we create from DWARF 2022-08-17 09:02:43 +01:00
test_runner [lldb] NFC: Fix trivial typo in comments, documents, and messages 2020-04-07 01:06:16 +09:00
tools [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
README-TestSuite [lldb][tests] Automatically call compute_mydir (NFC) 2022-06-17 14:34:49 -07:00
__init__.py
bench.py
concurrent_base.py
configuration.py [lldb] Use the just-built libc++ for testing the LLDB data formatters 2022-07-11 14:49:24 -07:00
decorators.py [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
dotest.py [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
dotest_args.py [lldb] Use the just-built libc++ for testing the LLDB data formatters 2022-07-11 14:49:24 -07:00
gdbclientutils.py [lldb] Avoid duplicate vdso modules when opening core files 2022-04-05 11:22:37 +02:00
lldb_pylint_helper.py
lldbbench.py
lldbdwarf.py [lldb][NFC] Delete unused and commented out DWARF constants 2021-07-26 12:26:35 -07:00
lldbgdbclient.py [lldb/platform-gdb] Clear cached protocol state upon disconnection 2022-01-10 16:27:30 +01:00
lldbinline.py [lldb/test] Allow indentation in inline tests 2021-10-28 14:39:02 +02:00
lldbpexpect.py [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
lldbplatform.py [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
lldbplatformutil.py [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
lldbtest.py [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
lldbtest_config.py
lldbutil.py [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
test_categories.py [lldb] [test] Disable gmodules testing on FreeBSD 2022-06-20 19:42:21 +02:00
test_result.py [lldb] [test] Rename '.categories' to 'categories' 2020-11-10 12:02:38 +01:00