mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-04 12:58:41 +00:00
modules view, watch window style
This commit is contained in:
@@ -184,6 +184,14 @@ read_only global Type B64__type = {TypeKind_B64, sizeof(B64), &type_nil, str8_
|
|||||||
read_only global Type F32__type = {TypeKind_F32, sizeof(F32), &type_nil, str8_lit_comp("F32")};
|
read_only global Type F32__type = {TypeKind_F32, sizeof(F32), &type_nil, str8_lit_comp("F32")};
|
||||||
read_only global Type F64__type = {TypeKind_F64, sizeof(F64), &type_nil, str8_lit_comp("F64")};
|
read_only global Type F64__type = {TypeKind_F64, sizeof(F64), &type_nil, str8_lit_comp("F64")};
|
||||||
|
|
||||||
|
//- rjf: Rng1U64
|
||||||
|
struct_members(Rng1U64)
|
||||||
|
{
|
||||||
|
member_lit_comp(Rng1U64, type(U64), min),
|
||||||
|
member_lit_comp(Rng1U64, type(U64), max),
|
||||||
|
};
|
||||||
|
struct_type(Rng1U64);
|
||||||
|
|
||||||
//- rjf: String8
|
//- rjf: String8
|
||||||
Type String8__str_ptr_type = {TypeKind_Ptr, sizeof(void *), type(U8), {0}, str8_lit_comp("size")};
|
Type String8__str_ptr_type = {TypeKind_Ptr, sizeof(void *), type(U8), {0}, str8_lit_comp("size")};
|
||||||
Member String8__members[] =
|
Member String8__members[] =
|
||||||
|
|||||||
@@ -49,9 +49,11 @@ X(B32, enabled)\
|
|||||||
X(B32, frozen)\
|
X(B32, frozen)\
|
||||||
X(U64, hit_count)\
|
X(U64, hit_count)\
|
||||||
X(U64, id)\
|
X(U64, id)\
|
||||||
|
X(Rng1U64, vaddr_range)\
|
||||||
X(U32, color)\
|
X(U32, color)\
|
||||||
X(String8, label)\
|
X(String8, label)\
|
||||||
X(String8, exe)\
|
X(String8, exe)\
|
||||||
|
X(String8, dbg)\
|
||||||
X(String8, args)\
|
X(String8, args)\
|
||||||
X(String8, working_directory)\
|
X(String8, working_directory)\
|
||||||
X(String8, entry_point)\
|
X(String8, entry_point)\
|
||||||
|
|||||||
@@ -1902,10 +1902,11 @@ rd_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range)
|
|||||||
CTRL_Entity *entity = rd_ctrl_entity_from_eval_space(space);
|
CTRL_Entity *entity = rd_ctrl_entity_from_eval_space(space);
|
||||||
|
|
||||||
// rjf: produce meta evaluation
|
// rjf: produce meta evaluation
|
||||||
meval->frozen = entity->is_frozen;
|
meval->frozen = entity->is_frozen;
|
||||||
meval->color = entity->rgba;
|
meval->vaddr_range = entity->vaddr_range;
|
||||||
meval->label = entity->string;
|
meval->color = entity->rgba;
|
||||||
meval->id = entity->id;
|
meval->label = entity->string;
|
||||||
|
meval->id = entity->id;
|
||||||
if(entity->kind == CTRL_EntityKind_Thread)
|
if(entity->kind == CTRL_EntityKind_Thread)
|
||||||
{
|
{
|
||||||
DI_Scope *di_scope = di_scope_open();
|
DI_Scope *di_scope = di_scope_open();
|
||||||
@@ -1928,6 +1929,13 @@ rd_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range)
|
|||||||
}
|
}
|
||||||
di_scope_close(di_scope);
|
di_scope_close(di_scope);
|
||||||
}
|
}
|
||||||
|
if(entity->kind == CTRL_EntityKind_Module)
|
||||||
|
{
|
||||||
|
DI_Key dbgi_key = ctrl_dbgi_key_from_module(entity);
|
||||||
|
meval->label = str8_skip_last_slash(entity->string);
|
||||||
|
meval->exe = path_normalized_from_string(scratch.arena, entity->string);
|
||||||
|
meval->dbg = path_normalized_from_string(scratch.arena, dbgi_key.path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rjf: debugger entity -> produce meta eval
|
// rjf: debugger entity -> produce meta eval
|
||||||
|
|||||||
@@ -817,6 +817,12 @@ internal String8
|
|||||||
rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_WatchViewColumn *col, B32 editable, U32 default_radix, FNT_Tag font, F32 font_size, F32 max_size_px)
|
rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_WatchViewColumn *col, B32 editable, U32 default_radix, FNT_Tag font, F32 font_size, F32 max_size_px)
|
||||||
{
|
{
|
||||||
String8 result = {0};
|
String8 result = {0};
|
||||||
|
EV_ViewRuleList *view_rules = row->view_rules;
|
||||||
|
if(col->view_rule_size != 0)
|
||||||
|
{
|
||||||
|
view_rules = ev_view_rule_list_copy(arena, row->view_rules);
|
||||||
|
ev_view_rule_list_push_string(arena, view_rules, str8(col->view_rule_buffer, col->view_rule_size));
|
||||||
|
}
|
||||||
switch(col->kind)
|
switch(col->kind)
|
||||||
{
|
{
|
||||||
default:{}break;
|
default:{}break;
|
||||||
@@ -827,7 +833,7 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
|
|||||||
case RD_WatchViewColumnKind_Value:
|
case RD_WatchViewColumnKind_Value:
|
||||||
{
|
{
|
||||||
E_Eval eval = e_eval_from_expr(arena, row->expr);
|
E_Eval eval = e_eval_from_expr(arena, row->expr);
|
||||||
result = rd_value_string_from_eval(arena, !editable * EV_StringFlag_ReadOnlyDisplayRules, default_radix, font, font_size, max_size_px, eval, row->member, row->view_rules);
|
result = rd_value_string_from_eval(arena, !editable * EV_StringFlag_ReadOnlyDisplayRules, default_radix, font, font_size, max_size_px, eval, row->member, view_rules);
|
||||||
}break;
|
}break;
|
||||||
case RD_WatchViewColumnKind_Type:
|
case RD_WatchViewColumnKind_Type:
|
||||||
{
|
{
|
||||||
@@ -858,7 +864,7 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
|
|||||||
expr = e_expr_ref_member_access(arena, expr, n->string);
|
expr = e_expr_ref_member_access(arena, expr, n->string);
|
||||||
}
|
}
|
||||||
E_Eval eval = e_eval_from_expr(arena, expr);
|
E_Eval eval = e_eval_from_expr(arena, expr);
|
||||||
result = rd_value_string_from_eval(arena, !editable * EV_StringFlag_ReadOnlyDisplayRules, default_radix, font, font_size, max_size_px, eval, row->member, row->view_rules);
|
result = rd_value_string_from_eval(arena, !editable * EV_StringFlag_ReadOnlyDisplayRules, default_radix, font, font_size, max_size_px, eval, row->member, view_rules);
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
@@ -868,6 +874,7 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
|
|||||||
result.str[result.size-1] == '"')
|
result.str[result.size-1] == '"')
|
||||||
{
|
{
|
||||||
result = str8_skip(str8_chop(result, 1), 1);
|
result = str8_skip(str8_chop(result, 1), 1);
|
||||||
|
result = raw_from_escaped_str8(arena, result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -4983,6 +4990,24 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(target)
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: targets @view_hook_impl
|
//~ rjf: targets @view_hook_impl
|
||||||
|
|
||||||
|
RD_VIEW_RULE_UI_FUNCTION_DEF(targets)
|
||||||
|
{
|
||||||
|
ProfBeginFunction();
|
||||||
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
|
if(!wv->initialized)
|
||||||
|
{
|
||||||
|
rd_watch_view_init(wv, RD_WatchViewFillKind_Breakpoints);
|
||||||
|
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.20f, .string = str8_lit("args.str"), .display_string = str8_lit("Arguments"), .dequote_string = 1);
|
||||||
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.10f, .string = str8_lit("working_directory.str"), .display_string = str8_lit("Working Directory "), .dequote_string = 1, .is_non_code = 1);
|
||||||
|
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Member, 0.10f, .string = str8_lit("entry_point.str"), .display_string = str8_lit("Custom Entry Point"), .dequote_string = 1);
|
||||||
|
}
|
||||||
|
rd_watch_view_build(wv, str8_lit("targets"), str8_lit(""), 0, 10, rect);
|
||||||
|
ProfEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0 // TODO(rjf): @msgs
|
||||||
RD_VIEW_RULE_UI_FUNCTION_DEF(targets)
|
RD_VIEW_RULE_UI_FUNCTION_DEF(targets)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
@@ -5131,6 +5156,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(targets)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: file_path_map @view_hook_impl
|
//~ rjf: file_path_map @view_hook_impl
|
||||||
@@ -5753,6 +5779,22 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(call_stack)
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: modules @view_hook_impl
|
//~ rjf: modules @view_hook_impl
|
||||||
|
|
||||||
|
RD_VIEW_RULE_UI_FUNCTION_DEF(modules)
|
||||||
|
{
|
||||||
|
ProfBeginFunction();
|
||||||
|
RD_WatchViewState *wv = rd_view_state(RD_WatchViewState);
|
||||||
|
if(!wv->initialized)
|
||||||
|
{
|
||||||
|
rd_watch_view_init(wv, RD_WatchViewFillKind_Breakpoints);
|
||||||
|
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("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.20f, .string = str8_lit("vaddr_range"), .display_string = str8_lit("Address Range"), .view_rule = str8_lit("hex"));
|
||||||
|
}
|
||||||
|
rd_watch_view_build(wv, str8_lit("modules"), str8_lit(""), 0, 10, rect);
|
||||||
|
ProfEnd();
|
||||||
|
}
|
||||||
|
|
||||||
#if 0 // TODO(rjf): @msgs
|
#if 0 // TODO(rjf): @msgs
|
||||||
typedef struct RD_ModulesViewState RD_ModulesViewState;
|
typedef struct RD_ModulesViewState RD_ModulesViewState;
|
||||||
struct RD_ModulesViewState
|
struct RD_ModulesViewState
|
||||||
@@ -5771,11 +5813,9 @@ struct RD_ModulesViewState
|
|||||||
F32 range_col_pct;
|
F32 range_col_pct;
|
||||||
F32 dbg_col_pct;
|
F32 dbg_col_pct;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
RD_VIEW_RULE_UI_FUNCTION_DEF(modules)
|
RD_VIEW_RULE_UI_FUNCTION_DEF(modules)
|
||||||
{
|
{
|
||||||
#if 0 // TODO(rjf): @msgs
|
|
||||||
RD_ModulesViewState *mv = rd_view_state(RD_ModulesViewState);
|
RD_ModulesViewState *mv = rd_view_state(RD_ModulesViewState);
|
||||||
if(mv->initialized == 0)
|
if(mv->initialized == 0)
|
||||||
{
|
{
|
||||||
@@ -5785,8 +5825,6 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(modules)
|
|||||||
mv->range_col_pct = 0.30f;
|
mv->range_col_pct = 0.30f;
|
||||||
mv->dbg_col_pct = 0.50f;
|
mv->dbg_col_pct = 0.50f;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#if 0 // TODO(rjf): @msgs
|
|
||||||
RD_ModulesViewState *mv = rd_view_state(RD_ModulesViewState);
|
RD_ModulesViewState *mv = rd_view_state(RD_ModulesViewState);
|
||||||
for(RD_Cmd *cmd = 0; rd_next_cmd(&cmd);)
|
for(RD_Cmd *cmd = 0; rd_next_cmd(&cmd);)
|
||||||
{
|
{
|
||||||
@@ -5816,8 +5854,6 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(modules)
|
|||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#if 0 // TODO(rjf): @msgs
|
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Temp scratch = scratch_begin(0, 0);
|
Temp scratch = scratch_begin(0, 0);
|
||||||
DI_Scope *scope = di_scope_open();
|
DI_Scope *scope = di_scope_open();
|
||||||
@@ -6082,8 +6118,8 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(modules)
|
|||||||
di_scope_close(scope);
|
di_scope_close(scope);
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: watch @view_hook_impl
|
//~ rjf: watch @view_hook_impl
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ typedef enum RD_WatchViewColumnKind
|
|||||||
RD_WatchViewColumnKind_Type,
|
RD_WatchViewColumnKind_Type,
|
||||||
RD_WatchViewColumnKind_ViewRule,
|
RD_WatchViewColumnKind_ViewRule,
|
||||||
RD_WatchViewColumnKind_Module,
|
RD_WatchViewColumnKind_Module,
|
||||||
RD_WatchViewColumnKind_FrameSelection,
|
|
||||||
RD_WatchViewColumnKind_Member,
|
RD_WatchViewColumnKind_Member,
|
||||||
|
RD_WatchViewColumnKind_FrameSelection,
|
||||||
RD_WatchViewColumnKind_COUNT
|
RD_WatchViewColumnKind_COUNT
|
||||||
}
|
}
|
||||||
RD_WatchViewColumnKind;
|
RD_WatchViewColumnKind;
|
||||||
|
|||||||
Reference in New Issue
Block a user