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

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 06:49:24 PDT 2022


avl added a comment.

> When you used this to compare the output of dsymutil changes, what was the input binary? Does this generate meaningful output for bigger programs like dsymutil itself?

yes it does. I used it for all llvm&clang binaries.

> In my experience, when you change the dsymutil algorithm that marks dies as kept, they end up in different subtrees. Is that something this tool can deal with? My original assumption was that it can't, but then I don't understand how this was useful for the other two patches.

Yes, this class can deal with different subtrees(type subtrees). The idea is that it skips type subtrees. The types are compared by string representation. Following is the example:

  0x0000001b:   DW_TAG_const_type                                  |  0x0000001b:   DW_TAG_class_type
                  DW_AT_type      (0x0000002a "class1")            |                  DW_AT_name      ("class1")
                                                                   |
  0x0000002a:   DW_TAG_class_type                                  |  0x0000002a:   DW_TAG_const_type
                  DW_AT_name      ("class1")                       |                  DW_AT_type      (0x0000001b "class1")
                                                                   |
  0x00000071:   DW_TAG_subprogram                                     0x00000071:   DW_TAG_subprogram
                  DW_AT_name      ("foo1")                                            DW_AT_name      ("foo1")
                  DW_AT_low_pc    (0x0000000000001000)                                DW_AT_low_pc    (0x0000000000001000)
                  DW_AT_high_pc   (0x0000000000001010)                                DW_AT_high_pc   (0x0000000000001010)
                  DW_AT_type      (0x0000001b "const class1")      |                  DW_AT_type      (0x0000002a "const class1")

For both above examples --type-compat-dump will skip types descriptions and print only type names:

  == DW_TAG_subprogram [1]
     DW_AT_name "foo1"
     DW_AT_low_pc 0x0000000000001000
     DW_AT_high_pc 0x0000000000001010
     DW_AT_type "const class1"

That allows to catch errors if type trees were incorrect. F.e. if "DW_AT_type "const class1"" look like this

DW_AT_type "class1"
DW_AT_type "const class2"
DW_AT_type "class1*".

That solution works not for all possible dies trees modifications, but for only type trees.


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