Author: labath
Date: Fri Jun 14 05:01:18 2019
New Revision: 363373

URL: http://llvm.org/viewvc/llvm-project?rev=363373&view=rev
Log:
DWARFIndex: s/ReportInvalidDIEOffset/ReportInvalidDIERef

In a dwo/debug_types world, the die offset is not enough to uniquely
idendify a debug info entry. Pass the the entire DIERef object instead.

This is technically NFC, because only AppleIndex implemented this
method (and there, the die offset *is* enough for unique
identification). However, this makes the code simpler, and simplifies
some of the follow-up patches.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp?rev=363373&r1=363372&r2=363373&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp Fri Jun 14 
05:01:18 2019
@@ -155,12 +155,12 @@ void AppleDWARFIndex::GetFunctions(const
     DWARFMappedHash::ExtractDIEArray(hash_data, offsets);
 }
 
-void AppleDWARFIndex::ReportInvalidDIEOffset(dw_offset_t offset,
-                                             llvm::StringRef name) {
+void AppleDWARFIndex::ReportInvalidDIERef(const DIERef &ref,
+                                          llvm::StringRef name) {
   m_module.ReportErrorIfModifyDetected(
       "the DWARF debug information has been modified (accelerator table had "
       "bad die 0x%8.8x for '%s')\n",
-      offset, name.str().c_str());
+      ref.die_offset, name.str().c_str());
 }
 
 void AppleDWARFIndex::Dump(Stream &s) {

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h?rev=363373&r1=363372&r2=363373&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h Fri Jun 14 
05:01:18 2019
@@ -48,8 +48,7 @@ public:
                     std::vector<DWARFDIE> &dies) override;
   void GetFunctions(const RegularExpression &regex, DIEArray &offsets) 
override;
 
-  void ReportInvalidDIEOffset(dw_offset_t offset,
-                              llvm::StringRef name) override;
+  void ReportInvalidDIERef(const DIERef &ref, llvm::StringRef name) override;
   void Dump(Stream &s) override;
 
 private:

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp?rev=363373&r1=363372&r2=363373&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp Fri Jun 14 
05:01:18 2019
@@ -24,7 +24,7 @@ void DWARFIndex::ProcessFunctionDIE(llvm
                                     std::vector<DWARFDIE> &dies) {
   DWARFDIE die = info.GetDIE(ref);
   if (!die) {
-    ReportInvalidDIEOffset(ref.die_offset, name);
+    ReportInvalidDIERef(ref, name);
     return;
   }
 

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.h?rev=363373&r1=363372&r2=363373&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFIndex.h Fri Jun 14 05:01:18 
2019
@@ -47,8 +47,7 @@ public:
   virtual void GetFunctions(const RegularExpression &regex,
                             DIEArray &offsets) = 0;
 
-  virtual void ReportInvalidDIEOffset(dw_offset_t offset,
-                                      llvm::StringRef name) = 0;
+  virtual void ReportInvalidDIERef(const DIERef &ref, llvm::StringRef name) = 
0;
   virtual void Dump(Stream &s) = 0;
 
 protected:

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h?rev=363373&r1=363372&r2=363373&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h Fri Jun 
14 05:01:18 2019
@@ -41,8 +41,7 @@ public:
   void GetFunctions(const RegularExpression &regex,
                     DIEArray &offsets) override;
 
-  void ReportInvalidDIEOffset(dw_offset_t offset,
-                              llvm::StringRef name) override {}
+  void ReportInvalidDIERef(const DIERef &ref, llvm::StringRef name) override {}
   void Dump(Stream &s) override;
 
 private:

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h?rev=363373&r1=363372&r2=363373&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h Fri Jun 14 
05:01:18 2019
@@ -39,8 +39,7 @@ public:
                     std::vector<DWARFDIE> &dies) override;
   void GetFunctions(const RegularExpression &regex, DIEArray &offsets) 
override;
 
-  void ReportInvalidDIEOffset(dw_offset_t offset,
-                              llvm::StringRef name) override {}
+  void ReportInvalidDIERef(const DIERef &ref, llvm::StringRef name) override {}
   void Dump(Stream &s) override;
 
 private:

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=363373&r1=363372&r2=363373&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Jun 14 
05:01:18 2019
@@ -2064,8 +2064,7 @@ uint32_t SymbolFileDWARF::FindGlobalVari
         } break;
         }
       } else {
-        m_index->ReportInvalidDIEOffset(die_ref.die_offset,
-                                        name.GetStringRef());
+        m_index->ReportInvalidDIERef(die_ref, name.GetStringRef());
       }
     }
   }
@@ -2128,7 +2127,7 @@ uint32_t SymbolFileDWARF::FindGlobalVari
         if (variables.GetSize() - original_size >= max_matches)
           break;
       } else
-        m_index->ReportInvalidDIEOffset(die_ref.die_offset, regex.GetText());
+        m_index->ReportInvalidDIERef(die_ref, regex.GetText());
     }
   }
 
@@ -2312,7 +2311,7 @@ uint32_t SymbolFileDWARF::FindFunctions(
   for (DIERef ref : offsets) {
     DWARFDIE die = info->GetDIE(ref);
     if (!die) {
-      m_index->ReportInvalidDIEOffset(ref.die_offset, regex.GetText());
+      m_index->ReportInvalidDIERef(ref, regex.GetText());
       continue;
     }
     if (resolved_dies.insert(die.GetDIE()).second)
@@ -2415,8 +2414,7 @@ uint32_t SymbolFileDWARF::FindTypes(
             break;
         }
       } else {
-        m_index->ReportInvalidDIEOffset(die_ref.die_offset,
-                                        name.GetStringRef());
+        m_index->ReportInvalidDIERef(die_ref, name.GetStringRef());
       }
     }
     const uint32_t num_matches = types.GetSize() - initial_types_size;
@@ -2494,8 +2492,7 @@ size_t SymbolFileDWARF::FindTypes(const
           ++num_matches;
         }
       } else {
-        m_index->ReportInvalidDIEOffset(die_ref.die_offset,
-                                        name.GetStringRef());
+        m_index->ReportInvalidDIERef(die_ref, name.GetStringRef());
       }
     }
     return num_matches;
@@ -2540,8 +2537,7 @@ SymbolFileDWARF::FindNamespace(ConstStri
               break;
           }
         } else {
-          m_index->ReportInvalidDIEOffset(die_ref.die_offset,
-                                          name.GetStringRef());
+          m_index->ReportInvalidDIERef(die_ref, name.GetStringRef());
         }
       }
     }
@@ -2751,8 +2747,7 @@ TypeSP SymbolFileDWARF::FindCompleteObjC
           }
         }
       } else {
-        m_index->ReportInvalidDIEOffset(die_ref.die_offset,
-                                        type_name.GetStringRef());
+        m_index->ReportInvalidDIERef(die_ref, type_name.GetStringRef());
       }
     }
   }
@@ -2959,8 +2954,7 @@ TypeSP SymbolFileDWARF::FindDefinitionTy
               }
             }
           } else {
-            m_index->ReportInvalidDIEOffset(die_ref.die_offset,
-                                            type_name.GetStringRef());
+            m_index->ReportInvalidDIERef(die_ref, type_name.GetStringRef());
           }
         }
       }
@@ -3127,7 +3121,7 @@ size_t SymbolFileDWARF::ParseVariablesFo
                 ++vars_added;
               }
             } else
-              m_index->ReportInvalidDIEOffset(die_ref.die_offset, "");
+              m_index->ReportInvalidDIERef(die_ref, "");
           }
         }
       }


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to