[PATCH] D64544: [DWARF] Add more error handling to debug line parser.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 11:33:39 PDT 2019


JDevlieghere added a comment.

In D64544#1589861 <https://reviews.llvm.org/D64544#1589861>, @probinson wrote:

> In D64544#1589853 <https://reviews.llvm.org/D64544#1589853>, @dblaikie wrote:
>
> > I was rather hoping for test coverage for all the new error messages this change introduced - is that unrealistic/impractical?
>


Oh, sure, I was focussed on the MD5 one because that's the only one that's "new". I'll make sure the other ones are covered too.

>> Yeah, the line table is especially tricky to hand-craft compared to checking in an object file. I think it technically can still be hand-crafted assembly (no line directives, etc, just a debug_line section with raw byte (etc) directives) - might be plausible & make it clearer what the input is? (checked in assembly, assembled with llvm-mc then run through llvm-dwarfdump to test the parsing)
> 
> Hear hear.  It looks like this patch is all about diagnosing issues in the v5 prologue/file-table, and it should be relatively easy to construct bogus examples in assembler.  You don't need a line-number program at all.  There ought to be examples of *valid* v5 line-table headers lying around, I know I did all the dumper work with assembler tests before I ever generated any v5 headers.

How would you be able to emit a wrong form value for the MD5 hash from assembly? The directive (which I think you came up with?) is just `md5 [data]`? Deciding which form to emit is hard-coded in `MCDwarf`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64544/new/

https://reviews.llvm.org/D64544





More information about the llvm-commits mailing list