[DWARFDebugLoc] Tweak error message when resolving offset pairs with no base address
authorPavel Labath <pavel@labath.sk>
Thu, 9 Jan 2020 09:14:30 +0000 (10:14 +0100)
committerPavel Labath <pavel@labath.sk>
Thu, 9 Jan 2020 09:20:42 +0000 (10:20 +0100)
The previous message mentioned DW_LLE_offset_pair, but this is
incorrect/confusing because we can get this message even with DWARF4
(which does not use DW_LLE encodings). This happens because DWARF<=4
location entries are "upgraded" to DWARF v5 during parsing.

The new error message refrains from referencing specific constants.
Fixes pr44482.

llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp

index 8aed9ab..0c5f9a9 100644 (file)
@@ -79,9 +79,9 @@ DWARFLocationInterpreter::Interpret(const DWARFLocationEntry &E) {
   }
   case dwarf::DW_LLE_offset_pair: {
     if (!Base) {
-      return createStringError(
-          inconvertibleErrorCode(),
-          "Unable to resolve DW_LLE_offset_pair: base address unknown");
+      return createStringError(inconvertibleErrorCode(),
+                               "Unable to resolve location list offset pair: "
+                               "Base address not defined");
     }
     DWARFAddressRange Range{Base->Address + E.Value0, Base->Address + E.Value1,
                             Base->SectionIndex};