summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/COFF
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2017-08-29 00:06:59 +0000
committerBob Haarman <llvm@inglorion.net>2017-08-29 00:06:59 +0000
commitb2a04a151379ed3d659c9dc8c945d17fff90a93f (patch)
tree6ae6c908c49f2b832f957a5afaffd45a0f4a8bf7 /llvm/test/DebugInfo/COFF
parent99ecb0ebcaa4b953fcc5e9fbf49b233ef1b9b294 (diff)
downloadbcm5719-llvm-b2a04a151379ed3d659c9dc8c945d17fff90a93f.tar.gz
bcm5719-llvm-b2a04a151379ed3d659c9dc8c945d17fff90a93f.zip
[codeview] support more DW_OPs for more complete debug info
Summary: Some variables show up in Visual Studio as "optimized out" even in -O0 -Od builds. This change fixes two issues that would cause this to happen. The first issue is that not all DIExpressions we generate were recognized by the CodeView writer. This has been addressed by adding support for DW_OP_constu, DW_OP_minus, and DW_OP_plus. The second issue is that we had no way to encode DW_OP_deref in CodeView. We get around that by changinge the type we encode in the debug info to be a reference to the type in the source code. This fixes PR34261. Reviewers: aprantl, rnk, zturner Reviewed By: rnk Subscribers: mgorny, llvm-commits, aprantl, hiraditya Differential Revision: https://reviews.llvm.org/D36907 llvm-svn: 311957
Diffstat (limited to 'llvm/test/DebugInfo/COFF')
-rw-r--r--llvm/test/DebugInfo/COFF/pieces.ll12
-rw-r--r--llvm/test/DebugInfo/COFF/types-array-advanced.ll75
2 files changed, 70 insertions, 17 deletions
diff --git a/llvm/test/DebugInfo/COFF/pieces.ll b/llvm/test/DebugInfo/COFF/pieces.ll
index 6d363cf5443..9a90300bb99 100644
--- a/llvm/test/DebugInfo/COFF/pieces.ll
+++ b/llvm/test/DebugInfo/COFF/pieces.ll
@@ -179,8 +179,7 @@
; ASM: .asciz "nested" # Function name
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "o"
-; FIXME: We should have a .cv_def_range for 'o', but we don't yet.
-; ASM-NOT: .cv_def_range
+; ASM: .cv_def_range .Lfunc_begin3 .Lfunc_end3, "E\021J\001\000\000\000\000\000\000"
; ASM: .short 4414 # Record kind: S_LOCAL
; ASM: .asciz "p"
; ASM: .cv_def_range [[p_start]] .Lfunc_end3, "C\021\021\000\000\000\004\000\000\000"
@@ -190,8 +189,17 @@
; OBJ: DisplayName: nested
; OBJ: }
; OBJ: LocalSym {
+; OBJ: Type: Nested&
; OBJ: VarName: o
; OBJ: }
+; OBJ: DefRangeRegisterRelSym {
+; OBJ: BaseRegister: 330
+; OBJ: HasSpilledUDTMember: No
+; OBJ: OffsetInParent: 0
+; OBJ: BasePointerOffset: 0
+; OBJ: LocalVariableAddrRange {
+; OBJ: }
+; OBJ: }
; OBJ: LocalSym {
; OBJ: VarName: p
; OBJ: }
diff --git a/llvm/test/DebugInfo/COFF/types-array-advanced.ll b/llvm/test/DebugInfo/COFF/types-array-advanced.ll
index d8985504e32..69da2b53993 100644
--- a/llvm/test/DebugInfo/COFF/types-array-advanced.ll
+++ b/llvm/test/DebugInfo/COFF/types-array-advanced.ll
@@ -50,28 +50,40 @@
; CHECK: SizeOf: 4
; CHECK: Name:
; CHECK: }
-; CHECK: Array (0x1004) {
+; CHECK: Pointer (0x1004) {
+; CHECK: TypeLeafKind: LF_POINTER (0x1002)
+; CHECK: PointeeType: 0x1003
+; CHECK: PointerAttributes: 0x2A
+; CHECK: PtrType: Near32 (0xA)
+; CHECK: PtrMode: LValueReference (0x1)
+; CHECK: IsFlat: 0
+; CHECK: IsConst: 0
+; CHECK: IsVolatile: 0
+; CHECK: IsUnaligned: 0
+; CHECK: SizeOf: 0
+; CHECK: }
+; CHECK: Array (0x1005) {
; CHECK: TypeLeafKind: LF_ARRAY (0x1503)
; CHECK: ElementType: char (0x70)
; CHECK: IndexType: unsigned long (0x22)
; CHECK: SizeOf: 7
; CHECK: Name:
; CHECK: }
-; CHECK: Array (0x1005) {
+; CHECK: Array (0x1006) {
; CHECK: TypeLeafKind: LF_ARRAY (0x1503)
-; CHECK: ElementType: 0x1004
+; CHECK: ElementType: 0x1005
; CHECK: IndexType: unsigned long (0x22)
; CHECK: SizeOf: 35
; CHECK: Name:
; CHECK: }
-; CHECK: Array (0x1006) {
+; CHECK: Array (0x1007) {
; CHECK: TypeLeafKind: LF_ARRAY (0x1503)
-; CHECK: ElementType: 0x1005
+; CHECK: ElementType: 0x1006
; CHECK: IndexType: unsigned long (0x22)
; CHECK: SizeOf: 70
; CHECK: Name:
; CHECK: }
-; CHECK: Struct (0x1007) {
+; CHECK: Struct (0x1008) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 0
; CHECK: Properties [ (0x280)
@@ -85,16 +97,16 @@
; CHECK: Name: incomplete_struct
; CHECK: LinkageName: .?AUincomplete_struct@@
; CHECK: }
-; CHECK: Array (0x1008) {
+; CHECK: Array (0x1009) {
; CHECK: TypeLeafKind: LF_ARRAY (0x1503)
-; CHECK: ElementType: incomplete_struct (0x1007)
+; CHECK: ElementType: incomplete_struct (0x1008)
; CHECK: IndexType: unsigned long (0x22)
; CHECK: SizeOf: 12
; CHECK: Name:
; CHECK: }
-; CHECK: Pointer (0x1009) {
+; CHECK: Pointer (0x100A) {
; CHECK: TypeLeafKind: LF_POINTER (0x1002)
-; CHECK: PointeeType: 0x1008
+; CHECK: PointeeType: 0x1009
; CHECK: PointerAttributes: 0x800A
; CHECK: PtrType: Near32 (0xA)
; CHECK: PtrMode: Pointer (0x0)
@@ -104,8 +116,41 @@
; CHECK: IsUnaligned: 0
; CHECK: SizeOf: 4
; CHECK: }
-;
-; CHECK: Modifier (0x100E) {
+; CHECK: FieldList (0x100B) {
+; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
+; CHECK: DataMember {
+; CHECK: TypeLeafKind: LF_MEMBER (0x150D)
+; CHECK: AccessSpecifier: Public (0x3)
+; CHECK: Type: int (0x74)
+; CHECK: FieldOffset: 0x0
+; CHECK: Name: s1
+; CHECK: }
+; CHECK: }
+; CHECK: Struct (0x100C) {
+; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
+; CHECK: MemberCount: 1
+; CHECK: Properties [ (0x200)
+; CHECK: HasUniqueName (0x200)
+; CHECK: ]
+; CHECK: FieldList: <field list> (0x100B)
+; CHECK: DerivedFrom: 0x0
+; CHECK: VShape: 0x0
+; CHECK: SizeOf: 4
+; CHECK: Name: incomplete_struct
+; CHECK: LinkageName: .?AUincomplete_struct@@
+; CHECK: }
+; CHECK: StringId (0x100D) {
+; CHECK: TypeLeafKind: LF_STRING_ID (0x1605)
+; CHECK: Id: 0x0
+; CHECK: StringData: \t.cpp
+; CHECK: }
+; CHECK: UdtSourceLine (0x100E) {
+; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
+; CHECK: UDT: incomplete_struct (0x100C)
+; CHECK: SourceFile: \t.cpp (0x100D)
+; CHECK: LineNumber: 4
+; CHECK: }
+; CHECK: Modifier (0x100F) {
; CHECK: TypeLeafKind: LF_MODIFIER (0x1001)
; CHECK: ModifiedType: int (0x74)
; CHECK: Modifiers [ (0x3)
@@ -113,12 +158,12 @@
; CHECK: Volatile (0x2)
; CHECK: ]
; CHECK: }
-; CHECK: Array (0x100F) {
+; CHECK: Array (0x1010) {
; CHECK: TypeLeafKind: LF_ARRAY (0x1503)
-; CHECK: ElementType: const volatile int (0x100E)
+; CHECK: ElementType: const volatile int (0x100F)
; CHECK: IndexType: unsigned long (0x22)
; CHECK: SizeOf: 16
-; CHECK: Name:
+; CHECK: Name:
; CHECK: }
; CHECK: ]
OpenPOWER on IntegriCloud