[Lldb-commits] [lldb] [lldb] Skip the prologue when a function's entry has no line row (PR #204480)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 17 15:52:30 PDT 2026


jimingham wrote:

Note, this complexity is mostly because we can't trust the `prologue_end` bit being reliably set.  You shouldn't have to care about first line or second line, you should just scan the line table entries in the address range of the function till you find the one marked with `prologue_end`.  But some compilers don't set this reliably (I'm not sure any current ones do this wrong, but lots of older ones do).  

The old convention was that the first line table entry was the "definition of the function" line, and its address would be the actual beginning of the function.  Then the second entry was the end of the prologue (and usually mapped to the `{` that opened the function.  That's why we care about a "first line"...

Someday it might be nice to stop supporting faulty compilers and convert this algorithm to rely on finding the prologue_end entry, as that would be simpler.  But short of that, this workaround is fine.

https://github.com/llvm/llvm-project/pull/204480


More information about the lldb-commits mailing list