mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-15 08:32:22 -07:00
organization pass & straightening some things out before entity simplification/replacement
This commit is contained in:
@@ -1685,7 +1685,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
|
||||
MTX_Op op = {r1u64(0, 0xffffffffffffffffull), str8_lit("[new session]\n")};
|
||||
mtx_push_op(d_state->output_log_key, op);
|
||||
#if 0 // TODO(rjf): @msgs
|
||||
RD_EntityList bps = d_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
RD_EntityList bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
for(RD_EntityNode *n = bps.first; n != 0; n = n->next)
|
||||
{
|
||||
n->entity->u64 = 0;
|
||||
@@ -1719,7 +1719,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
|
||||
|
||||
// rjf: find any pending thread names correllating with this TID -> equip name if found match
|
||||
{
|
||||
RD_EntityList pending_thread_names = d_query_cached_entity_list_with_kind(RD_EntityKind_PendingThreadName);
|
||||
RD_EntityList pending_thread_names = rd_query_cached_entity_list_with_kind(RD_EntityKind_PendingThreadName);
|
||||
for(RD_EntityNode *n = pending_thread_names.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *pending_thread_name = n->entity;
|
||||
@@ -1790,7 +1790,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
|
||||
// rjf: is first -> find target, equip process & module & first thread with target color
|
||||
if(is_first)
|
||||
{
|
||||
RD_EntityList targets = d_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
RD_EntityList targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
for(RD_EntityNode *n = targets.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *target = n->entity;
|
||||
@@ -2357,7 +2357,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
|
||||
// rjf: gather targets corresponding to all launched processes
|
||||
RD_EntityList targets = {0};
|
||||
{
|
||||
RD_EntityList processes = d_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
RD_EntityList processes = rd_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
for(RD_EntityNode *n = processes.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *process = n->entity;
|
||||
|
||||
+11
-1
@@ -129,7 +129,7 @@ typedef enum MD_NodeKind
|
||||
}
|
||||
MD_NodeKind;
|
||||
|
||||
typedef U64 MD_NodeFlags;
|
||||
typedef U32 MD_NodeFlags;
|
||||
enum
|
||||
{
|
||||
MD_NodeFlag_MaskSetDelimiters = (0x3F<<0),
|
||||
@@ -182,6 +182,16 @@ struct MD_Node
|
||||
|
||||
// rjf: source code info
|
||||
U64 src_offset;
|
||||
|
||||
// rjf: user-controlled generation number
|
||||
//
|
||||
// (unused by mdesk layer, but can be used by usage code to use MD_Node trees
|
||||
// in a "retained mode" way, where stable generational handles can be formed
|
||||
// to nodes)
|
||||
U64 user_gen;
|
||||
|
||||
// rjf: extra padding to 128 bytes
|
||||
U64 _unused_[2];
|
||||
};
|
||||
|
||||
typedef struct MD_NodeRec MD_NodeRec;
|
||||
|
||||
@@ -290,8 +290,8 @@ RD_CmdKindInfo rd_cmd_kind_info_table[219] =
|
||||
{ str8_lit_comp("open_window"), str8_lit_comp("Opens a new window."), str8_lit_comp(""), str8_lit_comp("Open New Window"), RD_IconKind_Window, (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("close_window"), str8_lit_comp("Closes an opened window."), str8_lit_comp(""), str8_lit_comp("Close Window"), RD_IconKind_Window, (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("toggle_fullscreen"), str8_lit_comp("Toggles fullscreen view on the active window."), str8_lit_comp(""), str8_lit_comp("Toggle Fullscreen"), RD_IconKind_Window, (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("confirm_accept"), str8_lit_comp("Accepts the active confirmation prompt."), str8_lit_comp(""), str8_lit_comp("Confirm Accept"), RD_IconKind_Null, (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("confirm_cancel"), str8_lit_comp("Cancels the active confirmation prompt."), str8_lit_comp(""), str8_lit_comp("Confirm Cancel"), RD_IconKind_Null, (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("popup_accept"), str8_lit_comp("Accepts the active popup prompt."), str8_lit_comp(""), str8_lit_comp("Popup Accept"), RD_IconKind_Null, (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("popup_cancel"), str8_lit_comp("Cancels the active popup prompt."), str8_lit_comp(""), str8_lit_comp("Popup Cancel"), RD_IconKind_Null, (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("reset_to_default_panels"), str8_lit_comp("Resets the window to the default panel layout."), str8_lit_comp("panel"), str8_lit_comp("Reset To Default Panel Layout"), RD_IconKind_Window, (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("reset_to_compact_panels"), str8_lit_comp("Resets the window to the compact panel layout."), str8_lit_comp("panel"), str8_lit_comp("Reset To Compact Panel Layout"), RD_IconKind_Window, (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
{ str8_lit_comp("new_panel_left"), str8_lit_comp("Creates a new panel to the left of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Left"), RD_IconKind_XSplit, (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), RD_EntityKind_Nil}},
|
||||
|
||||
@@ -135,8 +135,8 @@ RD_CmdKind_DecCodeFontScale,
|
||||
RD_CmdKind_OpenWindow,
|
||||
RD_CmdKind_CloseWindow,
|
||||
RD_CmdKind_ToggleFullscreen,
|
||||
RD_CmdKind_ConfirmAccept,
|
||||
RD_CmdKind_ConfirmCancel,
|
||||
RD_CmdKind_PopupAccept,
|
||||
RD_CmdKind_PopupCancel,
|
||||
RD_CmdKind_ResetToDefaultPanels,
|
||||
RD_CmdKind_ResetToCompactPanels,
|
||||
RD_CmdKind_NewPanelLeft,
|
||||
|
||||
@@ -256,9 +256,9 @@ RD_CmdTable: // | | | |
|
||||
{CloseWindow 1 1 Null null Nil 0 0 0 0 0 0 Window "close_window" "Close Window" "Closes an opened window." "" }
|
||||
{ToggleFullscreen 1 1 Null null Nil 0 0 0 0 0 0 Window "toggle_fullscreen" "Toggle Fullscreen" "Toggles fullscreen view on the active window." "" }
|
||||
|
||||
//- rjf: confirmations
|
||||
{ConfirmAccept 0 1 Null null Nil 0 0 0 0 0 0 Null "confirm_accept" "Confirm Accept" "Accepts the active confirmation prompt." "" }
|
||||
{ConfirmCancel 0 1 Null null Nil 0 0 0 0 0 0 Null "confirm_cancel" "Confirm Cancel" "Cancels the active confirmation prompt." "" }
|
||||
//- rjf: popups
|
||||
{PopupAccept 0 1 Null null Nil 0 0 0 0 0 0 Null "popup_accept" "Popup Accept" "Accepts the active popup prompt." "" }
|
||||
{PopupCancel 0 1 Null null Nil 0 0 0 0 0 0 Null "popup_cancel" "Popup Cancel" "Cancels the active popup prompt." "" }
|
||||
|
||||
//- rjf: panel splitting
|
||||
{ResetToDefaultPanels 1 1 Null null Nil 0 0 0 0 0 0 Window "reset_to_default_panels" "Reset To Default Panel Layout" "Resets the window to the default panel layout." "panel" }
|
||||
|
||||
+64
-64
@@ -1115,7 +1115,7 @@ rd_name_alloc(String8 string)
|
||||
// which is not undoable; the free lists we control, and are thus
|
||||
// trivially undoable)
|
||||
//
|
||||
D_NameChunkNode *node = 0;
|
||||
RD_NameChunkNode *node = 0;
|
||||
for(;node == 0;)
|
||||
{
|
||||
node = rd_state->free_name_chunks[bucket_idx];
|
||||
@@ -1126,8 +1126,8 @@ rd_name_alloc(String8 string)
|
||||
if(bucket_idx == ArrayCount(rd_state->free_name_chunks)-1)
|
||||
{
|
||||
node = 0;
|
||||
D_NameChunkNode *prev = 0;
|
||||
for(D_NameChunkNode *n = rd_state->free_name_chunks[bucket_idx];
|
||||
RD_NameChunkNode *prev = 0;
|
||||
for(RD_NameChunkNode *n = rd_state->free_name_chunks[bucket_idx];
|
||||
n != 0;
|
||||
prev = n, n = n->next)
|
||||
{
|
||||
@@ -1165,7 +1165,7 @@ rd_name_alloc(String8 string)
|
||||
chunk_size = u64_up_to_pow2(string.size);
|
||||
}
|
||||
U8 *chunk_memory = push_array(rd_state->arena, U8, chunk_size);
|
||||
D_NameChunkNode *chunk = (D_NameChunkNode *)chunk_memory;
|
||||
RD_NameChunkNode *chunk = (RD_NameChunkNode *)chunk_memory;
|
||||
SLLStackPush(rd_state->free_name_chunks[bucket_idx], chunk);
|
||||
}
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ rd_name_release(String8 string)
|
||||
{
|
||||
if(string.size == 0) {return;}
|
||||
U64 bucket_idx = rd_name_bucket_idx_from_string_size(string.size);
|
||||
D_NameChunkNode *node = (D_NameChunkNode *)string.str;
|
||||
RD_NameChunkNode *node = (RD_NameChunkNode *)string.str;
|
||||
node->size = u64_up_to_pow2(string.size);
|
||||
SLLStackPush(rd_state->free_name_chunks[bucket_idx], node);
|
||||
}
|
||||
@@ -1500,7 +1500,7 @@ rd_possible_overrides_from_file_path(Arena *arena, String8 file_path)
|
||||
PathStyle pth_style = PathStyle_Relative;
|
||||
String8List pth_parts = path_normalized_list_from_string(scratch.arena, file_path, &pth_style);
|
||||
{
|
||||
RD_EntityList links = d_query_cached_entity_list_with_kind(RD_EntityKind_FilePathMap);
|
||||
RD_EntityList links = rd_query_cached_entity_list_with_kind(RD_EntityKind_FilePathMap);
|
||||
for(RD_EntityNode *n = links.first; n != 0; n = n->next)
|
||||
{
|
||||
//- rjf: unpack link
|
||||
@@ -1665,7 +1665,7 @@ internal RD_Entity *
|
||||
rd_entity_from_name_and_kind(String8 string, RD_EntityKind kind)
|
||||
{
|
||||
RD_Entity *result = &d_nil_entity;
|
||||
RD_EntityList all_of_this_kind = d_query_cached_entity_list_with_kind(kind);
|
||||
RD_EntityList all_of_this_kind = rd_query_cached_entity_list_with_kind(kind);
|
||||
for(RD_EntityNode *n = all_of_this_kind.first; n != 0; n = n->next)
|
||||
{
|
||||
if(str8_match(n->entity->string, string, 0))
|
||||
@@ -2738,13 +2738,13 @@ rd_window_frame(RD_Window *ws)
|
||||
//- rjf: unpack context
|
||||
//
|
||||
B32 window_is_focused = os_window_is_focused(ws->os) || ws->window_temporarily_focused_ipc;
|
||||
B32 confirm_open = rd_state->confirm_active;
|
||||
B32 popup_open = rd_state->popup_active;
|
||||
B32 query_is_open = !rd_view_is_nil(ws->query_view_stack_top);
|
||||
B32 hover_eval_is_open = (!confirm_open &&
|
||||
B32 hover_eval_is_open = (!popup_open &&
|
||||
ws->hover_eval_string.size != 0 &&
|
||||
ws->hover_eval_first_frame_idx+20 < ws->hover_eval_last_frame_idx &&
|
||||
rd_state->frame_index-ws->hover_eval_last_frame_idx < 20);
|
||||
if(!window_is_focused || confirm_open)
|
||||
if(!window_is_focused || popup_open)
|
||||
{
|
||||
ws->menu_bar_key_held = 0;
|
||||
}
|
||||
@@ -3912,19 +3912,19 @@ rd_window_frame(RD_Window *ws)
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: confirmation popup
|
||||
//- rjf: popup
|
||||
//
|
||||
{
|
||||
if(rd_state->confirm_t > 0.005f) UI_TextAlignment(UI_TextAlign_Center) UI_Focus(rd_state->confirm_active ? UI_FocusKind_Root : UI_FocusKind_Off)
|
||||
if(rd_state->popup_t > 0.005f) UI_TextAlignment(UI_TextAlign_Center) UI_Focus(rd_state->popup_active ? UI_FocusKind_Root : UI_FocusKind_Off)
|
||||
{
|
||||
Vec2F32 window_dim = dim_2f32(window_rect);
|
||||
UI_Box *bg_box = &ui_g_nil_box;
|
||||
UI_Palette *palette = ui_build_palette(rd_palette_from_code(RD_PaletteCode_Floating));
|
||||
palette->background.w *= rd_state->confirm_t;
|
||||
palette->background.w *= rd_state->popup_t;
|
||||
UI_Rect(window_rect)
|
||||
UI_ChildLayoutAxis(Axis2_X)
|
||||
UI_Focus(UI_FocusKind_On)
|
||||
UI_BlurSize(10*rd_state->confirm_t)
|
||||
UI_BlurSize(10*rd_state->popup_t)
|
||||
UI_Palette(palette)
|
||||
{
|
||||
bg_box = ui_build_box_from_stringf(UI_BoxFlag_FixedSize|
|
||||
@@ -3934,15 +3934,15 @@ rd_window_frame(RD_Window *ws)
|
||||
UI_BoxFlag_DefaultFocusNav|
|
||||
UI_BoxFlag_DisableFocusOverlay|
|
||||
UI_BoxFlag_DrawBackgroundBlur|
|
||||
UI_BoxFlag_DrawBackground, "###confirm_popup_%p", ws);
|
||||
UI_BoxFlag_DrawBackground, "###popup_%p", ws);
|
||||
}
|
||||
if(rd_state->confirm_active) UI_Parent(bg_box) UI_Transparency(1-rd_state->confirm_t)
|
||||
if(rd_state->popup_active) UI_Parent(bg_box) UI_Transparency(1-rd_state->popup_t)
|
||||
{
|
||||
ui_ctx_menu_close();
|
||||
UI_WidthFill UI_PrefHeight(ui_children_sum(1.f)) UI_Column UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
UI_TextRasterFlags(rd_raster_flags_from_slot(RD_FontSlot_Main)) UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(rd_state->confirm_title);
|
||||
UI_PrefHeight(ui_em(3.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(rd_state->confirm_desc);
|
||||
UI_TextRasterFlags(rd_raster_flags_from_slot(RD_FontSlot_Main)) UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(rd_state->popup_title);
|
||||
UI_PrefHeight(ui_em(3.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(rd_state->popup_desc);
|
||||
ui_spacer(ui_em(1.5f, 1.f));
|
||||
UI_Row UI_Padding(ui_pct(1.f, 0.f)) UI_WidthFill UI_PrefHeight(ui_em(5.f, 1.f))
|
||||
{
|
||||
@@ -3951,13 +3951,13 @@ rd_window_frame(RD_Window *ws)
|
||||
RD_Palette(RD_PaletteCode_NeutralPopButton)
|
||||
if(ui_clicked(ui_buttonf("OK")) || (ui_key_match(bg_box->default_nav_focus_hot_key, ui_key_zero()) && ui_slot_press(UI_EventActionSlot_Accept)))
|
||||
{
|
||||
rd_cmd(RD_CmdKind_ConfirmAccept);
|
||||
rd_cmd(RD_CmdKind_PopupAccept);
|
||||
}
|
||||
UI_CornerRadius10(ui_top_font_size()*0.25f)
|
||||
UI_CornerRadius11(ui_top_font_size()*0.25f)
|
||||
if(ui_clicked(ui_buttonf("Cancel")) || ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
{
|
||||
rd_cmd(RD_CmdKind_ConfirmCancel);
|
||||
rd_cmd(RD_CmdKind_PopupCancel);
|
||||
}
|
||||
}
|
||||
ui_spacer(ui_em(3.f, 1.f));
|
||||
@@ -4503,7 +4503,7 @@ rd_window_frame(RD_Window *ws)
|
||||
Assert(ArrayCount(codepoints) == ArrayCount(cmds));
|
||||
rd_cmd_list_menu_buttons(ArrayCount(cmds), cmds, codepoints);
|
||||
RD_Palette(RD_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f));
|
||||
RD_EntityList targets_list = d_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
RD_EntityList targets_list = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
for(RD_EntityNode *n = targets_list.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *target = n->entity;
|
||||
@@ -4708,7 +4708,7 @@ rd_window_frame(RD_Window *ws)
|
||||
RD_Palette(RD_PaletteCode_NeutralPopButton)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
RD_EntityList tasks = d_query_cached_entity_list_with_kind(RD_EntityKind_ConversionTask);
|
||||
RD_EntityList tasks = rd_query_cached_entity_list_with_kind(RD_EntityKind_ConversionTask);
|
||||
for(RD_EntityNode *n = tasks.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *task = n->entity;
|
||||
@@ -4739,8 +4739,8 @@ rd_window_frame(RD_Window *ws)
|
||||
UI_FontSize(ui_top_font_size()*0.85f)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
RD_EntityList targets = d_push_active_target_list(scratch.arena);
|
||||
RD_EntityList processes = d_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
RD_EntityList targets = rd_push_active_target_list(scratch.arena);
|
||||
RD_EntityList processes = rd_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
B32 have_targets = targets.count != 0;
|
||||
B32 can_send_signal = !d_ctrl_targets_running();
|
||||
B32 can_play = (have_targets && (can_send_signal || d_ctrl_last_run_frame_idx()+4 > rd_state->frame_index));
|
||||
@@ -8531,7 +8531,7 @@ rd_cfg_strings_from_gfx(Arena *arena, String8 root_path, RD_CfgSrc source)
|
||||
continue;
|
||||
}
|
||||
B32 first = 1;
|
||||
RD_EntityList entities = d_query_cached_entity_list_with_kind(k);
|
||||
RD_EntityList entities = rd_query_cached_entity_list_with_kind(k);
|
||||
for(RD_EntityNode *n = entities.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *entity = n->entity;
|
||||
@@ -9199,10 +9199,10 @@ rd_cfg_path_from_src(RD_CfgSrc src)
|
||||
//- rjf: entity cache queries
|
||||
|
||||
internal RD_EntityList
|
||||
d_query_cached_entity_list_with_kind(RD_EntityKind kind)
|
||||
rd_query_cached_entity_list_with_kind(RD_EntityKind kind)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
D_EntityListCache *cache = &rd_state->kind_caches[kind];
|
||||
RD_EntityListCache *cache = &rd_state->kind_caches[kind];
|
||||
|
||||
// rjf: build cached list if we're out-of-date
|
||||
if(cache->alloc_gen != rd_state->kind_alloc_gens[kind])
|
||||
@@ -9223,10 +9223,10 @@ d_query_cached_entity_list_with_kind(RD_EntityKind kind)
|
||||
}
|
||||
|
||||
internal RD_EntityList
|
||||
d_push_active_target_list(Arena *arena)
|
||||
rd_push_active_target_list(Arena *arena)
|
||||
{
|
||||
RD_EntityList active_targets = {0};
|
||||
RD_EntityList all_targets = d_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
RD_EntityList all_targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
for(RD_EntityNode *n = all_targets.first; n != 0; n = n->next)
|
||||
{
|
||||
if(!n->entity->disabled)
|
||||
@@ -9238,10 +9238,10 @@ d_push_active_target_list(Arena *arena)
|
||||
}
|
||||
|
||||
internal RD_Entity *
|
||||
d_entity_from_ev_key_and_kind(EV_Key key, RD_EntityKind kind)
|
||||
rd_entity_from_ev_key_and_kind(EV_Key key, RD_EntityKind kind)
|
||||
{
|
||||
RD_Entity *result = &d_nil_entity;
|
||||
RD_EntityList list = d_query_cached_entity_list_with_kind(kind);
|
||||
RD_EntityList list = rd_query_cached_entity_list_with_kind(kind);
|
||||
for(RD_EntityNode *n = list.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *entity = n->entity;
|
||||
@@ -9497,7 +9497,7 @@ rd_init(CmdLine *cmdln)
|
||||
rd_state->entities_count = 0;
|
||||
rd_state->entities_root = rd_entity_alloc(&d_nil_entity, RD_EntityKind_Root);
|
||||
rd_state->key_map_arena = arena_alloc();
|
||||
rd_state->confirm_arena = arena_alloc();
|
||||
rd_state->popup_arena = arena_alloc();
|
||||
rd_state->view_spec_table_size = 256;
|
||||
rd_state->view_spec_table = push_array(arena, RD_ViewSpec *, rd_state->view_spec_table_size);
|
||||
rd_state->view_rule_spec_table_size = 1024;
|
||||
@@ -9743,7 +9743,7 @@ rd_frame(void)
|
||||
//////////////////////////////
|
||||
//- rjf: bind change
|
||||
//
|
||||
if(!rd_state->confirm_active && rd_state->bind_change_active)
|
||||
if(!rd_state->popup_active && rd_state->bind_change_active)
|
||||
{
|
||||
if(os_key_press(&events, os_handle_zero(), 0, OS_Key_Esc))
|
||||
{
|
||||
@@ -10044,7 +10044,7 @@ rd_frame(void)
|
||||
};
|
||||
for(U64 idx = 0; idx < ArrayCount(evallable_kinds); idx += 1)
|
||||
{
|
||||
RD_EntityList entities = d_query_cached_entity_list_with_kind(evallable_kinds[idx]);
|
||||
RD_EntityList entities = rd_query_cached_entity_list_with_kind(evallable_kinds[idx]);
|
||||
for(RD_EntityNode *n = entities.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *entity = n->entity;
|
||||
@@ -10062,7 +10062,7 @@ rd_frame(void)
|
||||
}
|
||||
|
||||
//- rjf: add macros for all watches which define identifiers
|
||||
RD_EntityList watches = d_query_cached_entity_list_with_kind(RD_EntityKind_Watch);
|
||||
RD_EntityList watches = rd_query_cached_entity_list_with_kind(RD_EntityKind_Watch);
|
||||
for(RD_EntityNode *n = watches.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *watch = n->entity;
|
||||
@@ -10223,19 +10223,19 @@ rd_frame(void)
|
||||
// get confirmation from user
|
||||
CTRL_EntityList processes = ctrl_entity_list_from_kind(d_state->ctrl_entity_store, CTRL_EntityKind_Process);
|
||||
UI_Key key = ui_key_from_string(ui_key_zero(), str8_lit("lossy_exit_confirmation"));
|
||||
if(processes.count != 0 && !rd_regs()->force_confirm && !ui_key_match(rd_state->confirm_key, key))
|
||||
if(processes.count != 0 && !rd_regs()->force_confirm && !ui_key_match(rd_state->popup_key, key))
|
||||
{
|
||||
rd_state->confirm_key = key;
|
||||
rd_state->confirm_active = 1;
|
||||
arena_clear(rd_state->confirm_arena);
|
||||
MemoryZeroStruct(&rd_state->confirm_cmds);
|
||||
rd_state->confirm_title = push_str8f(rd_state->confirm_arena, "Are you sure you want to exit?");
|
||||
rd_state->confirm_desc = push_str8f(rd_state->confirm_arena, "The debugger is still attached to %slive process%s.",
|
||||
processes.count == 1 ? "a " : "",
|
||||
processes.count == 1 ? "" : "es");
|
||||
rd_state->popup_key = key;
|
||||
rd_state->popup_active = 1;
|
||||
arena_clear(rd_state->popup_arena);
|
||||
MemoryZeroStruct(&rd_state->popup_cmds);
|
||||
rd_state->popup_title = push_str8f(rd_state->popup_arena, "Are you sure you want to exit?");
|
||||
rd_state->popup_desc = push_str8f(rd_state->popup_arena, "The debugger is still attached to %slive process%s.",
|
||||
processes.count == 1 ? "a " : "",
|
||||
processes.count == 1 ? "" : "es");
|
||||
RD_Regs *regs = rd_regs_copy(rd_frame_arena(), rd_regs());
|
||||
regs->force_confirm = 1;
|
||||
rd_cmd_list_push_new(rd_state->confirm_arena, &rd_state->confirm_cmds, rd_cmd_kind_info_table[RD_CmdKind_Exit].string, regs);
|
||||
rd_cmd_list_push_new(rd_state->popup_arena, &rd_state->popup_cmds, rd_cmd_kind_info_table[RD_CmdKind_Exit].string, regs);
|
||||
}
|
||||
|
||||
// rjf: otherwise, actually exit
|
||||
@@ -10307,19 +10307,19 @@ rd_frame(void)
|
||||
}break;
|
||||
|
||||
//- rjf: confirmations
|
||||
case RD_CmdKind_ConfirmAccept:
|
||||
case RD_CmdKind_PopupAccept:
|
||||
{
|
||||
rd_state->confirm_active = 0;
|
||||
rd_state->confirm_key = ui_key_zero();
|
||||
for(RD_CmdNode *n = rd_state->confirm_cmds.first; n != 0; n = n->next)
|
||||
rd_state->popup_active = 0;
|
||||
rd_state->popup_key = ui_key_zero();
|
||||
for(RD_CmdNode *n = rd_state->popup_cmds.first; n != 0; n = n->next)
|
||||
{
|
||||
rd_push_cmd(n->cmd.name, n->cmd.regs);
|
||||
}
|
||||
}break;
|
||||
case RD_CmdKind_ConfirmCancel:
|
||||
case RD_CmdKind_PopupCancel:
|
||||
{
|
||||
rd_state->confirm_active = 0;
|
||||
rd_state->confirm_key = ui_key_zero();
|
||||
rd_state->popup_active = 0;
|
||||
rd_state->popup_key = ui_key_zero();
|
||||
}break;
|
||||
|
||||
//- rjf: config path saving/loading/applying
|
||||
@@ -10500,7 +10500,7 @@ rd_frame(void)
|
||||
//- rjf: keep track of recent projects
|
||||
if(src == RD_CfgSrc_Project)
|
||||
{
|
||||
RD_EntityList recent_projects = d_query_cached_entity_list_with_kind(RD_EntityKind_RecentProject);
|
||||
RD_EntityList recent_projects = rd_query_cached_entity_list_with_kind(RD_EntityKind_RecentProject);
|
||||
RD_Entity *recent_project = &d_nil_entity;
|
||||
for(RD_EntityNode *n = recent_projects.first; n != 0; n = n->next)
|
||||
{
|
||||
@@ -10525,7 +10525,7 @@ rd_frame(void)
|
||||
RD_EntityKindFlags k_flags = rd_entity_kind_flags_table[k];
|
||||
if(k_flags & RD_EntityKindFlag_IsSerializedToConfig)
|
||||
{
|
||||
RD_EntityList entities = d_query_cached_entity_list_with_kind(k);
|
||||
RD_EntityList entities = rd_query_cached_entity_list_with_kind(k);
|
||||
for(RD_EntityNode *n = entities.first; n != 0; n = n->next)
|
||||
{
|
||||
if(n->entity->cfg_src == src)
|
||||
@@ -12580,7 +12580,7 @@ rd_frame(void)
|
||||
// rjf: try to find root folder as if it's inside of a path we've already loaded
|
||||
if(rd_entity_is_nil(root_folder))
|
||||
{
|
||||
RD_EntityList all_files = d_query_cached_entity_list_with_kind(RD_EntityKind_File);
|
||||
RD_EntityList all_files = rd_query_cached_entity_list_with_kind(RD_EntityKind_File);
|
||||
for(RD_EntityNode *n = all_files.first; n != 0; n = n->next)
|
||||
{
|
||||
if(n->entity->flags & RD_EntityFlag_IsFolder)
|
||||
@@ -13239,7 +13239,7 @@ rd_frame(void)
|
||||
B32 removed_already_existing = 0;
|
||||
if(kind == RD_CmdKind_ToggleBreakpoint)
|
||||
{
|
||||
RD_EntityList bps = d_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
RD_EntityList bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
for(RD_EntityNode *n = bps.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *bp = n->entity;
|
||||
@@ -13291,7 +13291,7 @@ rd_frame(void)
|
||||
B32 removed_already_existing = 0;
|
||||
if(kind == RD_CmdKind_ToggleWatchPin)
|
||||
{
|
||||
RD_EntityList wps = d_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
|
||||
RD_EntityList wps = rd_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
|
||||
for(RD_EntityNode *n = wps.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *wp = n->entity;
|
||||
@@ -13451,7 +13451,7 @@ rd_frame(void)
|
||||
RD_Entity *entity = rd_entity_from_handle(rd_regs()->entity);
|
||||
if(entity->kind == RD_EntityKind_Target)
|
||||
{
|
||||
RD_EntityList all_targets = d_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
RD_EntityList all_targets = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
B32 is_selected = !entity->disabled;
|
||||
for(RD_EntityNode *n = all_targets.first; n != 0; n = n->next)
|
||||
{
|
||||
@@ -14056,7 +14056,7 @@ rd_frame(void)
|
||||
//
|
||||
D_TargetArray targets = {0};
|
||||
{
|
||||
RD_EntityList target_entities = d_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
RD_EntityList target_entities = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
targets.count = target_entities.count;
|
||||
targets.v = push_array(scratch.arena, D_Target, targets.count);
|
||||
U64 idx = 0;
|
||||
@@ -14080,7 +14080,7 @@ rd_frame(void)
|
||||
//
|
||||
D_BreakpointArray breakpoints = {0};
|
||||
{
|
||||
RD_EntityList bp_entities = d_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
RD_EntityList bp_entities = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
breakpoints.count = bp_entities.count;
|
||||
breakpoints.v = push_array(scratch.arena, D_Breakpoint, breakpoints.count);
|
||||
U64 idx = 0;
|
||||
@@ -14181,7 +14181,7 @@ rd_frame(void)
|
||||
// rjf: increment breakpoint hit counts
|
||||
if(evt->cause == D_EventCause_UserBreakpoint)
|
||||
{
|
||||
RD_EntityList user_bps = d_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
RD_EntityList user_bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
for(RD_EntityNode *n = user_bps.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *bp = n->entity;
|
||||
@@ -14221,9 +14221,9 @@ rd_frame(void)
|
||||
//
|
||||
{
|
||||
F32 rate = rd_setting_val_from_code(RD_SettingCode_MenuAnimations).s32 ? 1 - pow_f32(2, (-10.f * rd_state->frame_dt)) : 1.f;
|
||||
B32 confirm_open = rd_state->confirm_active;
|
||||
rd_state->confirm_t += rate * ((F32)!!confirm_open-rd_state->confirm_t);
|
||||
if(abs_f32(rd_state->confirm_t - (F32)!!confirm_open) > 0.005f)
|
||||
B32 popup_open = rd_state->popup_active;
|
||||
rd_state->popup_t += rate * ((F32)!!popup_open-rd_state->popup_t);
|
||||
if(abs_f32(rd_state->popup_t - (F32)!!popup_open) > 0.005f)
|
||||
{
|
||||
rd_request_frame();
|
||||
}
|
||||
|
||||
+55
-49
@@ -899,15 +899,15 @@ struct RD_EvalVizViewCacheSlot
|
||||
////////////////////////////////
|
||||
//~ rjf: Main Per-Process Graphical State
|
||||
|
||||
typedef struct D_NameChunkNode D_NameChunkNode;
|
||||
struct D_NameChunkNode
|
||||
typedef struct RD_NameChunkNode RD_NameChunkNode;
|
||||
struct RD_NameChunkNode
|
||||
{
|
||||
D_NameChunkNode *next;
|
||||
RD_NameChunkNode *next;
|
||||
U64 size;
|
||||
};
|
||||
|
||||
typedef struct D_EntityListCache D_EntityListCache;
|
||||
struct D_EntityListCache
|
||||
typedef struct RD_EntityListCache RD_EntityListCache;
|
||||
struct RD_EntityListCache
|
||||
{
|
||||
Arena *arena;
|
||||
U64 alloc_gen;
|
||||
@@ -917,39 +917,70 @@ struct D_EntityListCache
|
||||
typedef struct RD_State RD_State;
|
||||
struct RD_State
|
||||
{
|
||||
// rjf: top-level state
|
||||
// rjf: basics
|
||||
Arena *arena;
|
||||
B32 quit;
|
||||
F64 time_in_seconds;
|
||||
|
||||
// rjf: log
|
||||
Log *log;
|
||||
String8 log_path;
|
||||
|
||||
// rjf: frame state
|
||||
F32 frame_dt;
|
||||
// rjf: frame history info
|
||||
U64 frame_index;
|
||||
Arena *frame_arenas[2];
|
||||
|
||||
// rjf: frame time history
|
||||
U64 frame_time_us_history[64];
|
||||
U64 num_frames_requested;
|
||||
F64 time_in_seconds;
|
||||
|
||||
// rjf: frame parameters
|
||||
F32 frame_dt;
|
||||
|
||||
// rjf: registers stack
|
||||
RD_RegsNode base_regs;
|
||||
RD_RegsNode *top_regs;
|
||||
|
||||
// rjf: autosave state
|
||||
F32 seconds_until_autosave;
|
||||
|
||||
// rjf: commands
|
||||
Arena *cmds_arena;
|
||||
RD_CmdList cmds;
|
||||
|
||||
// rjf: frame request state
|
||||
U64 num_frames_requested;
|
||||
// rjf: popup state
|
||||
UI_Key popup_key;
|
||||
B32 popup_active;
|
||||
F32 popup_t;
|
||||
Arena *popup_arena;
|
||||
RD_CmdList popup_cmds;
|
||||
String8 popup_title;
|
||||
String8 popup_desc;
|
||||
|
||||
// rjf: autosave timer
|
||||
F32 seconds_until_autosave;
|
||||
// rjf: string search state
|
||||
Arena *string_search_arena;
|
||||
String8 string_search_string;
|
||||
|
||||
// rjf: name allocator
|
||||
D_NameChunkNode *free_name_chunks[8];
|
||||
// rjf: eval visualization view cache
|
||||
U64 eval_viz_view_cache_slots_count;
|
||||
RD_EvalVizViewCacheSlot *eval_viz_view_cache_slots;
|
||||
RD_EvalVizViewCacheNode *eval_viz_view_cache_node_free;
|
||||
|
||||
// rjf: contextual hover info
|
||||
RD_Regs *hover_regs;
|
||||
RD_Regs *next_hover_regs;
|
||||
|
||||
// rjf: icon texture
|
||||
R_Handle icon_texture;
|
||||
|
||||
// rjf: current path
|
||||
Arena *current_path_arena;
|
||||
String8 current_path;
|
||||
|
||||
//-
|
||||
// TODO(rjf): TO BE ELIMINATED OR REPLACED VVVVVVVVVVVVVVVV
|
||||
//-
|
||||
|
||||
// rjf: entity state
|
||||
RD_NameChunkNode *free_name_chunks[8];
|
||||
Arena *entities_arena;
|
||||
RD_Entity *entities_base;
|
||||
U64 entities_count;
|
||||
@@ -961,7 +992,7 @@ struct RD_State
|
||||
|
||||
// rjf: entity query caches
|
||||
U64 kind_alloc_gens[RD_EntityKind_COUNT];
|
||||
D_EntityListCache kind_caches[RD_EntityKind_COUNT];
|
||||
RD_EntityListCache kind_caches[RD_EntityKind_COUNT];
|
||||
|
||||
// rjf: key map table
|
||||
Arena *key_map_arena;
|
||||
@@ -981,19 +1012,6 @@ struct RD_State
|
||||
UI_Key entity_ctx_menu_key;
|
||||
UI_Key tab_ctx_menu_key;
|
||||
|
||||
// rjf: confirmation popup state
|
||||
UI_Key confirm_key;
|
||||
B32 confirm_active;
|
||||
F32 confirm_t;
|
||||
Arena *confirm_arena;
|
||||
RD_CmdList confirm_cmds;
|
||||
String8 confirm_title;
|
||||
String8 confirm_desc;
|
||||
|
||||
// rjf: string search state
|
||||
Arena *string_search_arena;
|
||||
String8 string_search_string;
|
||||
|
||||
// rjf: view specs
|
||||
U64 view_spec_table_size;
|
||||
RD_ViewSpec **view_spec_table;
|
||||
@@ -1010,11 +1028,6 @@ struct RD_State
|
||||
B32 last_window_queued_save;
|
||||
RD_Handle last_focused_window;
|
||||
|
||||
// rjf: eval visualization view cache
|
||||
U64 eval_viz_view_cache_slots_count;
|
||||
RD_EvalVizViewCacheSlot *eval_viz_view_cache_slots;
|
||||
RD_EvalVizViewCacheNode *eval_viz_view_cache_node_free;
|
||||
|
||||
// rjf: view state
|
||||
RD_View *first_view;
|
||||
RD_View *last_view;
|
||||
@@ -1025,10 +1038,6 @@ struct RD_State
|
||||
// rjf: drag/drop state machine
|
||||
RD_DragDropState drag_drop_state;
|
||||
|
||||
// rjf: rich hover info
|
||||
RD_Regs *hover_regs;
|
||||
RD_Regs *next_hover_regs;
|
||||
|
||||
// rjf: config reading state
|
||||
Arena *cfg_path_arenas[RD_CfgSrc_COUNT];
|
||||
String8 cfg_paths[RD_CfgSrc_COUNT];
|
||||
@@ -1049,12 +1058,9 @@ struct RD_State
|
||||
// rjf: global settings
|
||||
RD_SettingVal cfg_setting_vals[RD_CfgSrc_COUNT][RD_SettingCode_COUNT];
|
||||
|
||||
// rjf: icon texture
|
||||
R_Handle icon_texture;
|
||||
|
||||
// rjf: current path
|
||||
Arena *current_path_arena;
|
||||
String8 current_path;
|
||||
//-
|
||||
// TODO(rjf): TO BE ELIMINATED OR REPLACED ^^^^^^^^^^^^^^^^^^
|
||||
//-
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1503,9 +1509,9 @@ internal Arena *rd_frame_arena(void);
|
||||
internal String8 rd_cfg_path_from_src(RD_CfgSrc src);
|
||||
|
||||
//- rjf: entity cache queries
|
||||
internal RD_EntityList d_query_cached_entity_list_with_kind(RD_EntityKind kind);
|
||||
internal RD_EntityList d_push_active_target_list(Arena *arena);
|
||||
internal RD_Entity *d_entity_from_ev_key_and_kind(EV_Key key, RD_EntityKind kind);
|
||||
internal RD_EntityList rd_query_cached_entity_list_with_kind(RD_EntityKind kind);
|
||||
internal RD_EntityList rd_push_active_target_list(Arena *arena);
|
||||
internal RD_Entity *rd_entity_from_ev_key_and_kind(EV_Key key, RD_EntityKind kind);
|
||||
|
||||
//- rjf: config state
|
||||
internal RD_CfgTable *rd_cfg_table(void);
|
||||
|
||||
+27
-27
@@ -6,19 +6,6 @@
|
||||
//
|
||||
// [ ] empty user file causing failure to launch
|
||||
//
|
||||
// [ ] engine/frontend commands situation
|
||||
// - currently, there is an interesting bifurcation of commands in the
|
||||
// frontend; you can either push a command *at a root level*, or push a
|
||||
// command to a locally-accessible list if you want that command to run
|
||||
// on the same frame (root level commands are deferred by a frame, since
|
||||
// the engine must see them first).
|
||||
// - things would be simpler if there was only a single "push command"
|
||||
// mechanism, and codepaths only ever saw these commands at most once.
|
||||
// this would require an alternate strategy of the initial "gather" of
|
||||
// commands, and instead it would just be a global queue, or something...
|
||||
// it is a little weird since commands are not just consumed in order...
|
||||
// - this will clean up the various different ways that codepaths
|
||||
// parameterize commands.
|
||||
// [ ] frontend entities vs. engine entities
|
||||
// - currently, the engine has entities like "watch", and the frontend
|
||||
// has entities like "windows", "panels", and "views".
|
||||
@@ -32,20 +19,6 @@
|
||||
// all of the stateful windows/panel/view/watch mechanisms, and then
|
||||
// the frontend pure-functionally queries stuff like os/r handles
|
||||
// on-demand, and then prunes them, immediate-mode cache style.
|
||||
// [ ] command params -> d_regs
|
||||
// - currently there are two almost-identical concepts relating to commands:
|
||||
// the parameters struct, and D_Regs. D_Regs is a registers struct which
|
||||
// is used to manage a stack of contextual information in various debugger
|
||||
// codepaths. it is used so that codepaths can register information they
|
||||
// know about, without passing it down to everyone explicitly - but those
|
||||
// later codepaths can still pass that information along. e.g. a window
|
||||
// calls into a watch window, watch window calls into visualizer, visualizer
|
||||
// pushes command, which needs to pass which window it occurred on along.
|
||||
// - i think D_Regs needs to expand a bit in order to encompass all of the
|
||||
// things that the command parameters were being used for, but at that point
|
||||
// commands can just be a spec * regs, and then the push-command API can
|
||||
// just have ways of overriding regs values explicitly, when the codepath
|
||||
// needs to be opinionated about which things are affected by which commands
|
||||
//
|
||||
// [ ] transient view timeout releasing
|
||||
//
|
||||
@@ -478,6 +451,33 @@
|
||||
// parameters, and then 99% of the UI code does not have to care.
|
||||
// [x] @cleanup simplification pass over eval visualization pipeline & types,
|
||||
// including view rule hooks
|
||||
// [x] engine/frontend commands situation
|
||||
// - currently, there is an interesting bifurcation of commands in the
|
||||
// frontend; you can either push a command *at a root level*, or push a
|
||||
// command to a locally-accessible list if you want that command to run
|
||||
// on the same frame (root level commands are deferred by a frame, since
|
||||
// the engine must see them first).
|
||||
// - things would be simpler if there was only a single "push command"
|
||||
// mechanism, and codepaths only ever saw these commands at most once.
|
||||
// this would require an alternate strategy of the initial "gather" of
|
||||
// commands, and instead it would just be a global queue, or something...
|
||||
// it is a little weird since commands are not just consumed in order...
|
||||
// - this will clean up the various different ways that codepaths
|
||||
// parameterize commands.
|
||||
// [x] command params -> d_regs
|
||||
// - currently there are two almost-identical concepts relating to commands:
|
||||
// the parameters struct, and D_Regs. D_Regs is a registers struct which
|
||||
// is used to manage a stack of contextual information in various debugger
|
||||
// codepaths. it is used so that codepaths can register information they
|
||||
// know about, without passing it down to everyone explicitly - but those
|
||||
// later codepaths can still pass that information along. e.g. a window
|
||||
// calls into a watch window, watch window calls into visualizer, visualizer
|
||||
// pushes command, which needs to pass which window it occurred on along.
|
||||
// - i think D_Regs needs to expand a bit in order to encompass all of the
|
||||
// things that the command parameters were being used for, but at that point
|
||||
// commands can just be a spec * regs, and then the push-command API can
|
||||
// just have ways of overriding regs values explicitly, when the codepath
|
||||
// needs to be opinionated about which things are affected by which commands
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Build Options
|
||||
|
||||
+28
-28
@@ -199,7 +199,7 @@ rd_code_view_build(Arena *arena, RD_View *view, RD_CodeViewState *cv, RD_CodeVie
|
||||
// rjf: find visible breakpoints for source code
|
||||
ProfScope("find visible breakpoints")
|
||||
{
|
||||
RD_EntityList bps = d_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
RD_EntityList bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
for(RD_EntityNode *n = bps.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *bp = n->entity;
|
||||
@@ -245,7 +245,7 @@ rd_code_view_build(Arena *arena, RD_View *view, RD_CodeViewState *cv, RD_CodeVie
|
||||
// rjf: find visible watch pins for source code
|
||||
ProfScope("find visible watch pins")
|
||||
{
|
||||
RD_EntityList wps = d_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
|
||||
RD_EntityList wps = rd_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
|
||||
for(RD_EntityNode *n = wps.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *wp = n->entity;
|
||||
@@ -297,7 +297,7 @@ rd_code_view_build(Arena *arena, RD_View *view, RD_CodeViewState *cv, RD_CodeVie
|
||||
// rjf: find breakpoints mapping to this disasm
|
||||
if(dasm_lines) ProfScope("find breakpoints mapping to this disassembly")
|
||||
{
|
||||
RD_EntityList bps = d_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
RD_EntityList bps = rd_query_cached_entity_list_with_kind(RD_EntityKind_Breakpoint);
|
||||
for(RD_EntityNode *n = bps.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *bp = n->entity;
|
||||
@@ -319,7 +319,7 @@ rd_code_view_build(Arena *arena, RD_View *view, RD_CodeViewState *cv, RD_CodeVie
|
||||
// rjf: find watch pins mapping to this disasm
|
||||
if(dasm_lines) ProfScope("find watch pins mapping to this disassembly")
|
||||
{
|
||||
RD_EntityList pins = d_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
|
||||
RD_EntityList pins = rd_query_cached_entity_list_with_kind(RD_EntityKind_WatchPin);
|
||||
for(RD_EntityNode *n = pins.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *pin = n->entity;
|
||||
@@ -1007,7 +1007,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
case RD_WatchViewFillKind_Watch:
|
||||
{
|
||||
mutable_entity_kind = RD_EntityKind_Watch;
|
||||
RD_EntityList watches = d_query_cached_entity_list_with_kind(mutable_entity_kind);
|
||||
RD_EntityList watches = rd_query_cached_entity_list_with_kind(mutable_entity_kind);
|
||||
for(RD_EntityNode *n = watches.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *watch = n->entity;
|
||||
@@ -1036,7 +1036,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
{
|
||||
mutable_entity_kind = RD_EntityKind_Breakpoint;
|
||||
ev_view_rule_list_push_string(scratch.arena, &top_level_view_rules, str8_lit("no_addr"));
|
||||
RD_EntityList bps = d_query_cached_entity_list_with_kind(mutable_entity_kind);
|
||||
RD_EntityList bps = rd_query_cached_entity_list_with_kind(mutable_entity_kind);
|
||||
for(RD_EntityNode *n = bps.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *bp = n->entity;
|
||||
@@ -1075,7 +1075,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
case RD_WatchViewFillKind_WatchPins:
|
||||
{
|
||||
mutable_entity_kind = RD_EntityKind_WatchPin;
|
||||
RD_EntityList wps = d_query_cached_entity_list_with_kind(mutable_entity_kind);
|
||||
RD_EntityList wps = rd_query_cached_entity_list_with_kind(mutable_entity_kind);
|
||||
for(RD_EntityNode *n = wps.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *wp = n->entity;
|
||||
@@ -1727,7 +1727,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
if(modifiable)
|
||||
{
|
||||
RD_WatchViewPoint pt = rd_watch_view_point_from_tbl(&blocks, tbl);
|
||||
RD_Entity *watch = d_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);
|
||||
if(!rd_entity_is_nil(watch))
|
||||
{
|
||||
rd_entity_equip_name(watch, new_string);
|
||||
@@ -1773,7 +1773,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
{
|
||||
RD_WatchViewPoint pt = rd_watch_view_point_from_tbl(&blocks, tbl);
|
||||
ev_key_set_view_rule(eval_view, pt.key, new_string);
|
||||
RD_Entity *watch = d_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);
|
||||
RD_Entity *view_rule = rd_entity_child_from_kind(watch, RD_EntityKind_ViewRule);
|
||||
if(new_string.size != 0 && rd_entity_is_nil(view_rule))
|
||||
{
|
||||
@@ -1857,14 +1857,14 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
{
|
||||
RD_WatchViewPoint fallback_pt_prev = rd_watch_view_point_from_tbl(&blocks, v2s64(0, y - 1));
|
||||
RD_WatchViewPoint fallback_pt_next = rd_watch_view_point_from_tbl(&blocks, v2s64(0, y + 1));
|
||||
RD_Entity *watch = d_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);
|
||||
if(!rd_entity_is_nil(watch))
|
||||
{
|
||||
EV_Key new_cursor_key = empty_row_key;
|
||||
EV_Key new_cursor_parent_key = empty_row_parent_key;
|
||||
if((evt->delta_2s32.x < 0 || evt->delta_2s32.y < 0) && !ev_key_match(ev_key_zero(), fallback_pt_prev.key))
|
||||
{
|
||||
RD_Entity *fallback_watch = d_entity_from_ev_key_and_kind(fallback_pt_prev.key, mutable_entity_kind);
|
||||
RD_Entity *fallback_watch = rd_entity_from_ev_key_and_kind(fallback_pt_prev.key, mutable_entity_kind);
|
||||
if(!rd_entity_is_nil(fallback_watch))
|
||||
{
|
||||
new_cursor_key = fallback_pt_prev.key;
|
||||
@@ -1873,7 +1873,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
}
|
||||
else if(!ev_key_match(ev_key_zero(), fallback_pt_next.key))
|
||||
{
|
||||
RD_Entity *fallback_watch = d_entity_from_ev_key_and_kind(fallback_pt_next.key, mutable_entity_kind);
|
||||
RD_Entity *fallback_watch = rd_entity_from_ev_key_and_kind(fallback_pt_next.key, mutable_entity_kind);
|
||||
if(!rd_entity_is_nil(fallback_watch))
|
||||
{
|
||||
new_cursor_key = fallback_pt_next.key;
|
||||
@@ -1889,7 +1889,7 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
// rjf: view rule deletions
|
||||
else if(selection_tbl.min.x <= RD_WatchViewColumnKind_ViewRule && RD_WatchViewColumnKind_ViewRule <= selection_tbl.max.x)
|
||||
{
|
||||
RD_Entity *watch = d_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);
|
||||
RD_Entity *view_rule = rd_entity_child_from_kind(watch, RD_EntityKind_ViewRule);
|
||||
rd_entity_mark_for_deletion(view_rule);
|
||||
ev_key_set_view_rule(eval_view, pt.key, str8_zero());
|
||||
@@ -1992,16 +1992,16 @@ rd_watch_view_build(RD_View *view, RD_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
EV_Key first_watch_key = ev_key_from_block_list_row_num(&blocks, selection_tbl.min.y);
|
||||
EV_Key reorder_group_prev_watch_key = ev_key_from_block_list_row_num(&blocks, selection_tbl.min.y - 1);
|
||||
EV_Key reorder_group_next_watch_key = ev_key_from_block_list_row_num(&blocks, selection_tbl.max.y + 1);
|
||||
RD_Entity *reorder_group_prev = d_entity_from_ev_key_and_kind(reorder_group_prev_watch_key, mutable_entity_kind);
|
||||
RD_Entity *reorder_group_next = d_entity_from_ev_key_and_kind(reorder_group_next_watch_key, mutable_entity_kind);
|
||||
RD_Entity *first_watch = d_entity_from_ev_key_and_kind(first_watch_key, mutable_entity_kind);
|
||||
RD_Entity *reorder_group_prev = rd_entity_from_ev_key_and_kind(reorder_group_prev_watch_key, mutable_entity_kind);
|
||||
RD_Entity *reorder_group_next = rd_entity_from_ev_key_and_kind(reorder_group_next_watch_key, mutable_entity_kind);
|
||||
RD_Entity *first_watch = rd_entity_from_ev_key_and_kind(first_watch_key, mutable_entity_kind);
|
||||
RD_Entity *last_watch = first_watch;
|
||||
if(!rd_entity_is_nil(first_watch))
|
||||
{
|
||||
for(S64 y = selection_tbl.min.y+1; y <= selection_tbl.max.y; y += 1)
|
||||
{
|
||||
EV_Key key = ev_key_from_block_list_row_num(&blocks, y);
|
||||
RD_Entity *new_last = d_entity_from_ev_key_and_kind(key, mutable_entity_kind);
|
||||
RD_Entity *new_last = rd_entity_from_ev_key_and_kind(key, mutable_entity_kind);
|
||||
if(!rd_entity_is_nil(new_last))
|
||||
{
|
||||
last_watch = new_last;
|
||||
@@ -2911,8 +2911,8 @@ RD_VIEW_UI_FUNCTION_DEF(getting_started)
|
||||
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
|
||||
UI_Padding(ui_pct(1, 0)) UI_Focus(UI_FocusKind_Null)
|
||||
{
|
||||
RD_EntityList targets = d_push_active_target_list(scratch.arena);
|
||||
RD_EntityList processes = d_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
RD_EntityList targets = rd_push_active_target_list(scratch.arena);
|
||||
RD_EntityList processes = rd_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
|
||||
//- rjf: icon & info
|
||||
UI_Padding(ui_em(2.f, 1.f))
|
||||
@@ -3952,7 +3952,7 @@ rd_process_info_list_from_query(Arena *arena, String8 query)
|
||||
U64 attached_process_count = 0;
|
||||
U32 *attached_process_pids = 0;
|
||||
{
|
||||
RD_EntityList processes = d_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
RD_EntityList processes = rd_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
attached_process_count = processes.count;
|
||||
attached_process_pids = push_array(scratch.arena, U32, attached_process_count);
|
||||
U64 idx = 0;
|
||||
@@ -4266,7 +4266,7 @@ rd_entity_lister_item_list_from_needle(Arena *arena, RD_EntityKind kind, RD_Enti
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
RD_EntityListerItemList result = {0};
|
||||
RD_EntityList ent_list = d_query_cached_entity_list_with_kind(kind);
|
||||
RD_EntityList ent_list = rd_query_cached_entity_list_with_kind(kind);
|
||||
for(RD_EntityNode *n = ent_list.first; n != 0; n = n->next)
|
||||
{
|
||||
RD_Entity *entity = n->entity;
|
||||
@@ -4981,7 +4981,7 @@ RD_VIEW_UI_FUNCTION_DEF(targets)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
RD_EntityList targets_list = d_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
RD_EntityList targets_list = rd_query_cached_entity_list_with_kind(RD_EntityKind_Target);
|
||||
RD_EntityFuzzyItemArray targets = rd_entity_fuzzy_item_array_from_entity_list_needle(scratch.arena, &targets_list, string);
|
||||
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
|
||||
|
||||
@@ -5194,7 +5194,7 @@ RD_VIEW_UI_FUNCTION_DEF(file_path_map)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
RD_EntityList maps_list = d_query_cached_entity_list_with_kind(RD_EntityKind_FilePathMap);
|
||||
RD_EntityList maps_list = rd_query_cached_entity_list_with_kind(RD_EntityKind_FilePathMap);
|
||||
RD_EntityArray maps = rd_entity_array_from_list(scratch.arena, &maps_list);
|
||||
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
|
||||
|
||||
@@ -5533,9 +5533,9 @@ RD_VIEW_UI_FUNCTION_DEF(scheduler)
|
||||
RD_SchedulerViewState *sv = rd_view_user_state(view, RD_SchedulerViewState);
|
||||
|
||||
//- rjf: get entities
|
||||
RD_EntityList machines = d_query_cached_entity_list_with_kind(RD_EntityKind_Machine);
|
||||
RD_EntityList processes = d_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
RD_EntityList threads = d_query_cached_entity_list_with_kind(RD_EntityKind_Thread);
|
||||
RD_EntityList machines = rd_query_cached_entity_list_with_kind(RD_EntityKind_Machine);
|
||||
RD_EntityList processes = rd_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
RD_EntityList threads = rd_query_cached_entity_list_with_kind(RD_EntityKind_Thread);
|
||||
|
||||
//- rjf: produce list of items; no query -> all entities, in tree; query -> only show threads
|
||||
RD_EntityFuzzyItemArray items = {0};
|
||||
@@ -5843,8 +5843,8 @@ RD_VIEW_UI_FUNCTION_DEF(modules)
|
||||
F32 *col_pcts[] = {&mv->idx_col_pct, &mv->desc_col_pct, &mv->range_col_pct, &mv->dbg_col_pct};
|
||||
|
||||
//- rjf: get entities
|
||||
RD_EntityList processes = d_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
RD_EntityList modules = d_query_cached_entity_list_with_kind(RD_EntityKind_Module);
|
||||
RD_EntityList processes = rd_query_cached_entity_list_with_kind(RD_EntityKind_Process);
|
||||
RD_EntityList modules = rd_query_cached_entity_list_with_kind(RD_EntityKind_Module);
|
||||
|
||||
//- rjf: make filtered item array
|
||||
RD_EntityFuzzyItemArray items = {0};
|
||||
|
||||
Reference in New Issue
Block a user