7 Commits

Author SHA1 Message Date
nerix
44f41f55b4
Reland "[LLDB][NativePDB] Find functions by basename" ( #152295) (#153160)
Relands #152295.

Checking for the overloads did not account for them being out of order.
For example, [the failed
output](https://github.com/llvm/llvm-project/pull/152295#issuecomment-3177563247)
contained the overloads, but out of order. The last commit here fixes
that by using `-DAG`.

---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-08-12 12:49:47 -05:00
Jonas Devlieghere
3a682864d9
Revert "[LLDB][NativePDB] Find functions by basename" (#153131)
Reverts llvm/llvm-project#152295
2025-08-11 22:23:20 -05:00
nerix
7e2cc725db
[LLDB][NativePDB] Find functions by basename (#152295)
This adds the ability for functions to be matched by their basename.

Before, the globals were searched for the name. This works if the full
name is available but fails for basenames.
PDB only includes the full names of functions, so we need to cache all
basenames. This is (again) very similar to
[SymbolFilePDB](b242150b07/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (L1291-L1383)).
There are two main differences:

- We can't just access the parent of a function to determine that it's a
member function - we need to check the type of the function, and its
"this type".
- SymbolFilePDB saved the full method name in the map. However, when
searching for methods, only the basename is passed, so the function
never found any methods.

Fixes #51933.

---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-08-11 20:51:37 -05:00
Zequan Wu
a3a8ed33a1 [LLDB][NativePDB] Fix function decl creation for class methods
This is a split of D113724. Calling `TypeSystemClang::AddMethodToCXXRecordType`
to create function decls for class methods.

Differential Revision: https://reviews.llvm.org/D113930
2021-12-07 10:41:28 -08:00
Zequan Wu
fe270ab061 [LLDB][NativePDB] fix find-functions.cpp failure on windows bots (2) 2021-11-29 11:06:06 -08:00
Zequan Wu
34d02fada2 [LLDB][NativePDB] fix find-functions.cpp failure on windows bots 2021-11-29 10:05:09 -08:00
Zequan Wu
22ced33a2f [LLDB][NativePDB] Allow find functions by full names
I don't see a reason why not to. If we allows lookup functions by full names,
I can change the test case in D113930 to use `lldb-test symbols --find=function --name=full::name --function-flags=full ...`,
though the duplicate method decl prolem is still there for `lldb-test symbols --dump-ast`.
That's a seprate bug, we can fix it later.

Differential Revision: https://reviews.llvm.org/D114467
2021-11-23 17:57:05 -08:00