https://bugs.llvm.org/show_bug.cgi?id=48432
Bug ID: 48432
Summary: [codeview] Different lambda functions getting the same
codeview function ID
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: DebugInfo
Assignee: unassignedb...@nondot.org
Reporter: akhu...@google.com
CC: jdevliegh...@apple.com, keith.wal...@arm.com,
llvm-bugs@lists.llvm.org,
paul_robin...@playstation.sony.com
If there are multiple lambda functions in a file, they sometimes get the same
function id.
In the symbolizer output below, both lambda functions in the stack trace have
the line number 5, even though the second one should be on line 6.
repro:
$ cat t.cpp
template <class F> void uselambda1(int &x, F f) { f(x); }
template <class F> void uselambda2(int &x, F f) { f(x); }
int Test(int n) {
uselambda1(n, [](int &x) { x /= 10; });
uselambda2(n, [](int &x) { x *= 2; });
return n;
}
int main() {
return Test(100);
}
$ clang -cc1 -triple x86_64-pc-windows-msvc -gcodeview
-debug-info-kind=line-tables-only -O2 -emit-obj -o t.obj t.cpp
$ lld-link -debug -entry:main -pdb:t.pdb t.obj
$ llvm-symbolizer --obj=t.exe --relative-address 0x1001 0x1018
Test(int)::(anonymous class)::operator()
C:\src\tests\sbox-integration\small-repro\t.cpp:5:0
uselambda1
C:\src\tests\sbox-integration\small-repro\t.cpp:1:0
Test(int)??:0:0
Test(int)::(anonymous class)::operator()
C:\src\tests\sbox-integration\small-repro\t.cpp:5:0
uselambda2
C:\src\tests\sbox-integration\small-repro\t.cpp:2:0
Test(int)
??:0:0
A dump of the inline line table shows that there are two functions with the
func id 0x1001.
Inlinee Lines
============================================================
Mod 0000 | `C:\src\tests\t.obj`:
Inlinee | Line | Source File
0x1000 | 1 | C:\src\tests\t.cpp (MD5: 4A4CBE958FA977B1C4A844AA292CF8C3)
0x1001 | 5 | C:\src\tests\t.cpp (MD5: 4A4CBE958FA977B1C4A844AA292CF8C3)
0x1002 | 2 | C:\src\tests\t.cpp (MD5: 4A4CBE958FA977B1C4A844AA292CF8C3)
0x1001 | 6 | C:\src\tests\t.cpp (MD5: 4A4CBE958FA977B1C4A844AA292CF8C3)
Mod 0001 | `* Linker *`:
(side note: there should be a line number for `Test(int)` in the symbolizer
output -- this is an unrelated bug in llvm-symbolizer)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs