Issue |
143104
|
Summary |
lldb cannot break on an inlined function name when using PDB debug information
|
Labels |
lldb,
platform:windows
|
Assignees |
|
Reporter |
DavidSpickett
|
Discovered while looking at a test failure on the Windows on Arm lldb bot:
https://lab.llvm.org/buildbot/#/builders/141/builds/9260
```
********************
Timed Out Tests (1):
lldb-shell :: Settings/TestFrameFunctionInlined.test
```
Which was added by https://github.com/llvm/llvm-project/pull/142952.
The test itself produces DWARF explicitly, which is a non-starter when the bot uses link.exe which discards that. However, even producing PDB, the timeout happens.
```
void regular();
[[clang::always_inline]] void inlined1() {
regular();
}
void regular() {inlined1();}
[[clang::always_inline]] void inlined2() {regular();}
int main() {
inlined2();
return 0;
}
```
This is because clang compiles main to:
```
main:
call regular
```
And regular is just going to call inline1, which calls regular and so on.
```
(lldb) bt
* thread #1, stop reason = instruction step into
* frame #0: 0x00007ff7a6581010 test.clang.exe`void __cdecl regular(void) at test.cpp:6
frame #1: 0x00007ff7a6581018 test.clang.exe`void __cdecl regular(void) at test.cpp:6
frame #2: 0x00007ff7a6581048 test.clang.exe`main at test.cpp:10
frame #3: 0x00007ff7a65821e0 test.clang.exe`static int __scrt_common_main_seh() at exe_common.inl:288
frame #4: 0x00007ff7a658229c test.clang.exe`mainCRTStartup(__formal=<unavailable>) at exe_main.cpp:16
frame #5: 0x00007ff9efe52310 kernel32.dll`BaseThreadInitThunk + 48
frame #6: 0x00007ff9f3a15aec ntdll.dll`RtlUserThreadStart + 60
```
This carries on for a while until the stack runs out.
Except that it shouldn't because on Linux we hit the break on inlined1 and we can do that because we know where inlined1 has been inlined to.
When using PDB debug info, this information is missing or we don't use it. Not sure which, could easily be both.
So we never hit the breakpoint, and finally stop when the stack runs out:
```
(lldb) s
Process 12108 stopped
* thread #1, stop reason = Exception 0xc00000fd encountered at address 0x7ff6c07c48d8
frame #0: 0x00007ff6c07c48d8 test.exe`void __cdecl inlined1(void) at test.cpp:3
1 void regular();
2
-> 3 [[clang::always_inline]] void inlined1() {
4 regular();
5 }
6 void regular() {inlined1();}
7 [[clang::always_inline]] void inlined2() {regular();}
```
Each one of these recursive loops is maybe 16 bytes of stack used. So there's a lot of frames to bracktrace, too much to do within the timeout.
So I'm going to disable this test on Windows for all these reasons, but this issue is to report specifically that we cannot handle this example program when using PDB debug information.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs