[llvm] r296253 - [DebugInfo] Skip implicit_const attributes when dumping .debug_info. NFC.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 09:04:04 PST 2017


Skipping these values doesn't seem to be correct - in the case of
flag_present, I think the value is still rendered in the dump, is it not? I
would expect the same for implicit_const values. (also, this needs test
coverage either way)

On Sat, Feb 25, 2017 at 5:27 AM Victor Leschuk via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: vleschuk
> Date: Sat Feb 25 07:15:57 2017
> New Revision: 296253
>
> URL: http://llvm.org/viewvc/llvm-project?rev=296253&view=rev
> Log:
> [DebugInfo] Skip implicit_const attributes when dumping .debug_info. NFC.
>
> When dumping .debug_info section we loop through all attributes mentioned
> in
> .debug_abbrev section and dump values using DWARFFormValue::extractValue().
> We need to skip implicit_const attributes here as their values are not
> really located in .debug_info but directly in .debug_abbrev. This patch
> fixes
> triggered assert() in DWARFFormValue::extractValue() caused by trying to
> access implicit_const values from .debug_info.
>
> Modified:
>     llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
>
> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp?rev=296253&r1=296252&r2=296253&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp Sat Feb 25 07:15:57 2017
> @@ -329,6 +329,12 @@ void DWARFDie::dump(raw_ostream &OS, uns
>
>          // Dump all data in the DIE for the attributes.
>          for (const auto &AttrSpec : AbbrevDecl->attributes()) {
> +          if (AttrSpec.Form == DW_FORM_implicit_const) {
> +            // We are dumping .debug_info section ,
> +            // implicit_const attribute values are not really stored here,
> +            // but in .debug_abbrev section. So we just skip such attrs.
> +            continue;
> +          }
>            dumpAttribute(OS, *this, &offset, AttrSpec.Attr, AttrSpec.Form,
>                          Indent);
>          }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://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/20170227/d977e141/attachment.html>


More information about the llvm-commits mailing list