[lld] [llvm] [Symbolizer] Support for Missing Line Numbers. (PR #82240)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 04:43:25 PDT 2024


================
@@ -1312,23 +1312,25 @@ uint32_t DWARFDebugLine::LineTable::findRowInSeq(
   return RowPos - Rows.begin();
 }
 
-uint32_t DWARFDebugLine::LineTable::lookupAddress(
-    object::SectionedAddress Address) const {
+uint32_t
+DWARFDebugLine::LineTable::lookupAddress(object::SectionedAddress Address,
+                                         bool *IsApproximateLine) const {
 
   // Search for relocatable addresses
-  uint32_t Result = lookupAddressImpl(Address);
+  uint32_t Result = lookupAddressImpl(Address, IsApproximateLine);
 
   if (Result != UnknownRowIndex ||
       Address.SectionIndex == object::SectionedAddress::UndefSection)
     return Result;
 
   // Search for absolute addresses
   Address.SectionIndex = object::SectionedAddress::UndefSection;
-  return lookupAddressImpl(Address);
+  return lookupAddressImpl(Address, IsApproximateLine);
 }
 
-uint32_t DWARFDebugLine::LineTable::lookupAddressImpl(
-    object::SectionedAddress Address) const {
+uint32_t
+DWARFDebugLine::LineTable::lookupAddressImpl(object::SectionedAddress Address,
+                                             bool *IsApproximateLine) const {
----------------
ampandey-1995 wrote:

Yes, I have created a ```struct Approximate```  to accomplish the task of report enablement and also to figure out that approximate logic should report the line which is approximate i.e ```IsApproximateLine```.

`
  struct Approximate {
    Approximate(bool EnableReport) : Report(EnableReport) {}

    bool Report = false;
    bool IsApproximateLine = false;
  };
`

Both Report and IsApproximateLine are members of struct Approximate. This struct is then passed as parameters to functions ```getFileLineInfoForAddress```, ```lookupAddress``` & ```lookupAddressImpl```. 

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


More information about the llvm-commits mailing list