[PATCH] D124082: [Debuginfo][llvm-dwarfdump][dsymutil] Add dsymutil compatibility dump.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 11:57:10 PDT 2022


avl added a comment.

In D124082#3462426 <https://reviews.llvm.org/D124082#3462426>, @dblaikie wrote:

> I don't think this would be enough to make dumps very comparable, would it?

It works for dsymutil. Following commands produce equal md5 value for many llvm binaries(for others, they produce incompatible value which points to the real problem).

  dsymutil intput-file -o - | llvm-dwarfdump --dsymutil-compat-dump - -o - | md5
  dsymutil --no-odr intput-file -o - | llvm-dwarfdump --dsymutil-compat-dump - -o - | md5



> We'd have to sort DIEs or something (based on their semantic content) to make things very comparable, beyond only omitting offsets?

This patch not only omit offsets but also skip dies. Currently it prints only dies which have 
DW_AT_lowpc or DW_AT_ranges or parameters dies. For such dies the patch assumes(to have successful comparison) they are in the same order
as they are in the other input. Other dies are skipped. It allows not to depend on the order or amount of types dies.
The types are compared by names which are printed by this patch.

> (& also this mode probably wouldn't be dsym specific, I'd guess - but some comparable/generic/semantic dump?)

Above assumption on the order of dies makes it dsymutil specific(and currently it would be most useful to compare dsymutil output). We can make it more general. But then, we would need to sort dies somehow as you suggested. I propose we can start from dsymutil specific solution and then make it more general.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124082



More information about the llvm-commits mailing list