raddbg debug view for fixed capacity dynamic arrays

This commit is contained in:
gingerBill
2026-03-12 12:56:00 +00:00
parent a6160770ff
commit bc636e4b36
2 changed files with 3 additions and 2 deletions

View File

@@ -3583,6 +3583,7 @@ gb_internal bool lb_generate_code(lbGenerator *gen) {
lb_add_raddbg_string(m, "type_view: {type: \"[]?\", expr: \"array(data, len)\"}");
lb_add_raddbg_string(m, "type_view: {type: \"string\", expr: \"array(data, len)\"}");
lb_add_raddbg_string(m, "type_view: {type: \"[dynamic]?\", expr: \"rows($, array(data, len), len, cap, allocator)\"}");
lb_add_raddbg_string(m, "type_view: {type: \"[dynamic;?]?\", expr: \"rows($, array(data, len), len)\"}");
// column major matrices
lb_add_raddbg_string(m, "type_view: {type: \"matrix[1, ?]?\", expr: \"columns($.data, $[0])\"}");

View File

@@ -442,14 +442,14 @@ gb_internal LLVMMetadataRef lb_debug_fixed_capacity_dynamic_array(lbModule *m, T
LLVMDIFlagZero, lb_debug_type(m, elem_type)
);
i64 len_offset = type_offset_of(bt, 1);
i64 len_offset_in_bits = 8*type_offset_of(bt, 1);
elements[1] = LLVMDIBuilderCreateMemberType(
m->debug_builder, member_scope,
"len", 3,
file, line,
int_bits, int_bits,
len_offset,
len_offset_in_bits,
LLVMDIFlagZero, lb_debug_type(m, t_int)
);