-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DebugInfo] Report errors when DWARFUnitHeader::applyIndexEntry fails (…
…#89156) Motivation: LLDB is able to report errors about these scenarios whereas LLVM's DWARF parser only gives a boolean success/fail. I want to migrate LLDB to using LLVM's DWARFUnitHeader class, but I don't want to lose some of the error reporting, so I'm adding it to the LLVM class first.
- Loading branch information
Showing
5 changed files
with
152 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
llvm/test/DebugInfo/X86/invalid-cu-abbrev-contribution-dwp.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o - | \ | ||
# RUN: llvm-dwarfdump -debug-info - 2>&1 | FileCheck %s | ||
|
||
# CHECK: warning: DWARF package unit at offset 0x00000000 missing abbreviation column | ||
|
||
.section .debug_abbrev.dwo, "e", @progbits | ||
.LAbbrBegin: | ||
.uleb128 1 # Abbreviation Code | ||
.uleb128 17 # DW_TAG_compile_unit | ||
.byte 0 # DW_CHILDREN_no | ||
.uleb128 3 # DW_AT_name | ||
.uleb128 8 # DW_FORM_string | ||
.uleb128 0x2131 # DW_AT_GNU_dwo_id | ||
.uleb128 7 # DW_FORM_data8 | ||
.byte 0 # EOM(1) | ||
.byte 0 # EOM(2) | ||
.byte 0 # EOM(3) | ||
.LAbbrEnd: | ||
|
||
.section .debug_info.dwo, "e", @progbits | ||
.LCUBegin: | ||
.long .LCUEnd-.LCUVersion # Length | ||
.LCUVersion: | ||
.short 4 # Version | ||
.long 0 # Abbrev offset | ||
.byte 4 # Address size | ||
.uleb128 1 # Abbrev [1] DW_TAG_compile_unit | ||
.asciz "a.c" # DW_AT_name | ||
.quad 0x1100001122222222 # DW_AT_GNU_dwo_id | ||
.LCUEnd: | ||
|
||
.section .debug_cu_index, "", @progbits | ||
## Header: | ||
.short 2 # Version | ||
.space 2 # Padding | ||
.long 1 # Section count (Invalid, should be 2) | ||
.long 1 # Unit count | ||
.long 4 # Slot count | ||
## Hash Table of Signatures: | ||
.quad 0 | ||
.quad 0 | ||
.quad 0x1100001122222222 | ||
.quad 0 | ||
## Parallel Table of Indexes: | ||
.long 0 | ||
.long 0 | ||
.long 1 | ||
.long 0 | ||
## Table of Section Offsets: | ||
## Row 0: | ||
.long 1 # DW_SECT_INFO | ||
# .long 3 # DW_SECT_ABBREV (Intentionally omitted) | ||
## Row 1: | ||
.long .LCUBegin-.debug_info.dwo # Offset in .debug_info.dwo | ||
# .long .LAbbrBegin-.debug_abbrev.dwo # Offset in .debug_abbrev.dwo (Intentionally omitted) | ||
## Table of Section Sizes: | ||
.long .LCUEnd-.LCUBegin # Size of the contribution in .debug_info.dwo | ||
.long .LAbbrEnd-.LAbbrBegin # Size of the contribution in .debug_abbrev.dwo (Intentionally omitted) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o - | \ | ||
# RUN: llvm-dwarfdump -debug-info - 2>&1 | FileCheck %s | ||
|
||
# CHECK: warning: DWARF package unit at offset 0x00000000 has a non-zero abbreviation offset | ||
|
||
.section .debug_abbrev.dwo, "e", @progbits | ||
.LAbbrBegin: | ||
.uleb128 1 # Abbreviation Code | ||
.uleb128 17 # DW_TAG_compile_unit | ||
.byte 0 # DW_CHILDREN_no | ||
.uleb128 3 # DW_AT_name | ||
.uleb128 8 # DW_FORM_string | ||
.uleb128 0x2131 # DW_AT_GNU_dwo_id | ||
.uleb128 7 # DW_FORM_data8 | ||
.byte 0 # EOM(1) | ||
.byte 0 # EOM(2) | ||
.byte 0 # EOM(3) | ||
.LAbbrEnd: | ||
|
||
.section .debug_info.dwo, "e", @progbits | ||
.LCUBegin: | ||
.long .LCUEnd-.LCUVersion # Length | ||
.LCUVersion: | ||
.short 4 # Version | ||
.long 1 # Abbrev offset (Invalid, should be 0) | ||
.byte 4 # Address size | ||
.uleb128 1 # Abbrev [1] DW_TAG_compile_unit | ||
.asciz "a.c" # DW_AT_name | ||
.quad 0x1100001122222222 # DW_AT_GNU_dwo_id | ||
.LCUEnd: | ||
|
||
.section .debug_cu_index, "", @progbits | ||
## Header: | ||
.short 2 # Version | ||
.space 2 # Padding | ||
.long 2 # Section count | ||
.long 1 # Unit count | ||
.long 4 # Slot count | ||
## Hash Table of Signatures: | ||
.quad 0 | ||
.quad 0 | ||
.quad 0x1100001122222222 | ||
.quad 0 | ||
## Parallel Table of Indexes: | ||
.long 0 | ||
.long 0 | ||
.long 1 | ||
.long 0 | ||
## Table of Section Offsets: | ||
## Row 0: | ||
.long 1 # DW_SECT_INFO | ||
.long 3 # DW_SECT_ABBREV | ||
## Row 1: | ||
.long .LCUBegin-.debug_info.dwo # Offset in .debug_info.dwo | ||
.long .LAbbrBegin-.debug_abbrev.dwo # Offset in .debug_abbrev.dwo | ||
## Table of Section Sizes: | ||
.long .LCUEnd-.LCUBegin | ||
.long .LAbbrEnd-.LAbbrBegin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters