This is an archive of the discontinued LLVM Phabricator instance.

DWARFVerifier: Enhance validation of .debug_names hash tables
ClosedPublic

Authored by labath on Mar 13 2018, 8:50 AM.

Details

Summary

This patch adds more checks to the .debug_names validator. Specifically,
they check for:

  • buckets claiming to be non-empty but pointing to mismatched hashes (most consumers would interpret this as an empty bucket, but it questionable whether the generator meant that)
  • hashes that are not reachable from any bucket
  • names with incorrect hashes

Together, these checks ensure that any name in the index can be reached
through the hash table using the regular lookup algorithm. We also warn
if we encounter a name index without a hash table.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Mar 13 2018, 8:50 AM
aprantl added inline comments.Mar 13 2018, 9:48 AM
lib/DebugInfo/DWARF/DWARFVerifier.cpp
848 ↗(On Diff #138203)

A few more comments on what is being checked wouldn't hurt.

881 ↗(On Diff #138203)

Can you turn this comment into a full sentence?

JDevlieghere accepted this revision.Mar 13 2018, 1:38 PM

LGTM with Adrian's comments addressed.

This revision is now accepted and ready to land.Mar 13 2018, 1:38 PM
labath updated this revision to Diff 138319.Mar 14 2018, 3:53 AM

I've added a bunch of comments to explain how the checks work. Let me know if
this is what you had in mind.

This revision was automatically updated to reflect the committed changes.