mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
[DWARFYAML] Abbrev codes in a new abbrev table should start from 1 (by default).
The abbrev codes in a new abbrev table should start from 1 (by default), rather than inherit the value from the code in the previous table. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D86545
This commit is contained in:
parent
2a1fa7b84c
commit
c0f8e4de72
@ -95,8 +95,8 @@ Error DWARFYAML::emitDebugStr(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Error DWARFYAML::emitDebugAbbrev(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
Error DWARFYAML::emitDebugAbbrev(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
||||||
uint64_t AbbrevCode = 0;
|
|
||||||
for (const DWARFYAML::AbbrevTable &AbbrevTable : DI.DebugAbbrev) {
|
for (const DWARFYAML::AbbrevTable &AbbrevTable : DI.DebugAbbrev) {
|
||||||
|
uint64_t AbbrevCode = 0;
|
||||||
for (const DWARFYAML::Abbrev &AbbrevDecl : AbbrevTable.Table) {
|
for (const DWARFYAML::Abbrev &AbbrevDecl : AbbrevTable.Table) {
|
||||||
AbbrevCode =
|
AbbrevCode =
|
||||||
AbbrevDecl.Code ? (uint64_t)*AbbrevDecl.Code : AbbrevCode + 1;
|
AbbrevDecl.Code ? (uint64_t)*AbbrevDecl.Code : AbbrevCode + 1;
|
||||||
|
@ -277,9 +277,12 @@ DWARF:
|
|||||||
## ^- abbreviation code (ULEB128) 0x04
|
## ^- abbreviation code (ULEB128) 0x04
|
||||||
## ^- abbreviation code (ULEB128) 0x04
|
## ^- abbreviation code (ULEB128) 0x04
|
||||||
##
|
##
|
||||||
# CODE-NEXT: 0x00000010 2e000000 052e0000 00062e00 0000
|
# CODE-NEXT: 0x00000010 2e000000 052e0000 00062e00 00000001
|
||||||
## ^- abbreviation code ULEB128
|
## ^- abbreviation code ULEB128
|
||||||
## ^- abbreviation code ULEB128
|
## ^- abbreviation code ULEB128
|
||||||
|
## ^- abbreviation code ULEB128
|
||||||
|
# CODE-NEXT: 0x00000020 11000000 022e0000 0000
|
||||||
|
## ^- abbreviation code ULEB128
|
||||||
|
|
||||||
--- !ELF
|
--- !ELF
|
||||||
FileHeader:
|
FileHeader:
|
||||||
@ -303,6 +306,12 @@ DWARF:
|
|||||||
Children: DW_CHILDREN_no
|
Children: DW_CHILDREN_no
|
||||||
- Tag: DW_TAG_subprogram
|
- Tag: DW_TAG_subprogram
|
||||||
Children: DW_CHILDREN_no
|
Children: DW_CHILDREN_no
|
||||||
|
- Table:
|
||||||
|
## Test that the abbrev codes in a new table start from 1 by default.
|
||||||
|
- Tag: DW_TAG_compile_unit
|
||||||
|
Children: DW_CHILDREN_no
|
||||||
|
- Tag: DW_TAG_subprogram
|
||||||
|
Children: DW_CHILDREN_no
|
||||||
|
|
||||||
## i) Test that yaml2obj emits an error message when there are non-empty compilation units
|
## i) Test that yaml2obj emits an error message when there are non-empty compilation units
|
||||||
## and multiple abbrev tables are assigned the same ID.
|
## and multiple abbrev tables are assigned the same ID.
|
||||||
|
Loading…
Reference in New Issue
Block a user