mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 14:28:40 +00:00
eliminate watch view fill kind; extend rtti & eval type system with 'external' pointers, for e.g. meta-space vaddr u64s pointing into an address space; begin sketching out paths for mutational rows in watch collections, use to add 'add target' fastpath in targets collection evaluations
This commit is contained in:
+15
-1
@@ -45,6 +45,7 @@ typed_data_rebase_ptrs(Type *type, String8 data, void *base_ptr)
|
|||||||
{
|
{
|
||||||
default:{}break;
|
default:{}break;
|
||||||
case TypeKind_Ptr:
|
case TypeKind_Ptr:
|
||||||
|
if(!t->type->is_external)
|
||||||
{
|
{
|
||||||
*(U64 *)t->ptr = ((U64)(*(U8 **)t->ptr - (U8 *)base_ptr));
|
*(U64 *)t->ptr = ((U64)(*(U8 **)t->ptr - (U8 *)base_ptr));
|
||||||
}break;
|
}break;
|
||||||
@@ -106,7 +107,7 @@ serialized_from_typed_data(Arena *arena, Type *type, String8 data, TypeSerialize
|
|||||||
str8_serial_push_string(scratch.arena, &strings, str8(t->src, t->type->size*t->count));
|
str8_serial_push_string(scratch.arena, &strings, str8(t->src, t->type->size*t->count));
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
//- rjf: pointers -> try to interpret/understand pointer & read/write, otherwise skip
|
//- rjf: pointers -> try to interpret/understand pointer & read/write, otherwise just write as plain data
|
||||||
case TypeKind_Ptr:
|
case TypeKind_Ptr:
|
||||||
{
|
{
|
||||||
// rjf: unpack info about this pointer
|
// rjf: unpack info about this pointer
|
||||||
@@ -173,6 +174,12 @@ serialized_from_typed_data(Arena *arena, Type *type, String8 data, TypeSerialize
|
|||||||
task->containing_ptr = t->containing_ptr;
|
task->containing_ptr = t->containing_ptr;
|
||||||
SLLQueuePush(first_task, last_task, task);
|
SLLQueuePush(first_task, last_task, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rjf: catch-all: write pointer value
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str8_serial_push_string(scratch.arena, &strings, str8(t->src, t->type->size*t->count));
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
//- rjf: arrays -> descend to underlying type, + count
|
//- rjf: arrays -> descend to underlying type, + count
|
||||||
@@ -339,6 +346,13 @@ deserialized_from_typed_data(Arena *arena, Type *type, String8 data, TypeSeriali
|
|||||||
task->containing_ptr = t->containing_ptr;
|
task->containing_ptr = t->containing_ptr;
|
||||||
SLLQueuePush(first_task, last_task, task);
|
SLLQueuePush(first_task, last_task, task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rjf: catch-all: read pointer value
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MemoryCopy(t->dst, t_src, t->type->size*t->count);
|
||||||
|
read_off += t->type->size*t->count;
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
//- rjf: arrays -> descend to underlying type, + count
|
//- rjf: arrays -> descend to underlying type, + count
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ struct Type
|
|||||||
String8 count_delimiter_name; // gathered from surrounding members, turns *->[1] into *->[N]
|
String8 count_delimiter_name; // gathered from surrounding members, turns *->[1] into *->[N]
|
||||||
U64 count;
|
U64 count;
|
||||||
Member *members;
|
Member *members;
|
||||||
|
B32 is_external;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|||||||
@@ -21,9 +21,10 @@ struct CTRL_MetaEvalFrame
|
|||||||
{
|
{
|
||||||
U64 vaddr;
|
U64 vaddr;
|
||||||
};
|
};
|
||||||
|
ptr_type(CTRL_MetaEvalFrame__vaddr_type, type(void), .is_external = 1, .size = sizeof(U64));
|
||||||
struct_members(CTRL_MetaEvalFrame)
|
struct_members(CTRL_MetaEvalFrame)
|
||||||
{
|
{
|
||||||
member_lit_comp(CTRL_MetaEvalFrame, type(U64), vaddr),
|
member_lit_comp(CTRL_MetaEvalFrame, &CTRL_MetaEvalFrame__vaddr_type, vaddr),
|
||||||
};
|
};
|
||||||
struct_type(CTRL_MetaEvalFrame);
|
struct_type(CTRL_MetaEvalFrame);
|
||||||
typedef struct CTRL_MetaEvalFrameArray CTRL_MetaEvalFrameArray;
|
typedef struct CTRL_MetaEvalFrameArray CTRL_MetaEvalFrameArray;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ e_autoresolved_eval_from_eval(E_Eval eval)
|
|||||||
if(string_idx == 0) { string_idx = gvar->name_string_idx; }
|
if(string_idx == 0) { string_idx = gvar->name_string_idx; }
|
||||||
if(string_idx != 0)
|
if(string_idx != 0)
|
||||||
{
|
{
|
||||||
eval.type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, e_type_key_basic(E_TypeKind_Void));
|
eval.type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, e_type_key_basic(E_TypeKind_Void), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return eval;
|
return eval;
|
||||||
@@ -127,7 +127,7 @@ e_dynamically_typed_eval_from_eval(E_Eval eval)
|
|||||||
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, global_var->container_idx);
|
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, global_var->container_idx);
|
||||||
RDI_TypeNode *type = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx);
|
RDI_TypeNode *type = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx);
|
||||||
E_TypeKey derived_type_key = e_type_key_ext(e_type_kind_from_rdi(type->kind), udt->self_type_idx, rdi_idx);
|
E_TypeKey derived_type_key = e_type_key_ext(e_type_kind_from_rdi(type->kind), udt->self_type_idx, rdi_idx);
|
||||||
E_TypeKey ptr_to_derived_type_key = e_type_key_cons_ptr(arch, derived_type_key);
|
E_TypeKey ptr_to_derived_type_key = e_type_key_cons_ptr(arch, derived_type_key, 0);
|
||||||
eval.type_key = ptr_to_derived_type_key;
|
eval.type_key = ptr_to_derived_type_key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -711,7 +711,7 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *expr)
|
|||||||
|
|
||||||
// rjf: generate
|
// rjf: generate
|
||||||
result.root = r_tree.root;
|
result.root = r_tree.root;
|
||||||
result.type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, r_type_unwrapped);
|
result.type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, r_type_unwrapped, 0);
|
||||||
result.mode = E_Mode_Value;
|
result.mode = E_Mode_Value;
|
||||||
result.space = r_tree.space;
|
result.space = r_tree.space;
|
||||||
}break;
|
}break;
|
||||||
@@ -1064,7 +1064,7 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *expr)
|
|||||||
E_TypeKey ptr_type = ptr_tree->type_key;
|
E_TypeKey ptr_type = ptr_tree->type_key;
|
||||||
if(ptr_is_decay)
|
if(ptr_is_decay)
|
||||||
{
|
{
|
||||||
ptr_type = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, direct_type);
|
ptr_type = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, direct_type, 0);
|
||||||
}
|
}
|
||||||
E_IRNode *new_root = e_irtree_binary_op_u(arena, op, ptr_root, int_root);
|
E_IRNode *new_root = e_irtree_binary_op_u(arena, op, ptr_root, int_root);
|
||||||
result.root = new_root;
|
result.root = new_root;
|
||||||
|
|||||||
@@ -942,7 +942,7 @@ e_type_from_expr(E_Expr *expr)
|
|||||||
case E_ExprKind_Ptr:
|
case E_ExprKind_Ptr:
|
||||||
{
|
{
|
||||||
E_TypeKey direct_type_key = e_type_from_expr(expr->first);
|
E_TypeKey direct_type_key = e_type_from_expr(expr->first);
|
||||||
result = e_type_key_cons_ptr(e_parse_ctx->primary_module->arch, direct_type_key);
|
result = e_type_key_cons_ptr(e_parse_ctx->primary_module->arch, direct_type_key, 0);
|
||||||
}break;
|
}break;
|
||||||
case E_ExprKind_Array:
|
case E_ExprKind_Array:
|
||||||
{
|
{
|
||||||
@@ -1251,7 +1251,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
E_Expr *type = e_push_expr(arena, E_ExprKind_TypeIdent, token_string.str);
|
E_Expr *type = e_push_expr(arena, E_ExprKind_TypeIdent, token_string.str);
|
||||||
type->type_key = e_type_key_cons_ptr(e_parse_ctx->primary_module->arch, e_type_key_basic(E_TypeKind_U64));
|
type->type_key = e_type_key_cons_ptr(e_parse_ctx->primary_module->arch, e_type_key_basic(E_TypeKind_U64), 0);
|
||||||
E_Expr *casted = atom;
|
E_Expr *casted = atom;
|
||||||
E_Expr *cast = e_push_expr(arena, E_ExprKind_Cast, token_string.str);
|
E_Expr *cast = e_push_expr(arena, E_ExprKind_Cast, token_string.str);
|
||||||
e_expr_push_child(cast, type);
|
e_expr_push_child(cast, type);
|
||||||
|
|||||||
+10
-3
@@ -329,6 +329,7 @@ internal B32
|
|||||||
e_cons_type_params_match(E_ConsTypeParams *l, E_ConsTypeParams *r)
|
e_cons_type_params_match(E_ConsTypeParams *l, E_ConsTypeParams *r)
|
||||||
{
|
{
|
||||||
B32 result = (l->kind == r->kind &&
|
B32 result = (l->kind == r->kind &&
|
||||||
|
l->flags == r->flags &&
|
||||||
str8_match(l->name, r->name, 0) &&
|
str8_match(l->name, r->name, 0) &&
|
||||||
e_type_key_match(l->direct_key, r->direct_key) &&
|
e_type_key_match(l->direct_key, r->direct_key) &&
|
||||||
l->count == r->count);
|
l->count == r->count);
|
||||||
@@ -430,9 +431,9 @@ e_type_key_cons_array(E_TypeKey element_type_key, U64 count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal E_TypeKey
|
internal E_TypeKey
|
||||||
e_type_key_cons_ptr(Arch arch, E_TypeKey element_type_key)
|
e_type_key_cons_ptr(Arch arch, E_TypeKey element_type_key, E_TypeFlags flags)
|
||||||
{
|
{
|
||||||
E_TypeKey key = e_type_key_cons(.arch = arch, .kind = E_TypeKind_Ptr, .direct_key = element_type_key);
|
E_TypeKey key = e_type_key_cons(.arch = arch, .kind = E_TypeKind_Ptr, .flags = flags, .direct_key = element_type_key);
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +452,12 @@ e_type_key_cons_base(Type *type)
|
|||||||
case TypeKind_Ptr:
|
case TypeKind_Ptr:
|
||||||
{
|
{
|
||||||
E_TypeKey direct_type = e_type_key_cons_base(type->direct);
|
E_TypeKey direct_type = e_type_key_cons_base(type->direct);
|
||||||
result = e_type_key_cons_ptr(arch_from_context(), direct_type);
|
E_TypeFlags flags = 0;
|
||||||
|
if(type->is_external)
|
||||||
|
{
|
||||||
|
flags |= E_TypeFlag_External;
|
||||||
|
}
|
||||||
|
result = e_type_key_cons_ptr(arch_from_context(), direct_type, flags);
|
||||||
}break;
|
}break;
|
||||||
case TypeKind_Array:
|
case TypeKind_Array:
|
||||||
{
|
{
|
||||||
@@ -591,6 +597,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
|||||||
{
|
{
|
||||||
type = push_array(arena, E_Type, 1);
|
type = push_array(arena, E_Type, 1);
|
||||||
type->kind = e_type_kind_from_key(node->key);
|
type->kind = e_type_kind_from_key(node->key);
|
||||||
|
type->flags = node->params.flags;
|
||||||
type->name = push_str8_copy(arena, node->params.name);
|
type->name = push_str8_copy(arena, node->params.name);
|
||||||
type->direct_type_key = node->params.direct_key;
|
type->direct_type_key = node->params.direct_key;
|
||||||
type->count = node->params.count;
|
type->count = node->params.count;
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ enum
|
|||||||
{
|
{
|
||||||
E_TypeFlag_Const = (1<<0),
|
E_TypeFlag_Const = (1<<0),
|
||||||
E_TypeFlag_Volatile = (1<<1),
|
E_TypeFlag_Volatile = (1<<1),
|
||||||
|
E_TypeFlag_External = (1<<2),
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct E_Member E_Member;
|
typedef struct E_Member E_Member;
|
||||||
@@ -140,6 +141,7 @@ struct E_ConsTypeParams
|
|||||||
{
|
{
|
||||||
Arch arch;
|
Arch arch;
|
||||||
E_TypeKind kind;
|
E_TypeKind kind;
|
||||||
|
E_TypeFlags flags;
|
||||||
String8 name;
|
String8 name;
|
||||||
E_TypeKey direct_key;
|
E_TypeKey direct_key;
|
||||||
U64 count;
|
U64 count;
|
||||||
@@ -242,7 +244,7 @@ internal E_TypeKey e_type_key_cons_(E_ConsTypeParams *params);
|
|||||||
|
|
||||||
//- rjf: constructed type construction helpers
|
//- rjf: constructed type construction helpers
|
||||||
internal E_TypeKey e_type_key_cons_array(E_TypeKey element_type_key, U64 count);
|
internal E_TypeKey e_type_key_cons_array(E_TypeKey element_type_key, U64 count);
|
||||||
internal E_TypeKey e_type_key_cons_ptr(Arch arch, E_TypeKey element_type_key);
|
internal E_TypeKey e_type_key_cons_ptr(Arch arch, E_TypeKey element_type_key, E_TypeFlags flags);
|
||||||
internal E_TypeKey e_type_key_cons_base(Type *type);
|
internal E_TypeKey e_type_key_cons_base(Type *type);
|
||||||
|
|
||||||
//- rjf: basic type key functions
|
//- rjf: basic type key functions
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(array)
|
|||||||
E_Value count = ev_value_from_params(params);
|
E_Value count = ev_value_from_params(params);
|
||||||
E_TypeKey element_type_key = e_type_ptee_from_key(type_key);
|
E_TypeKey element_type_key = e_type_ptee_from_key(type_key);
|
||||||
E_TypeKey array_type_key = e_type_key_cons_array(element_type_key, count.u64);
|
E_TypeKey array_type_key = e_type_key_cons_array(element_type_key, count.u64);
|
||||||
E_TypeKey ptr_type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, array_type_key);
|
E_TypeKey ptr_type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, array_type_key, 0);
|
||||||
expr = e_expr_ref_cast(arena, ptr_type_key, expr);
|
expr = e_expr_ref_cast(arena, ptr_type_key, expr);
|
||||||
}
|
}
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
@@ -351,7 +351,7 @@ EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(slice)
|
|||||||
String8 struct_name = e_type_string_from_key(scratch.arena, irtree.type_key);
|
String8 struct_name = e_type_string_from_key(scratch.arena, irtree.type_key);
|
||||||
E_TypeKey element_type_key = e_type_ptee_from_key(base_ptr_member->type_key);
|
E_TypeKey element_type_key = e_type_ptee_from_key(base_ptr_member->type_key);
|
||||||
E_TypeKey array_type_key = e_type_key_cons_array(element_type_key, count);
|
E_TypeKey array_type_key = e_type_key_cons_array(element_type_key, count);
|
||||||
E_TypeKey sized_base_ptr_type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, array_type_key);
|
E_TypeKey sized_base_ptr_type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, array_type_key, 0);
|
||||||
E_MemberList slice_type_members = {0};
|
E_MemberList slice_type_members = {0};
|
||||||
e_member_list_push(scratch.arena, &slice_type_members, count_member);
|
e_member_list_push(scratch.arena, &slice_type_members, count_member);
|
||||||
e_member_list_push(scratch.arena, &slice_type_members, &(E_Member){.kind = E_MemberKind_DataField, .type_key = sized_base_ptr_type_key, .name = base_ptr_member->name, .off = base_ptr_member->off});
|
e_member_list_push(scratch.arena, &slice_type_members, &(E_Member){.kind = E_MemberKind_DataField, .type_key = sized_base_ptr_type_key, .name = base_ptr_member->name, .off = base_ptr_member->off});
|
||||||
@@ -367,7 +367,7 @@ EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(slice)
|
|||||||
if(base_ptr_member != 0 && count_member != 0)
|
if(base_ptr_member != 0 && count_member != 0)
|
||||||
{
|
{
|
||||||
expr = e_expr_ref_addr(arena, expr);
|
expr = e_expr_ref_addr(arena, expr);
|
||||||
expr = e_expr_ref_cast(arena, e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, slice_type_key), expr);
|
expr = e_expr_ref_cast(arena, e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, slice_type_key, 0), expr);
|
||||||
expr = e_expr_ref_deref(arena, expr);
|
expr = e_expr_ref_deref(arena, expr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -426,7 +426,7 @@ EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(only)
|
|||||||
String8 struct_name = e_type_string_from_key(scratch.arena, irtree.type_key);
|
String8 struct_name = e_type_string_from_key(scratch.arena, irtree.type_key);
|
||||||
E_TypeKey new_type = e_type_key_cons(.kind = E_TypeKind_Struct, .name = struct_name, .members = new_members_array.v, .count = new_members_array.count);
|
E_TypeKey new_type = e_type_key_cons(.kind = E_TypeKind_Struct, .name = struct_name, .members = new_members_array.v, .count = new_members_array.count);
|
||||||
expr = e_expr_ref_addr(arena, expr);
|
expr = e_expr_ref_addr(arena, expr);
|
||||||
expr = e_expr_ref_cast(arena, e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, new_type), expr);
|
expr = e_expr_ref_cast(arena, e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, new_type, 0), expr);
|
||||||
expr = e_expr_ref_deref(arena, expr);
|
expr = e_expr_ref_deref(arena, expr);
|
||||||
}
|
}
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
@@ -465,7 +465,7 @@ EV_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(omit)
|
|||||||
String8 struct_name = e_type_string_from_key(scratch.arena, irtree.type_key);
|
String8 struct_name = e_type_string_from_key(scratch.arena, irtree.type_key);
|
||||||
E_TypeKey new_type = e_type_key_cons(.kind = E_TypeKind_Struct, .name = struct_name, .members = new_members_array.v, .count = new_members_array.count);
|
E_TypeKey new_type = e_type_key_cons(.kind = E_TypeKind_Struct, .name = struct_name, .members = new_members_array.v, .count = new_members_array.count);
|
||||||
expr = e_expr_ref_addr(arena, expr);
|
expr = e_expr_ref_addr(arena, expr);
|
||||||
expr = e_expr_ref_cast(arena, e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, new_type), expr);
|
expr = e_expr_ref_cast(arena, e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, new_type, 0), expr);
|
||||||
expr = e_expr_ref_deref(arena, expr);
|
expr = e_expr_ref_deref(arena, expr);
|
||||||
}
|
}
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
|
|||||||
@@ -7902,6 +7902,10 @@ EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(rd_collection_block_prod)
|
|||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
RD_EntityList targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
RD_EntityList targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||||
EV_ViewRuleList top_level_view_rules = {0};
|
EV_ViewRuleList top_level_view_rules = {0};
|
||||||
|
EV_Key addnew_key = ev_key_make(ev_hash_from_key(key), 1);
|
||||||
|
EV_Block *addnew_block = ev_block_begin(arena, EV_BlockKind_Canvas, key, addnew_key, depth);
|
||||||
|
addnew_block->visual_idx_range = addnew_block->semantic_idx_range = r1u64(0, 1);
|
||||||
|
ev_block_end(out, addnew_block);
|
||||||
for(RD_EntityNode *n = targets.first; n != 0; n = n->next)
|
for(RD_EntityNode *n = targets.first; n != 0; n = n->next)
|
||||||
{
|
{
|
||||||
RD_Entity *target = n->entity;
|
RD_Entity *target = n->entity;
|
||||||
@@ -8254,9 +8258,21 @@ rd_append_value_strings_from_eval(Arena *arena, EV_StringFlags flags, U32 defaul
|
|||||||
}
|
}
|
||||||
if(eval.space.kind == RD_EvalSpaceKind_MetaEntity ||
|
if(eval.space.kind == RD_EvalSpaceKind_MetaEntity ||
|
||||||
eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity)
|
eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity)
|
||||||
|
{
|
||||||
|
E_TypeKind kind = e_type_kind_from_key(eval.type_key);
|
||||||
|
if(kind != E_TypeKind_Ptr)
|
||||||
{
|
{
|
||||||
no_addr = 1;
|
no_addr = 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
E_Type *type = e_type_from_key(scratch.arena, eval.type_key);
|
||||||
|
if(!(type->flags & E_TypeFlag_External))
|
||||||
|
{
|
||||||
|
no_addr = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//- rjf: member evaluations -> display member info
|
//- rjf: member evaluations -> display member info
|
||||||
if(eval.mode == E_Mode_Null && !e_type_key_match(e_type_key_zero(), eval.type_key) && member != 0)
|
if(eval.mode == E_Mode_Null && !e_type_key_match(e_type_key_zero(), eval.type_key) && member != 0)
|
||||||
|
|||||||
@@ -158,11 +158,6 @@ struct RD_SettingVal
|
|||||||
S32 s32;
|
S32 s32;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////
|
|
||||||
//~ rjf: View Hook Function Types
|
|
||||||
|
|
||||||
typedef struct RD_View RD_View;
|
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: View Rule Info Types
|
//~ rjf: View Rule Info Types
|
||||||
|
|
||||||
@@ -186,6 +181,8 @@ typedef RD_VIEW_RULE_UI_FUNCTION_SIG(RD_ViewRuleUIFunctionType);
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: View Types
|
//~ rjf: View Types
|
||||||
|
|
||||||
|
typedef struct RD_View RD_View;
|
||||||
|
|
||||||
typedef struct RD_ArenaExt RD_ArenaExt;
|
typedef struct RD_ArenaExt RD_ArenaExt;
|
||||||
struct RD_ArenaExt
|
struct RD_ArenaExt
|
||||||
{
|
{
|
||||||
|
|||||||
+63
-28
@@ -939,12 +939,11 @@ rd_watch_view_column_release(RD_WatchViewState *wv, RD_WatchViewColumn *col)
|
|||||||
//- rjf: watch view main hooks
|
//- rjf: watch view main hooks
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
rd_watch_view_init(RD_WatchViewState *ewv, RD_WatchViewFillKind fill_kind)
|
rd_watch_view_init(RD_WatchViewState *ewv)
|
||||||
{
|
{
|
||||||
if(ewv->initialized == 0)
|
if(ewv->initialized == 0)
|
||||||
{
|
{
|
||||||
ewv->initialized = 1;
|
ewv->initialized = 1;
|
||||||
ewv->fill_kind = fill_kind;
|
|
||||||
ewv->column_arena = rd_push_view_arena();
|
ewv->column_arena = rd_push_view_arena();
|
||||||
ewv->text_edit_arena = rd_push_view_arena();
|
ewv->text_edit_arena = rd_push_view_arena();
|
||||||
}
|
}
|
||||||
@@ -962,7 +961,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- rjf: unpack arguments
|
//- rjf: unpack arguments
|
||||||
//
|
//
|
||||||
FNT_Tag code_font = rd_font_from_slot(RD_FontSlot_Code);
|
EV_ViewRuleList *top_level_view_rules = ev_view_rule_list_from_string(scratch.arena, root_view_rule);
|
||||||
String8 eval_view_key_string = push_str8f(scratch.arena, "eval_view_watch_%p", ewv);
|
String8 eval_view_key_string = push_str8f(scratch.arena, "eval_view_watch_%p", ewv);
|
||||||
EV_View *eval_view = rd_ev_view_from_key(d_hash_from_string(eval_view_key_string));
|
EV_View *eval_view = rd_ev_view_from_key(d_hash_from_string(eval_view_key_string));
|
||||||
String8 filter = rd_view_filter();
|
String8 filter = rd_view_filter();
|
||||||
@@ -971,10 +970,35 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
RD_EntityKind mutable_entity_kind = RD_EntityKind_Nil;
|
RD_EntityKind mutable_entity_kind = RD_EntityKind_Nil;
|
||||||
F32 row_string_max_size_px = dim_2f32(rect).x;
|
F32 row_string_max_size_px = dim_2f32(rect).x;
|
||||||
|
|
||||||
|
//////////////////////////////
|
||||||
|
//- rjf: root-level view rule which has a ui hook? call into that to build the UI
|
||||||
|
//
|
||||||
|
B32 is_top_level_hook = 0;
|
||||||
|
{
|
||||||
|
RD_ViewRuleInfo *hook_rule_info = 0;
|
||||||
|
MD_Node *hook_rule_root = &md_nil_node;
|
||||||
|
for(EV_ViewRuleNode *n = top_level_view_rules->first; n != 0; n = n->next)
|
||||||
|
{
|
||||||
|
RD_ViewRuleInfo *rule_info = rd_view_rule_info_from_string(n->v.root->string);
|
||||||
|
if(rule_info != &rd_nil_view_rule_info && rule_info->ui != 0)
|
||||||
|
{
|
||||||
|
hook_rule_info = rule_info;
|
||||||
|
hook_rule_root = n->v.root;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(hook_rule_info)
|
||||||
|
{
|
||||||
|
hook_rule_info->ui(root_expr, hook_rule_root, rect);
|
||||||
|
is_top_level_hook = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- rjf: determine autocompletion string
|
//- rjf: determine autocompletion string
|
||||||
//
|
//
|
||||||
String8 autocomplete_hint_string = {0};
|
String8 autocomplete_hint_string = {0};
|
||||||
|
if(!is_top_level_hook)
|
||||||
{
|
{
|
||||||
for(UI_Event *evt = 0; ui_next_event(&evt);)
|
for(UI_Event *evt = 0; ui_next_event(&evt);)
|
||||||
{
|
{
|
||||||
@@ -1001,13 +1025,12 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
};
|
};
|
||||||
U64 frame_rows_count = 0;
|
U64 frame_rows_count = 0;
|
||||||
FrameRow *frame_rows = 0;
|
FrameRow *frame_rows = 0;
|
||||||
EV_ViewRuleList *top_level_view_rules = ev_view_rule_list_from_string(scratch.arena, root_view_rule);
|
|
||||||
EV_BlockList blocks = {0};
|
EV_BlockList blocks = {0};
|
||||||
UI_ScrollListRowBlockArray row_blocks = {0};
|
UI_ScrollListRowBlockArray row_blocks = {0};
|
||||||
Vec2S64 cursor_tbl = {0};
|
Vec2S64 cursor_tbl = {0};
|
||||||
Vec2S64 mark_tbl = {0};
|
Vec2S64 mark_tbl = {0};
|
||||||
Rng2S64 selection_tbl = {0};
|
Rng2S64 selection_tbl = {0};
|
||||||
UI_Focus(UI_FocusKind_On)
|
if(!is_top_level_hook) UI_Focus(UI_FocusKind_On)
|
||||||
{
|
{
|
||||||
B32 state_dirty = 1;
|
B32 state_dirty = 1;
|
||||||
B32 snap_to_cursor = 0;
|
B32 snap_to_cursor = 0;
|
||||||
@@ -1393,7 +1416,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
//
|
//
|
||||||
EV_Key empty_row_parent_key = ev_key_make(max_U64, max_U64);
|
EV_Key empty_row_parent_key = ev_key_make(max_U64, max_U64);
|
||||||
EV_Key empty_row_key = ev_key_make(ev_hash_from_key(empty_row_parent_key), 1);
|
EV_Key empty_row_key = ev_key_make(ev_hash_from_key(empty_row_parent_key), 1);
|
||||||
if(state_dirty && modifiable)
|
if(state_dirty && modifiable && filter.size == 0)
|
||||||
{
|
{
|
||||||
EV_Block *b = ev_block_begin(scratch.arena, EV_BlockKind_Null, empty_row_parent_key, empty_row_key, 0);
|
EV_Block *b = ev_block_begin(scratch.arena, EV_BlockKind_Null, empty_row_parent_key, empty_row_key, 0);
|
||||||
b->visual_idx_range = b->semantic_idx_range = r1u64(0, 1);
|
b->visual_idx_range = b->semantic_idx_range = r1u64(0, 1);
|
||||||
@@ -1591,7 +1614,6 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
//
|
//
|
||||||
if(!ewv->text_editing && evt->slot == UI_EventActionSlot_Accept)
|
if(!ewv->text_editing && evt->slot == UI_EventActionSlot_Accept)
|
||||||
{
|
{
|
||||||
taken = 1;
|
|
||||||
EV_WindowedRowList rows = ev_windowed_row_list_from_block_list(scratch.arena, eval_view, r1s64(ui_scroll_list_row_from_item(&row_blocks, selection_tbl.min.y-1),
|
EV_WindowedRowList rows = ev_windowed_row_list_from_block_list(scratch.arena, eval_view, r1s64(ui_scroll_list_row_from_item(&row_blocks, selection_tbl.min.y-1),
|
||||||
ui_scroll_list_row_from_item(&row_blocks, selection_tbl.max.y-1)+1), &blocks);
|
ui_scroll_list_row_from_item(&row_blocks, selection_tbl.max.y-1)+1), &blocks);
|
||||||
EV_Row *row = rows.first;
|
EV_Row *row = rows.first;
|
||||||
@@ -1601,6 +1623,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
{
|
{
|
||||||
B32 is_expanded = ev_expansion_from_key(eval_view, row->key);
|
B32 is_expanded = ev_expansion_from_key(eval_view, row->key);
|
||||||
ev_key_set_expansion(eval_view, row->parent_key, row->key, !is_expanded);
|
ev_key_set_expansion(eval_view, row->parent_key, row->key, !is_expanded);
|
||||||
|
taken = 1;
|
||||||
}
|
}
|
||||||
RD_ViewRuleInfo *view_rule_info = &rd_nil_view_rule_info;
|
RD_ViewRuleInfo *view_rule_info = &rd_nil_view_rule_info;
|
||||||
MD_Node *view_rule_params_root = &md_nil_node;
|
MD_Node *view_rule_params_root = &md_nil_node;
|
||||||
@@ -1618,6 +1641,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
rd_cmd(RD_CmdKind_OpenTab,
|
rd_cmd(RD_CmdKind_OpenTab,
|
||||||
.string = e_string_from_expr(scratch.arena, row->expr),
|
.string = e_string_from_expr(scratch.arena, row->expr),
|
||||||
.params_tree = view_rule_params_root);
|
.params_tree = view_rule_params_root);
|
||||||
|
taken = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1741,7 +1765,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
{
|
{
|
||||||
default:{}break;
|
default:{}break;
|
||||||
case RD_WatchViewColumnKind_Expr:
|
case RD_WatchViewColumnKind_Expr:
|
||||||
if(modifiable)
|
if(modifiable && filter.size == 0)
|
||||||
{
|
{
|
||||||
RD_WatchViewPoint pt = rd_watch_view_point_from_tbl(&blocks, tbl);
|
RD_WatchViewPoint pt = rd_watch_view_point_from_tbl(&blocks, tbl);
|
||||||
RD_Entity *watch = rd_entity_from_ev_key_and_kind(pt.key, mutable_entity_kind);
|
RD_Entity *watch = rd_entity_from_ev_key_and_kind(pt.key, mutable_entity_kind);
|
||||||
@@ -2063,6 +2087,9 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- rjf: build ui
|
//- rjf: build ui
|
||||||
//
|
//
|
||||||
|
B32 pressed = 0;
|
||||||
|
if(!is_top_level_hook)
|
||||||
|
{
|
||||||
F32 **col_pcts = push_array(scratch.arena, F32*, ewv->column_count);
|
F32 **col_pcts = push_array(scratch.arena, F32*, ewv->column_count);
|
||||||
{
|
{
|
||||||
S64 x = 0;
|
S64 x = 0;
|
||||||
@@ -2071,7 +2098,6 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
col_pcts[x] = &c->pct;
|
col_pcts[x] = &c->pct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
B32 pressed = 0;
|
|
||||||
Rng1S64 visible_row_rng = {0};
|
Rng1S64 visible_row_rng = {0};
|
||||||
UI_ScrollListParams scroll_list_params = {0};
|
UI_ScrollListParams scroll_list_params = {0};
|
||||||
{
|
{
|
||||||
@@ -2285,8 +2311,17 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
if(row->block_kind == EV_BlockKind_Canvas)
|
if(row->block_kind == EV_BlockKind_Canvas)
|
||||||
UI_Parent(row_box) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
UI_Parent(row_box) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||||
{
|
{
|
||||||
//- rjf: build canvas row contents
|
//- rjf: build button row contents
|
||||||
if(ui_view_rule_info->ui != 0)
|
if(ui_view_rule_info == &rd_nil_view_rule_info)
|
||||||
|
{
|
||||||
|
if(ui_clicked(rd_icon_buttonf(RD_IconKind_Add, 0, "Add New Target")))
|
||||||
|
{
|
||||||
|
rd_cmd(RD_CmdKind_RunCommand, .string = rd_cmd_kind_info_table[RD_CmdKind_AddTarget].string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//- rjf: build ui hook row contents
|
||||||
|
if(ui_view_rule_info != &rd_nil_view_rule_info && ui_view_rule_info->ui != 0)
|
||||||
{
|
{
|
||||||
//- rjf: unpack
|
//- rjf: unpack
|
||||||
RD_WatchViewPoint pt = {0, row->parent_key, row->key};
|
RD_WatchViewPoint pt = {0, row->parent_key, row->key};
|
||||||
@@ -2453,7 +2488,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
default:{}break;
|
default:{}break;
|
||||||
case RD_WatchViewColumnKind_Expr:
|
case RD_WatchViewColumnKind_Expr:
|
||||||
{
|
{
|
||||||
cell_can_edit = (row->depth == 0 && modifiable);
|
cell_can_edit = (row->depth == 0 && modifiable && filter.size == 0);
|
||||||
if(filter.size != 0)
|
if(filter.size != 0)
|
||||||
{
|
{
|
||||||
cell_matches = fuzzy_match_find(scratch.arena, filter, ev_expr_string_from_row(scratch.arena, row));
|
cell_matches = fuzzy_match_find(scratch.arena, filter, ev_expr_string_from_row(scratch.arena, row));
|
||||||
@@ -2878,16 +2913,17 @@ rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- rjf: general table-wide press logic
|
//- rjf: general table-wide press logic
|
||||||
//
|
//
|
||||||
if(pressed)
|
if(!is_top_level_hook) if(pressed)
|
||||||
{
|
{
|
||||||
rd_cmd(RD_CmdKind_FocusPanel);
|
rd_cmd(RD_CmdKind_FocusPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
rd_store_view_scroll_pos(scroll_pos);
|
if(!is_top_level_hook) { rd_store_view_scroll_pos(scroll_pos); }
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
fzy_scope_close(fzy_scope);
|
fzy_scope_close(fzy_scope);
|
||||||
di_scope_close(di_scope);
|
di_scope_close(di_scope);
|
||||||
@@ -4996,7 +5032,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(targets)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Breakpoints);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.25f, .string = str8_lit("label.str"), .display_string = str8_lit("Label"), .dequote_string = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.25f, .string = str8_lit("label.str"), .display_string = str8_lit("Label"), .dequote_string = 1);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.35f, .string = str8_lit("exe.str"), .display_string = str8_lit("Executable"), .dequote_string = 1, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.35f, .string = str8_lit("exe.str"), .display_string = str8_lit("Executable"), .dequote_string = 1, .is_non_code = 1);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.20f, .string = str8_lit("args.str"), .display_string = str8_lit("Arguments"), .dequote_string = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.20f, .string = str8_lit("args.str"), .display_string = str8_lit("Arguments"), .dequote_string = 1);
|
||||||
@@ -5506,7 +5542,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(breakpoints)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Breakpoints);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.25f, .string = str8_lit("label.str"), .display_string = str8_lit("Label"), .dequote_string = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.25f, .string = str8_lit("label.str"), .display_string = str8_lit("Label"), .dequote_string = 1);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.35f, .string = str8_lit("location.str"), .display_string = str8_lit("Location"), .dequote_string = 1, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.35f, .string = str8_lit("location.str"), .display_string = str8_lit("Location"), .dequote_string = 1, .is_non_code = 1);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.20f, .string = str8_lit("condition.str"),.display_string = str8_lit("Condition"), .dequote_string = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.20f, .string = str8_lit("condition.str"),.display_string = str8_lit("Condition"), .dequote_string = 1);
|
||||||
@@ -5526,7 +5562,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(watch_pins)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_WatchPins);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.5f, .string = str8_lit("Label"), .dequote_string = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.5f, .string = str8_lit("Label"), .dequote_string = 1);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.5f, .string = str8_lit("Location"), .dequote_string = 1, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.5f, .string = str8_lit("Location"), .dequote_string = 1, .is_non_code = 1);
|
||||||
}
|
}
|
||||||
@@ -5767,7 +5803,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(call_stack)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_CallStack);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_FrameSelection, 0.05f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_FrameSelection, 0.05f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.7f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.7f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Module, 0.25f, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Module, 0.25f, .is_non_code = 1);
|
||||||
@@ -5785,7 +5821,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(modules)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Breakpoints);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.20f, .string = str8_lit("label.str"), .display_string = str8_lit("Name"), .dequote_string = 1, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.20f, .string = str8_lit("label.str"), .display_string = str8_lit("Name"), .dequote_string = 1, .is_non_code = 1);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.30f, .string = str8_lit("exe.str"), .display_string = str8_lit("Executable Path"), .dequote_string = 1, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.30f, .string = str8_lit("exe.str"), .display_string = str8_lit("Executable Path"), .dequote_string = 1, .is_non_code = 1);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.30f, .string = str8_lit("dbg.str"), .display_string = str8_lit("Debug Info Path"), .dequote_string = 1, .is_non_code = 1);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.30f, .string = str8_lit("dbg.str"), .display_string = str8_lit("Debug Info Path"), .dequote_string = 1, .is_non_code = 1);
|
||||||
@@ -6130,14 +6166,13 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(watch)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Watch);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.30f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.30f);
|
||||||
}
|
}
|
||||||
String8 filter = rd_view_filter();
|
rd_watch_view_build(wv, str8_lit("watches"), str8_lit(""), 1, 10, rect);
|
||||||
rd_watch_view_build(wv, str8_lit("watches"), str8_lit(""), 1 * (filter.size == 0), 10, rect);
|
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6150,7 +6185,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(locals)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Locals);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||||
@@ -6169,7 +6204,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(registers)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Registers);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||||
@@ -6188,7 +6223,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(globals)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Globals);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||||
@@ -6207,7 +6242,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(thread_locals)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_ThreadLocals);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||||
@@ -6226,7 +6261,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(types)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Types);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.25f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.3f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Type, 0.15f);
|
||||||
@@ -6245,7 +6280,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(procedures)
|
|||||||
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
if(!wv->initialized)
|
if(!wv->initialized)
|
||||||
{
|
{
|
||||||
rd_watch_view_init(wv, RD_WatchViewFillKind_Procedures);
|
rd_watch_view_init(wv);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.2f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Expr, 0.2f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.6f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.6f);
|
||||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.2f);
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_ViewRule, 0.2f);
|
||||||
|
|||||||
@@ -81,22 +81,6 @@ struct RD_WatchViewColumn
|
|||||||
B32 dequote_string;
|
B32 dequote_string;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum RD_WatchViewFillKind
|
|
||||||
{
|
|
||||||
RD_WatchViewFillKind_Watch,
|
|
||||||
RD_WatchViewFillKind_Breakpoints,
|
|
||||||
RD_WatchViewFillKind_WatchPins,
|
|
||||||
RD_WatchViewFillKind_CallStack,
|
|
||||||
RD_WatchViewFillKind_Registers,
|
|
||||||
RD_WatchViewFillKind_Locals,
|
|
||||||
RD_WatchViewFillKind_Globals,
|
|
||||||
RD_WatchViewFillKind_ThreadLocals,
|
|
||||||
RD_WatchViewFillKind_Types,
|
|
||||||
RD_WatchViewFillKind_Procedures,
|
|
||||||
RD_WatchViewFillKind_COUNT
|
|
||||||
}
|
|
||||||
RD_WatchViewFillKind;
|
|
||||||
|
|
||||||
typedef struct RD_WatchViewPoint RD_WatchViewPoint;
|
typedef struct RD_WatchViewPoint RD_WatchViewPoint;
|
||||||
struct RD_WatchViewPoint
|
struct RD_WatchViewPoint
|
||||||
{
|
{
|
||||||
@@ -123,9 +107,6 @@ struct RD_WatchViewState
|
|||||||
{
|
{
|
||||||
B32 initialized;
|
B32 initialized;
|
||||||
|
|
||||||
// rjf: fill kinds (way that the contents of the watch view are computed)
|
|
||||||
RD_WatchViewFillKind fill_kind;
|
|
||||||
|
|
||||||
// rjf: column state
|
// rjf: column state
|
||||||
Arena *column_arena;
|
Arena *column_arena;
|
||||||
RD_WatchViewColumn *first_column;
|
RD_WatchViewColumn *first_column;
|
||||||
@@ -176,7 +157,7 @@ internal RD_WatchViewColumn *rd_watch_view_column_alloc_(RD_WatchViewState *wv,
|
|||||||
internal void rd_watch_view_column_release(RD_WatchViewState *wv, RD_WatchViewColumn *col);
|
internal void rd_watch_view_column_release(RD_WatchViewState *wv, RD_WatchViewColumn *col);
|
||||||
|
|
||||||
//- rjf: watch view main hooks
|
//- rjf: watch view main hooks
|
||||||
internal void rd_watch_view_init(RD_WatchViewState *ewv, RD_WatchViewFillKind fill_kind);
|
internal void rd_watch_view_init(RD_WatchViewState *ewv);
|
||||||
internal void rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view_rule, B32 modifiable, U32 default_radix, Rng2F32 rect);
|
internal void rd_watch_view_build(RD_WatchViewState *ewv, String8 root_expr, String8 root_view_rule, B32 modifiable, U32 default_radix, Rng2F32 rect);
|
||||||
|
|
||||||
#endif // RADDBG_VIEWS_H
|
#endif // RADDBG_VIEWS_H
|
||||||
|
|||||||
Reference in New Issue
Block a user