llvm.org GIT mirror llvm / d76926a
[MC/Dwarf] Unclamp DWARF linetables format on Darwin. In r319995, we fixed the line table format to version 2 on Darwin because dsymutil didn't yet understand the new format which caused test failures for the LLDB bots. This has been resolved in the meantime so there's no reason to keep this limitation. rdar://problem/35968332 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342136 91177308-0d34-0410-b5e6-96231b3b80d8 Jonas Devlieghere 2 years ago
8 changed file(s) with 16 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
461461 emitAbsValue(*MCOS,
462462 MakeStartMinusEndExpr(*MCOS, *LineStartSym, *LineEndSym, 4), 4);
463463
464 // Next 2 bytes is the Version.
464465 unsigned LineTableVersion = context.getDwarfVersion();
465
466 // On Darwin we default to v2 for anything before DWARF v5.
467 if (context.getObjectFileInfo()->getTargetTriple().isOSDarwin() &&
468 LineTableVersion < 5)
469 LineTableVersion = 2;
470
471 // Next 2 bytes is the Version.
472466 MCOS->EmitIntValue(LineTableVersion, 2);
473467
474468 // Keep track of the bytes between the very start and where the header length
0 ; MD5 checksums provided by IR should be passed through to asm.
11 ; They'll be emitted to an object file only for DWARF 5 or later.
2 ;
3 ; Note that on Darwin for DWARF 4 or earlier, the line table version is clamped
4 ; to version 2. However that doesn't affect the output checked in this test.
52
63 ; REQUIRES: object-emission
74 ; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4
0 ; Source text provided by IR should be passed through to asm.
11 ; It is emitted to an object file only for DWARF 5 or later.
2 ;
3 ; Note that on Darwin for DWARF 4 or earlier, the line table version is clamped
4 ; to version 2. However that doesn't affect the output checked in this test.
52
63 ; REQUIRES: object-emission
74 ; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4
2323 ; Expect no line table entry since there are no functions and file references in this compile unit
2424 ; CHECK: .debug_line contents:
2525 ; CHECK: Line table prologue:
26 ; CHECK: total_length: 0x00000019
26 ; CHECK: total_length: 0x0000001a
2727 ; CHECK-NOT: file_names[
2828
2929 @i = external global i32
1414 ; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000010)
1515
1616 ; CHECK: DW_TAG_compile_unit
17 ; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000003c)
17 ; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000003d)
1818 ; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000010)
1919 ; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000009)
2020 ; CHECK: DW_TAG_subprogram
2525 ; CHECK: .debug_line contents:
2626 ; CHECK-NEXT: debug_line[{{.*}}]
2727 ; CHECK-NEXT: Line table prologue:
28 ; CHECK-NEXT: total_length: 0x00000038
28 ; CHECK-NEXT: total_length: 0x00000039
2929 ; CHECK: file_names[ 1]:
3030 ; CHECK-NEXT: name: "simple.c"
3131 ; CHECK-NEXT: dir_index: 0
3232 ; CHECK: debug_line[{{.*}}]
3333 ; CHECK-NEXT: Line table prologue:
34 ; CHECK-NEXT: total_length: 0x00000039
34 ; CHECK-NEXT: total_length: 0x0000003a
3535 ; CHECK: file_names[ 1]:
3636 ; CHECK-NEXT: name: "simple2.c"
3737 ; CHECK-NEXT: dir_index: 0
77 // CHECK-NEXT: Name: __debug_line
88 // CHECK-NEXT: Segment: __DWARF
99 // CHECK-NEXT: Address: 0x1
10 // CHECK-NEXT: Size: 0x28
10 // CHECK-NEXT: Size: 0x29
1111 // CHECK-NEXT: Offset: 237
1212 // CHECK-NEXT: Alignment: 0
1313 // CHECK-NEXT: RelocationOffset: 0x0
1919 // CHECK-NEXT: Reserved1: 0x0
2020 // CHECK-NEXT: Reserved2: 0x0
2121 // CHECK-NEXT: SectionData (
22 // CHECK-NEXT: 0000: 24000000 02001E00 00000101 FB0E0D00 |$...............|
23 // CHECK-NEXT: 0010: 01010101 00000001 00000164 69720000 |...........dir..|
24 // CHECK-NEXT: 0020: 666F6F00 01000000 |foo.....|
22 // CHECK-NEXT: 000: 25000000 04001F00 00000101 01FB0E0D |%...............|
23 // CHECK-NEXT: 010: 00010101 01000000 01000001 64697200 |............dir.|
24 // CHECK-NEXT: 020: 00666F6F 00010000 00 |.foo.....|
2525 // CHECK-NEXT: )
2626 // CHECK-NEXT: }
8888 // CHECK: .debug_line contents:
8989 // CHECK: Line table prologue:
9090 // We don't check the total_length as it includes lengths of temp paths
91 // CHECK: version: 2
91 // CHECK: version: 4
9292 // We don't check the prologue_length as it too includes lengths of temp paths
9393 // CHECK: min_inst_length: 1
9494 // CHECK: default_is_stmt: 1
88 // CHECK: Name: __debug_line (5F 5F 64 65 62 75 67 5F 6C 69 6E 65 00 00 00 00)
99 // CHECK: Segment: __DWARF (5F 5F 44 57 41 52 46 00 00 00 00 00 00 00 00 00)
1010 // CHECK: Address: 0x1
11 // CHECK: Size: 0x3C
11 // CHECK: Size: 0x3D
1212 // CHECK: Offset: 237
1313 // CHECK: Alignment: 0
1414 // CHECK: RelocationOffset: 0x12C
2020 // CHECK: Reserved1: 0x0
2121 // CHECK: Reserved2: 0x0
2222 // CHECK: SectionData (
23 // CHECK: 0000: 38000000 02002100 00000101 FB0E0D00 |8.....!.........|
24 // CHECK: 0010: 01010101 00000001 00000100 62617200 |............bar.|
25 // CHECK: 0020: 00000066 6F6F0000 00000004 02000502 |...foo..........|
26 // CHECK: 0030: 00000000 033F0102 01000101 |.....?......|
23 // CHECK: 000: 39000000 04002200 00000101 01FB0E0D |9.....".........|
24 // CHECK: 010: 00010101 01000000 01000001 00626172 |.............bar|
25 // CHECK: 020: 00000000 666F6F00 00000000 04020005 |....foo.........|
26 // CHECK: 030: 02000000 00033F01 02010001 01 |......?......|
2727 // CHECK: )
2828 // CHECK: }
2929 // CHECK: ]
3030 // CHECK: Relocations [
3131 // CHECK: Section __debug_line {
32 // CHECK: 0x30 0 2 0 GENERIC_RELOC_VANILLA 0 __text
32 // CHECK: 0x31 0 2 0 GENERIC_RELOC_VANILLA 0 __text
3333 // CHECK: }
3434 // CHECK: ]