| ... | @@ -1725,10 +1725,31 @@ pub const Object = struct { | ... | @@ -1725,10 +1725,31 @@ pub const Object = struct { |
| 1725 | return array_di_ty; | 1725 | return array_di_ty; |
| 1726 | }, | 1726 | }, |
| 1727 | .Vector => { | 1727 | .Vector => { |
| | 1728 | const elem_ty = ty.elemType2(); |
| | 1729 | // Vector elements cannot be padded since that would make |
| | 1730 | // @bitSizOf(elem) * len > @bitSizOf(vec). |
| | 1731 | // Neither gdb nor lldb seem to be able to display non-byte sized |
| | 1732 | // vectors properly. |
| | 1733 | const elem_di_type = switch (elem_ty.zigTypeTag()) { |
| | 1734 | .Int => blk: { |
| | 1735 | const info = elem_ty.intInfo(target); |
| | 1736 | assert(info.bits != 0); |
| | 1737 | const name = try ty.nameAlloc(gpa, o.module); |
| | 1738 | defer gpa.free(name); |
| | 1739 | const dwarf_encoding: c_uint = switch (info.signedness) { |
| | 1740 | .signed => DW.ATE.signed, |
| | 1741 | .unsigned => DW.ATE.unsigned, |
| | 1742 | }; |
| | 1743 | break :blk dib.createBasicType(name, info.bits, dwarf_encoding); |
| | 1744 | }, |
| | 1745 | .Bool => dib.createBasicType("bool", 1, DW.ATE.boolean), |
| | 1746 | else => try o.lowerDebugType(ty.childType(), .full), |
| | 1747 | }; |
| | 1748 | |
| 1728 | const vector_di_ty = dib.createVectorType( | 1749 | const vector_di_ty = dib.createVectorType( |
| 1729 | ty.abiSize(target) * 8, | 1750 | ty.abiSize(target) * 8, |
| 1730 | ty.abiAlignment(target) * 8, | 1751 | ty.abiAlignment(target) * 8, |
| 1731 | try o.lowerDebugType(ty.childType(), .full), | 1752 | elem_di_type, |
| 1732 | ty.vectorLen(), | 1753 | ty.vectorLen(), |
| 1733 | ); | 1754 | ); |
| 1734 | // The recursive call to `lowerDebugType` means we can't use `gop` anymore. | 1755 | // The recursive call to `lowerDebugType` means we can't use `gop` anymore. |