<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 28, 2015, at 5:01 PM, Alexey Samsonov <<a href="mailto:vonosmas@gmail.com" class="">vonosmas@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra">On Tue, May 26, 2015 at 1:35 PM, Filipe Cabecinhas<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:filcab@gmail.com" target="_blank" class="">filcab@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Throwing afl (or libFuzzer)<span class=""></span> at llvm-dwarfdump might do a lot. :)</blockquote><div class=""><br class=""></div><div class="">Sure it does. We should first make significant improvements to LLVMObject library so that it doesn't crash with report_fatal_error() if it's given a</div><div class="">broken executable. Luckily, we have all this std::error_code machinery. However, we use it far less frequently than we should. Trying to tackle this task</div><div class="">resulted in <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10111&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=wDepzKWNQSGQzVSKQ_yREiaBuagKyqDqMiMU_P8ybDw&s=scjjp6gwisgoQ8d0hGdM1Fz7HZ-O9fxXpOknXN0kXEY&e=" class="">http://reviews.llvm.org/D10111</a>.</div></div></div></div></div></blockquote><div><br class=""></div><div>Hey, this is great! Where libObject might call report_fatal_error too much, I’m pretty sure libDebugInfoDWARF make use of too much asserts driven by input data rather than returning errors. It’s great that you tackle this. Do not hesitate to file bugs for the issues you find, I’m willing to help in fixing these!</div><div><br class=""></div><div>Fred</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class=""><div class="h5"><br class=""><br class="">On Tuesday, May 26, 2015, Alexey Samsonov <<a href="mailto:vonosmas@gmail.com" target="_blank" class="">vonosmas@gmail.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class="">Fair enough. I will add such an input then. I guess there will be even more once of those once/if I write llvm-dwarfdump-fuzzer :)</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, May 26, 2015 at 1:30 PM, Filipe Cabecinhas<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a class="">filcab@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">If we want to be sure we're handling the errors correctly, we want invalid input. There's a bunch of them for macho (tests/Object/Inputs/macho{,64}-invalid-*) and bitcode (tests/Bitcode/Inputs/invalid-*).<div class=""><br class=""></div><div class=""> <span class="Apple-converted-space"> </span>Filipe<div class=""><div class=""><br class=""><br class="">On Tuesday, May 26, 2015, Eric Christopher <<a class="">echristo@gmail.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class="">Could have a binary input?<br class=""><br class="">-eric</div><br class=""><div class="gmail_quote">On Tue, May 26, 2015 at 12:46 PM Alexey Samsonov <<a class="">vonosmas@gmail.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class="">At this stage that would require producing a broken DWARF file, possibly by manually flipping bits in the output of clang/gcc. Do we really want this in the tree?</div><div class="gmail_extra"></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, May 26, 2015 at 7:06 AM, Rafael Espíndola<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a class="">rafael.espindola@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">testcase?<br class=""><div class=""><div class=""><br class="">On 19 May 2015 at 17:54, Alexey Samsonov <<a class="">vonosmas@gmail.com</a>> wrote:<br class="">> Author: samsonov<br class="">> Date: Tue May 19 16:54:32 2015<br class="">> New Revision: 237733<br class="">><br class="">> URL:<span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D237733-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=i0RikhEETYZDN7aNgdqzao5KZVbb44wCscGgxV85vOo&s=WJCv3-sOyU-kNy7q14dfet81O5FN3uwSBCHo7z8kJxI&e=" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=237733&view=rev</a><br class="">> Log:<br class="">> [DWARF parser] Make DWARF parser more robust against missing compile/type units.<br class="">><br class="">> DWARF standard claims that each compilation/type unit header in<br class="">> .debug_info/.debug_types section must be followed by corresponding<br class="">> compile/type unit DIE, possibly with its children. Two situations<br class="">> are possible:<br class="">><br class="">>  * compile/type unit DIE is missing because DWARF producer failed to<br class="">>    emit it.<br class="">>  * DWARF parser failed to parse unit DIE correctly, for instance if it<br class="">>    contains some unsupported attributes (see r237721, for instance).<br class="">><br class="">> In either of these cases, the library, and the tools that use it<br class="">> (llvm-dwarfdump, llvm-symbolizer) should not crash. Insert appropriate<br class="">> checks to protect against this.<br class="">><br class="">> Modified:<br class="">>     llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h<br class="">>     llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp<br class="">>     llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp<br class="">>     llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp<br class="">>     llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp<br class="">>     llvm/trunk/tools/dsymutil/DwarfLinker.cpp<br class="">><br class="">> Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h<br class="">> URL:<span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_include_llvm_DebugInfo_DWARF_DWARFUnit.h-3Frev-3D237733-26r1-3D237732-26r2-3D237733-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=i0RikhEETYZDN7aNgdqzao5KZVbb44wCscGgxV85vOo&s=UdM4yDUJGI81iOHT3gWMDhnYdYi5sDeMyoD249yK-9Y&e=" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h?rev=237733&r1=237732&r2=237733&view=diff</a><br class="">> ==============================================================================<br class="">> --- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h (original)<br class="">> +++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFUnit.h Tue May 19 16:54:32 2015<br class="">> @@ -195,9 +195,8 @@ public:<br class="">>      BaseAddr = base_addr;<br class="">>    }<br class="">><br class="">> -  const DWARFDebugInfoEntryMinimal *<br class="">> -  getCompileUnitDIE(bool extract_cu_die_only = true) {<br class="">> -    extractDIEsIfNeeded(extract_cu_die_only);<br class="">> +  const DWARFDebugInfoEntryMinimal *getUnitDIE(bool ExtractUnitDIEOnly = true) {<br class="">> +    extractDIEsIfNeeded(ExtractUnitDIEOnly);<br class="">>      return DieArray.empty() ? nullptr : &DieArray[0];<br class="">>    }<br class="">><br class="">> @@ -226,8 +225,7 @@ public:<br class="">>    /// It is illegal to call this method with a DIE that hasn't be<br class="">>    /// created by this unit. In other word, it's illegal to call this<br class="">>    /// method on a DIE that isn't accessible by following<br class="">> -  /// children/sibling links starting from this unit's<br class="">> -  /// getCompileUnitDIE().<br class="">> +  /// children/sibling links starting from this unit's getUnitDIE().<br class="">>    uint32_t getDIEIndex(const DWARFDebugInfoEntryMinimal *DIE) {<br class="">>      assert(!DieArray.empty() && DIE >= &DieArray[0] &&<br class="">>             DIE < &DieArray[0] + DieArray.size());<br class="">><br class="">> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp<br class="">> URL:<span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_DebugInfo_DWARF_DWARFCompileUnit.cpp-3Frev-3D237733-26r1-3D237732-26r2-3D237733-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=i0RikhEETYZDN7aNgdqzao5KZVbb44wCscGgxV85vOo&s=q9Qw5_oJ_WYHkzMoXhKy_3DjR5vajUv8gQ4HRKAbXj8&e=" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp?rev=237733&r1=237732&r2=237733&view=diff</a><br class="">> ==============================================================================<br class="">> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp (original)<br class="">> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp Tue May 19 16:54:32 2015<br class="">> @@ -22,9 +22,10 @@ void DWARFCompileUnit::dump(raw_ostream<br class="">>       << " (next unit at " << format("0x%08x", getNextUnitOffset())<br class="">>       << ")\n";<br class="">><br class="">> -  const DWARFDebugInfoEntryMinimal *CU = getCompileUnitDIE(false);<br class="">> -  assert(CU && "Null Compile Unit?");<br class="">> -  CU->dump(OS, this, -1U);<br class="">> +  if (const DWARFDebugInfoEntryMinimal *CU = getUnitDIE(false))<br class="">> +    CU->dump(OS, this, -1U);<br class="">> +  else<br class="">> +    OS << "<compile unit can't be parsed!>\n\n";<br class="">>  }<br class="">><br class="">>  // VTable anchor.<br class="">><br class="">> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp<br class="">> URL:<span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_DebugInfo_DWARF_DWARFContext.cpp-3Frev-3D237733-26r1-3D237732-26r2-3D237733-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=i0RikhEETYZDN7aNgdqzao5KZVbb44wCscGgxV85vOo&s=HJVL60uJ4lybBLyg2Qcq9DDCYOza6L53QTPT0GfYrpU&e=" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp?rev=237733&r1=237732&r2=237733&view=diff</a><br class="">> ==============================================================================<br class="">> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp (original)<br class="">> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp Tue May 19 16:54:32 2015<br class="">> @@ -140,9 +140,11 @@ void DWARFContext::dump(raw_ostream &OS,<br class="">>      OS << "\n.debug_line contents:\n";<br class="">>      for (const auto &CU : compile_units()) {<br class="">>        savedAddressByteSize = CU->getAddressByteSize();<br class="">> -      unsigned stmtOffset =<br class="">> -          CU->getCompileUnitDIE()->getAttributeValueAsSectionOffset(<br class="">> -              CU.get(), DW_AT_stmt_list, -1U);<br class="">> +      const auto *CUDIE = CU->getUnitDIE();<br class="">> +      if (CUDIE == nullptr)<br class="">> +        continue;<br class="">> +      unsigned stmtOffset = CUDIE->getAttributeValueAsSectionOffset(<br class="">> +          CU.get(), DW_AT_stmt_list, -1U);<br class="">>        if (stmtOffset != -1U) {<br class="">>          DataExtractor lineData(getLineSection().Data, isLittleEndian(),<br class="">>                                 savedAddressByteSize);<br class="">> @@ -321,13 +323,14 @@ const DWARFDebugFrame *DWARFContext::get<br class="">>  }<br class="">><br class="">>  const DWARFLineTable *<br class="">> -DWARFContext::getLineTableForUnit(DWARFUnit *cu) {<br class="">> +DWARFContext::getLineTableForUnit(DWARFUnit *U) {<br class="">>    if (!Line)<br class="">>      Line.reset(new DWARFDebugLine(&getLineSection().Relocs));<br class="">> -<br class="">> +  const auto *UnitDIE = U->getUnitDIE();<br class="">> +  if (UnitDIE == nullptr)<br class="">> +    return nullptr;<br class="">>    unsigned stmtOffset =<br class="">> -      cu->getCompileUnitDIE()->getAttributeValueAsSectionOffset(<br class="">> -          cu, DW_AT_stmt_list, -1U);<br class="">> +      UnitDIE->getAttributeValueAsSectionOffset(U, DW_AT_stmt_list, -1U);<br class="">>    if (stmtOffset == -1U)<br class="">>      return nullptr; // No line table for this compile unit.<br class="">><br class="">> @@ -337,7 +340,7 @@ DWARFContext::getLineTableForUnit(DWARFU<br class="">><br class="">>    // We have to parse it first.<br class="">>    DataExtractor lineData(getLineSection().Data, isLittleEndian(),<br class="">> -                         cu->getAddressByteSize());<br class="">> +                         U->getAddressByteSize());<br class="">>    return Line->getOrParseLineTable(lineData, stmtOffset);<br class="">>  }<br class="">><br class="">><br class="">> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp<br class="">> URL:<span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_DebugInfo_DWARF_DWARFTypeUnit.cpp-3Frev-3D237733-26r1-3D237732-26r2-3D237733-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=i0RikhEETYZDN7aNgdqzao5KZVbb44wCscGgxV85vOo&s=CKRMfE-kGYuRa3LpYSaggn0lntWaEmnHl811uBLEi58&e=" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp?rev=237733&r1=237732&r2=237733&view=diff</a><br class="">> ==============================================================================<br class="">> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp (original)<br class="">> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp Tue May 19 16:54:32 2015<br class="">> @@ -33,7 +33,8 @@ void DWARFTypeUnit::dump(raw_ostream &OS<br class="">>       << " (next unit at " << format("0x%08x", getNextUnitOffset())<br class="">>       << ")\n";<br class="">><br class="">> -  const DWARFDebugInfoEntryMinimal *CU = getCompileUnitDIE(false);<br class="">> -  assert(CU && "Null Compile Unit?");<br class="">> -  CU->dump(OS, this, -1U);<br class="">> +  if (const DWARFDebugInfoEntryMinimal *TU = getUnitDIE(false))<br class="">> +    TU->dump(OS, this, -1U);<br class="">> +  else<br class="">> +    OS << "<type unit can't be parsed!>\n\n";<br class="">>  }<br class="">><br class="">> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp<br class="">> URL:<span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_DebugInfo_DWARF_DWARFUnit.cpp-3Frev-3D237733-26r1-3D237732-26r2-3D237733-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=i0RikhEETYZDN7aNgdqzao5KZVbb44wCscGgxV85vOo&s=ONzxT5tM7jRAOqxX9shQH-CMGyvjBMnqGzlxdK0hAz0&e=" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=237733&r1=237732&r2=237733&view=diff</a><br class="">> ==============================================================================<br class="">> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp (original)<br class="">> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp Tue May 19 16:54:32 2015<br class="">> @@ -310,8 +310,11 @@ void DWARFUnit::clearDIEs(bool KeepCUDie<br class="">>  }<br class="">><br class="">>  void DWARFUnit::collectAddressRanges(DWARFAddressRangesVector &CURanges) {<br class="">> -  // First, check if CU DIE describes address ranges for the unit.<br class="">> -  const auto &CUDIERanges = getCompileUnitDIE()->getAddressRanges(this);<br class="">> +  const auto *U = getUnitDIE();<br class="">> +  if (U == nullptr)<br class="">> +    return;<br class="">> +  // First, check if unit DIE describes address ranges for the whole unit.<br class="">> +  const auto &CUDIERanges = U->getAddressRanges(this);<br class="">>    if (!CUDIERanges.empty()) {<br class="">>      CURanges.insert(CURanges.end(), CUDIERanges.begin(), CUDIERanges.end());<br class="">>      return;<br class="">><br class="">> Modified: llvm/trunk/tools/dsymutil/DwarfLinker.cpp<br class="">> URL:<span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_tools_dsymutil_DwarfLinker.cpp-3Frev-3D237733-26r1-3D237732-26r2-3D237733-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=i0RikhEETYZDN7aNgdqzao5KZVbb44wCscGgxV85vOo&s=lthJ-pbHL4ZQvFR0n9YmO2E7a1DFd4N2iMCAXNF-VrM&e=" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/DwarfLinker.cpp?rev=237733&r1=237732&r2=237733&view=diff</a><br class="">> ==============================================================================<br class="">> --- llvm/trunk/tools/dsymutil/DwarfLinker.cpp (original)<br class="">> +++ llvm/trunk/tools/dsymutil/DwarfLinker.cpp Tue May 19 16:54:32 2015<br class="">> @@ -729,7 +729,7 @@ void DwarfStreamer::emitLocationsForUnit<br class="">>    const DWARFSection &InputSec = Dwarf.getLocSection();<br class="">>    DataExtractor Data(InputSec.Data, Dwarf.isLittleEndian(), AddressSize);<br class="">>    DWARFUnit &OrigUnit = Unit.getOrigUnit();<br class="">> -  const auto *OrigUnitDie = OrigUnit.getCompileUnitDIE(false);<br class="">> +  const auto *OrigUnitDie = OrigUnit.getUnitDIE(false);<br class="">>    int64_t UnitPcOffset = 0;<br class="">>    uint64_t OrigLowPc = OrigUnitDie->getAttributeValueAsAddress(<br class="">>        &OrigUnit, dwarf::DW_AT_low_pc, -1ULL);<br class="">> @@ -2203,7 +2203,7 @@ void DwarfLinker::patchRangesForUnit(con<br class="">>                                 OrigDwarf.isLittleEndian(), AddressSize);<br class="">>    auto InvalidRange = FunctionRanges.end(), CurrRange = InvalidRange;<br class="">>    DWARFUnit &OrigUnit = Unit.getOrigUnit();<br class="">> -  const auto *OrigUnitDie = OrigUnit.getCompileUnitDIE(false);<br class="">> +  const auto *OrigUnitDie = OrigUnit.getUnitDIE(false);<br class="">>    uint64_t OrigLowPc = OrigUnitDie->getAttributeValueAsAddress(<br class="">>        &OrigUnit, dwarf::DW_AT_low_pc, -1ULL);<br class="">>    // Ranges addresses are based on the unit's low_pc. Compute the<br class="">> @@ -2287,7 +2287,7 @@ static void insertLineSequence(std::vect<br class="">>  void DwarfLinker::patchLineTableForUnit(CompileUnit &Unit,<br class="">>                                          DWARFContext &OrigDwarf) {<br class="">>    const DWARFDebugInfoEntryMinimal *CUDie =<br class="">> -      Unit.getOrigUnit().getCompileUnitDIE();<br class="">> +      Unit.getOrigUnit().getUnitDIE();<br class="">>    uint64_t StmtList = CUDie->getAttributeValueAsSectionOffset(<br class="">>        &Unit.getOrigUnit(), dwarf::DW_AT_stmt_list, -1ULL);<br class="">>    if (StmtList == -1ULL)<br class="">> @@ -2461,7 +2461,7 @@ bool DwarfLinker::link(const DebugMap &M<br class="">>      // In a first phase, just read in the debug info and store the DIE<br class="">>      // parent links that we will use during the next phase.<br class="">>      for (const auto &CU : DwarfContext.compile_units()) {<br class="">> -      auto *CUDie = CU->getCompileUnitDIE(false);<br class="">> +      auto *CUDie = CU->getUnitDIE(false);<br class="">>        if (Options.Verbose) {<br class="">>          outs() << "Input compilation unit:";<br class="">>          CUDie->dump(outs(), CU.get(), 0);<br class="">> @@ -2476,7 +2476,7 @@ bool DwarfLinker::link(const DebugMap &M<br class="">>      // references require the ParentIdx to be setup for every CU in<br class="">>      // the object file before calling this.<br class="">>      for (auto &CurrentUnit : Units)<br class="">> -      lookForDIEsToKeep(*CurrentUnit.getOrigUnit().getCompileUnitDIE(), *Obj,<br class="">> +      lookForDIEsToKeep(*CurrentUnit.getOrigUnit().getUnitDIE(), *Obj,<br class="">>                          CurrentUnit, 0);<br class="">><br class="">>      // The calls to applyValidRelocs inside cloneDIE will walk the<br class="">> @@ -2489,7 +2489,7 @@ bool DwarfLinker::link(const DebugMap &M<br class="">>      // to clone/emit.<br class="">>      if (!ValidRelocs.empty())<br class="">>        for (auto &CurrentUnit : Units) {<br class="">> -        const auto *InputDIE = CurrentUnit.getOrigUnit().getCompileUnitDIE();<br class="">> +        const auto *InputDIE = CurrentUnit.getOrigUnit().getUnitDIE();<br class="">>          CurrentUnit.setStartOffset(OutputDebugInfoSize);<br class="">>          DIE *OutputDIE = cloneDIE(*InputDIE, CurrentUnit, 0 /* PCOffset */,<br class="">>                                    11 /* Unit Header size */);<br class="">><br class="">><br class="">> _______________________________________________<br class="">> llvm-commits mailing list<br class="">><span class="Apple-converted-space"> </span><a class="">llvm-commits@cs.uiuc.edu</a><br class="">><span class="Apple-converted-space"> </span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class=""></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div></div><div class="gmail_extra">--<span class="Apple-converted-space"> </span><br class=""><div class=""><div dir="ltr" class="">Alexey Samsonov<br class=""><a class="">vonosmas@gmail.com</a></div></div></div>_______________________________________________<br class="">llvm-commits mailing list<br class=""><a class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class=""></blockquote></div></blockquote></div></div></div><span class=""><font color="#888888" class=""><br class=""><br class="">--<span class="Apple-converted-space"> </span><br class=""> <span class="Apple-converted-space"> </span>F<br class=""><br class=""></font></span></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class=""><div dir="ltr" class="">Alexey Samsonov<br class=""><a class="">vonosmas@gmail.com</a></div></div></div></blockquote><br class=""><br class=""></div></div><span class=""><font color="#888888" class="">--<span class="Apple-converted-space"> </span><br class=""> <span class="Apple-converted-space"> </span>F<br class=""><br class=""></font></span></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature"><div dir="ltr" class="">Alexey Samsonov<br class=""><a href="mailto:vonosmas@gmail.com" target="_blank" class="">vonosmas@gmail.com</a></div></div></div></div><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">llvm-commits mailing list</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:llvm-commits@cs.uiuc.edu" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">llvm-commits@cs.uiuc.edu</a><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></div></blockquote></div><br class=""></body></html>