diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2017-10-06 22:27:31 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2017-10-06 22:27:31 +0000 |
commit | 9fb72f1b5607e6a57e230f075438ae58a9ca0147 (patch) | |
tree | b2e87f750c4298ea297b93aa6a659132f9180632 /test/tools | |
parent | b231046a7d1522b4e26d167f111aa5ca06e3d585 (diff) | |
download | llvm-9fb72f1b5607e6a57e230f075438ae58a9ca0147.tar.gz |
[dwarfdump] Verify that unit type matches root DIE
This patch adds two new verifiers:
- It checks that the root DIE of a CU is actually a valid unit DIE.
(based on its tag)
- For DWARF5 which contains a unit type int he CU header, it checks that
this matches the type of the unit DIE.
Differential revision: https://reviews.llvm.org/D38453
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tools')
-rw-r--r-- | test/tools/llvm-dwarfdump/X86/empty-CU.s | 2 | ||||
-rw-r--r-- | test/tools/llvm-dwarfdump/X86/verify_debug_info.s | 2 | ||||
-rw-r--r-- | test/tools/llvm-dwarfdump/X86/verify_unit_header_chain.s | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/test/tools/llvm-dwarfdump/X86/empty-CU.s b/test/tools/llvm-dwarfdump/X86/empty-CU.s index 14ff75836f4..a01fc16e0d7 100644 --- a/test/tools/llvm-dwarfdump/X86/empty-CU.s +++ b/test/tools/llvm-dwarfdump/X86/empty-CU.s @@ -1,7 +1,7 @@ # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \ # RUN: | not llvm-dwarfdump --verify --debug-info - \ # RUN: | FileCheck %s -# CHECK: error: Compilation unit without unit DIE. +# CHECK: error: Compilation unit without DIE. .section __DWARF,__debug_info,regular,debug .long 8 # CU length diff --git a/test/tools/llvm-dwarfdump/X86/verify_debug_info.s b/test/tools/llvm-dwarfdump/X86/verify_debug_info.s index b87db731a75..af947afb30e 100644 --- a/test/tools/llvm-dwarfdump/X86/verify_debug_info.s +++ b/test/tools/llvm-dwarfdump/X86/verify_debug_info.s @@ -11,6 +11,8 @@ # CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000003f] = "/Users/sgravani/Development/tests") # CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) # CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000016){{[[:space:]]}} +# CHECK-NEXT: error: Compilation unit root DIE is not a unit DIE: DW_TAG_null. +# CHECK-NEXT: error: Compilation unit type (DW_UT_compile) and root DIE (DW_TAG_null) do not match. # CHECK-NEXT: error: Units[2] - start offset: 0x00000068 # CHECK-NEXT: note: The length for this unit is too large for the .debug_info provided. # CHECK-NEXT: note: The unit type encoding is not valid. diff --git a/test/tools/llvm-dwarfdump/X86/verify_unit_header_chain.s b/test/tools/llvm-dwarfdump/X86/verify_unit_header_chain.s index baee5d86a24..046e7b7b6a2 100644 --- a/test/tools/llvm-dwarfdump/X86/verify_unit_header_chain.s +++ b/test/tools/llvm-dwarfdump/X86/verify_unit_header_chain.s @@ -9,6 +9,8 @@ # CHECK-NEXT: error: Units[2] - start offset: 0x00000026 # CHECK-NEXT: note: The 16 bit unit header version is not valid. # CHECK-NEXT: note: The offset into the .debug_abbrev section is not valid. +# CHECK-NEXT: error: Compilation unit root DIE is not a unit DIE: DW_TAG_null. +# CHECK-NEXT: error: Compilation unit type (DW_UT_compile) and root DIE (DW_TAG_null) do not match. # CHECK-NEXT: error: Units[4] - start offset: 0x00000041 # CHECK-NEXT: note: The length for this unit is too large for the .debug_info provided. |