[all-commits] [llvm/llvm-project] c47585: [DWARFDebugLine] Check for errors when parsing v2 ...

Pavel Labath via All-commits all-commits at lists.llvm.org
Tue Apr 21 07:56:01 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c475856d0532995a74206e5f4bd5ebf80ce85750
      https://github.com/llvm/llvm-project/commit/c475856d0532995a74206e5f4bd5ebf80ce85750
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2020-04-21 (Tue, 21 Apr 2020)

  Changed paths:
    M llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
    M llvm/test/tools/llvm-dwarfdump/X86/Inputs/debug_line_malformed.s
    M llvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test
    A llvm/test/tools/llvm-dwarfdump/X86/debug_line_short_prologue_v4.s
    M llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp

  Log Message:
  -----------
  [DWARFDebugLine] Check for errors when parsing v2 file/dir lists

Summary:
Without this we could silently accept an invalid prologue because the
default DataExtractor behavior is to return an empty string when
reaching the end of file. And empty string is also used to terminate
these lists.

This makes the parsing code slightly more complicated, but this
complexity will go away once the parser starts working with truncating
data extractors. The reason I am doing it this way is because without
this, the truncation would regress the quality of error messages (right
now, we produce bad error messages only near EOF, but truncation would
make everything behave as if it was near EOF).

Reviewers: dblaikie, probinson, jhenderson

Subscribers: hiraditya, MaskRay, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77555




More information about the All-commits mailing list