[Lldb-commits] [PATCH] D53646: [LLDB] - Parse the DW_LLE_startx_length correctly for DWARF v5 case.

George Rimar via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 25 02:26:42 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB345249: [LLDB] - Parse the DW_LLE_startx_length correctly for DWARF v5 case. (authored by grimar, committed by ).
Herald added a subscriber: lldb-commits.

Repository:
  rLLDB LLDB

https://reviews.llvm.org/D53646

Files:
  include/lldb/Expression/DWARFExpression.h
  source/Expression/DWARFExpression.cpp


Index: source/Expression/DWARFExpression.cpp
===================================================================
--- source/Expression/DWARFExpression.cpp
+++ source/Expression/DWARFExpression.cpp
@@ -3029,7 +3029,9 @@
   if (!debug_loc_data.ValidOffset(*offset_ptr))
     return false;
 
-  switch (dwarf_cu->GetSymbolFileDWARF()->GetLocationListFormat()) {
+  DWARFExpression::LocationListFormat format =
+      dwarf_cu->GetSymbolFileDWARF()->GetLocationListFormat();
+  switch (format) {
   case NonLocationList:
     return false;
   case RegularLocationList:
@@ -3051,7 +3053,9 @@
     case DW_LLE_startx_length: {
       uint64_t index = debug_loc_data.GetULEB128(offset_ptr);
       low_pc = ReadAddressFromDebugAddrSection(dwarf_cu, index);
-      uint32_t length = debug_loc_data.GetU32(offset_ptr);
+      uint64_t length = (format == LocLists)
+                            ? debug_loc_data.GetULEB128(offset_ptr)
+                            : debug_loc_data.GetU32(offset_ptr);
       high_pc = low_pc + length;
       return true;
     }
Index: include/lldb/Expression/DWARFExpression.h
===================================================================
--- include/lldb/Expression/DWARFExpression.h
+++ include/lldb/Expression/DWARFExpression.h
@@ -40,8 +40,10 @@
   enum LocationListFormat : uint8_t {
     NonLocationList,     // Not a location list
     RegularLocationList, // Location list format used in non-split dwarf files
-    SplitDwarfLocationList, // Location list format used in split dwarf files
-    LocLists,               // Location list format used in DWARF v5 (.debug_loclists).
+    SplitDwarfLocationList, // Location list format used in pre-DWARF v5 split
+                            // dwarf files (.debug_loc.dwo)
+    LocLists,               // Location list format used in DWARF v5
+                            // (.debug_loclists/.debug_loclists.dwo).
   };
 
   //------------------------------------------------------------------
@@ -153,7 +155,7 @@
   lldb::addr_t GetLocation_DW_OP_addr(uint32_t op_addr_idx, bool &error) const;
 
   bool Update_DW_OP_addr(lldb::addr_t file_addr);
-  
+
   void SetModule(const lldb::ModuleSP &module) { m_module_wp = module; }
 
   bool ContainsThreadLocalStorage() const;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53646.171054.patch
Type: text/x-patch
Size: 2258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181025/bd228535/attachment.bin>


More information about the lldb-commits mailing list