[all-commits] [llvm/llvm-project] 9670a4: libDebugInfoDWARF: Don't try to parse loclist[.dwo...

David Blaikie via All-commits all-commits at lists.llvm.org
Tue Oct 13 22:34:42 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9670a45c980c371c5ece8047a00b8b2abec73823
      https://github.com/llvm/llvm-project/commit/9670a45c980c371c5ece8047a00b8b2abec73823
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2020-10-13 (Tue, 13 Oct 2020)

  Changed paths:
    M llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
    M llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
    A llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_unused_invalid.s

  Log Message:
  -----------
  libDebugInfoDWARF: Don't try to parse loclist[.dwo] headers when parsing debug_info[.dwo]

There's no way to know whether there's a loclist contribution to parse
if there's no loclistx encoding - and if there is one, there's no need
to walk back from the loclist_base (or, uin the case of
info.dwo/loclist.dwo - starting at 0 in the contribution) to parse the
header, instead rely on the DWARF32/64 and address size in the CU
that's already available.

This would come up in split DWARF (non-split wouldn't try to read a
loclist header in the absence of a loclist_base) when one unit had
location lists and another does not (because the loclists.dwo section
would be non-empty in that case - in the case where it's empty the
parsing would silently skip).

Simplify the testing a bit, rather than needing a whole dwp, etc - by
creating a malformed loclists.dwo section (and use single file Split
DWARF) that would trip up any attempt to parse it - but no attempt
should be made.




More information about the All-commits mailing list