[dwarfdump] Add verbose output for .debug-line section

This patch adds dumping of line table instructions as well as the final
state at each specified pc value in verbose mode. This is essentially
the same as the default in Darwin's dwarfdump. Dumping the actual line
table opcodes can be particularly useful for something like debugging a
bad `.debug_line` section.

Differential revision: https://reviews.llvm.org/D37971

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jonas Devlieghere 2017-09-21 20:15:30 +00:00
parent 5586629f29
commit 45b741c841
18 changed files with 552 additions and 447 deletions

View File

@ -217,7 +217,8 @@ public:
void clear();
/// Parse prologue and all rows.
bool parse(const DWARFDataExtractor &DebugLineData, uint32_t *OffsetPtr);
bool parse(const DWARFDataExtractor &DebugLineData, uint32_t *OffsetPtr,
raw_ostream *OS = nullptr);
using RowVector = std::vector<Row>;
using RowIter = RowVector::const_iterator;

View File

@ -335,8 +335,14 @@ void DWARFContext::dump(
isLittleEndian(), savedAddressByteSize);
DWARFDebugLine::LineTable LineTable;
uint32_t Offset = *StmtOffset;
LineTable.parse(lineData, &Offset);
LineTable.dump(OS);
// Verbose dumping is done during parsing and not on the intermediate
// representation.
if (DumpOpts.Verbose) {
LineTable.parse(lineData, &Offset, &OS);
} else {
LineTable.parse(lineData, &Offset);
LineTable.dump(OS);
}
}
}
}

View File

@ -394,7 +394,7 @@ DWARFDebugLine::getOrParseLineTable(const DWARFDataExtractor &DebugLineData,
}
bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
uint32_t *OffsetPtr) {
uint32_t *OffsetPtr, raw_ostream *OS) {
const uint32_t DebugLineOffset = *OffsetPtr;
clear();
@ -405,14 +405,23 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
return false;
}
if (OS)
Prologue.dump(*OS);
const uint32_t EndOffset =
DebugLineOffset + Prologue.TotalLength + Prologue.sizeofTotalLength();
ParsingState State(this);
while (*OffsetPtr < EndOffset) {
if (OS)
*OS << format("0x%08.08" PRIx32 ": ", *OffsetPtr);
uint8_t Opcode = DebugLineData.getU8(OffsetPtr);
if (OS)
*OS << format("%02.02" PRIx8 " ", Opcode);
if (Opcode == 0) {
// Extended Opcodes always start with a zero opcode followed by
// a uleb128 length so you can skip ones you don't know about
@ -421,6 +430,8 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
uint32_t ArgSize = Len - (*OffsetPtr - ExtOffset);
uint8_t SubOpcode = DebugLineData.getU8(OffsetPtr);
if (OS)
*OS << LNExtendedString(SubOpcode);
switch (SubOpcode) {
case DW_LNE_end_sequence:
// Set the end_sequence register of the state machine to true and
@ -432,6 +443,11 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
// of the sequence.
State.Row.EndSequence = true;
State.appendRowToMatrix(*OffsetPtr);
if (OS) {
*OS << "\n";
OS->indent(12);
State.Row.dump(*OS);
}
State.resetRowAndSequence();
break;
@ -443,6 +459,8 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
// that affect the address register add a delta to it. This instruction
// stores a relocatable value into it instead.
State.Row.Address = DebugLineData.getRelocatedAddress(OffsetPtr);
if (OS)
*OS << format(" (0x%16.16" PRIx64 ")", State.Row.Address);
break;
case DW_LNE_define_file:
@ -473,11 +491,18 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
FileEntry.ModTime = DebugLineData.getULEB128(OffsetPtr);
FileEntry.Length = DebugLineData.getULEB128(OffsetPtr);
Prologue.FileNames.push_back(FileEntry);
if (OS)
*OS << " (" << FileEntry.Name.str()
<< ", dir=" << FileEntry.DirIdx << ", mod_time="
<< format("(0x%16.16" PRIx64 ")", FileEntry.ModTime)
<< ", length=" << FileEntry.Length << ")";
}
break;
case DW_LNE_set_discriminator:
State.Row.Discriminator = DebugLineData.getULEB128(OffsetPtr);
if (OS)
*OS << " (" << State.Row.Discriminator << ")";
break;
default:
@ -487,6 +512,8 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
break;
}
} else if (Opcode < Prologue.OpcodeBase) {
if (OS)
*OS << LNStandardString(Opcode);
switch (Opcode) {
// Standard Opcodes
case DW_LNS_copy:
@ -494,32 +521,49 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
// current values of the state-machine registers. Then set
// the basic_block register to false.
State.appendRowToMatrix(*OffsetPtr);
if (OS) {
*OS << "\n";
OS->indent(12);
State.Row.dump(*OS);
*OS << "\n";
}
break;
case DW_LNS_advance_pc:
// Takes a single unsigned LEB128 operand, multiplies it by the
// min_inst_length field of the prologue, and adds the
// result to the address register of the state machine.
State.Row.Address +=
DebugLineData.getULEB128(OffsetPtr) * Prologue.MinInstLength;
{
uint64_t AddrOffset =
DebugLineData.getULEB128(OffsetPtr) * Prologue.MinInstLength;
State.Row.Address += AddrOffset;
if (OS)
*OS << " (" << AddrOffset << ")";
}
break;
case DW_LNS_advance_line:
// Takes a single signed LEB128 operand and adds that value to
// the line register of the state machine.
State.Row.Line += DebugLineData.getSLEB128(OffsetPtr);
if (OS)
*OS << " (" << State.Row.Line << ")";
break;
case DW_LNS_set_file:
// Takes a single unsigned LEB128 operand and stores it in the file
// register of the state machine.
State.Row.File = DebugLineData.getULEB128(OffsetPtr);
if (OS)
*OS << " (" << State.Row.File << ")";
break;
case DW_LNS_set_column:
// Takes a single unsigned LEB128 operand and stores it in the
// column register of the state machine.
State.Row.Column = DebugLineData.getULEB128(OffsetPtr);
if (OS)
*OS << " (" << State.Row.Column << ")";
break;
case DW_LNS_negate_stmt:
@ -551,6 +595,9 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
uint64_t AddrOffset =
(AdjustOpcode / Prologue.LineRange) * Prologue.MinInstLength;
State.Row.Address += AddrOffset;
if (OS)
*OS
<< format(" (0x%16.16" PRIx64 ")", AddrOffset);
}
break;
@ -564,7 +611,13 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
// judge when the computation of a special opcode overflows and
// requires the use of DW_LNS_advance_pc. Such assemblers, however,
// can use DW_LNS_fixed_advance_pc instead, sacrificing compression.
State.Row.Address += DebugLineData.getU16(OffsetPtr);
{
uint16_t PCOffset = DebugLineData.getU16(OffsetPtr);
State.Row.Address += PCOffset;
if (OS)
*OS
<< format(" (0x%16.16" PRIx64 ")", PCOffset);
}
break;
case DW_LNS_set_prologue_end:
@ -583,6 +636,8 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
// Takes a single unsigned LEB128 operand and stores it in the
// column register of the state machine.
State.Row.Isa = DebugLineData.getULEB128(OffsetPtr);
if (OS)
*OS << " (" << State.Row.Isa << ")";
break;
default:
@ -592,8 +647,12 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
{
assert(Opcode - 1U < Prologue.StandardOpcodeLengths.size());
uint8_t OpcodeLength = Prologue.StandardOpcodeLengths[Opcode - 1];
for (uint8_t I = 0; I < OpcodeLength; ++I)
DebugLineData.getULEB128(OffsetPtr);
for (uint8_t I = 0; I < OpcodeLength; ++I) {
uint64_t Value = DebugLineData.getULEB128(OffsetPtr);
if (OS)
*OS << format("Skipping ULEB128 value: 0x%16.16" PRIx64 ")\n",
Value);
}
}
break;
}
@ -638,10 +697,20 @@ bool DWARFDebugLine::LineTable::parse(const DWARFDataExtractor &DebugLineData,
Prologue.LineBase + (AdjustOpcode % Prologue.LineRange);
State.Row.Line += LineOffset;
State.Row.Address += AddrOffset;
if (OS) {
*OS << "address += " << ((uint32_t)AdjustOpcode)
<< ", line += " << LineOffset << "\n";
OS->indent(12);
State.Row.dump(*OS);
}
State.appendRowToMatrix(*OffsetPtr);
// Reset discriminator to 0.
State.Row.Discriminator = 0;
}
if(OS)
*OS << "\n";
}
if (!State.Sequence.Empty) {

View File

@ -2,7 +2,7 @@
; PR 19261
; RUN: %llc_dwarf -fast-isel=false -O0 -filetype=obj %s -o %t
; RUN: llvm-dwarfdump -v %t | FileCheck %s
; RUN: llvm-dwarfdump -a %t | FileCheck %s
; CHECK: {{0x[0-9a-f]+}} 1 0 1 0 0 is_stmt
; CHECK: {{0x[0-9a-f]+}} 2 0 1 0 0 is_stmt

View File

@ -1,10 +1,10 @@
# RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s
# RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -a - | FileCheck %s
#
# This testcase has an implicit def pseudo-iunstruction with a debug location.
#
# CHECK: .debug_info contents:
# CHECK: DW_TAG_subprogram
# CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
# CHECK: DW_AT_low_pc (0x0000000000000000)
# CHECK-NOT: DW_TAG
# CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn3Ev"
# CHECK-NOT: DW_TAG
@ -20,38 +20,38 @@
source_filename = "t.ll"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx"
%class.E = type { %class.D }
%class.D = type { %class.B }
%class.B = type { %class.A, %class.A }
%class.A = type { i8 }
%class.C = type <{ %class.E*, %class.B, [2 x i8] }>
@a = local_unnamed_addr global %class.E* null, align 4
define i32 @_ZN1C5m_fn3Ev(%class.C* nocapture) local_unnamed_addr align 2 !dbg !6 {
%2 = alloca %class.B, align 1
%3 = load %class.E*, %class.E** @a, align 4
%4 = icmp eq %class.E* %3, null
br i1 %4, label %10, label %5
; <label>:5: ; preds = %1
%6 = bitcast %class.C* %0 to %class.D**
%7 = load %class.D*, %class.D** %6, align 4
%8 = bitcast %class.D* %7 to i8*
%9 = load i8, i8* %8, align 1
br label %10
; <label>:10: ; preds = %5, %1
%11 = phi i8 [ %9, %5 ], [ undef, %1 ], !dbg !10
%12 = getelementptr inbounds %class.C, %class.C* %0, i32 0, i32 1, i32 0, i32 0
store i8 %11, i8* %12, align 1, !dbg !14
ret i32 undef
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "Apple LLVM version 8.1.0 (clang-802.0.30.3)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !2)
!1 = !DIFile(filename: "test.ii", directory: "/")
!2 = !{}
@ -77,9 +77,9 @@ legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
liveins:
liveins:
- { reg: '%rdi' }
frameInfo:
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
@ -93,27 +93,27 @@ frameInfo:
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
#stack:
#stack:
# - { id: 0, name: '<unnamed alloca>', offset: -16, size: 2, alignment: 8 }
body: |
bb.0 (%ir-block.1):
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: %rdi
CMP64mi8 %rip, 1, _, @a, _, 0, implicit-def %eflags :: (dereferenceable load 8 from @a, align 4)
JE_1 %bb.1, implicit %eflags
bb.2 (%ir-block.5):
liveins: %rdi
%rax = MOV64rm %rdi, 1, _, 0, _ :: (load 8 from %ir.6, align 4)
%al = MOV8rm killed %rax, 1, _, 0, _ :: (load 1 from %ir.8)
MOV8mr killed %rdi, 1, _, 8, _, killed %al, debug-location !14 :: (store 1 into %ir.12)
RETQ undef %eax
bb.1:
liveins: %rdi
%al = IMPLICIT_DEF debug-location !10
MOV8mr killed %rdi, 1, _, 8, _, killed %al, debug-location !14 :: (store 1 into %ir.12)
RETQ undef %eax

View File

@ -1,4 +1,4 @@
; RUN: llc -filetype=obj -O0 -relocation-model=pic < %s -mtriple mips-unknown-linux-gnu | llvm-dwarfdump -v - | FileCheck %s
; RUN: llc -filetype=obj -O0 -relocation-model=pic < %s -mtriple mips-unknown-linux-gnu | llvm-dwarfdump -a - | FileCheck %s
; PR19815
; Generated using clang -target mips-linux-gnu -g test.c -S -o - -flto|opt -sroa -S

View File

@ -1,5 +1,5 @@
// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -fdebug-compilation-dir=/tmp -dwarf-version 2 2>&1 | FileCheck -check-prefix MESSAGES %s
// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF %s
// RUN: llvm-dwarfdump -a %t | FileCheck -check-prefix DWARF %s
// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC %s
.section .text, "ax"
@ -24,13 +24,13 @@ b:
// DWARF: DW_AT_language DW_FORM_data2
// DWARF: .debug_info contents:
// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_compile_unit [1]
// DWARF: DW_TAG_compile_unit
// DWARF-NOT: DW_TAG_
// DWARF: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
// DWARF: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000004)
// DWARF: DW_AT_low_pc {{.*}}(0x0000000000000000)
// DWARF: DW_AT_high_pc {{.*}}(0x0000000000000004)
// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_label [2] *
// DWARF-NEXT: DW_AT_name [DW_FORM_string] ("a")
// DWARF: DW_TAG_label
// DWARF-NEXT: DW_AT_name {{.*}}("a")
// DWARF: .debug_aranges contents:

View File

@ -1,11 +1,14 @@
// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 5 -fdebug-compilation-dir=/tmp
// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF45 %s
// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL %s
// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC -check-prefix RELOC5 %s
// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -fdebug-compilation-dir=/tmp
// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF45 %s
// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL %s
// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC -check-prefix RELOC4 %s
// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 3 -fdebug-compilation-dir=/tmp
// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF3 %s
// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL %s
// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 2 2>&1 | FileCheck -check-prefix VERSION %s
// RUN: not llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 1 2>&1 | FileCheck -check-prefix DWARF1 %s
// RUN: not llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 6 2>&1 | FileCheck -check-prefix DWARF6 %s
@ -48,11 +51,11 @@ b:
// DWARF-NEXT: [0x00000000 - 0x00000004)
// DWARF: .debug_line contents:
// DWARF: 0x0000000000000000 14 0 1 0 0 is_stmt
// DWARF-NEXT: 0x0000000000000004 14 0 1 0 0 is_stmt end_sequence
// DWARF-NEXT: 0x0000000000000000 18 0 1 0 0 is_stmt
// DWARF-NEXT: 0x0000000000000004 18 0 1 0 0 is_stmt end_sequence
// DWARF-DL: .debug_line contents:
// DWARF-DL: 0x0000000000000000 17 0 1 0 0 is_stmt
// DWARF-DL-NEXT: 0x0000000000000004 17 0 1 0 0 is_stmt end_sequence
// DWARF-DL-NEXT: 0x0000000000000000 21 0 1 0 0 is_stmt
// DWARF-DL-NEXT: 0x0000000000000004 21 0 1 0 0 is_stmt end_sequence
// DWARF: .debug_ranges contents:

View File

@ -1,5 +1,5 @@
// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -fdebug-compilation-dir=/tmp
// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF %s
// RUN: llvm-dwarfdump -a %t | FileCheck -check-prefix DWARF %s
// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC %s
.section foo, "ax"
@ -18,13 +18,13 @@ b:
// DWARF: DW_AT_language DW_FORM_data2
// DWARF: .debug_info contents:
// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_compile_unit [1]
// DWARF: DW_TAG_compile_unit
// DWARF-NOT: DW_TAG_
// DWARF: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
// DWARF: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000004)
// DWARF: DW_AT_low_pc (0x0000000000000000)
// DWARF: DW_AT_high_pc (0x0000000000000004)
// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_label [2] *
// DWARF-NEXT: DW_AT_name [DW_FORM_string] ("b")
// DWARF: DW_TAG_label
// DWARF-NEXT: DW_AT_name ("b")
// DWARF: .debug_aranges contents:

View File

@ -1,5 +1,5 @@
// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -fdebug-compilation-dir=/tmp
// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF %s
// RUN: llvm-dwarfdump -a %t | FileCheck -check-prefix DWARF %s
// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC %s
.section .text, "ax"
@ -19,13 +19,13 @@ a:
// DWARF: DW_AT_language DW_FORM_data2
// DWARF: .debug_info contents:
// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_compile_unit [1]
// DWARF: DW_TAG_compile_unit
// DWARF-NOT: DW_TAG_
// DWARF: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
// DWARF: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000004)
// DWARF: DW_AT_low_pc (0x0000000000000000)
// DWARF: DW_AT_high_pc (0x0000000000000004)
// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_label [2] *
// DWARF-NEXT: DW_AT_name [DW_FORM_string] ("a")
// DWARF: DW_TAG_label
// DWARF-NEXT: DW_AT_name ("a")
// DWARF: .debug_aranges contents:

View File

@ -1,5 +1,5 @@
// RUN: llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t
// RUN: llvm-dwarfdump -v -all %t | FileCheck %s
// RUN: llvm-dwarfdump -all %t | FileCheck %s
.globl _bar
_bar:
@ -38,46 +38,46 @@ _x: .long 1
// CHECK: .debug_info contents:
// We don't check the leading addresses these are at.
// CHECK: DW_TAG_compile_unit [1] *
// CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
// CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
// CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000008)
// CHECK: DW_TAG_compile_unit
// CHECK: DW_AT_stmt_list (0x00000000)
// CHECK: DW_AT_low_pc (0x0000000000000000)
// CHECK: DW_AT_high_pc (0x0000000000000008)
// We don't check the file name as it is a temp directory
// CHECK: DW_AT_name [DW_FORM_string]
// CHECK: DW_AT_name
// We don't check the DW_AT_comp_dir which is the current working directory
// CHECK: DW_AT_producer [DW_FORM_string] ("llvm-mc (based on {{.*}})")
// CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_Mips_Assembler)
// CHECK: DW_AT_producer ("llvm-mc (based on {{.*}})")
// CHECK: DW_AT_language (DW_LANG_Mips_Assembler)
// CHECK: DW_TAG_label [2] *
// CHECK: DW_AT_name [DW_FORM_string] ("bar")
// CHECK: DW_AT_decl_file [DW_FORM_data4] ([[FILE:".*gen-dwarf.s"]])
// CHECK: DW_AT_decl_line [DW_FORM_data4] (5)
// CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
// CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
// CHECK: DW_TAG_label
// CHECK: DW_AT_name ("bar")
// CHECK: DW_AT_decl_file ([[FILE:".*gen-dwarf.s"]])
// CHECK: DW_AT_decl_line (5)
// CHECK: DW_AT_low_pc (0x0000000000000000)
// CHECK: DW_AT_prototyped (0x00)
// CHECK: DW_TAG_unspecified_parameters [3]
// CHECK: DW_TAG_unspecified_parameters
// CHECK: NULL
// CHECK: DW_TAG_label [2] *
// CHECK: DW_AT_name [DW_FORM_string] ("foo")
// CHECK: DW_AT_decl_file [DW_FORM_data4] ([[FILE]])
// CHECK: DW_AT_decl_line [DW_FORM_data4] (9)
// CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000007)
// CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
// CHECK: DW_TAG_label
// CHECK: DW_AT_name ("foo")
// CHECK: DW_AT_decl_file ([[FILE]])
// CHECK: DW_AT_decl_line (9)
// CHECK: DW_AT_low_pc (0x0000000000000007)
// CHECK: DW_AT_prototyped (0x00)
// CHECK: DW_TAG_unspecified_parameters [3]
// CHECK: DW_TAG_unspecified_parameters
// CHECK: NULL
// CHECK: DW_TAG_label [2] *
// CHECK: DW_AT_name [DW_FORM_string] ("baz")
// CHECK: DW_AT_decl_file [DW_FORM_data4] ([[FILE]])
// CHECK: DW_AT_decl_line [DW_FORM_data4] (10)
// CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000007)
// CHECK: DW_AT_prototyped [DW_FORM_flag] (0x00)
// CHECK: DW_TAG_label
// CHECK: DW_AT_name ("baz")
// CHECK: DW_AT_decl_file ([[FILE]])
// CHECK: DW_AT_decl_line (10)
// CHECK: DW_AT_low_pc (0x0000000000000007)
// CHECK: DW_AT_prototyped (0x00)
// CHECK: DW_TAG_unspecified_parameters [3]
// CHECK: DW_TAG_unspecified_parameters
// CHECK: NULL

View File

@ -5,15 +5,15 @@ RUN: cat %p/../Inputs/basic.macho.x86_64 > %t/basic.macho.x86_64
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64
Check that the object file in the bundle exists and is sane:
RUN: llvm-dwarfdump -v %t/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
Check that llvm-dwarfdump -v recognizes the bundle as a dSYM:
RUN: llvm-dwarfdump -v %t/basic.macho.x86_64.dSYM | FileCheck %S/basic-linking-x86.test
Check that llvm-dwarfdump -a recognizes the bundle as a dSYM:
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dSYM | FileCheck %S/basic-linking-x86.test
RUN: FileCheck %s --input-file %t/basic.macho.x86_64.dSYM/Contents/Info.plist
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 -o %t/dsymdest/basic.macho.x86_64.dSYM
RUN: llvm-dwarfdump -v %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
RUN: llvm-dwarfdump -a %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 | FileCheck %S/basic-linking-x86.test
RUN: FileCheck %s --input-file %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist
CHECK: <?xml version="1.0" encoding="UTF-8"?>

View File

@ -1,12 +1,12 @@
RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %t1
RUN: llvm-dwarfdump -v %t1.dwarf | FileCheck %s
RUN: llvm-dwarfdump -a %t1.dwarf | FileCheck %s
RUN: llvm-dsymutil -f -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
RUN: llvm-dwarfdump -v %t2 | FileCheck %s
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -v - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -v - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dsymutil -f -y -o - - | llvm-dwarfdump -v - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump -v - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
RUN: llvm-dwarfdump -a %t2 | FileCheck %s
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dsymutil -f -y -o - - | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
CHECK: file format Mach-O 64-bit x86-64
@ -14,129 +14,129 @@ CHECK: debug_info contents
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000040] = "basic1.c")
CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x00000000)
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ea0)
CHECK: DW_TAG_subprogram [2] *
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000051] = "main")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
CHECK: DW_AT_prototyped [DW_FORM_flag] (0x01)
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
CHECK: DW_AT_external [DW_FORM_flag] (0x01)
CHECK: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public)
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ea0)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000ec4)
CHECK: DW_AT_frame_base [DW_FORM_block1] (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000056] = "argc")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_fbreg -8)
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005b] = "argv")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006a => {0x0000006a})
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_fbreg -16)
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_language (DW_LANG_C99)
CHECK: DW_AT_name ("basic1.c")
CHECK: DW_AT_stmt_list (0x00000000)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000ea0)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("main")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line (23)
CHECK: DW_AT_prototyped (0x01)
CHECK: DW_AT_type (cu + 0x0063)
CHECK: DW_AT_external (0x01)
CHECK: DW_AT_accessibility (DW_ACCESS_public)
CHECK: DW_AT_low_pc (0x0000000100000ea0)
CHECK: DW_AT_high_pc (0x0000000100000ec4)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("argc")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line (23)
CHECK: DW_AT_type (cu + 0x0063)
CHECK: DW_AT_location (DW_OP_fbreg -8)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("argv")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line (23)
CHECK: DW_AT_type (cu + 0x006a)
CHECK: DW_AT_location (DW_OP_fbreg -16)
CHECK: NULL
CHECK: DW_TAG_base_type [4]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)
CHECK: DW_AT_byte_size [DW_FORM_data1] (0x04)
CHECK: DW_TAG_pointer_type [5]
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006f => {0x0000006f})
CHECK: DW_TAG_pointer_type [5]
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x00000074})
CHECK: DW_TAG_const_type [6]
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0079 => {0x00000079})
CHECK: DW_TAG_base_type [4]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000064] = "char")
CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
CHECK: DW_AT_byte_size [DW_FORM_data1] (0x01)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_AT_encoding (DW_ATE_signed)
CHECK: DW_AT_byte_size (0x04)
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x006f)
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x0074)
CHECK: DW_TAG_const_type
CHECK: DW_AT_type (cu + 0x0079)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("char")
CHECK: DW_AT_encoding (DW_ATE_signed_char)
CHECK: DW_AT_byte_size (0x01)
CHECK: NULL
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000069] = "basic2.c")
CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000003f)
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ed0)
CHECK: DW_TAG_base_type [4]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
CHECK: DW_TAG_variable [7]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000072] = "private_int")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
BASIC: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x100001008)
ARCHIVE: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x100001004)
CHECK: DW_TAG_variable [7]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000007e] = "baz")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x100001000)
CHECK: DW_TAG_subprogram [2] *
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000082] = "foo")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000ed0)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f19)
CHECK: DW_AT_frame_base [DW_FORM_block1] (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_fbreg -4)
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name ("basic2.c")
CHECK: DW_AT_stmt_list (0x0000003f)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000ed0)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("private_int")
CHECK: DW_AT_type (cu + 0x0026)
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
BASIC: DW_AT_location (DW_OP_addr 0x100001008)
ARCHIVE: DW_AT_location (DW_OP_addr 0x100001004)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("baz")
CHECK: DW_AT_type (cu + 0x0026)
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001000)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("foo")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_type (cu + 0x0026)
CHECK: DW_AT_low_pc (0x0000000100000ed0)
CHECK: DW_AT_high_pc (0x0000000100000f19)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (cu + 0x0026)
CHECK: DW_AT_location (DW_OP_fbreg -4)
CHECK: NULL
CHECK: DW_TAG_subprogram [8]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0026 => {0x000000a7})
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f20)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f37)
CHECK: DW_AT_frame_base [DW_FORM_block1] (DW_OP_reg6 RBP)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (cu + 0x0026)
CHECK: DW_AT_low_pc (0x0000000100000f20)
CHECK: DW_AT_high_pc (0x0000000100000f37)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: NULL
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008e] = "basic3.c")
CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x00000093)
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
CHECK: DW_TAG_variable [9]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000097] = "val")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x003c => {0x00000162})
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
BASIC: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x100001004)
ARCHIVE: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x100001008)
CHECK: DW_TAG_volatile_type [10]
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
CHECK: DW_TAG_base_type [4]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
CHECK: DW_TAG_subprogram [2] *
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000009b] = "bar")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f84)
CHECK: DW_AT_frame_base [DW_FORM_block1] (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_fbreg -8)
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name ("basic3.c")
CHECK: DW_AT_stmt_list (0x00000093)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("val")
CHECK: DW_AT_type (cu + 0x003c)
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
BASIC: DW_AT_location (DW_OP_addr 0x100001004)
ARCHIVE: DW_AT_location (DW_OP_addr 0x100001008)
CHECK: DW_TAG_volatile_type
CHECK: DW_AT_type (cu + 0x0041)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("bar")
CHECK: DW_AT_type (cu + 0x0041)
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_AT_high_pc (0x0000000100000f84)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (cu + 0x0041)
CHECK: DW_AT_location (DW_OP_fbreg -8)
CHECK: NULL
CHECK: DW_TAG_subprogram [8]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0041 => {0x00000167})
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000fa9)
CHECK: DW_AT_frame_base [DW_FORM_block1] (DW_OP_reg6 RBP)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (cu + 0x0041)
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_AT_high_pc (0x0000000100000fa9)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: NULL

View File

@ -1,118 +1,118 @@
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump -v - | FileCheck %s
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s
CHECK: file format Mach-O 64-bit x86-64
CHECK: debug_info contents
CHECK: Compile Unit: {{.*}} version = 0x0004
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ")
CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000016] = "basic1.c")
CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000001f] = "/Inputs")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000b)
CHECK: DW_TAG_subprogram [2] *
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000b)
CHECK: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6 RBP)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000027] = "main")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_prototyped [DW_FORM_flag_present] (true)
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000000000a1)
CHECK: DW_AT_external [DW_FORM_flag_present] (true)
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000002c] = "argc")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000000000a1)
CHECK: DW_TAG_formal_parameter [4]
CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_reg4 RSI)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000031] = "argv")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0060 => {0x00000060})
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("clang version 3.7.0 ")
CHECK: DW_AT_language (DW_LANG_C99)
CHECK: DW_AT_name ("basic1.c")
CHECK: DW_AT_stmt_list (0x00000000)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_AT_high_pc (0x0000000b)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_AT_high_pc (0x0000000b)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_AT_name ("main")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_prototyped (true)
CHECK: DW_AT_type (0x00000000000000a1)
CHECK: DW_AT_external (true)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_location (DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_AT_name ("argc")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_type (0x00000000000000a1)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_location (DW_OP_reg4 RSI)
CHECK: DW_AT_name ("argv")
CHECK: DW_AT_type (cu + 0x0060)
CHECK: NULL
CHECK: DW_TAG_pointer_type [5]
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0065 => {0x00000065})
CHECK: DW_TAG_pointer_type [5]
CHECK: DW_TAG_const_type [6]
CHECK: DW_TAG_base_type [7]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000036] = "char")
CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
CHECK: DW_AT_byte_size [DW_FORM_data1] (0x01)
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x0065)
CHECK: DW_TAG_pointer_type
CHECK: DW_TAG_const_type
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("char")
CHECK: DW_AT_encoding (DW_ATE_signed_char)
CHECK: DW_AT_byte_size (0x01)
CHECK: NULL
CHECK: Compile Unit:{{.*}} version = 0x0004
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ")
CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000003b] = "basic2.c")
CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000044)
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50)
CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000037)
CHECK: DW_TAG_base_type [7]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000044] = "int")
CHECK: DW_TAG_variable [8]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000048] = "baz")
CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addr 0x100001000)
CHECK: DW_TAG_variable [8]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000004c] = "private_int")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addr 0x100001008)
CHECK: DW_TAG_subprogram [9]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000058] = "inc")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1})
CHECK: DW_AT_inline [DW_FORM_data1] (DW_INL_inlined)
CHECK: DW_TAG_subprogram [10] *
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50)
CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000037)
CHECK: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6 RBP)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005c] = "foo")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_prototyped [DW_FORM_flag_present] (true)
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1})
CHECK: DW_TAG_formal_parameter [11]
CHECK: DW_AT_location [DW_FORM_sec_offset] (0x00000000
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("clang version 3.7.0 ")
CHECK: DW_AT_language (DW_LANG_C99)
CHECK: DW_AT_name ("basic2.c")
CHECK: DW_AT_stmt_list (0x00000044)
CHECK: DW_AT_low_pc (0x0000000100000f50)
CHECK: DW_AT_high_pc (0x00000037)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("baz")
CHECK: DW_AT_location (DW_OP_addr 0x100001000)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("private_int")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001008)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (cu + 0x002a)
CHECK: DW_AT_inline (DW_INL_inlined)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_low_pc (0x0000000100000f50)
CHECK: DW_AT_high_pc (0x00000037)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_AT_name ("foo")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_prototyped (true)
CHECK: DW_AT_type (cu + 0x002a)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_location (0x00000000
CHECK: 0x0000000000000000 - 0x000000000000000c: DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "arg")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1})
CHECK: DW_TAG_inlined_subroutine [12]
CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x005b => {0x000000d2} "inc")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f61)
CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000f)
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (cu + 0x002a)
CHECK: DW_TAG_inlined_subroutine
CHECK: DW_AT_abstract_origin (cu + 0x005b "inc")
CHECK: DW_AT_low_pc (0x0000000100000f61)
CHECK: DW_AT_high_pc (0x0000000f)
CHECK: NULL
CHECK: NULL
CHECK: Compile Unit: {{.*}} version = 0x0004
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ")
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000064] = "basic3.c")
CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000009a)
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000024)
CHECK: DW_TAG_variable [13]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006d] = "val")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addr 0x100001004)
CHECK: DW_TAG_volatile_type [14]
CHECK: DW_TAG_subprogram [15]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000058] = "inc")
CHECK: DW_AT_inline [DW_FORM_data1] (DW_INL_inlined)
CHECK: DW_TAG_subprogram [2] *
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000024)
CHECK: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6 RBP)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000071] = "bar")
CHECK: DW_TAG_formal_parameter [16]
CHECK: DW_AT_location [DW_FORM_sec_offset] (0x00000025
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("clang version 3.7.0 ")
CHECK: DW_AT_name ("basic3.c")
CHECK: DW_AT_stmt_list (0x0000009a)
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_AT_high_pc (0x00000024)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("val")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001004)
CHECK: DW_TAG_volatile_type
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_inline (DW_INL_inlined)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_AT_high_pc (0x00000024)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_AT_name ("bar")
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_location (0x00000025
CHECK: 0x0000000000000000 - 0x000000000000000f: DW_OP_reg5 RDI, DW_OP_piece 0x4
CHECK: 0x0000000000000019 - 0x000000000000001d: DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "arg")
CHECK: DW_TAG_inlined_subroutine [17]
CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0044 => {0x0000015f} "inc")
CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
CHECK: DW_AT_name ("arg")
CHECK: DW_TAG_inlined_subroutine
CHECK: DW_AT_abstract_origin (cu + 0x0044 "inc")
CHECK: DW_AT_ranges (0x00000000
CHECK: [0x0000000100000f94 - 0x0000000100000f9a)
CHECK: [0x0000000100000f9f - 0x0000000100000fa7))
@ -145,7 +145,7 @@ CHECK: Address Line Column File ISA Discriminator Flags
CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
CHECK-NEXT: 0x0000000100000f40 26 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f44 27 10 1 0 0 is_stmt prologue_end
CHECK-NEXT: 0x0000000100000f49 27 3 1 0 0
CHECK-NEXT: 0x0000000100000f49 27 3 1 0 0
CHECK-NEXT: 0x0000000100000f4b 27 3 1 0 0 end_sequence
CHECK: Dir Mod Time File Len File Name
@ -155,13 +155,13 @@ CHECK: Address Line Column File ISA Discriminator Flags
CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
CHECK-NEXT: 0x0000000100000f50 19 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f54 20 18 1 0 0 is_stmt prologue_end
CHECK-NEXT: 0x0000000100000f5a 20 17 1 0 0
CHECK-NEXT: 0x0000000100000f5c 20 10 1 0 0
CHECK-NEXT: 0x0000000100000f5a 20 17 1 0 0
CHECK-NEXT: 0x0000000100000f5c 20 10 1 0 0
CHECK-NEXT: 0x0000000100000f61 15 10 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f70 20 23 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f74 20 36 1 0 0
CHECK-NEXT: 0x0000000100000f83 20 31 1 0 0
CHECK-NEXT: 0x0000000100000f85 20 3 1 0 0
CHECK-NEXT: 0x0000000100000f74 20 36 1 0 0
CHECK-NEXT: 0x0000000100000f83 20 31 1 0 0
CHECK-NEXT: 0x0000000100000f85 20 3 1 0 0
CHECK-NEXT: 0x0000000100000f87 20 3 1 0 0 end_sequence
CHECK: Dir Mod Time File Len File Name
@ -175,7 +175,7 @@ CHECK-NEXT: 0x0000000100000f9a 17 7 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f9f 12 10 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000fa7 20 1 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000fa9 19 18 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000fab 19 10 1 0 0
CHECK-NEXT: 0x0000000100000fab 19 10 1 0 0
CHECK-NEXT: 0x0000000100000fb2 20 1 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000fb4 20 1 1 0 0 is_stmt end_sequence

View File

@ -1,5 +1,5 @@
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump -v - | FileCheck %s
RUN: llvm-dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump -v - | FileCheck %s
RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s
RUN: llvm-dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s
CHECK: file format Mach-O 64-bit x86-64
@ -7,129 +7,129 @@ CHECK: debug_info contents
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000040] = "basic1.c")
CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x00000000)
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
CHECK: DW_TAG_subprogram [2] *
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000051] = "main")
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line [DW_FORM_data1] (23)
CHECK: DW_AT_prototyped [DW_FORM_flag] (0x01)
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
CHECK: DW_AT_external [DW_FORM_flag] (0x01)
CHECK: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public)
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f4b)
CHECK: DW_AT_frame_base [DW_FORM_block1] (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000056] = "argc")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0063 => {0x00000063})
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_TAG_formal_parameter [3]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005b] = "argv")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006a => {0x0000006a})
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI)
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_language (DW_LANG_C99)
CHECK: DW_AT_name ("basic1.c")
CHECK: DW_AT_stmt_list (0x00000000)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("main")
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
CHECK: DW_AT_decl_line (23)
CHECK: DW_AT_prototyped (0x01)
CHECK: DW_AT_type (cu + 0x0063)
CHECK: DW_AT_external (0x01)
CHECK: DW_AT_accessibility (DW_ACCESS_public)
CHECK: DW_AT_low_pc (0x0000000100000f40)
CHECK: DW_AT_high_pc (0x0000000100000f4b)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("argc")
CHECK: DW_AT_type (cu + 0x0063)
CHECK: DW_AT_location (DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("argv")
CHECK: DW_AT_type (cu + 0x006a)
CHECK: DW_AT_location (DW_OP_reg4 RSI)
CHECK: NULL
CHECK: DW_TAG_base_type [4]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "int")
CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed)
CHECK: DW_AT_byte_size [DW_FORM_data1] (0x04)
CHECK: DW_TAG_pointer_type [5]
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006f => {0x0000006f})
CHECK: DW_TAG_pointer_type [5]
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x00000074})
CHECK: DW_TAG_const_type [6]
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0079 => {0x00000079})
CHECK: DW_TAG_base_type [4]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000064] = "char")
CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char)
CHECK: DW_AT_byte_size [DW_FORM_data1] (0x01)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("int")
CHECK: DW_AT_encoding (DW_ATE_signed)
CHECK: DW_AT_byte_size (0x04)
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x006f)
CHECK: DW_TAG_pointer_type
CHECK: DW_AT_type (cu + 0x0074)
CHECK: DW_TAG_const_type
CHECK: DW_AT_type (cu + 0x0079)
CHECK: DW_TAG_base_type
CHECK: DW_AT_name ("char")
CHECK: DW_AT_encoding (DW_ATE_signed_char)
CHECK: DW_AT_byte_size (0x01)
CHECK: NULL
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000069] = "basic2.c")
CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000003e)
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50)
CHECK: DW_TAG_variable [7]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000072] = "private_int")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x100001008)
CHECK: DW_TAG_variable [7]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000007e] = "baz")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x100001000)
CHECK: DW_TAG_subprogram [8] *
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000082] = "foo")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f89)
CHECK: DW_AT_frame_base [DW_FORM_block1] (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter [9]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_AT_location [DW_FORM_data4] (0x00000000
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name ("basic2.c")
CHECK: DW_AT_stmt_list (0x0000003e)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f50)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("private_int")
CHECK: DW_AT_type (0x0000000000000063)
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001008)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("baz")
CHECK: DW_AT_type (0x0000000000000063)
CHECK: DW_AT_location (DW_OP_addr 0x100001000)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("foo")
CHECK: DW_AT_type (0x0000000000000063)
CHECK: DW_AT_low_pc (0x0000000100000f50)
CHECK: DW_AT_high_pc (0x0000000100000f89)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (0x0000000000000063)
CHECK: DW_AT_location (0x00000000
CHECK: 0x0000000000000000 - 0x000000000000000e: DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_TAG_inlined_subroutine [10]
CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x00a7 => {0x00000128} "inc")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f63)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000f72)
CHECK: DW_AT_call_line [DW_FORM_data1] (20)
CHECK: DW_TAG_inlined_subroutine
CHECK: DW_AT_abstract_origin (cu + 0x00a7 "inc")
CHECK: DW_AT_low_pc (0x0000000100000f63)
CHECK: DW_AT_high_pc (0x0000000100000f72)
CHECK: DW_AT_call_line (20)
CHECK: NULL
CHECK: DW_TAG_subprogram [11]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_AT_inline [DW_FORM_data1] (DW_INL_inlined)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (0x0000000000000063)
CHECK: DW_AT_inline (DW_INL_inlined)
CHECK: NULL
CHECK: Compile Unit:
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008e] = "basic3.c")
CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000007e)
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000049] = "/Inputs")
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
CHECK: DW_TAG_variable [12]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000097] = "val")
CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x003c => {0x00000176})
CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_addr 0x100001004)
CHECK: DW_TAG_volatile_type [13]
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_TAG_subprogram [8] *
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000009b] = "bar")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000fb4)
CHECK: DW_AT_frame_base [DW_FORM_block1] (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter [9]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000086] = "arg")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_AT_location [DW_FORM_data4] (0x00000025
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK: DW_AT_name ("basic3.c")
CHECK: DW_AT_stmt_list (0x0000007e)
CHECK: DW_AT_comp_dir ("/Inputs")
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_TAG_variable
CHECK: DW_AT_name ("val")
CHECK: DW_AT_type (cu + 0x003c)
CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
CHECK: DW_AT_location (DW_OP_addr 0x100001004)
CHECK: DW_TAG_volatile_type
CHECK: DW_AT_type (0x0000000000000063)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("bar")
CHECK: DW_AT_type (0x0000000000000063)
CHECK: DW_AT_low_pc (0x0000000100000f90)
CHECK: DW_AT_high_pc (0x0000000100000fb4)
CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
CHECK: DW_TAG_formal_parameter
CHECK: DW_AT_name ("arg")
CHECK: DW_AT_type (0x0000000000000063)
CHECK: DW_AT_location (0x00000025
CHECK: 0x0000000000000000 - 0x000000000000000f: DW_OP_reg5 RDI, DW_OP_piece 0x4
CHECK: 0x0000000000000019 - 0x000000000000001d: DW_OP_reg5 RDI, DW_OP_piece 0x4)
CHECK: DW_TAG_lexical_block [14] *
CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f94)
CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000100000fa7)
CHECK: DW_TAG_inlined_subroutine [15]
CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x009a => {0x000001d4} "inc")
CHECK: DW_AT_ranges [DW_FORM_data4] (0x00000000
CHECK: DW_TAG_lexical_block
CHECK: DW_AT_low_pc (0x0000000100000f94)
CHECK: DW_AT_high_pc (0x0000000100000fa7)
CHECK: DW_TAG_inlined_subroutine
CHECK: DW_AT_abstract_origin (cu + 0x009a "inc")
CHECK: DW_AT_ranges (0x00000000
CHECK: [0x0000000100000f94 - 0x0000000100000f9a)
CHECK: [0x0000000100000f9f - 0x0000000100000fa7))
CHECK: NULL
CHECK: NULL
CHECK: DW_TAG_subprogram [11]
CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008a] = "inc")
CHECK: DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name ("inc")
CHECK: DW_AT_type (0x0000000000000063)
CHECK: NULL
CHECK: .debug_loc contents:
@ -153,36 +153,30 @@ CHECK: .debug_line contents
CHECK: Dir Mod Time File Len File Name
CHECK-NEXT: ---- ---------- ---------- ---------------------------
CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic1.c
CHECK: Address Line Column File ISA Discriminator Flags
CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
CHECK-NEXT: 0x0000000100000f40 23 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f44 24 0 1 0 0 is_stmt prologue_end
CHECK-NEXT: 0x0000000100000f4b 24 0 1 0 0 is_stmt end_sequence
CHECK: 0x0000000100000f40 23 0 1 0 0 is_stmt
CHECK: 0x0000000100000f44 24 0 1 0 0 is_stmt prologue_end
CHECK: 0x0000000100000f4b 24 0 1 0 0 is_stmt end_sequence
CHECK: Dir Mod Time File Len File Name
CHECK-NEXT: ---- ---------- ---------- ---------------------------
CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic2.c
CHECK: Address Line Column File ISA Discriminator Flags
CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
CHECK-NEXT: 0x0000000100000f50 19 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f54 20 0 1 0 0 is_stmt prologue_end
CHECK-NEXT: 0x0000000100000f63 15 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f72 20 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f89 20 0 1 0 0 is_stmt end_sequence
CHECK: 0x0000000100000f50 19 0 1 0 0 is_stmt
CHECK: 0x0000000100000f54 20 0 1 0 0 is_stmt prologue_end
CHECK: 0x0000000100000f63 15 0 1 0 0 is_stmt
CHECK: 0x0000000100000f72 20 0 1 0 0 is_stmt
CHECK: 0x0000000100000f89 20 0 1 0 0 is_stmt end_sequence
CHECK: Dir Mod Time File Len File Name
CHECK-NEXT: ---- ---------- ---------- ---------------------------
CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic3.c
CHECK: Address Line Column File ISA Discriminator Flags
CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
CHECK-NEXT: 0x0000000100000f90 16 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f94 12 0 1 0 0 is_stmt prologue_end
CHECK-NEXT: 0x0000000100000f9a 17 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000f9f 12 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000fa7 20 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000fa9 19 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000fb2 20 0 1 0 0 is_stmt
CHECK-NEXT: 0x0000000100000fb4 20 0 1 0 0 is_stmt end_sequence
CHECK: 0x0000000100000f90 16 0 1 0 0 is_stmt
CHECK: 0x0000000100000f94 12 0 1 0 0 is_stmt prologue_end
CHECK: 0x0000000100000f9a 17 0 1 0 0 is_stmt
CHECK: 0x0000000100000f9f 12 0 1 0 0 is_stmt
CHECK: 0x0000000100000fa7 20 0 1 0 0 is_stmt
CHECK: 0x0000000100000fa9 19 0 1 0 0 is_stmt
CHECK: 0x0000000100000fb2 20 0 1 0 0 is_stmt
CHECK: 0x0000000100000fb4 20 0 1 0 0 is_stmt end_sequence
CHECK: .debug_pubnames contents:
CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081

View File

@ -8,21 +8,21 @@ RUN: cat %p/../Inputs/basic-lto-dw4.macho.x86_64 > %t/basic-lto-dw4.macho.x86_64
# Multiple inputs in flat mode
RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64
RUN: llvm-dwarfdump -v %t/basic.macho.x86_64.dwarf \
RUN: llvm-dwarfdump -a %t/basic.macho.x86_64.dwarf \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dwarfdump -v %t/basic-archive.macho.x86_64.dwarf \
RUN: llvm-dwarfdump -a %t/basic-archive.macho.x86_64.dwarf \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=ARCHIVE
RUN: llvm-dwarfdump -v %t/basic-lto.macho.x86_64.dwarf | FileCheck %S/basic-lto-linking-x86.test
RUN: llvm-dwarfdump -v %t/basic-lto-dw4.macho.x86_64.dwarf | FileCheck %S/basic-lto-dw4-linking-x86.test
RUN: llvm-dwarfdump -a %t/basic-lto.macho.x86_64.dwarf | FileCheck %S/basic-lto-linking-x86.test
RUN: llvm-dwarfdump -a %t/basic-lto-dw4.macho.x86_64.dwarf | FileCheck %S/basic-lto-dw4-linking-x86.test
# Multiple inputs that end up in the same named bundle
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM
RUN: llvm-dwarfdump -v %t.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 \
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic.macho.x86_64 \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dwarfdump -v %t.dSYM/Contents/Resources/DWARF/basic-archive.macho.x86_64 \
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-archive.macho.x86_64 \
RUN: | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=ARCHIVE
RUN: llvm-dwarfdump -v %t.dSYM/Contents/Resources/DWARF/basic-lto.macho.x86_64 | FileCheck %S/basic-lto-linking-x86.test
RUN: llvm-dwarfdump -v %t.dSYM/Contents/Resources/DWARF/basic-lto-dw4.macho.x86_64 | FileCheck %S/basic-lto-dw4-linking-x86.test
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-lto.macho.x86_64 | FileCheck %S/basic-lto-linking-x86.test
RUN: llvm-dwarfdump -a %t.dSYM/Contents/Resources/DWARF/basic-lto-dw4.macho.x86_64 | FileCheck %S/basic-lto-dw4-linking-x86.test
# Multiple inputs in a named bundle in flat mode... impossible.
RUN: not llvm-dsymutil -f -oso-prepend-path=%p/.. %t/basic.macho.x86_64 %t/basic-archive.macho.x86_64 %t/basic-lto.macho.x86_64 %t/basic-lto-dw4.macho.x86_64 -o %t.dSYM 2>&1 | FileCheck %s

View File

@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
# RUN: | llvm-dwarfdump -debug-info - \
# RUN: | llvm-dwarfdump --debug-info --debug-line - \
# RUN: | FileCheck %s
# CHECK-NOT: .debug_abbrev contents:
@ -12,12 +12,19 @@
# CHECK: DW_AT_name ("int")
# CHECK-NOT: debug_str
# CHECK-NOT: DW_AT_type {{.*}} =>
#
# CHECK: Address Line Column File ISA Discriminator Flags
# CHECK-NEXT:------------------ ------ ------ ------ --- ------------- -------------
# CHECK-NEXT:0x0000000000000000 1 0 1 0 0 is_stmt
# CHECK-NEXT:0x0000000000000006 1 12 1 0 0 is_stmt prologue_end
# CHECK-NEXT:0x0000000000000008 1 12 1 0 0 is_stmt end_sequence
# CHECK-NOT: {{.*}} contents:
#
# This test is meant to verify that without specifying -verbose DW_FORMs and
# abbreviation codes are hidden from .debug_info section. Furthermore it
# verifies that it also hides .debug_str and die reference offsets into the CU.
# verifies that it also hides .debug_str and die reference offsets into the CU
# and that the .debug_line table is printed rather than the opcodes.
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 12

View File

@ -0,0 +1,25 @@
# RUN: llvm-mc %S/brief.s -filetype obj -triple x86_64-apple-darwin -o - \
# RUN: | llvm-dwarfdump -v --debug-info --debug-line - \
# RUN: | FileCheck %s
# CHECK-NOT: .debug_abbrev contents:
# CHECK: .debug_info contents:
# CHECK: DW_TAG_compile_unit [1]
# CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{.*}}] = "brief.c")
# CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{.*}}] = "main")
# CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{.*}}] = "int")
# CHECK: .debug_line contents:
# CHECK: 00 DW_LNE_set_address (0x0000000000000000)
# CHECK: 01 DW_LNS_copy
# CHECK: 0x0000000000000000 1 0 1 0 0 is_stmt
# CHECK: 05 DW_LNS_set_column (12)
# CHECK: 0a DW_LNS_set_prologue_end
# CHECK: 66 address += 89, line += 0
# CHECK: 0x0000000000000006 1 12 1 0 0 is_stmt prologue_end
# CHECK: 02 DW_LNS_advance_pc (2)
# CHECK: 00 DW_LNE_end_sequence
# CHECK: 0x0000000000000008 1 12 1 0 0 is_stmt end_sequence
#
# CHECK-NOT: {{.*}} contents: