mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 07:32:23 -07:00
eliminate old expand-key-based eval history - ctrl process memory cache offers much better comprehensive replacement. also eliminate per-row and per-block eval views, since we've collapsed all eval views to one per list-of-watch-trees
This commit is contained in:
@@ -4475,8 +4475,6 @@ df_eval_view_from_key(DF_EvalViewKey key)
|
||||
eval_view->key = key;
|
||||
eval_view->arena = arena_alloc();
|
||||
df_expand_tree_table_init(eval_view->arena, &eval_view->expand_tree_table, 256);
|
||||
eval_view->history_cache_table_size = 64;
|
||||
eval_view->history_cache_table = push_array(eval_view->arena, DF_EvalHistoryCacheSlot, eval_view->history_cache_table_size);
|
||||
eval_view->view_rule_table.slot_count = 64;
|
||||
eval_view->view_rule_table.slots = push_array(eval_view->arena, DF_EvalViewRuleCacheSlot, eval_view->view_rule_table.slot_count);
|
||||
}
|
||||
@@ -4484,83 +4482,6 @@ df_eval_view_from_key(DF_EvalViewKey key)
|
||||
return eval_view;
|
||||
}
|
||||
|
||||
//- rjf: key -> eval history
|
||||
|
||||
internal DF_EvalHistoryCacheNode *
|
||||
df_eval_history_cache_node_from_key(DF_EvalView *eval_view, DF_ExpandKey key)
|
||||
{
|
||||
//- rjf: key -> hash * slot idx * slot
|
||||
String8 key_string = str8_struct(&key);
|
||||
U64 hash = df_hash_from_string(key_string);
|
||||
U64 slot_idx = hash%eval_view->history_cache_table_size;
|
||||
DF_EvalHistoryCacheSlot *slot = &eval_view->history_cache_table[slot_idx];
|
||||
|
||||
//- rjf: slot idx -> existing node
|
||||
DF_EvalHistoryCacheNode *existing_node = 0;
|
||||
for(DF_EvalHistoryCacheNode *n = slot->first; n != 0; n = n->hash_next)
|
||||
{
|
||||
if(df_expand_key_match(n->key, key))
|
||||
{
|
||||
existing_node = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return existing_node;
|
||||
}
|
||||
|
||||
internal B32
|
||||
df_eval_view_record_history_val(DF_EvalView *eval_view, DF_ExpandKey key, DF_EvalHistoryVal val)
|
||||
{
|
||||
B32 change = 0;
|
||||
|
||||
//- rjf: key -> hash * slot idx * slot
|
||||
String8 key_string = str8_struct(&key);
|
||||
U64 hash = df_hash_from_string(key_string);
|
||||
U64 slot_idx = hash%eval_view->history_cache_table_size;
|
||||
DF_EvalHistoryCacheSlot *slot = &eval_view->history_cache_table[slot_idx];
|
||||
|
||||
//- rjf: slot idx -> existing node
|
||||
DF_EvalHistoryCacheNode *existing_node = 0;
|
||||
for(DF_EvalHistoryCacheNode *n = slot->first; n != 0; n = n->hash_next)
|
||||
{
|
||||
if(df_expand_key_match(n->key, key))
|
||||
{
|
||||
existing_node = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: grab existing node - if there is none, we need to allocate one
|
||||
DF_EvalHistoryCacheNode *node = existing_node;
|
||||
if(node == 0)
|
||||
{
|
||||
// TODO(rjf): check lru cache, allocate from there, prevent too much growth
|
||||
node = push_array(eval_view->arena, DF_EvalHistoryCacheNode, 1);
|
||||
DLLPushBack_NP(slot->first, slot->last, node, hash_next, hash_prev);
|
||||
node->key = key;
|
||||
node->first_run_idx = node->last_run_idx = df_ctrl_run_gen();
|
||||
}
|
||||
|
||||
//- rjf: record value
|
||||
if(node != 0)
|
||||
{
|
||||
DF_EvalHistoryVal *newest_val = &node->values[node->newest_val_idx];
|
||||
if(newest_val->mode != val.mode ||
|
||||
newest_val->imm_u128[0] != val.imm_u128[0] ||
|
||||
newest_val->imm_u128[1] != val.imm_u128[1] ||
|
||||
newest_val->offset != val.offset)
|
||||
{
|
||||
change = 1;
|
||||
node->newest_val_idx = (node->newest_val_idx + 1) % ArrayCount(node->values);
|
||||
node->values[node->newest_val_idx] = val;
|
||||
node->last_run_idx = df_ctrl_run_gen();
|
||||
}
|
||||
}
|
||||
|
||||
return change;
|
||||
}
|
||||
|
||||
//- rjf: key -> view rules
|
||||
|
||||
internal void
|
||||
@@ -5108,7 +5029,6 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *block = push_array(arena, DF_EvalVizBlock, 1);
|
||||
{
|
||||
block->kind = DF_EvalVizBlockKind_Root;
|
||||
block->eval_view = eval_view;
|
||||
block->eval = eval;
|
||||
block->cfg_table = *cfg_table;
|
||||
block->string = push_str8_copy(arena, string);
|
||||
@@ -5256,7 +5176,6 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *memblock = push_array(arena, DF_EvalVizBlock, 1);
|
||||
{
|
||||
memblock->kind = DF_EvalVizBlockKind_Members;
|
||||
memblock->eval_view = eval_view;
|
||||
memblock->eval = udt_eval;
|
||||
memblock->cfg_table = *cfg_table;
|
||||
memblock->parent_key = key;
|
||||
@@ -5314,7 +5233,6 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
{
|
||||
DF_EvalVizBlock *next_memblock = push_array(arena, DF_EvalVizBlock, 1);
|
||||
next_memblock->kind = DF_EvalVizBlockKind_Members;
|
||||
next_memblock->eval_view = eval_view;
|
||||
next_memblock->eval = udt_eval;
|
||||
next_memblock->cfg_table = *cfg_table;
|
||||
next_memblock->parent_key = key;
|
||||
@@ -5373,7 +5291,6 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *linkblock = push_array(arena, DF_EvalVizBlock, 1);
|
||||
{
|
||||
linkblock->kind = DF_EvalVizBlockKind_Links;
|
||||
linkblock->eval_view = eval_view;
|
||||
linkblock->eval = udt_eval;
|
||||
linkblock->link_member_type_key = link_member->type_key;
|
||||
linkblock->link_member_off = link_member->off;
|
||||
@@ -5433,7 +5350,6 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
{
|
||||
DF_EvalVizBlock *next_linkblock = push_array(arena, DF_EvalVizBlock, 1);
|
||||
next_linkblock->kind = DF_EvalVizBlockKind_Links;
|
||||
next_linkblock->eval_view = eval_view;
|
||||
next_linkblock->eval = udt_eval;
|
||||
next_linkblock->link_member_type_key = link_member->type_key;
|
||||
next_linkblock->link_member_off = link_member->off;
|
||||
@@ -5467,7 +5383,6 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *elemblock = push_array(arena, DF_EvalVizBlock, 1);
|
||||
{
|
||||
elemblock->kind = DF_EvalVizBlockKind_Elements;
|
||||
elemblock->eval_view = eval_view;
|
||||
elemblock->eval = arr_eval;
|
||||
elemblock->cfg_table = *cfg_table;
|
||||
elemblock->parent_key = key;
|
||||
@@ -5522,7 +5437,6 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
{
|
||||
DF_EvalVizBlock *next_elemblock = push_array(arena, DF_EvalVizBlock, 1);
|
||||
next_elemblock->kind = DF_EvalVizBlockKind_Elements;
|
||||
next_elemblock->eval_view = eval_view;
|
||||
next_elemblock->eval = arr_eval;
|
||||
next_elemblock->cfg_table = *cfg_table;
|
||||
next_elemblock->parent_key = key;
|
||||
|
||||
+1
-47
@@ -265,8 +265,6 @@ struct DF_Unwind
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation Types
|
||||
|
||||
//- rjf: primary artifact from evaluation
|
||||
|
||||
typedef struct DF_Eval DF_Eval;
|
||||
struct DF_Eval
|
||||
{
|
||||
@@ -284,37 +282,6 @@ struct DF_Eval
|
||||
EVAL_ErrorList errors;
|
||||
};
|
||||
|
||||
//- rjf: value history types
|
||||
|
||||
typedef struct DF_EvalHistoryVal DF_EvalHistoryVal;
|
||||
struct DF_EvalHistoryVal
|
||||
{
|
||||
EVAL_EvalMode mode;
|
||||
U64 offset;
|
||||
U64 imm_u128[2];
|
||||
};
|
||||
|
||||
typedef struct DF_EvalHistoryCacheNode DF_EvalHistoryCacheNode;
|
||||
struct DF_EvalHistoryCacheNode
|
||||
{
|
||||
DF_EvalHistoryCacheNode *lru_next;
|
||||
DF_EvalHistoryCacheNode *lru_prev;
|
||||
DF_EvalHistoryCacheNode *hash_next;
|
||||
DF_EvalHistoryCacheNode *hash_prev;
|
||||
DF_ExpandKey key;
|
||||
U64 first_run_idx;
|
||||
U64 last_run_idx;
|
||||
U64 newest_val_idx;
|
||||
DF_EvalHistoryVal values[64];
|
||||
};
|
||||
|
||||
typedef struct DF_EvalHistoryCacheSlot DF_EvalHistoryCacheSlot;
|
||||
struct DF_EvalHistoryCacheSlot
|
||||
{
|
||||
DF_EvalHistoryCacheNode *first;
|
||||
DF_EvalHistoryCacheNode *last;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Rule Hook Types
|
||||
|
||||
@@ -674,13 +641,6 @@ struct DF_EvalView
|
||||
// rjf: expansion state
|
||||
DF_ExpandTreeTable expand_tree_table;
|
||||
|
||||
// rjf: key -> value history cache
|
||||
U64 history_cache_table_size;
|
||||
U64 history_cache_table_num_active_nodes;
|
||||
DF_EvalHistoryCacheSlot *history_cache_table;
|
||||
DF_EvalHistoryCacheNode *history_cache_lru_first;
|
||||
DF_EvalHistoryCacheNode *history_cache_lru_last;
|
||||
|
||||
// rjf: key -> view rule cache
|
||||
DF_EvalViewRuleCacheTable view_rule_table;
|
||||
};
|
||||
@@ -747,7 +707,6 @@ struct DF_EvalVizBlock
|
||||
{
|
||||
DF_EvalVizBlock *next;
|
||||
DF_EvalVizBlockKind kind;
|
||||
DF_EvalView *eval_view;
|
||||
DF_Eval eval;
|
||||
TG_Key link_member_type_key;
|
||||
U64 link_member_off;
|
||||
@@ -792,8 +751,7 @@ struct DF_EvalVizRow
|
||||
DF_EvalVizRow *next;
|
||||
DF_EvalVizRowFlags flags;
|
||||
|
||||
// rjf: eval & eval view state
|
||||
DF_EvalView *eval_view;
|
||||
// rjf: evaluation artifacts
|
||||
DF_Eval eval;
|
||||
|
||||
// rjf: basic visualization contents
|
||||
@@ -1574,10 +1532,6 @@ internal B32 df_eval_view_key_match(DF_EvalViewKey a, DF_EvalViewKey b);
|
||||
//- rjf: cache lookup
|
||||
internal DF_EvalView *df_eval_view_from_key(DF_EvalViewKey key);
|
||||
|
||||
//- rjf: key -> eval history
|
||||
internal DF_EvalHistoryCacheNode *df_eval_history_cache_node_from_key(DF_EvalView *eval_view, DF_ExpandKey key);
|
||||
internal B32 df_eval_view_record_history_val(DF_EvalView *eval_view, DF_ExpandKey key, DF_EvalHistoryVal val);
|
||||
|
||||
//- rjf: key -> view rules
|
||||
internal void df_eval_view_set_key_rule(DF_EvalView *eval_view, DF_ExpandKey key, String8 view_rule_string);
|
||||
internal String8 df_eval_view_rule_from_key(DF_EvalView *eval_view, DF_ExpandKey key);
|
||||
|
||||
+5
-10
@@ -3989,7 +3989,7 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
DF_EvalViewKey eval_view_key = df_eval_view_key_from_stringf("eval_hover_%I64x", expr_hash);
|
||||
DF_EvalView *eval_view = df_eval_view_from_key(eval_view_key);
|
||||
DF_EvalVizBlockList viz_blocks = df_eval_viz_block_list_from_eval_view_expr_num(scratch.arena, scope, &ctrl_ctx, &parse_ctx, eval_view, expr, 1);
|
||||
DF_EvalVizWindowedRowList viz_rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, scope, &ctrl_ctx, &parse_ctx, 10, ui_top_font(), ui_top_font_size(), r1s64(0, 50), &viz_blocks);
|
||||
DF_EvalVizWindowedRowList viz_rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, scope, &ctrl_ctx, &parse_ctx, eval_view, 10, ui_top_font(), ui_top_font_size(), r1s64(0, 50), &viz_blocks);
|
||||
|
||||
//- rjf: animate
|
||||
{
|
||||
@@ -6869,7 +6869,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
}
|
||||
|
||||
internal DF_EvalVizWindowedRowList
|
||||
df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, U32 default_radix, F_Tag font, F32 font_size, Rng1S64 visible_range, DF_EvalVizBlockList *blocks)
|
||||
df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_EvalView *eval_view, U32 default_radix, F_Tag font, F32 font_size, Rng1S64 visible_range, DF_EvalVizBlockList *blocks)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
@@ -6971,7 +6971,6 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, block->eval, &block->cfg_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, block->eval, &block->cfg_table);
|
||||
DF_EvalVizRow *row = push_array(arena, DF_EvalVizRow, 1);
|
||||
row->eval_view = block->eval_view;
|
||||
row->eval = block->eval;
|
||||
row->expr = block->string;
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -7043,7 +7042,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
}
|
||||
|
||||
// rjf: get view rules
|
||||
String8 view_rule_string = df_eval_view_rule_from_key(block->eval_view, key);
|
||||
String8 view_rule_string = df_eval_view_rule_from_key(eval_view, key);
|
||||
DF_CfgTable view_rule_table = df_cfg_table_from_inheritance(scratch.arena, &block->cfg_table);
|
||||
df_cfg_table_push_unparsed_string(scratch.arena, &view_rule_table, view_rule_string, DF_CfgSrc_User);
|
||||
|
||||
@@ -7057,7 +7056,6 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, member_eval, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, member_eval, &view_rule_table);
|
||||
DF_EvalVizRow *row = push_array(arena, DF_EvalVizRow, 1);
|
||||
row->eval_view = block->eval_view;
|
||||
row->eval = member_eval;
|
||||
row->expr = push_str8_copy(arena, member->name);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -7128,7 +7126,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
}
|
||||
|
||||
// rjf: get view rules
|
||||
String8 view_rule_string = df_eval_view_rule_from_key(block->eval_view, key);
|
||||
String8 view_rule_string = df_eval_view_rule_from_key(eval_view, key);
|
||||
DF_CfgTable view_rule_table = df_cfg_table_from_inheritance(scratch.arena, &block->cfg_table);
|
||||
df_cfg_table_push_unparsed_string(scratch.arena, &view_rule_table, view_rule_string, DF_CfgSrc_User);
|
||||
|
||||
@@ -7142,7 +7140,6 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, elem_eval, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, elem_eval, &view_rule_table);
|
||||
DF_EvalVizRow *row = push_array(arena, DF_EvalVizRow, 1);
|
||||
row->eval_view = block->eval_view;
|
||||
row->eval = elem_eval;
|
||||
row->expr = push_str8f(arena, "[%I64u]", idx);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -7213,7 +7210,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
}
|
||||
|
||||
// rjf: get view rules
|
||||
String8 view_rule_string = df_eval_view_rule_from_key(block->eval_view, key);
|
||||
String8 view_rule_string = df_eval_view_rule_from_key(eval_view, key);
|
||||
DF_CfgTable view_rule_table = df_cfg_table_from_inheritance(scratch.arena, &block->cfg_table);
|
||||
df_cfg_table_push_unparsed_string(scratch.arena, &view_rule_table, view_rule_string, DF_CfgSrc_User);
|
||||
|
||||
@@ -7226,7 +7223,6 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, link_eval, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, default_radix, font, font_size, 500, 0, link_eval, &view_rule_table);
|
||||
DF_EvalVizRow *row = push_array(arena, DF_EvalVizRow, 1);
|
||||
row->eval_view = block->eval_view;
|
||||
row->eval = link_eval;
|
||||
row->expr = push_str8f(arena, "[%I64u]", idx);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -7282,7 +7278,6 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(parent_key), 1);
|
||||
DF_EvalVizRow *row = push_array(arena, DF_EvalVizRow, 1);
|
||||
row->flags = DF_EvalVizRowFlag_Canvas;
|
||||
row->eval_view = block->eval_view;
|
||||
row->eval = block->eval;
|
||||
row->size_in_rows = dim_1u64(intersect_1u64(visible_idx_range, r1u64(0, dim_1u64(block->visual_idx_range))));
|
||||
row->skipped_size_in_rows= (visible_idx_range.min > block->visual_idx_range.min) ? visible_idx_range.min - block->visual_idx_range.min : 0;
|
||||
|
||||
+1
-1
@@ -955,7 +955,7 @@ internal void df_window_update_and_render(Arena *arena, OS_EventList *events, DF
|
||||
|
||||
internal String8 df_eval_escaped_from_raw_string(Arena *arena, String8 raw);
|
||||
internal String8List df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags flags, TG_Graph *graph, RADDBG_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, U32 default_radix, F_Tag font, F32 font_size, F32 max_size, S32 depth, DF_Eval eval, DF_CfgTable *cfg_table);
|
||||
internal DF_EvalVizWindowedRowList df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, U32 default_radix, F_Tag font, F32 font_size, Rng1S64 visible_range, DF_EvalVizBlockList *blocks);
|
||||
internal DF_EvalVizWindowedRowList df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_EvalView *eval_view, U32 default_radix, F_Tag font, F32 font_size, Rng1S64 visible_range, DF_EvalVizBlockList *blocks);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Hover Eval
|
||||
|
||||
@@ -485,7 +485,6 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(rgba)
|
||||
{
|
||||
DF_EvalVizBlock *block = push_array(arena, DF_EvalVizBlock, 1);
|
||||
block->kind = DF_EvalVizBlockKind_Canvas;
|
||||
block->eval_view = eval_view;
|
||||
block->eval = eval;
|
||||
block->cfg_table = *cfg_table;
|
||||
block->parent_key = key;
|
||||
@@ -659,7 +658,6 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text)
|
||||
{
|
||||
DF_EvalVizBlock *block = push_array(arena, DF_EvalVizBlock, 1);
|
||||
block->kind = DF_EvalVizBlockKind_Canvas;
|
||||
block->eval_view = eval_view;
|
||||
block->eval = eval;
|
||||
block->cfg_table = *cfg_table;
|
||||
block->parent_key = key;
|
||||
@@ -768,7 +766,6 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm)
|
||||
{
|
||||
DF_EvalVizBlock *block = push_array(arena, DF_EvalVizBlock, 1);
|
||||
block->kind = DF_EvalVizBlockKind_Canvas;
|
||||
block->eval_view = eval_view;
|
||||
block->eval = eval;
|
||||
block->cfg_table = *cfg_table;
|
||||
block->parent_key = key;
|
||||
@@ -860,7 +857,6 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_EvalVizBlock *block = push_array(arena, DF_EvalVizBlock, 1);
|
||||
block->kind = DF_EvalVizBlockKind_Canvas;
|
||||
block->eval_view = eval_view;
|
||||
block->eval = eval;
|
||||
block->cfg_table = *cfg_table;
|
||||
block->parent_key = key;
|
||||
@@ -1107,7 +1103,6 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo)
|
||||
{
|
||||
DF_EvalVizBlock *block = push_array(arena, DF_EvalVizBlock, 1);
|
||||
block->kind = DF_EvalVizBlockKind_Canvas;
|
||||
block->eval_view = eval_view;
|
||||
block->eval = eval;
|
||||
block->cfg_table = *cfg_table;
|
||||
block->parent_key = key;
|
||||
|
||||
+5
-40
@@ -783,6 +783,8 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
U64 thread_ip_vaddr = df_query_cached_rip_from_thread_unwind(thread, ctrl_ctx.unwind_count);
|
||||
DF_EvalViewKey eval_view_key = df_eval_view_key_from_eval_watch_view(ewv);
|
||||
DF_EvalView *eval_view = df_eval_view_from_key(eval_view_key);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: process * thread info -> parse_ctx
|
||||
@@ -988,25 +990,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
//- rjf: viz blocks -> rows
|
||||
DF_EvalVizWindowedRowList rows = {0};
|
||||
{
|
||||
rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, scope, &ctrl_ctx, &parse_ctx, default_radix, code_font, code_font_size, r1s64(visible_row_rng.min-1, visible_row_rng.max), &blocks);
|
||||
}
|
||||
|
||||
//- rjf: record history for windowed rows
|
||||
if(!df_ctrl_targets_running())
|
||||
{
|
||||
for(DF_EvalVizRow *row = rows.first; row != 0; row = row->next)
|
||||
{
|
||||
DF_Eval row_eval = row->eval;
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx.type_graph, parse_ctx.rdbg, &ctrl_ctx, row_eval);
|
||||
if(value_eval.mode != EVAL_EvalMode_NULL)
|
||||
{
|
||||
DF_EvalHistoryVal val = zero_struct;
|
||||
val.mode = value_eval.mode;
|
||||
val.offset = value_eval.offset;
|
||||
MemoryCopyArray(val.imm_u128, value_eval.imm_u128);
|
||||
df_eval_view_record_history_val(row->eval_view, row->key, val);
|
||||
}
|
||||
}
|
||||
rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, scope, &ctrl_ctx, &parse_ctx, eval_view, default_radix, code_font, code_font_size, r1s64(visible_row_rng.min-1, visible_row_rng.max), &blocks);
|
||||
}
|
||||
|
||||
//- rjf: build table
|
||||
@@ -1016,11 +1000,9 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
for(DF_EvalVizRow *row = rows.first; row != 0; row = row->next, semantic_idx += 1)
|
||||
{
|
||||
U64 row_hash = df_hash_from_expand_key(row->key);
|
||||
DF_EvalView *eval_view = row->eval_view;
|
||||
df_expand_tree_table_animate(&eval_view->expand_tree_table, df_dt());
|
||||
B32 row_selected = ((semantic_idx+1) == cursor.y);
|
||||
B32 row_expanded = df_expand_key_is_set(&eval_view->expand_tree_table, row->key);
|
||||
DF_EvalHistoryCacheNode *history_cache_node = df_eval_history_cache_node_from_key(eval_view, row->key);
|
||||
|
||||
//- rjf: determine if row's data is fresh
|
||||
B32 row_is_fresh = 0;
|
||||
@@ -1050,21 +1032,6 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
commit_row = row;
|
||||
}
|
||||
|
||||
//- rjf: color changed rows
|
||||
if(history_cache_node &&
|
||||
history_cache_node->last_run_idx == df_ctrl_run_gen() &&
|
||||
history_cache_node->last_run_idx != history_cache_node->first_run_idx &&
|
||||
history_cache_node->values[history_cache_node->newest_val_idx].mode != EVAL_EvalMode_NULL)
|
||||
{
|
||||
F32 animation_time_max = 1.f;
|
||||
F32 animation_time = 1.f;//ClampTop(animation_time_max, history_cache_node->seconds_since_change);
|
||||
F32 animation_progress = animation_time / animation_time_max;
|
||||
Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Highlight0);
|
||||
color.w *= 0.25f - (animation_progress * 0.15f);
|
||||
ui_set_next_overlay_color(color);
|
||||
ui_set_next_flags(UI_BoxFlag_DrawOverlay);
|
||||
}
|
||||
|
||||
//- rjf: build canvas row
|
||||
if(row->flags & DF_EvalVizRowFlag_Canvas) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
@@ -1581,8 +1548,6 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
//- rjf: committed on a valid row
|
||||
if(commit_row != 0)
|
||||
{
|
||||
DF_EvalViewKey eval_view_key = df_eval_view_key_from_eval_watch_view(ewv);
|
||||
DF_EvalView *eval_view = df_eval_view_from_key(eval_view_key);
|
||||
switch(commit_column)
|
||||
{
|
||||
default:break;
|
||||
@@ -1632,7 +1597,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
//- rjf: view rule commits
|
||||
case DF_EvalWatchViewColumnKind_ViewRule:
|
||||
{
|
||||
df_eval_view_set_key_rule(commit_row->eval_view, commit_row->key, commit_string);
|
||||
df_eval_view_set_key_rule(eval_view, commit_row->key, commit_string);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@@ -1705,7 +1670,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
// rjf: go to parent on collapses
|
||||
if(found_block != 0)
|
||||
{
|
||||
DF_ExpandNode *node = df_expand_node_from_key(&found_block->eval_view->expand_tree_table, found_block->parent_key);
|
||||
DF_ExpandNode *node = df_expand_node_from_key(&eval_view->expand_tree_table, found_block->parent_key);
|
||||
if(node != 0)
|
||||
{
|
||||
for(DF_ExpandNode *n = node; n != 0; n = n->parent)
|
||||
|
||||
+1
-1
@@ -398,7 +398,7 @@
|
||||
|
||||
#define RADDBG_VERSION_MAJOR 0
|
||||
#define RADDBG_VERSION_MINOR 9
|
||||
#define RADDBG_VERSION_PATCH 7
|
||||
#define RADDBG_VERSION_PATCH 8
|
||||
#define RADDBG_VERSION_STRING_LITERAL Stringify(RADDBG_VERSION_MAJOR) "." Stringify(RADDBG_VERSION_MINOR) "." Stringify(RADDBG_VERSION_PATCH)
|
||||
#if defined(NDEBUG)
|
||||
# define RADDBG_TITLE_STRING_LITERAL "The RAD Debugger (" RADDBG_VERSION_STRING_LITERAL " ALPHA) - " __DATE__ ""
|
||||
|
||||
Reference in New Issue
Block a user