[llvm] r374122 - DebugInfo: Move LLE enum handling to .def to match RLE handling

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 11:35:07 PDT 2019


Thanks - sorry for the noise. I've committed an attempted fix in r374196 &
will keep an eye on the buildbot.

On Wed, Oct 9, 2019 at 11:15 AM Vitaly Buka <vitalybuka at google.com> wrote:

> UBSAN error after the patch
>
> /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp:146:15: runtime error: load of value 71, which is not a valid value for type 'llvm::dwarf::LoclistEntries'
>
>
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/15298/steps/check-llvm%20ubsan/logs/stdio
>
> On Tue, Oct 8, 2019 at 2:46 PM David Blaikie via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: dblaikie
>> Date: Tue Oct  8 14:48:46 2019
>> New Revision: 374122
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=374122&view=rev
>> Log:
>> DebugInfo: Move LLE enum handling to .def to match RLE handling
>>
>> Modified:
>>     llvm/trunk/include/llvm/BinaryFormat/Dwarf.def
>>     llvm/trunk/include/llvm/BinaryFormat/Dwarf.h
>>     llvm/trunk/lib/BinaryFormat/Dwarf.cpp
>>     llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
>>
>> Modified: llvm/trunk/include/llvm/BinaryFormat/Dwarf.def
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/Dwarf.def?rev=374122&r1=374121&r2=374122&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/include/llvm/BinaryFormat/Dwarf.def (original)
>> +++ llvm/trunk/include/llvm/BinaryFormat/Dwarf.def Tue Oct  8 14:48:46
>> 2019
>> @@ -17,7 +17,7 @@
>>      defined HANDLE_DW_VIRTUALITY || defined HANDLE_DW_DEFAULTED ||
>>        \
>>      defined HANDLE_DW_CC || defined HANDLE_DW_LNS || defined
>> HANDLE_DW_LNE ||  \
>>      defined HANDLE_DW_LNCT || defined HANDLE_DW_MACRO ||
>>        \
>> -    defined HANDLE_DW_RLE ||
>>        \
>> +    defined HANDLE_DW_RLE || defined HANDLE_DW_LLE ||
>>       \
>>      (defined HANDLE_DW_CFA && defined HANDLE_DW_CFA_PRED) ||
>>        \
>>      defined HANDLE_DW_APPLE_PROPERTY || defined HANDLE_DW_UT ||
>>       \
>>      defined HANDLE_DWARF_SECTION || defined HANDLE_DW_IDX ||
>>        \
>> @@ -91,6 +91,10 @@
>>  #define HANDLE_DW_RLE(ID, NAME)
>>  #endif
>>
>> +#ifndef HANDLE_DW_LLE
>> +#define HANDLE_DW_LLE(ID, NAME)
>> +#endif
>> +
>>  #ifndef HANDLE_DW_CFA
>>  #define HANDLE_DW_CFA(ID, NAME)
>>  #endif
>> @@ -825,6 +829,17 @@ HANDLE_DW_RLE(0x05, base_address)
>>  HANDLE_DW_RLE(0x06, start_end)
>>  HANDLE_DW_RLE(0x07, start_length)
>>
>> +// DWARF v5 Loc List Entry encoding values.
>> +HANDLE_DW_LLE(0x00, end_of_list)
>> +HANDLE_DW_LLE(0x01, base_addressx)
>> +HANDLE_DW_LLE(0x02, startx_endx)
>> +HANDLE_DW_LLE(0x03, startx_length)
>> +HANDLE_DW_LLE(0x04, offset_pair)
>> +HANDLE_DW_LLE(0x05, default_location)
>> +HANDLE_DW_LLE(0x06, base_address)
>> +HANDLE_DW_LLE(0x07, start_end)
>> +HANDLE_DW_LLE(0x08, start_length)
>> +
>>  // Call frame instruction encodings.
>>  HANDLE_DW_CFA(0x00, nop)
>>  HANDLE_DW_CFA(0x40, advance_loc)
>> @@ -939,6 +954,7 @@ HANDLE_DW_IDX(0x05, type_hash)
>>  #undef HANDLE_DW_LNCT
>>  #undef HANDLE_DW_MACRO
>>  #undef HANDLE_DW_RLE
>> +#undef HANDLE_DW_LLE
>>  #undef HANDLE_DW_CFA
>>  #undef HANDLE_DW_CFA_PRED
>>  #undef HANDLE_DW_APPLE_PROPERTY
>>
>> Modified: llvm/trunk/include/llvm/BinaryFormat/Dwarf.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/Dwarf.h?rev=374122&r1=374121&r2=374122&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/include/llvm/BinaryFormat/Dwarf.h (original)
>> +++ llvm/trunk/include/llvm/BinaryFormat/Dwarf.h Tue Oct  8 14:48:46 2019
>> @@ -308,11 +308,17 @@ enum MacroEntryType {
>>  };
>>
>>  /// DWARF v5 range list entry encoding values.
>> -enum RangeListEntries {
>> +enum RnglistEntries {
>>  #define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID,
>>  #include "llvm/BinaryFormat/Dwarf.def"
>>  };
>>
>> +/// DWARF v5 loc list entry encoding values.
>> +enum LoclistEntries {
>> +#define HANDLE_DW_LLE(ID, NAME) DW_LLE_##NAME = ID,
>> +#include "llvm/BinaryFormat/Dwarf.def"
>> +};
>> +
>>  /// Call frame instruction encodings.
>>  enum CallFrameInfo {
>>  #define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID,
>> @@ -348,19 +354,6 @@ enum Constants {
>>    DW_EH_PE_indirect = 0x80
>>  };
>>
>> -/// Constants for location lists in DWARF v5.
>> -enum LocationListEntry : unsigned char {
>> -  DW_LLE_end_of_list = 0x00,
>> -  DW_LLE_base_addressx = 0x01,
>> -  DW_LLE_startx_endx = 0x02,
>> -  DW_LLE_startx_length = 0x03,
>> -  DW_LLE_offset_pair = 0x04,
>> -  DW_LLE_default_location = 0x05,
>> -  DW_LLE_base_address = 0x06,
>> -  DW_LLE_start_end = 0x07,
>> -  DW_LLE_start_length = 0x08
>> -};
>> -
>>  /// Constants for the DW_APPLE_PROPERTY_attributes attribute.
>>  /// Keep this list in sync with clang's DeclSpec.h
>> ObjCPropertyAttributeKind!
>>  enum ApplePropertyAttributes {
>> @@ -475,6 +468,7 @@ StringRef LNStandardString(unsigned Stan
>>  StringRef LNExtendedString(unsigned Encoding);
>>  StringRef MacinfoString(unsigned Encoding);
>>  StringRef RangeListEncodingString(unsigned Encoding);
>> +StringRef LocListEncodingString(unsigned Encoding);
>>  StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch);
>>  StringRef ApplePropertyString(unsigned);
>>  StringRef UnitTypeString(unsigned);
>>
>> Modified: llvm/trunk/lib/BinaryFormat/Dwarf.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/BinaryFormat/Dwarf.cpp?rev=374122&r1=374121&r2=374122&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/BinaryFormat/Dwarf.cpp (original)
>> +++ llvm/trunk/lib/BinaryFormat/Dwarf.cpp Tue Oct  8 14:48:46 2019
>> @@ -472,6 +472,17 @@ StringRef llvm::dwarf::RangeListEncoding
>>    }
>>  }
>>
>> +StringRef llvm::dwarf::LocListEncodingString(unsigned Encoding) {
>> +  switch (Encoding) {
>> +  default:
>> +    return StringRef();
>> +#define HANDLE_DW_LLE(ID, NAME)
>>       \
>> +  case DW_LLE_##NAME:
>>       \
>> +    return "DW_LLE_" #NAME;
>> +#include "llvm/BinaryFormat/Dwarf.def"
>> +  }
>> +}
>> +
>>  StringRef llvm::dwarf::CallFrameString(unsigned Encoding,
>>      Triple::ArchType Arch) {
>>    assert(Arch != llvm::Triple::ArchType::UnknownArch);
>>
>> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp?rev=374122&r1=374121&r2=374122&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp (original)
>> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp Tue Oct  8 14:48:46
>> 2019
>> @@ -143,7 +143,7 @@ DWARFDebugLoclists::parseOneLocationList
>>    DataExtractor::Cursor C(*Offset);
>>
>>    // dwarf::DW_LLE_end_of_list_entry is 0 and indicates the end of the
>> list.
>> -  while (auto Kind =
>> static_cast<dwarf::LocationListEntry>(Data.getU8(C))) {
>> +  while (auto Kind = static_cast<dwarf::LoclistEntries>(Data.getU8(C))) {
>>      Entry E;
>>      E.Kind = Kind;
>>      switch (Kind) {
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191009/7393130b/attachment.html>


More information about the llvm-commits mailing list