2017-04-22 07:35:26 +08:00
|
|
|
; RUN: llc -split-dwarf-file=baz.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
|
2017-09-12 07:05:20 +08:00
|
|
|
; RUN: llvm-dwarfdump -v -all %t | FileCheck %s
|
2013-04-07 11:43:09 +08:00
|
|
|
; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=OBJ %s
|
2014-02-26 06:46:44 +08:00
|
|
|
; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s
|
2012-12-01 07:59:06 +08:00
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
source_filename = "test/DebugInfo/X86/fission-cu.ll"
|
2012-12-01 07:59:06 +08:00
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
@a = common global i32 0, align 4, !dbg !0
|
2012-12-01 07:59:06 +08:00
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
!llvm.dbg.cu = !{!4}
|
|
|
|
!llvm.module.flags = !{!7}
|
2012-12-01 07:59:06 +08:00
|
|
|
|
2017-08-31 02:06:51 +08:00
|
|
|
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
|
|
|
|
!2 = !DIFile(filename: "baz.c", directory: "/usr/local/google/home/echristo/tmp")
|
|
|
|
!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
|
|
!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)", isOptimized: false, runtimeVersion: 0, splitDebugFilename: "baz.dwo", emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
|
|
|
|
!5 = !{}
|
2012-12-01 07:59:06 +08:00
|
|
|
; Check that the skeleton compile unit contains the proper attributes:
|
|
|
|
; This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,
|
|
|
|
; DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,
|
|
|
|
; DW_AT_ranges_base, DW_AT_addr_base.
|
|
|
|
|
2013-02-05 15:32:00 +08:00
|
|
|
; CHECK: .debug_abbrev contents:
|
|
|
|
; CHECK: Abbrev table for offset: 0x00000000
|
|
|
|
; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_no
|
2014-01-09 12:28:46 +08:00
|
|
|
; CHECK: DW_AT_stmt_list DW_FORM_sec_offset
|
2013-02-05 15:32:00 +08:00
|
|
|
; CHECK: DW_AT_GNU_dwo_name DW_FORM_strp
|
|
|
|
; CHECK: DW_AT_comp_dir DW_FORM_strp
|
2013-08-13 04:27:48 +08:00
|
|
|
; CHECK: DW_AT_GNU_dwo_id DW_FORM_data8
|
2013-02-05 15:32:00 +08:00
|
|
|
|
2013-01-16 07:56:56 +08:00
|
|
|
; Check that we're using the right forms.
|
|
|
|
; CHECK: .debug_abbrev.dwo contents:
|
|
|
|
; CHECK: Abbrev table for offset: 0x00000000
|
|
|
|
; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes
|
2016-03-25 02:37:08 +08:00
|
|
|
; CHECK: DW_AT_GNU_dwo_name DW_FORM_GNU_str_index
|
2013-01-16 07:56:56 +08:00
|
|
|
; CHECK: DW_AT_producer DW_FORM_GNU_str_index
|
|
|
|
; CHECK: DW_AT_language DW_FORM_data2
|
|
|
|
; CHECK: DW_AT_name DW_FORM_GNU_str_index
|
2013-04-10 03:23:15 +08:00
|
|
|
; CHECK-NOT: DW_AT_low_pc
|
|
|
|
; CHECK-NOT: DW_AT_stmt_list
|
|
|
|
; CHECK-NOT: DW_AT_comp_dir
|
2013-02-05 15:31:55 +08:00
|
|
|
; CHECK: DW_AT_GNU_dwo_id DW_FORM_data8
|
2013-01-16 07:56:56 +08:00
|
|
|
|
2013-10-29 13:49:41 +08:00
|
|
|
; CHECK: [2] DW_TAG_variable DW_CHILDREN_no
|
2013-01-16 07:56:56 +08:00
|
|
|
; CHECK: DW_AT_name DW_FORM_GNU_str_index
|
|
|
|
; CHECK: DW_AT_type DW_FORM_ref4
|
|
|
|
; CHECK: DW_AT_external DW_FORM_flag_present
|
|
|
|
; CHECK: DW_AT_decl_file DW_FORM_data1
|
|
|
|
; CHECK: DW_AT_decl_line DW_FORM_data1
|
2014-02-16 16:46:55 +08:00
|
|
|
; CHECK: DW_AT_location DW_FORM_exprloc
|
2013-01-16 07:56:56 +08:00
|
|
|
|
2013-10-29 13:49:41 +08:00
|
|
|
; CHECK: [3] DW_TAG_base_type DW_CHILDREN_no
|
|
|
|
; CHECK: DW_AT_name DW_FORM_GNU_str_index
|
|
|
|
; CHECK: DW_AT_encoding DW_FORM_data1
|
|
|
|
; CHECK: DW_AT_byte_size DW_FORM_data1
|
|
|
|
|
2014-01-09 07:29:59 +08:00
|
|
|
; CHECK: .debug_info contents:
|
|
|
|
; CHECK: DW_TAG_compile_unit
|
2014-03-25 05:31:35 +08:00
|
|
|
; CHECK-NEXT: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
|
|
|
|
; CHECK-NEXT: DW_AT_GNU_dwo_name [DW_FORM_strp] ( .debug_str[0x00000000] = "baz.dwo")
|
|
|
|
; CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000008] = "/usr/local/google/home/echristo/tmp")
|
|
|
|
; CHECK-NEXT: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x1f1f859683d49324)
|
2014-01-09 07:29:59 +08:00
|
|
|
|
2013-01-03 07:52:13 +08:00
|
|
|
; Check that the rest of the compile units have information.
|
|
|
|
; CHECK: .debug_info.dwo contents:
|
|
|
|
; CHECK: DW_TAG_compile_unit
|
2016-03-25 02:37:08 +08:00
|
|
|
; CHECK: DW_AT_GNU_dwo_name [DW_FORM_GNU_str_index] ( indexed (00000000) string = "baz.dwo")
|
|
|
|
; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000001) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")
|
2014-09-05 03:39:20 +08:00
|
|
|
; CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
|
2016-03-25 02:37:08 +08:00
|
|
|
; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000002) string = "baz.c")
|
2013-04-10 03:23:15 +08:00
|
|
|
; CHECK-NOT: DW_AT_low_pc
|
|
|
|
; CHECK-NOT: DW_AT_stmt_list
|
|
|
|
; CHECK-NOT: DW_AT_comp_dir
|
2014-02-20 10:50:45 +08:00
|
|
|
; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x1f1f859683d49324)
|
2013-01-03 07:52:13 +08:00
|
|
|
; CHECK: DW_TAG_variable
|
2016-03-25 02:37:08 +08:00
|
|
|
; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000003) string = "a")
|
2017-10-10 22:15:25 +08:00
|
|
|
; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[TYPE:0x[0-9a-f]*]]}
|
2013-01-19 06:11:33 +08:00
|
|
|
; CHECK: DW_AT_external [DW_FORM_flag_present] (true)
|
|
|
|
; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)
|
2014-09-05 15:21:50 +08:00
|
|
|
; CHECK: DW_AT_decl_line [DW_FORM_data1] (1)
|
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-30 05:41:21 +08:00
|
|
|
; CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_GNU_addr_index 0x0)
|
2013-10-29 13:49:41 +08:00
|
|
|
; CHECK: [[TYPE]]: DW_TAG_base_type
|
2016-03-25 02:37:08 +08:00
|
|
|
; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000004) string = "int")
|
2013-01-19 06:11:33 +08:00
|
|
|
|
2014-01-09 07:29:59 +08:00
|
|
|
; CHECK: .debug_str contents:
|
|
|
|
; CHECK: 0x00000000: "baz.dwo"
|
|
|
|
; CHECK: 0x00000008: "/usr/local/google/home/echristo/tmp"
|
2013-01-16 07:56:56 +08:00
|
|
|
|
|
|
|
; CHECK: .debug_str.dwo contents:
|
2016-03-25 02:37:08 +08:00
|
|
|
; CHECK: 0x00000000: "baz.dwo"
|
|
|
|
; CHECK: 0x00000008: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)"
|
|
|
|
; CHECK: 0x0000003d: "baz.c"
|
|
|
|
; CHECK: 0x00000043: "a"
|
|
|
|
; CHECK: 0x00000045: "int"
|
2013-01-16 07:56:56 +08:00
|
|
|
|
|
|
|
; CHECK: .debug_str_offsets.dwo contents:
|
|
|
|
; CHECK: 0x00000000: 00000000
|
2016-03-25 02:37:08 +08:00
|
|
|
; CHECK: 0x00000004: 00000008
|
|
|
|
; CHECK: 0x00000008: 0000003d
|
|
|
|
; CHECK: 0x0000000c: 00000043
|
|
|
|
; CHECK: 0x00000010: 00000045
|
2013-04-07 11:43:09 +08:00
|
|
|
|
|
|
|
; Object file checks
|
|
|
|
; For x86-64-linux we should have this set of relocations for the debug info section
|
|
|
|
;
|
|
|
|
; OBJ: .debug_info
|
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_abbrev
|
2014-01-09 12:28:46 +08:00
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_line
|
2013-04-07 11:43:09 +08:00
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_str
|
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_str
|
2014-03-22 04:27:21 +08:00
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_addr
|
2013-04-07 11:43:09 +08:00
|
|
|
; OBJ-NEXT: }
|
2013-12-31 01:22:27 +08:00
|
|
|
|
2014-02-26 06:46:44 +08:00
|
|
|
; HDR-NOT: .debug_aranges
|
2014-03-25 04:53:02 +08:00
|
|
|
; HDR-NOT: .rela.{{.*}}.dwo
|
2014-02-26 06:46:44 +08:00
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
!6 = !{!0}
|
|
|
|
!7 = !{i32 1, !"Debug Info Version", i32 3}
|