[PATCH] D81820: [ObjectYAML][ELF] Add support for emitting the .debug_abbrev section.

Xing GUO via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 19:51:09 PDT 2020


Higuoxing marked an inline comment as done.
Higuoxing added a comment.

In D81820#2093285 <https://reviews.llvm.org/D81820#2093285>, @MaskRay wrote:

> I asked around how we should comment individual bytes.
>
> lichway gave an alternative:
>
>   # CONTENT-NEXT:                0000:  01 11 01 25
>                                         ~~ ~~ ~~ ~~
>                                          ^  ^  ^  ^
>                                          |  |  |  |
>         ULEB128  abbreviation code ______|  |  |  |
>         ULEB128  DW_TAG_compile_unit _______|  |  |
>          1-byte  DW_CHILDREN_yes ______________|  |
>         ULEB128  DW_AT_producer __________________|
>  
>                                         0E 13 05 03
>                                         ~~ ~~ ~~ ~~
>                                          ^  ^  ^  ^
>                                          |  |  |  |
>         ULEB128  DW_FORM_strp ___________|  |  |  |
>         ULEB128  DW_AT_language ____________|  |  |
>         ULEB128  DW_FORM_data2 ________________|  |
>         ULEB128  DW_AT_name ______________________|
>
>
> wanders: Not radically different, but if you put the comment above instead it will read from top instead of from bottom.
>
> (Request changes just to make sure these suggestions are considered and the comments should be improved if you think any suggestion is favorable.)


Hi Fangrui, thanks for the suggestion.

It seems that `FileCheck` cannot match bytes one by one.

  ## Cannot match
  # CONTENT-NEXT: 0000: 01 11 01 25
  ## Can match
  # CONTENT-NEXT: 0000: 01110125 

I have also checked the manual and there's no such an option that makes `FileCheck` happy with this match pattern. Did I miss something?

What do you think of having something like this?

  # CONTENT-NEXT: 0000: 01110125
                        ^~^~^~^~
                  ______| | | |
                  ________| | |
                  __________| |
                  ____________|

OR

  # CONTENT-NEXT: 0000: 01110125
                        ^~       ULEB28 abbreviation code
                          ^~     ULEB128 DW_TAG_compile_unit
                            ^~   1-byte DW_CHILDREN_yes
                              ^~ ULEB128 DW_AT_producer



================
Comment at: llvm/lib/ObjectYAML/DWARFYAML.cpp:35
     SecNames.insert("debug_line");
+  if (!AbbrevDecls.empty())
+    SecNames.insert("debug_abbrev");
----------------
MaskRay wrote:
> Probably use an alphabetical order.
Oh, thanks for spotting it. Can I re-arrange them in a follow-up patch?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81820





More information about the llvm-commits mailing list