HomePhabricator

[DWARFYAML][debug_aranges] Replace InitialLength with Format and Length.

Authored by Higuoxing on Jun 4 2020, 9:15 PM.

Description

[DWARFYAML][debug_aranges] Replace InitialLength with Format and Length.

This patch addresses the comment in D80972.

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

Details