[llvm-branch-commits] [GSYM] Include end_sequence debug_line rows in Dwarf transform (PR #90535)

Greg Clayton via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 6 17:54:03 PDT 2024


================
@@ -424,19 +439,13 @@ static void convertFunctionLineTable(OutputAggregator &Out, CUInfo &CUI,
     auto LastLE = FI.OptLineTable->last();
     if (LastLE && LastLE->File == FileIdx && LastLE->Line == Row.Line)
         continue;
+
     // Only push a row if it isn't an end sequence. End sequence markers are
     // included for the last address in a function or the last contiguous
     // address in a sequence.
-    if (Row.EndSequence) {
----------------
clayborg wrote:

> I'm not quite following the collection of thoughts here, they seem disjoint to me, so trying to discuss:
> 
> > We used to not break out on Row.EndSequence
> 
> I don't understand the relationship between end_sequence and functions with discontiguous ranges - could you describe this connection in more detail?

If a `DW_TAG_subprogram` has N discontiguous ranges, we will create N FunctionInfo objects, one for each range. We will request the line table entries for each range in the `DW_TAG_subprogram`'s `DW_AT_ranges` attribute.  So if there are end sequences in there, we try to keep going. If there is an end_sequence in the line table this is probably the indication of a bug in the line tables.

> 
> > as it allows functions to have discontiguous ranges.
> 
> Agreed with @pogo59, I believe both Bolt and Propeller can create discontiguous address ranges for a function (but you'll see DW_AT_ranges on the subprogram)

Yes, and as I mention above, we create individual FunctionInfo objects for each range and only request the line table entries for each individual range.
> 
> > I was assuming that if we asked for the rows for a given address range we wouldn't get all entries if two merged functions with different line table entries were found, but that assumption might not be correct?
> 
> Yeah, looking at the implementation of `lookupAddressRangeImpl` it finds a single sequence that starts closest to the start address, then adds all rows within that sequence that cover the range requested. So, no, it won't retrieve addresses/ranges from multiple sequences.



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


More information about the llvm-branch-commits mailing list