summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo
diff options
context:
space:
mode:
authorWolfgang Pieb <Wolfgang.Pieb@sony.com>2017-06-21 19:37:44 +0000
committerWolfgang Pieb <Wolfgang.Pieb@sony.com>2017-06-21 19:37:44 +0000
commit258927e3da21c393dda09a6173dbf2912e3f81cd (patch)
tree179767ae0afe50e7523eb1790044c8cfd6c6cc09 /llvm/test/DebugInfo
parentfd048cc0ec2bb8d12d081258aab79bad495e7ae5 (diff)
downloadbcm5719-llvm-258927e3da21c393dda09a6173dbf2912e3f81cd.tar.gz
bcm5719-llvm-258927e3da21c393dda09a6173dbf2912e3f81cd.zip
[DWARF] Support for DW_FORM_strx3 and complete support for DW_FORM_strx{1,2,4}
(consumer). Reviewer: aprantl Differential Revision: https://reviews.llvm.org/D34418 llvm-svn: 305944
Diffstat (limited to 'llvm/test/DebugInfo')
-rw-r--r--llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.s59
-rw-r--r--llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.x86_64.obin4000 -> 4344 bytes
-rw-r--r--llvm/test/DebugInfo/dwarfdump-str-offsets.test36
3 files changed, 83 insertions, 12 deletions
diff --git a/llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.s b/llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.s
index f395f4b872c..9ae59ec609c 100644
--- a/llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.s
+++ b/llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.s
@@ -20,6 +20,14 @@ str_TU:
.asciz "Type_Unit"
str_TU_type:
.asciz "MyStruct"
+str_Subprogram:
+ .asciz "MyFunc"
+str_Variable1:
+ .asciz "MyVar1"
+str_Variable2:
+ .asciz "MyVar2"
+str_Variable3:
+ .asciz "MyVar3"
# Every unit contributes to the string_offsets table.
.section .debug_str_offsets,"",@progbits
@@ -31,6 +39,10 @@ str_TU_type:
.long str_producer
.long str_CU1
.long str_CU1_dir
+ .long str_Subprogram
+ .long str_Variable1
+ .long str_Variable2
+ .long str_Variable3
.debug_str_offsets_segment0_end:
# CU2's contribution
.long .debug_str_offsets_segment1_end-.debug_str_offsets_base1
@@ -85,7 +97,7 @@ dwo_str_TU_5_type:
.section .debug_abbrev,"",@progbits
.byte 0x01 # Abbrev code
.byte 0x11 # DW_TAG_compile_unit
- .byte 0x00 # DW_CHILDREN_no
+ .byte 0x01 # DW_CHILDREN_yes
.byte 0x25 # DW_AT_producer
.byte 0x1a # DW_FORM_strx
.byte 0x03 # DW_AT_name
@@ -112,9 +124,37 @@ dwo_str_TU_5_type:
.byte 0x1a # DW_FORM_strx
.byte 0x00 # EOM(1)
.byte 0x00 # EOM(2)
+ .byte 0x04 # Abbrev code
+ .byte 0x2e # DW_TAG_subprogram
+ .byte 0x01 # DW_CHILDREN_yes
+ .byte 0x03 # DW_AT_name
+ .byte 0x25 # DW_FORM_strx1
+ .byte 0x00 # EOM(1)
+ .byte 0x00 # EOM(2)
+ .byte 0x05 # Abbrev code
+ .byte 0x34 # DW_TAG_variable
+ .byte 0x00 # DW_CHILDREN_no
+ .byte 0x03 # DW_AT_name
+ .byte 0x26 # DW_FORM_strx2
+ .byte 0x00 # EOM(1)
+ .byte 0x00 # EOM(2)
+ .byte 0x06 # Abbrev code
+ .byte 0x34 # DW_TAG_variable
+ .byte 0x00 # DW_CHILDREN_no
+ .byte 0x03 # DW_AT_name
+ .byte 0x27 # DW_FORM_strx3
+ .byte 0x00 # EOM(1)
+ .byte 0x00 # EOM(2)
+ .byte 0x07 # Abbrev code
+ .byte 0x34 # DW_TAG_variable
+ .byte 0x00 # DW_CHILDREN_no
+ .byte 0x03 # DW_AT_name
+ .byte 0x28 # DW_FORM_strx4
+ .byte 0x00 # EOM(1)
+ .byte 0x00 # EOM(2)
.byte 0x00 # EOM(3)
-# And a .dwo copy for the .dwo sections.
+# And a .dwo copy of a subset for the .dwo sections.
.section .debug_abbrev.dwo,"",@progbits
.byte 0x01 # Abbrev code
.byte 0x11 # DW_TAG_compile_unit
@@ -163,6 +203,21 @@ CU1_5_version:
.byte 1 # The index of the CU name string
.long .debug_str_offsets_base0
.byte 2 # The index of the comp dir string
+# A subprogram DIE with DW_AT_name, using DW_FORM_strx1.
+ .byte 4 # Abbreviation code
+ .byte 3 # Subprogram name string (DW_FORM_strx1)
+# A variable DIE with DW_AT_name, using DW_FORM_strx2.
+ .byte 5 # Abbreviation code
+ .short 0x0004 # Subprogram name string (DW_FORM_strx2)
+# A variable DIE with DW_AT_name, using DW_FORM_strx3.
+ .byte 6 # Abbreviation code
+ .byte 5 # Subprogram name string (DW_FORM_strx3)
+ .short 0 # Subprogram name string (DW_FORM_strx3)
+# A variable DIE with DW_AT_name, using DW_FORM_strx4.
+ .byte 7 # Abbreviation code
+ .quad 0x00000006 # Subprogram name string (DW_FORM_strx4)
+ .byte 0 # NULL
+ .byte 0 # NULL
.byte 0 # NULL
CU1_5_end:
diff --git a/llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.x86_64.o b/llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.x86_64.o
index e15ac1c1542..14753d82e10 100644
--- a/llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.x86_64.o
+++ b/llvm/test/DebugInfo/Inputs/dwarfdump-str-offsets.x86_64.o
Binary files differ
diff --git a/llvm/test/DebugInfo/dwarfdump-str-offsets.test b/llvm/test/DebugInfo/dwarfdump-str-offsets.test
index 937c9c4d6ec..0465357ba32 100644
--- a/llvm/test/DebugInfo/dwarfdump-str-offsets.test
+++ b/llvm/test/DebugInfo/dwarfdump-str-offsets.test
@@ -19,12 +19,24 @@ CHECK-NEXT: DW_AT_producer [DW_FORM_strx] ( indexed (00000000) string = "Handmad
CHECK-NEXT: DW_AT_name [DW_FORM_strx] ( indexed (00000001) string = "Compile_Unit_1")
CHECK-NEXT: DW_AT_str_offsets_base [DW_FORM_sec_offset] (0x00000008)
CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strx] ( indexed (00000002) string = "/home/test/CU1")
+CHECK-NOT: NULL
+CHECK: DW_TAG_subprogram
+CHECK-NEXT: DW_AT_name [DW_FORM_strx1] ( indexed (00000003) string = "MyFunc")
+CHECK-NOT: NULL
+CHECK: DW_TAG_variable
+CHECK-NEXT: DW_AT_name [DW_FORM_strx2] ( indexed (00000004) string = "MyVar1")
+CHECK-NOT: NULL
+CHECK: DW_TAG_variable
+CHECK-NEXT: DW_AT_name [DW_FORM_strx3] ( indexed (00000005) string = "MyVar2")
+CHECK-NOT: NULL
+CHECK: DW_TAG_variable
+CHECK-NEXT: DW_AT_name [DW_FORM_strx4] ( indexed (00000006) string = "MyVar3")
; Second compile unit (b.cpp)
CHECK: DW_TAG_compile_unit
CHECK-NEXT: DW_AT_producer [DW_FORM_strx] ( indexed (00000000) string = "Handmade DWARF producer")
CHECK-NEXT: DW_AT_name [DW_FORM_strx] ( indexed (00000001) string = "Compile_Unit_2")
-CHECK-NEXT: DW_AT_str_offsets_base [DW_FORM_sec_offset] (0x0000001c)
+CHECK-NEXT: DW_AT_str_offsets_base [DW_FORM_sec_offset] (0x0000002c)
CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strx] ( indexed (00000002) string = "/home/test/CU2")
; The split CU
@@ -40,7 +52,7 @@ CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strx] ( indexed (00000002) string = "/home/t
CHECK: .debug_types contents:
CHECK: DW_TAG_type_unit
CHECK-NEXT: DW_AT_name [DW_FORM_strx] ( indexed (00000000) string = "Type_Unit")
-CHECK-NEXT: DW_AT_str_offsets_base [DW_FORM_sec_offset] (0x00000030)
+CHECK-NEXT: DW_AT_str_offsets_base [DW_FORM_sec_offset] (0x00000040)
CHECK: DW_TAG_structure_type
CHECK-NEXT: DW_AT_name [DW_FORM_strx] ( indexed (00000001) string = "MyStruct")
@@ -54,17 +66,21 @@ CHECK-NEXT: DW_AT_name [DW_FORM_strx] ( indexed (00000001) string = "V5_split_My
; The .debug_str_offsets section
CHECK: .debug_str_offsets contents:
-CHECK-NEXT: 0x00000000: Contribution size = 12, Version = 5
+CHECK-NEXT: 0x00000000: Contribution size = 28, Version = 5
CHECK-NEXT: 0x00000008: 00000000 "Handmade DWARF producer"
CHECK-NEXT: 0x0000000c: 00000018 "Compile_Unit_1"
CHECK-NEXT: 0x00000010: 00000027 "/home/test/CU1"
-CHECK-NEXT: 0x00000014: Contribution size = 12, Version = 5
-CHECK-NEXT: 0x0000001c: 00000000 "Handmade DWARF producer"
-CHECK-NEXT: 0x00000020: 00000036 "Compile_Unit_2"
-CHECK-NEXT: 0x00000024: 00000045 "/home/test/CU2"
-CHECK-NEXT: 0x00000028: Contribution size = 8, Version = 5
-CHECK-NEXT: 0x00000030: 00000054 "Type_Unit"
-CHECK-NEXT: 0x00000034: 0000005e "MyStruct"
+CHECK-NEXT: 0x00000014: 00000067 "MyFunc"
+CHECK-NEXT: 0x00000018: 0000006e "MyVar1"
+CHECK-NEXT: 0x0000001c: 00000075 "MyVar2"
+CHECK-NEXT: 0x00000020: 0000007c "MyVar3"
+CHECK-NEXT: 0x00000024: Contribution size = 12, Version = 5
+CHECK-NEXT: 0x0000002c: 00000000 "Handmade DWARF producer"
+CHECK-NEXT: 0x00000030: 00000036 "Compile_Unit_2"
+CHECK-NEXT: 0x00000034: 00000045 "/home/test/CU2"
+CHECK-NEXT: 0x00000038: Contribution size = 8, Version = 5
+CHECK-NEXT: 0x00000040: 00000054 "Type_Unit"
+CHECK-NEXT: 0x00000044: 0000005e "MyStruct"
CHECK: .debug_str_offsets.dwo contents:
CHECK-NEXT: 0x00000000: Contribution size = 12, Version = 5
OpenPOWER on IntegriCloud