-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dwarfdump] Fix .debug_line verification for DWARF 5
DWARF 5 uses a 0-based index while previous versions use a 1-based index. Fix the verifier and add a test. Differential revision: https://reviews.llvm.org/D147202
- Loading branch information
1 parent
f080f11
commit 031e4e5
Showing
2 changed files
with
52 additions
and
3 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
48 changes: 48 additions & 0 deletions
48
llvm/test/tools/llvm-dwarfdump/X86/verify_dwarf5_debug_line.yaml
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,48 @@ | ||
# RUN: llvm-mc %s -filetype obj -triple x86_64-unknown-linux-gnu -o %t.out | ||
# RUN: llvm-dwarfdump --verbose -verify %t.out | FileCheck %s | ||
|
||
# CHECK: Verifying .debug_line... | ||
|
||
.text | ||
.file "dwarf5.c" | ||
.globl main # -- Begin function main | ||
.p2align 4, 0x90 | ||
.type main,@function | ||
main: # @main | ||
.Lfunc_begin0: | ||
.file 0 "/tmp" "dwarf5.c" md5 0xa6f6c381b31c93c579beac58181f5d01 | ||
.loc 0 1 0 # dwarf5.c:1:0 | ||
.cfi_startproc | ||
# %bb.0: # %entry | ||
pushq %rbp | ||
.cfi_def_cfa_offset 16 | ||
.cfi_offset %rbp, -16 | ||
movq %rsp, %rbp | ||
.cfi_def_cfa_register %rbp | ||
movl $0, -4(%rbp) | ||
movl %edi, -8(%rbp) | ||
movq %rsi, -16(%rbp) | ||
.Ltmp0: | ||
.loc 0 2 3 prologue_end # dwarf5.c:2:3 | ||
xorl %eax, %eax | ||
.loc 0 2 3 epilogue_begin is_stmt 0 # dwarf5.c:2:3 | ||
popq %rbp | ||
.cfi_def_cfa %rsp, 8 | ||
retq | ||
.Ltmp1: | ||
.Lfunc_end0: | ||
.size main, .Lfunc_end0-main | ||
.cfi_endproc | ||
# -- End function | ||
.Linfo_string0: | ||
.asciz "clang version 17.0.0" # string offset=0 | ||
.Linfo_string1: | ||
.asciz "dwarf5.c" # string offset=101 | ||
.Linfo_string2: | ||
.asciz "/tmp" # string offset=110 | ||
.section .debug_str_offsets,"",@progbits | ||
.long .Linfo_string0 | ||
.long .Linfo_string1 | ||
.long .Linfo_string2 | ||
.ident "clang version 17.0.0" | ||
.Lline_table_start0: |