[all-commits] [llvm/llvm-project] 929edd: [DWARFYAML][debug_aranges] Replace InitialLength w...

Xing GUO via All-commits all-commits at lists.llvm.org
Thu Jun 4 21:13:23 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 929edd8bd25b0390de97994eb90f42b26636d205
      https://github.com/llvm/llvm-project/commit/929edd8bd25b0390de97994eb90f42b26636d205
  Author: Xing GUO <higuoxing at gmail.com>
  Date:   2020-06-05 (Fri, 05 Jun 2020)

  Changed paths:
    M llvm/include/llvm/ObjectYAML/DWARFYAML.h
    M llvm/lib/ObjectYAML/DWARFEmitter.cpp
    M llvm/lib/ObjectYAML/DWARFYAML.cpp
    M llvm/test/ObjectYAML/MachO/DWARF-debug_aranges.yaml
    M llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
    M llvm/test/ObjectYAML/MachO/DWARF-debug_line.yaml
    M llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
    M llvm/test/tools/llvm-gsymutil/ARM_AArch64/fat-macho-dwarf.yaml
    M llvm/test/tools/llvm-gsymutil/X86/mach-dwarf.yaml
    M llvm/test/tools/obj2yaml/MachO/DWARF-debug_aranges-error.yaml
    M llvm/test/tools/yaml2obj/ELF/DWARF/debug-aranges.yaml
    M llvm/tools/obj2yaml/dwarf2yaml.cpp

  Log Message:
  -----------
  [DWARFYAML][debug_aranges] Replace InitialLength with Format and Length.

This patch addresses the comment in [D80972](https://reviews.llvm.org/D80972#inline-744217).

Before this patch, the initial length field of .debug_aranges section should be declared as:

```
## 32-bit DWARF
debug_aranges:
  - Length:
      TotalLength: 0x20
    Version: 2
    ...

## 64-bit DWARF
debug_aranges:
  - Length:
      TotalLength:   0xffffffff
      TotalLength64: 0x20
    Version: 2
    ...
```

After this patch:

```
## 32-bit DWARF
debug_aranges:
  - [[Format:  DWARF32]] ## Optional
    Length:  0x20
    Version: 2
    ...

## 64-bit DWARF
debug_aranges:
  - Format:  DWARF64
    Length:  0x20
    Version: 2
```

Current implementation of generating DWARF64 .debug_aranges section is buggy. A follow-up patch will improve it and add test cases for DWARF64.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D81063




More information about the All-commits mailing list