-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Reland "[LLDB][NativePDB] Create functions with mangled name" #161678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
70c954a
[LLDB][NativePDB] Create functions with mangled name
Nerixyz 5cb50cc
fix: use value_or
Nerixyz d242da2
fix: formatting
Nerixyz 077dbc7
Merge remote-tracking branch 'upstream/main' into fix/npdb-use-mangle…
Nerixyz 7642fdd
fix: `find-functions` test
Nerixyz ebbe796
Merge remote-tracking branch 'upstream/main' into fix/npdb-use-mangle…
Nerixyz 5847701
fix: use LLVM's symbol lookup
Nerixyz 6c80008
fix: check for mangled or demangled names in `variables.test`
Nerixyz b3b230b
Merge remote-tracking branch 'upstream/main' into fix/npdb-use-mangle…
Nerixyz 19e75f3
Merge remote-tracking branch 'upstream/main' into fix/npdb-use-mangle…
Nerixyz cf5f2ce
Merge remote-tracking branch 'upstream/main' into fix/npdb-use-mangle…
Nerixyz 15482a4
fix: check for `main` function name
Nerixyz f65c12e
fix: remove unused operators
Nerixyz f2a0657
fix: resolve auto
Nerixyz 0fc03c2
fix: make `FindMangledSymbol` private
Nerixyz c2cad1e
doc: add documentation for `FindMangledFunctionName`
Nerixyz 5ba3702
fix: strip leading underscore for __cdecl functions on x86
Nerixyz 20356cc
fix: check function type to get calling convention
Nerixyz 3779ad3
fix: strip function name in `FindMangledSymbol`
Nerixyz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
lldb/test/Shell/SymbolFile/NativePDB/c-calling-conventions.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// clang-format off | ||
// REQUIRES: lld, x86 | ||
|
||
// RUN: %build --compiler=clang-cl --arch=32 --nodefaultlib --output=%t-32.exe %s | ||
// RUN: lldb-test symbols %t-32.exe | FileCheck --check-prefixes CHECK-32,CHECK-BOTH %s | ||
// RUN: %build --compiler=clang-cl --arch=64 --nodefaultlib --output=%t-64.exe %s | ||
// RUN: lldb-test symbols %t-64.exe | FileCheck --check-prefixes CHECK-64,CHECK-BOTH %s | ||
|
||
extern "C" { | ||
int FuncCCall() { return 0; } | ||
int __stdcall FuncStdCall() { return 0; } | ||
int __fastcall FuncFastCall() { return 0; } | ||
int __vectorcall FuncVectorCall() { return 0; } | ||
|
||
int __cdecl _underscoreCdecl() { return 0; } | ||
int __stdcall _underscoreStdcall() { return 0; } | ||
int __fastcall _underscoreFastcall() { return 0; } | ||
int __vectorcall _underscoreVectorcall() { return 0; } | ||
} | ||
|
||
int main() { | ||
FuncCCall(); | ||
FuncStdCall(); | ||
FuncFastCall(); | ||
FuncVectorCall(); | ||
_underscoreCdecl(); | ||
_underscoreStdcall(); | ||
_underscoreFastcall(); | ||
_underscoreVectorcall(); | ||
return 0; | ||
} | ||
|
||
// CHECK-BOTH-DAG: Function{{.*}}, demangled = FuncCCall, | ||
// CHECK-BOTH-DAG: Function{{.*}}, demangled = FuncVectorCall@@0, | ||
// CHECK-BOTH-DAG: Function{{.*}}, demangled = _underscoreCdecl, | ||
// CHECK-BOTH-DAG: Function{{.*}}, demangled = _underscoreVectorcall@@0, | ||
// CHECK-BOTH-DAG: Function{{.*}}, demangled = main, | ||
|
||
// __stdcall and __fastcall aren't available on 64 bit | ||
|
||
// CHECK-32-DAG: Function{{.*}}, demangled = _FuncStdCall@0, | ||
// CHECK-64-DAG: Function{{.*}}, demangled = FuncStdCall, | ||
|
||
// CHECK-32-DAG: Function{{.*}}, demangled = @FuncFastCall@0, | ||
// CHECK-64-DAG: Function{{.*}}, demangled = FuncFastCall, | ||
|
||
// CHECK-32-DAG: Function{{.*}}, demangled = __underscoreStdcall@0, | ||
// CHECK-64-DAG: Function{{.*}}, demangled = _underscoreStdcall, | ||
|
||
// CHECK-32-DAG: Function{{.*}}, demangled = @_underscoreFastcall@0, | ||
// CHECK-64-DAG: Function{{.*}}, demangled = _underscoreFastcall, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.