mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[DWARFYAML] Replace InitialLength with Format and Length. NFC.
This change replaces the InitialLength of pub-tables with Format and Length. All the InitialLength fields have been removed. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D85880
This commit is contained in:
parent
ac8a8b4ad9
commit
b9e787ce80
@ -26,26 +26,6 @@
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace DWARFYAML {
|
namespace DWARFYAML {
|
||||||
|
|
||||||
struct InitialLength {
|
|
||||||
uint32_t TotalLength;
|
|
||||||
uint64_t TotalLength64;
|
|
||||||
|
|
||||||
bool isDWARF64() const { return TotalLength == UINT32_MAX; }
|
|
||||||
|
|
||||||
uint64_t getLength() const {
|
|
||||||
return isDWARF64() ? TotalLength64 : TotalLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setLength(uint64_t Len) {
|
|
||||||
if (Len >= (uint64_t)UINT32_MAX) {
|
|
||||||
TotalLength64 = Len;
|
|
||||||
TotalLength = UINT32_MAX;
|
|
||||||
} else {
|
|
||||||
TotalLength = Len;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct AttributeAbbrev {
|
struct AttributeAbbrev {
|
||||||
llvm::dwarf::Attribute Attribute;
|
llvm::dwarf::Attribute Attribute;
|
||||||
llvm::dwarf::Form Form;
|
llvm::dwarf::Form Form;
|
||||||
@ -95,7 +75,8 @@ struct PubEntry {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct PubSection {
|
struct PubSection {
|
||||||
InitialLength Length;
|
dwarf::DwarfFormat Format;
|
||||||
|
yaml::Hex64 Length;
|
||||||
uint16_t Version;
|
uint16_t Version;
|
||||||
uint32_t UnitOffset;
|
uint32_t UnitOffset;
|
||||||
uint32_t UnitSize;
|
uint32_t UnitSize;
|
||||||
@ -375,10 +356,6 @@ template <> struct MappingTraits<DWARFYAML::StringOffsetsTable> {
|
|||||||
static void mapping(IO &IO, DWARFYAML::StringOffsetsTable &StrOffsetsTable);
|
static void mapping(IO &IO, DWARFYAML::StringOffsetsTable &StrOffsetsTable);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct MappingTraits<DWARFYAML::InitialLength> {
|
|
||||||
static void mapping(IO &IO, DWARFYAML::InitialLength &DWARF);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <> struct ScalarEnumerationTraits<dwarf::DwarfFormat> {
|
template <> struct ScalarEnumerationTraits<dwarf::DwarfFormat> {
|
||||||
static void enumeration(IO &IO, dwarf::DwarfFormat &Format) {
|
static void enumeration(IO &IO, dwarf::DwarfFormat &Format) {
|
||||||
IO.enumCase(Format, "DWARF32", dwarf::DWARF32);
|
IO.enumCase(Format, "DWARF32", dwarf::DWARF32);
|
||||||
|
@ -68,13 +68,6 @@ static void ZeroFillBytes(raw_ostream &OS, size_t Size) {
|
|||||||
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
OS.write(reinterpret_cast<char *>(FillData.data()), Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void writeInitialLength(const DWARFYAML::InitialLength &Length,
|
|
||||||
raw_ostream &OS, bool IsLittleEndian) {
|
|
||||||
writeInteger((uint32_t)Length.TotalLength, OS, IsLittleEndian);
|
|
||||||
if (Length.isDWARF64())
|
|
||||||
writeInteger((uint64_t)Length.TotalLength64, OS, IsLittleEndian);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void writeInitialLength(const dwarf::DwarfFormat Format,
|
static void writeInitialLength(const dwarf::DwarfFormat Format,
|
||||||
const uint64_t Length, raw_ostream &OS,
|
const uint64_t Length, raw_ostream &OS,
|
||||||
bool IsLittleEndian) {
|
bool IsLittleEndian) {
|
||||||
@ -213,7 +206,7 @@ Error DWARFYAML::emitDebugRanges(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
|||||||
|
|
||||||
static Error emitPubSection(raw_ostream &OS, const DWARFYAML::PubSection &Sect,
|
static Error emitPubSection(raw_ostream &OS, const DWARFYAML::PubSection &Sect,
|
||||||
bool IsLittleEndian, bool IsGNUPubSec = false) {
|
bool IsLittleEndian, bool IsGNUPubSec = false) {
|
||||||
writeInitialLength(Sect.Length, OS, IsLittleEndian);
|
writeInitialLength(Sect.Format, Sect.Length, OS, IsLittleEndian);
|
||||||
writeInteger((uint16_t)Sect.Version, OS, IsLittleEndian);
|
writeInteger((uint16_t)Sect.Version, OS, IsLittleEndian);
|
||||||
writeInteger((uint32_t)Sect.UnitOffset, OS, IsLittleEndian);
|
writeInteger((uint32_t)Sect.UnitOffset, OS, IsLittleEndian);
|
||||||
writeInteger((uint32_t)Sect.UnitSize, OS, IsLittleEndian);
|
writeInteger((uint32_t)Sect.UnitSize, OS, IsLittleEndian);
|
||||||
|
@ -136,6 +136,7 @@ void MappingTraits<DWARFYAML::PubEntry>::mapping(IO &IO,
|
|||||||
|
|
||||||
void MappingTraits<DWARFYAML::PubSection>::mapping(
|
void MappingTraits<DWARFYAML::PubSection>::mapping(
|
||||||
IO &IO, DWARFYAML::PubSection &Section) {
|
IO &IO, DWARFYAML::PubSection &Section) {
|
||||||
|
IO.mapOptional("Format", Section.Format, dwarf::DWARF32);
|
||||||
IO.mapRequired("Length", Section.Length);
|
IO.mapRequired("Length", Section.Length);
|
||||||
IO.mapRequired("Version", Section.Version);
|
IO.mapRequired("Version", Section.Version);
|
||||||
IO.mapRequired("UnitOffset", Section.UnitOffset);
|
IO.mapRequired("UnitOffset", Section.UnitOffset);
|
||||||
@ -286,13 +287,6 @@ void MappingTraits<DWARFYAML::ListTable<EntryType>>::mapping(
|
|||||||
IO.mapOptional("Lists", ListTable.Lists);
|
IO.mapOptional("Lists", ListTable.Lists);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MappingTraits<DWARFYAML::InitialLength>::mapping(
|
|
||||||
IO &IO, DWARFYAML::InitialLength &InitialLength) {
|
|
||||||
IO.mapRequired("TotalLength", InitialLength.TotalLength);
|
|
||||||
if (InitialLength.isDWARF64())
|
|
||||||
IO.mapRequired("TotalLength64", InitialLength.TotalLength64);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end namespace yaml
|
} // end namespace yaml
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
@ -403,8 +403,7 @@ DWARF:
|
|||||||
- Address: 0x0000000100000F50
|
- Address: 0x0000000100000F50
|
||||||
Length: 52
|
Length: 52
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 23
|
||||||
TotalLength: 23
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 121
|
UnitSize: 121
|
||||||
@ -412,8 +411,7 @@ DWARF:
|
|||||||
- DieOffset: 0x0000002A
|
- DieOffset: 0x0000002A
|
||||||
Name: main
|
Name: main
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 31
|
||||||
TotalLength: 31
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 121
|
UnitSize: 121
|
||||||
|
@ -308,8 +308,7 @@ DWARF:
|
|||||||
- int
|
- int
|
||||||
- char
|
- char
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 23
|
||||||
TotalLength: 23
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 121
|
UnitSize: 121
|
||||||
@ -317,8 +316,7 @@ DWARF:
|
|||||||
- DieOffset: 0x0000002A
|
- DieOffset: 0x0000002A
|
||||||
Name: main
|
Name: main
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 31
|
||||||
TotalLength: 31
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 121
|
UnitSize: 121
|
||||||
@ -331,8 +329,7 @@ DWARF:
|
|||||||
|
|
||||||
#CHECK: DWARF:
|
#CHECK: DWARF:
|
||||||
#CHECK: debug_pubnames:
|
#CHECK: debug_pubnames:
|
||||||
#CHECK: Length:
|
#CHECK: Length: 0x0000000000000017
|
||||||
#CHECK: TotalLength: 23
|
|
||||||
#CHECK: Version: 2
|
#CHECK: Version: 2
|
||||||
#CHECK: UnitOffset: 0
|
#CHECK: UnitOffset: 0
|
||||||
#CHECK: UnitSize: 121
|
#CHECK: UnitSize: 121
|
||||||
@ -340,8 +337,7 @@ DWARF:
|
|||||||
#CHECK: - DieOffset: 0x0000002A
|
#CHECK: - DieOffset: 0x0000002A
|
||||||
#CHECK: Name: main
|
#CHECK: Name: main
|
||||||
#CHECK: debug_pubtypes:
|
#CHECK: debug_pubtypes:
|
||||||
#CHECK: Length:
|
#CHECK: Length: 0x000000000000001F
|
||||||
#CHECK: TotalLength: 31
|
|
||||||
#CHECK: Version: 2
|
#CHECK: Version: 2
|
||||||
#CHECK: UnitOffset: 0
|
#CHECK: UnitOffset: 0
|
||||||
#CHECK: UnitSize: 121
|
#CHECK: UnitSize: 121
|
||||||
|
@ -387,8 +387,7 @@ Slices:
|
|||||||
- Address: 0x000000000000BFF0
|
- Address: 0x000000000000BFF0
|
||||||
Length: 16
|
Length: 16
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 23
|
||||||
TotalLength: 23
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 119
|
UnitSize: 119
|
||||||
@ -396,8 +395,7 @@ Slices:
|
|||||||
- DieOffset: 0x00000026
|
- DieOffset: 0x00000026
|
||||||
Name: main
|
Name: main
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 31
|
||||||
TotalLength: 31
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 119
|
UnitSize: 119
|
||||||
@ -865,8 +863,7 @@ Slices:
|
|||||||
- Address: 0x0000000100007F9C
|
- Address: 0x0000000100007F9C
|
||||||
Length: 28
|
Length: 28
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 23
|
||||||
TotalLength: 23
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 126
|
UnitSize: 126
|
||||||
@ -874,8 +871,7 @@ Slices:
|
|||||||
- DieOffset: 0x0000002A
|
- DieOffset: 0x0000002A
|
||||||
Name: main
|
Name: main
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 31
|
||||||
TotalLength: 31
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 126
|
UnitSize: 126
|
||||||
|
@ -550,8 +550,7 @@ DWARF:
|
|||||||
- Address: 0x0000000100000F90
|
- Address: 0x0000000100000F90
|
||||||
Length: 37
|
Length: 37
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 43
|
||||||
TotalLength: 43
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 224
|
UnitSize: 224
|
||||||
@ -563,8 +562,7 @@ DWARF:
|
|||||||
- DieOffset: 0x00000069
|
- DieOffset: 0x00000069
|
||||||
Name: main
|
Name: main
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 31
|
||||||
TotalLength: 31
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0
|
UnitOffset: 0
|
||||||
UnitSize: 224
|
UnitSize: 224
|
||||||
|
@ -44,8 +44,7 @@ FileHeader:
|
|||||||
Machine: EM_X86_64
|
Machine: EM_X86_64
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubnames:
|
debug_gnu_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -140,8 +139,7 @@ Sections:
|
|||||||
Size: 0x10
|
Size: 0x10
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubnames:
|
debug_gnu_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -164,8 +162,7 @@ Sections:
|
|||||||
Content: "00"
|
Content: "00"
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubnames:
|
debug_gnu_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -227,8 +224,7 @@ Sections:
|
|||||||
Type: SHT_STRTAB
|
Type: SHT_STRTAB
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubnames:
|
debug_gnu_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -238,7 +234,7 @@ DWARF:
|
|||||||
|
|
||||||
# RUN: not yaml2obj --docnum=8 %s -o %t8.o 2>&1 | FileCheck %s --check-prefix=MISSING-KEY --ignore-case
|
# RUN: not yaml2obj --docnum=8 %s -o %t8.o 2>&1 | FileCheck %s --check-prefix=MISSING-KEY --ignore-case
|
||||||
|
|
||||||
# MISSING-KEY: YAML:260:9: error: missing required key 'Descriptor'
|
# MISSING-KEY: YAML:{{.*}}:9: error: missing required key 'Descriptor'
|
||||||
# MISSING-KEY-NEXT: - DieOffset: 0x12345678
|
# MISSING-KEY-NEXT: - DieOffset: 0x12345678
|
||||||
# MISSING-KEY-NEXT: ^
|
# MISSING-KEY-NEXT: ^
|
||||||
# MISSING-KEY-NEXT: yaml2obj: error: failed to parse YAML input: Invalid argument
|
# MISSING-KEY-NEXT: yaml2obj: error: failed to parse YAML input: Invalid argument
|
||||||
@ -251,8 +247,7 @@ FileHeader:
|
|||||||
Machine: EM_X86_64
|
Machine: EM_X86_64
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubnames:
|
debug_gnu_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
|
@ -44,8 +44,7 @@ FileHeader:
|
|||||||
Machine: EM_X86_64
|
Machine: EM_X86_64
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubtypes:
|
debug_gnu_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -140,8 +139,7 @@ Sections:
|
|||||||
Size: 0x10
|
Size: 0x10
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubtypes:
|
debug_gnu_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -164,8 +162,7 @@ Sections:
|
|||||||
Content: "00"
|
Content: "00"
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubtypes:
|
debug_gnu_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -227,8 +224,7 @@ Sections:
|
|||||||
Type: SHT_STRTAB
|
Type: SHT_STRTAB
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubtypes:
|
debug_gnu_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -238,7 +234,7 @@ DWARF:
|
|||||||
|
|
||||||
# RUN: not yaml2obj --docnum=8 %s -o %t8.o 2>&1 | FileCheck %s --check-prefix=MISSING-KEY --ignore-case
|
# RUN: not yaml2obj --docnum=8 %s -o %t8.o 2>&1 | FileCheck %s --check-prefix=MISSING-KEY --ignore-case
|
||||||
|
|
||||||
# MISSING-KEY: YAML:260:9: error: missing required key 'Descriptor'
|
# MISSING-KEY: YAML:{{.*}}:9: error: missing required key 'Descriptor'
|
||||||
# MISSING-KEY-NEXT: - DieOffset: 0x12345678
|
# MISSING-KEY-NEXT: - DieOffset: 0x12345678
|
||||||
# MISSING-KEY-NEXT: ^
|
# MISSING-KEY-NEXT: ^
|
||||||
# MISSING-KEY-NEXT: yaml2obj: error: failed to parse YAML input: Invalid argument
|
# MISSING-KEY-NEXT: yaml2obj: error: failed to parse YAML input: Invalid argument
|
||||||
@ -251,8 +247,7 @@ FileHeader:
|
|||||||
Machine: EM_X86_64
|
Machine: EM_X86_64
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_gnu_pubtypes:
|
debug_gnu_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
|
@ -43,8 +43,7 @@ FileHeader:
|
|||||||
Machine: EM_X86_64
|
Machine: EM_X86_64
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -136,8 +135,7 @@ Sections:
|
|||||||
Size: 0x10
|
Size: 0x10
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -160,8 +158,7 @@ Sections:
|
|||||||
Content: "00"
|
Content: "00"
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -223,8 +220,7 @@ Sections:
|
|||||||
Type: SHT_STRTAB
|
Type: SHT_STRTAB
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
|
@ -43,8 +43,8 @@ FileHeader:
|
|||||||
Machine: EM_X86_64
|
Machine: EM_X86_64
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Format: [[FORMAT=DWARF32]]
|
||||||
TotalLength: 0x1234
|
Length: 0x1234
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -136,8 +136,7 @@ Sections:
|
|||||||
Size: 0x10
|
Size: 0x10
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -160,8 +159,7 @@ Sections:
|
|||||||
Content: "00"
|
Content: "00"
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
@ -223,8 +221,7 @@ Sections:
|
|||||||
Type: SHT_STRTAB
|
Type: SHT_STRTAB
|
||||||
DWARF:
|
DWARF:
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x1234
|
UnitOffset: 0x1234
|
||||||
UnitSize: 0x4321
|
UnitSize: 0x4321
|
||||||
|
@ -19,13 +19,6 @@
|
|||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
void dumpInitialLength(DataExtractor &Data, uint64_t &Offset,
|
|
||||||
DWARFYAML::InitialLength &InitialLength) {
|
|
||||||
InitialLength.TotalLength = Data.getU32(&Offset);
|
|
||||||
if (InitialLength.isDWARF64())
|
|
||||||
InitialLength.TotalLength64 = Data.getU64(&Offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
void dumpDebugAbbrev(DWARFContext &DCtx, DWARFYAML::Data &Y) {
|
void dumpDebugAbbrev(DWARFContext &DCtx, DWARFYAML::Data &Y) {
|
||||||
auto AbbrevSetPtr = DCtx.getDebugAbbrev();
|
auto AbbrevSetPtr = DCtx.getDebugAbbrev();
|
||||||
if (AbbrevSetPtr) {
|
if (AbbrevSetPtr) {
|
||||||
@ -132,11 +125,18 @@ static DWARFYAML::PubSection dumpPubSection(const DWARFContext &DCtx,
|
|||||||
DCtx.isLittleEndian(), 0);
|
DCtx.isLittleEndian(), 0);
|
||||||
DWARFYAML::PubSection Y;
|
DWARFYAML::PubSection Y;
|
||||||
uint64_t Offset = 0;
|
uint64_t Offset = 0;
|
||||||
dumpInitialLength(PubSectionData, Offset, Y.Length);
|
uint64_t Length = PubSectionData.getU32(&Offset);
|
||||||
|
if (Length == dwarf::DW_LENGTH_DWARF64) {
|
||||||
|
Y.Format = dwarf::DWARF64;
|
||||||
|
Y.Length = PubSectionData.getU64(&Offset);
|
||||||
|
} else {
|
||||||
|
Y.Format = dwarf::DWARF32;
|
||||||
|
Y.Length = Length;
|
||||||
|
}
|
||||||
Y.Version = PubSectionData.getU16(&Offset);
|
Y.Version = PubSectionData.getU16(&Offset);
|
||||||
Y.UnitOffset = PubSectionData.getU32(&Offset);
|
Y.UnitOffset = PubSectionData.getU32(&Offset);
|
||||||
Y.UnitSize = PubSectionData.getU32(&Offset);
|
Y.UnitSize = PubSectionData.getU32(&Offset);
|
||||||
while (Offset < Y.Length.getLength()) {
|
while (Offset < Y.Length) {
|
||||||
DWARFYAML::PubEntry NewEntry;
|
DWARFYAML::PubEntry NewEntry;
|
||||||
NewEntry.DieOffset = PubSectionData.getU32(&Offset);
|
NewEntry.DieOffset = PubSectionData.getU32(&Offset);
|
||||||
if (IsGNUStyle)
|
if (IsGNUStyle)
|
||||||
|
@ -68,8 +68,7 @@ Blah: unexpected
|
|||||||
TEST(DebugPubSection, TestDebugPubSection) {
|
TEST(DebugPubSection, TestDebugPubSection) {
|
||||||
StringRef Yaml = R"(
|
StringRef Yaml = R"(
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x4321
|
UnitOffset: 0x4321
|
||||||
UnitSize: 0x00
|
UnitSize: 0x00
|
||||||
@ -79,8 +78,7 @@ debug_pubnames:
|
|||||||
- DieOffset: 0x4321
|
- DieOffset: 0x4321
|
||||||
Name: def
|
Name: def
|
||||||
debug_pubtypes:
|
debug_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x4321
|
UnitOffset: 0x4321
|
||||||
UnitSize: 0x00
|
UnitSize: 0x00
|
||||||
@ -115,8 +113,7 @@ debug_pubtypes:
|
|||||||
TEST(DebugPubSection, TestUnexpectedDescriptor) {
|
TEST(DebugPubSection, TestUnexpectedDescriptor) {
|
||||||
StringRef Yaml = R"(
|
StringRef Yaml = R"(
|
||||||
debug_pubnames:
|
debug_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x4321
|
UnitOffset: 0x4321
|
||||||
UnitSize: 0x00
|
UnitSize: 0x00
|
||||||
@ -133,8 +130,7 @@ debug_pubnames:
|
|||||||
TEST(DebugGNUPubSection, TestDebugGNUPubSections) {
|
TEST(DebugGNUPubSection, TestDebugGNUPubSections) {
|
||||||
StringRef Yaml = R"(
|
StringRef Yaml = R"(
|
||||||
debug_gnu_pubnames:
|
debug_gnu_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x4321
|
UnitOffset: 0x4321
|
||||||
UnitSize: 0x00
|
UnitSize: 0x00
|
||||||
@ -146,8 +142,7 @@ debug_gnu_pubnames:
|
|||||||
Descriptor: 0x34
|
Descriptor: 0x34
|
||||||
Name: def
|
Name: def
|
||||||
debug_gnu_pubtypes:
|
debug_gnu_pubtypes:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x4321
|
UnitOffset: 0x4321
|
||||||
UnitSize: 0x00
|
UnitSize: 0x00
|
||||||
@ -188,8 +183,7 @@ debug_gnu_pubtypes:
|
|||||||
TEST(DebugGNUPubSection, TestMissingDescriptor) {
|
TEST(DebugGNUPubSection, TestMissingDescriptor) {
|
||||||
StringRef Yaml = R"(
|
StringRef Yaml = R"(
|
||||||
debug_gnu_pubnames:
|
debug_gnu_pubnames:
|
||||||
Length:
|
Length: 0x1234
|
||||||
TotalLength: 0x1234
|
|
||||||
Version: 2
|
Version: 2
|
||||||
UnitOffset: 0x4321
|
UnitOffset: 0x4321
|
||||||
UnitSize: 0x00
|
UnitSize: 0x00
|
||||||
|
Loading…
Reference in New Issue
Block a user