From f874b5e1e08860c169b9a318391aabedfd3f7ff0 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Fri, 30 Dec 2022 16:21:16 +0200 Subject: llvm: work around lldb bugs Closes #14122 --- src/codegen/llvm.zig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/codegen') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index fcf9423cd0..230f306dac 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -1459,7 +1459,8 @@ pub const Object = struct { .signed => DW.ATE.signed, .unsigned => DW.ATE.unsigned, }; - const di_type = dib.createBasicType(name, info.bits, dwarf_encoding); + const di_bits = ty.abiSize(target) * 8; // lldb cannot handle non-byte sized types + const di_type = dib.createBasicType(name, di_bits, dwarf_encoding); gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_type); return di_type; }, @@ -1550,7 +1551,8 @@ pub const Object = struct { return di_type; }, .Bool => { - const di_type = dib.createBasicType("bool", 1, DW.ATE.boolean); + const di_bits = 8; // lldb cannot handle non-byte sized types + const di_type = dib.createBasicType("bool", di_bits, DW.ATE.boolean); gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_type); return di_type; }, @@ -1739,7 +1741,8 @@ pub const Object = struct { var buf: Type.Payload.ElemType = undefined; const child_ty = ty.optionalChild(&buf); if (!child_ty.hasRuntimeBitsIgnoreComptime()) { - const di_ty = dib.createBasicType(name, 1, DW.ATE.boolean); + const di_bits = 8; // lldb cannot handle non-byte sized types + const di_ty = dib.createBasicType(name, di_bits, DW.ATE.boolean); gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_ty); return di_ty; } @@ -1934,7 +1937,8 @@ pub const Object = struct { .signed => DW.ATE.signed, .unsigned => DW.ATE.unsigned, }; - const di_ty = dib.createBasicType(name, info.bits, dwarf_encoding); + const di_bits = ty.abiSize(target) * 8; // lldb cannot handle non-byte sized types + const di_ty = dib.createBasicType(name, di_bits, dwarf_encoding); gop.value_ptr.* = AnnotatedDITypePtr.initFull(di_ty); return di_ty; } -- cgit v1.2.3