authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-12-30 16:21:16+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-12-30 17:00:50+02:00
logf874b5e1e08860c169b9a318391aabedfd3f7ff0
tree6f6c6d20994952a9558fa9c73fb2357601fad8c4
parent67316e2eab68f19778af82018eb32af1d1b575b3

llvm: work around lldb bugs

Closes #14122

1 files changed, 8 insertions(+), 4 deletions(-)

src/codegen/llvm.zig+8-4
...@@ -1459,7 +1459,8 @@ pub const Object = struct {...@@ -1459,7 +1459,8 @@ pub const Object = struct {
1459 .signed => DW.ATE.signed,1459 .signed => DW.ATE.signed,
1460 .unsigned => DW.ATE.unsigned,1460 .unsigned => DW.ATE.unsigned,
1461 };1461 };
1462 const di_type = dib.createBasicType(name, info.bits, dwarf_encoding);1462 const di_bits = ty.abiSize(target) * 8; // lldb cannot handle non-byte sized types
1463 const di_type = dib.createBasicType(name, di_bits, dwarf_encoding);
1463 gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_type);1464 gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_type);
1464 return di_type;1465 return di_type;
1465 },1466 },
...@@ -1550,7 +1551,8 @@ pub const Object = struct {...@@ -1550,7 +1551,8 @@ pub const Object = struct {
1550 return di_type;1551 return di_type;
1551 },1552 },
1552 .Bool => {1553 .Bool => {
1553 const di_type = dib.createBasicType("bool", 1, DW.ATE.boolean);1554 const di_bits = 8; // lldb cannot handle non-byte sized types
1555 const di_type = dib.createBasicType("bool", di_bits, DW.ATE.boolean);
1554 gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_type);1556 gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_type);
1555 return di_type;1557 return di_type;
1556 },1558 },
...@@ -1739,7 +1741,8 @@ pub const Object = struct {...@@ -1739,7 +1741,8 @@ pub const Object = struct {
1739 var buf: Type.Payload.ElemType = undefined;1741 var buf: Type.Payload.ElemType = undefined;
1740 const child_ty = ty.optionalChild(&buf);1742 const child_ty = ty.optionalChild(&buf);
1741 if (!child_ty.hasRuntimeBitsIgnoreComptime()) {1743 if (!child_ty.hasRuntimeBitsIgnoreComptime()) {
1742 const di_ty = dib.createBasicType(name, 1, DW.ATE.boolean);1744 const di_bits = 8; // lldb cannot handle non-byte sized types
1745 const di_ty = dib.createBasicType(name, di_bits, DW.ATE.boolean);
1743 gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_ty);1746 gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_ty);
1744 return di_ty;1747 return di_ty;
1745 }1748 }
...@@ -1934,7 +1937,8 @@ pub const Object = struct {...@@ -1934,7 +1937,8 @@ pub const Object = struct {
1934 .signed => DW.ATE.signed,1937 .signed => DW.ATE.signed,
1935 .unsigned => DW.ATE.unsigned,1938 .unsigned => DW.ATE.unsigned,
1936 };1939 };
1937 const di_ty = dib.createBasicType(name, info.bits, dwarf_encoding);1940 const di_bits = ty.abiSize(target) * 8; // lldb cannot handle non-byte sized types
1941 const di_ty = dib.createBasicType(name, di_bits, dwarf_encoding);
1938 gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_ty);1942 gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_ty);
1939 return di_ty;1943 return di_ty;
1940 }1944 }