[PATCH] D32765: Add line table verification to lldb-dwarfdump --verify. AbandonedPublic

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 15:41:29 PDT 2017


probinson added a comment.

Following up on my comment in the other review:

In https://reviews.llvm.org/D32754#743907, @clayborg wrote:

> In https://reviews.llvm.org/D32754#743899, @probinson wrote:
>
> > Can you verify that each CU (that has DW_AT_stmt_list) points to a different place in .debug_line?
>
>
> That is a good idea. Maybe we emit a warning? I say that because it seems like a good way to save space for type unique style DWARF to share line tables since they only use the line tables for DW_AT_decl_file and DW_AT_call_file. Is it against the DWARF spec to share a line table? Let me know if you think this should be a warning or error.


A type unit can certainly point to the same line table as its CU; but type units are not themselves CUs.  (In v4 they are in .debug_types not .debug_info, while in v5 they have a distinct unit-type code, so the verifier can easily tell them apart.)  So the uniqueness check should not apply to TUs.

I am hard-pressed to imagine a situation where two CUs could reasonably share a line table.  In a split-DWARF package file, there is no actual line table, but sharing the directory/file tables implies a coherent use of file/directory numbers across two CUs, or the packager rewriting the CUs to make them consistent, which is *really* hard to justify.

So, unless somebody can come up with a solid use-case, I'd say it should be an error for two CUs to have the same DW_AT_stmt_list offset.  (Maybe this should be in the .debug_info verification instead of the line-table verification, though.)


https://reviews.llvm.org/D32765





More information about the llvm-commits mailing list