diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-12-30 16:21:16 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-12-30 17:00:50 +0200 |
| commit | f874b5e1e08860c169b9a318391aabedfd3f7ff0 (patch) | |
| tree | 6f6c6d20994952a9558fa9c73fb2357601fad8c4 /src/codegen | |
| parent | 67316e2eab68f19778af82018eb32af1d1b575b3 (diff) | |
| download | zig-f874b5e1e08860c169b9a318391aabedfd3f7ff0.tar.gz zig-f874b5e1e08860c169b9a318391aabedfd3f7ff0.zip | |
llvm: work around lldb bugs
Closes #14122
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/llvm.zig | 12 |
1 files changed, 8 insertions, 4 deletions
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; } |
