-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DWARFv5][DWARFLinker] avoid stripping template names for .debug_names.
DWARFLinker puts three names for subprograms into the .apple_names and .debug_names: short name, linkage name, name without template parameters. DW_TAG_subprogram DW_AT_linkage_name "_Z3fooIcEvv" DW_AT_name "foo<char>" short name: "foo<char>" linkage name: "_Z3fooIcEvv" name without template parameters: "foo" DWARFv5 does not require stripping template parameters for subprogram name. Current llvm-dwarfdump --verify reports the error if names stored in accelerator table do not match with DIE name(name with stripped template parameters stored in accelerator table does not match with original DIE name). This patch does not store name without template parameters into the .debug_names table. Differential Revision: https://reviews.llvm.org/D153869
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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
Binary file not shown.
This file contains 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,34 @@ | ||
## This test checks that DIE name with stripped template parameters | ||
## is not stored into .debug_name section. | ||
|
||
## cat dwarf5-accel.cpp | ||
## | ||
## template<typename A> void foo() {}; | ||
## | ||
## int main ( void ) { | ||
## foo<char>(); | ||
## return 0; | ||
## } | ||
|
||
## $ clang -gdwarf-5 dwarf5-accel.cpp -c -o dwarf5-accel.o | ||
|
||
#RUN: dsymutil -accelerator=Dwarf -oso-prepend-path %p/Inputs -y %s -o %t.dSYM | ||
#RUN: llvm-dwarfdump --verify %t.dSYM | FileCheck %s --check-prefix VERIFY | ||
#RUN: llvm-dwarfdump -a --verbose %t.dSYM | FileCheck %s | ||
|
||
#VERIFY: No errors. | ||
|
||
#CHECK: .debug_names | ||
#CHECK-NOT: "foo" | ||
#CHECK: _Z3fooIcEvv | ||
#CHECK-NOT: "foo" | ||
#CHECK: "foo<char>" | ||
|
||
--- | ||
triple: 'x86_64-apple-darwin' | ||
objects: | ||
- filename: 'dwarf5-accel.o' | ||
timestamp: 1676048242 | ||
symbols: | ||
- { sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000AB0, size: 0x00000008 } | ||
- { sym: __Z3fooIcEvv, objAddr: 0x0000000000000020, binAddr: 0x0000000100000BB0, size: 0x00000008 } |