mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-24 12:44:59 -07:00
fix pointer dereference path in type-mode evaluation; carve out exception for lens visualization with string-pointers - in that case, we just want to apply a string size limitation & go to the regular string path; begin getting off old color slots
This commit is contained in:
@@ -1604,6 +1604,7 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
||||
goto arrays_and_sets_and_structs;
|
||||
}
|
||||
E_Type *type = e_type_from_key__cached(type_key);
|
||||
E_TypeKind element_type_kind = e_type_kind_from_key(e_type_key_unwrap(type->direct_type_key, E_TypeUnwrapFlag_All));
|
||||
B32 lens_applied = 1;
|
||||
EV_StringParams lens_params = *params;
|
||||
if(0){}
|
||||
@@ -1624,6 +1625,15 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
||||
{
|
||||
lens_params.flags |= EV_StringFlag_DisableAddresses;
|
||||
}
|
||||
else if(str8_match(type->name, str8_lit("array"), 0) &&
|
||||
type->count >= 1 &&
|
||||
(((E_TypeKind_Char8 <= element_type_kind && element_type_kind <= E_TypeKind_UChar32) ||
|
||||
element_type_kind == E_TypeKind_S8 ||
|
||||
element_type_kind == E_TypeKind_U8)))
|
||||
{
|
||||
lens_params.limit_strings = 1;
|
||||
lens_params.limit_strings_size = e_value_from_expr(type->args[0]).u64;
|
||||
}
|
||||
else
|
||||
{
|
||||
lens_applied = 0;
|
||||
@@ -1821,6 +1831,12 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
||||
case 4: {string = str8_from_32(scratch.arena, str32_cstring((U32 *)string_buffer));}break;
|
||||
}
|
||||
|
||||
// rjf: apply string size limitation
|
||||
if(params->limit_strings)
|
||||
{
|
||||
string = str8_prefix(string, params->limit_strings_size);
|
||||
}
|
||||
|
||||
// rjf: escape and quote
|
||||
B32 string__is_escaped_and_quoted = (!(params->flags & EV_StringFlag_DisableStringQuotes) || depth > 0);
|
||||
String8 string__escaped_and_quoted = string;
|
||||
|
||||
Reference in New Issue
Block a user