<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56288>56288</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLDB fails to skip prologue with clang generated PDB
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
lldb,
platform:windows
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
omjavaid
</td>
</tr>
</table>
<pre>
LLDB is expected to skip prologue and advance to the breakpoint location to the first source line in the function when you have debug information. For example consider following code:
#include <string.h>
int
product (int x, int y)
{
int result = x * y;
return result;
}
int
main(int argc, char const *argv[])
{
int array[4];
memset(array, 0, 4 * sizeof(int));
array[0] = product (1238, 78392);
array[1] = product (379265, 23674);
array[2] = product (872934, 234);
array[3] = product (1238, 78392);
return 0;
}
Compile with clang-cl /Zi skip_prolog.cpp. Clang will generate PDB debug info by default.
Start LLDB and set breakpoint on main. LLDB is expected to stop at line memset which is the first executable line of the function main. However LLDB stops at first assembly instruction stopping at main brace without skipping the prologue.
This is architecture independent so it happens on both x86_64 and AArch64.
This works fine when PDB is generated by cl.exe.
Also works fine when clang compiles with dwarf debug info.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVMuSmzoQ_RrYqELZEhhYsPCMM5VFFqnKXd1NSkgNKCMjShJ-3K-_LWGPSTKzCEWBoF-nH6dbI6_N16-HJ6IcgcsEwoMk3hD3qiYyWaNNPwPhoyRcnvgoIAj9AKS1wF8no0ZPtBHcKzPeRZ2yzhNnZovqWo1A1LgI5lFExfMAI7mamQz8BERCO_eo0xl7jI4y8mIswuHHSQMRZnRKgiWd0dqc1djjLwkJ2yebQ7LZJ5SpUehZAknYs_MWNbIhYZ9v4vhEnMsBc5Kz8CShVcB-SegzCYdrQuubQfm0HAheQWTBzRot2IFc0G6PumylYsHPdrxpvUmS8vBu_CNX4y02t70I4cXAbcwyoNrj31NSPCXF4WNE3Fp-RaU8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