diff options
| author | Scott Linder <scott@scottlinder.com> | 2018-02-23 23:01:06 +0000 |
|---|---|---|
| committer | Scott Linder <scott@scottlinder.com> | 2018-02-23 23:01:06 +0000 |
| commit | 16c7bdaf3245d23b9b441144f5efb610e2044927 (patch) | |
| tree | 870f3b5c5c606b19951cb4433f3887825bc61e56 /llvm/test/MC | |
| parent | 5e2f6ba51e89c9b9625902f0c36493ad46e46a3b (diff) | |
| download | bcm5719-llvm-16c7bdaf3245d23b9b441144f5efb610e2044927.tar.gz bcm5719-llvm-16c7bdaf3245d23b9b441144f5efb610e2044927.zip | |
[DebugInfo] Support DWARF v5 source code embedding extension
In DWARF v5 the Line Number Program Header is extensible, allowing values with
new content types. In this extension a content type is added,
DW_LNCT_LLVM_source, which contains the embedded source code of the file.
Add new optional attribute for !DIFile IR metadata called source which contains
source text. Use this to output the source to the DWARF line table of code
objects. Analogously extend METADATA_FILE in Bitcode and .file directive in ASM
to support optional source.
Teach llvm-dwarfdump and llvm-objdump about the new values. Update the output
format of llvm-dwarfdump to make room for the new attribute on file_names
entries, and support embedded sources for the -source option in llvm-objdump.
Differential Revision: https://reviews.llvm.org/D42765
llvm-svn: 325970
Diffstat (limited to 'llvm/test/MC')
| -rw-r--r-- | llvm/test/MC/ARM/dwarf-asm-multiple-sections.s | 3 | ||||
| -rw-r--r-- | llvm/test/MC/ELF/debug-md5.s | 11 | ||||
| -rw-r--r-- | llvm/test/MC/MachO/gen-dwarf-cpp.s | 14 | ||||
| -rw-r--r-- | llvm/test/MC/MachO/gen-dwarf-macro-cpp.s | 10 | ||||
| -rw-r--r-- | llvm/test/MC/MachO/gen-dwarf.s | 6 |
5 files changed, 28 insertions, 16 deletions
diff --git a/llvm/test/MC/ARM/dwarf-asm-multiple-sections.s b/llvm/test/MC/ARM/dwarf-asm-multiple-sections.s index 4d8c7d25db3..4c099acccd5 100644 --- a/llvm/test/MC/ARM/dwarf-asm-multiple-sections.s +++ b/llvm/test/MC/ARM/dwarf-asm-multiple-sections.s @@ -55,7 +55,8 @@ b: // DWARF-DL: version: [[DWVER]] // DWARF-DL-5: address_size: 4 // DWARF-DL-5: include_directories[ 0] = "" -// DWARF-DL: file_names[ [[DWFILE]]] {{.*}} "<stdin>" +// DWARF-DL: file_names[ [[DWFILE]]]: +// DWARF-DL: name: "<stdin>" // 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 diff --git a/llvm/test/MC/ELF/debug-md5.s b/llvm/test/MC/ELF/debug-md5.s index 1a228ea671e..f8f3bc1a362 100644 --- a/llvm/test/MC/ELF/debug-md5.s +++ b/llvm/test/MC/ELF/debug-md5.s @@ -13,9 +13,14 @@ # CHECK: include_directories[ 1] = .debug_line_str[0x[[DIR1:[0-9a-f]+]]] = "dir1" # CHECK: include_directories[ 2] = .debug_line_str[0x[[DIR2:[0-9a-f]+]]] = "dir2" # CHECK-NOT: include_directories -# CHECK: Dir MD5 Checksum File Name -# CHECK: file_names[ 0] 1 00112233445566778899aabbccddeeff .debug_line_str[0x[[FILE1:[0-9a-f]+]]] = "foo" -# CHECK: file_names[ 1] 2 ffeeddccbbaa99887766554433221100 .debug_line_str[0x[[FILE2:[0-9a-f]+]]] = "bar" +# CHECK: file_names[ 0]: +# CHECK-NEXT: name: .debug_line_str[0x[[FILE1:[0-9a-f]+]]] = "foo" +# CHECK-NEXT: dir_index: 1 +# CHECK-NEXT: md5_checksum: 00112233445566778899aabbccddeeff +# CHECK: file_names[ 1]: +# CHECK-NEXT: name: .debug_line_str[0x[[FILE2:[0-9a-f]+]]] = "bar" +# CHECK-NEXT: dir_index: 2 +# CHECK-NEXT: md5_checksum: ffeeddccbbaa99887766554433221100 # CHECK: .debug_line_str contents: # CHECK-NEXT: 0x[[DIR0]]: "" diff --git a/llvm/test/MC/MachO/gen-dwarf-cpp.s b/llvm/test/MC/MachO/gen-dwarf-cpp.s index ad07bf6096a..3cb26ce6081 100644 --- a/llvm/test/MC/MachO/gen-dwarf-cpp.s +++ b/llvm/test/MC/MachO/gen-dwarf-cpp.s @@ -16,11 +16,15 @@ L1: leave // We check that the source name "t.s" is picked up // CHECK: include_directories[ 1] = "{{.*(/|\\\\)}}test{{(/|\\\\)}}MC{{(/|\\\\)}}MachO" // CHECK: include_directories[ 2] = "inc" -// CHECK: Dir Mod Time File Len File Name -// CHECK: ---- ---------- ---------- --------------------------- -// CHECK: file_names[ 1] 1 0x00000000 0x00000000 "gen-dwarf-cpp.s" -// CHECK: file_names[ 2] 0 0x00000000 0x00000000 "t.s" -// CHECK: file_names[ 3] 2 0x00000000 0x00000000 "g.s" +// CHECK: file_names[ 1]: +// CHECK-NEXT: name: "gen-dwarf-cpp.s" +// CHECK-NEXT: dir_index: 1 +// CHECK: file_names[ 2]: +// CHECK-NEXT: name: "t.s" +// CHECK-NEXT: dir_index: 0 +// CHECK: file_names[ 3]: +// CHECK-NEXT: name: "g.s" +// CHECK-NEXT: dir_index: 2 // CHECK-NOT: file_names // We check that the source line number 100 is picked up before the "movl" diff --git a/llvm/test/MC/MachO/gen-dwarf-macro-cpp.s b/llvm/test/MC/MachO/gen-dwarf-macro-cpp.s index 9fc8571c90c..de40bbdd656 100644 --- a/llvm/test/MC/MachO/gen-dwarf-macro-cpp.s +++ b/llvm/test/MC/MachO/gen-dwarf-macro-cpp.s @@ -11,7 +11,9 @@ // rdar://12637628 // We check that the source name "foo.S" is picked up -// CHECK: Dir Mod Time File Len File Name -// CHECK: ---- ---------- ---------- --------------------------- -// CHECK: file_names[ 1] 1 0x00000000 0x00000000 "gen-dwarf-macro-cpp.s" -// CHECK: file_names[ 2] 0 0x00000000 0x00000000 "foo.S" +// CHECK: file_names[ 1]: +// CHECK-NEXT: name: "gen-dwarf-macro-cpp.s" +// CHECK-NEXT: dir_index: 1 +// CHECK: file_names[ 2]: +// CHECK-NEXT: name: "foo.S" +// CHECK-NEXT: dir_index: 0 diff --git a/llvm/test/MC/MachO/gen-dwarf.s b/llvm/test/MC/MachO/gen-dwarf.s index f3985175227..f567f79979f 100644 --- a/llvm/test/MC/MachO/gen-dwarf.s +++ b/llvm/test/MC/MachO/gen-dwarf.s @@ -109,9 +109,9 @@ _x: .long 1 // CHECK: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0 // CHECK: standard_opcode_lengths[DW_LNS_set_isa] = 1 // We don't check include_directories as it has a temp path -// CHECK: Dir Mod Time File Len File Name -// CHECK: ---- ---------- ---------- --------------------------- -// CHECK: file_names[ 1] 1 0x00000000 0x00000000 "gen-dwarf.s" +// CHECK: file_names[ 1]: +// CHECK-NEXT: name: "gen-dwarf.s" +// CHECK-NEXT: dir_index: 1 // CHECK: Address Line Column File ISA Discriminator Flags // CHECK: ------------------ ------ ------ ------ --- ------------- ------------- |

