mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-23 12:15:00 -07:00
eliminate all old debug engine eval visualization code; we're now moved over to the new more standalone eval viz codebase layer
This commit is contained in:
@@ -428,16 +428,10 @@ D_ViewRuleTable:
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@gen
|
||||
{
|
||||
@expand(D_ViewRuleTable a) `$(a.xp == "x" -> "D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
@expand(D_ViewRuleTable a) `$(a.vb == "x" -> "D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
}
|
||||
|
||||
@data(D_ViewRuleSpecInfo) @c_file d_core_view_rule_spec_info_table:
|
||||
{
|
||||
@expand(D_ViewRuleTable a)
|
||||
```{str8_lit_comp("$(a.string)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.schema)"), str8_lit_comp("$(a.description)"), (D_ViewRuleSpecInfoFlag_Inherited*$(a.ih == "x"))|(D_ViewRuleSpecInfoFlag_Expandable*$(a.ex == "x"))|(D_ViewRuleSpecInfoFlag_ExprResolution*$(a.xp == "x"))|(D_ViewRuleSpecInfoFlag_VizBlockProd*$(a.vb == "x")), $(a.xp == "x" -> "D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME("..a.name_lower..")") $(a.xp != "x" -> 0), $(a.vb == "x" -> "D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vb != "x" -> 0), }```;
|
||||
```{str8_lit_comp("$(a.string)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.schema)"), str8_lit_comp("$(a.description)"), (D_ViewRuleSpecInfoFlag_Inherited*$(a.ih == "x"))|(D_ViewRuleSpecInfoFlag_Expandable*$(a.ex == "x"))|(D_ViewRuleSpecInfoFlag_ExprResolution*$(a.xp == "x"))|(D_ViewRuleSpecInfoFlag_VizBlockProd*$(a.vb == "x")), }```;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -280,8 +280,6 @@ struct D_ViewRuleSpecInfo
|
||||
String8 schema;
|
||||
String8 description;
|
||||
D_ViewRuleSpecInfoFlags flags;
|
||||
D_CoreViewRuleExprResolutionHookFunctionType *expr_resolution;
|
||||
D_CoreViewRuleVizBlockProdHookFunctionType *viz_block_prod;
|
||||
};
|
||||
|
||||
typedef struct D_ViewRuleSpecInfoArray D_ViewRuleSpecInfoArray;
|
||||
@@ -1347,60 +1345,11 @@ internal String8 d_eval_view_rule_from_key(D_EvalView *eval_view, D_ExpandKey ke
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation Visualization
|
||||
|
||||
//- rjf: expr * view rule table -> expr
|
||||
internal E_Expr *d_expr_from_expr_cfg(Arena *arena, E_Expr *expr, D_CfgTable *cfg);
|
||||
|
||||
//- rjf: evaluation value string builder helpers
|
||||
internal String8 d_string_from_ascii_value(Arena *arena, U8 val);
|
||||
internal String8 d_string_from_hresult_facility_code(U32 code);
|
||||
internal String8 d_string_from_hresult_code(U32 code);
|
||||
internal String8 d_string_from_simple_typed_eval(Arena *arena, D_EvalVizStringFlags flags, U32 radix, E_Eval eval);
|
||||
internal String8 d_escaped_from_raw_string(Arena *arena, String8 raw);
|
||||
|
||||
//- rjf: type info -> expandability/editablity
|
||||
internal B32 d_type_key_is_expandable(E_TypeKey type_key);
|
||||
internal B32 d_type_key_is_editable(E_TypeKey type_key);
|
||||
|
||||
//- rjf: writing values back to child processes
|
||||
internal B32 d_commit_eval_value_string(E_Eval dst_eval, String8 string);
|
||||
|
||||
//- rjf: type helpers
|
||||
internal E_MemberArray d_filtered_data_members_from_members_cfg_table(Arena *arena, E_MemberArray members, D_CfgTable *cfg);
|
||||
internal D_EvalLinkBaseChunkList d_eval_link_base_chunk_list_from_eval(Arena *arena, E_TypeKey link_member_type_key, U64 link_member_off, E_Eval eval, U64 cap);
|
||||
internal D_EvalLinkBase d_eval_link_base_from_chunk_list_index(D_EvalLinkBaseChunkList *list, U64 idx);
|
||||
internal D_EvalLinkBaseArray d_eval_link_base_array_from_chunk_list(Arena *arena, D_EvalLinkBaseChunkList *chunks);
|
||||
|
||||
//- rjf: viz block collection building
|
||||
internal D_EvalVizBlock *d_eval_viz_block_begin(Arena *arena, D_EvalVizBlockKind kind, D_ExpandKey parent_key, D_ExpandKey key, S32 depth);
|
||||
internal D_EvalVizBlock *d_eval_viz_block_split_and_continue(Arena *arena, D_EvalVizBlockList *list, D_EvalVizBlock *split_block, U64 split_idx);
|
||||
internal void d_eval_viz_block_end(D_EvalVizBlockList *list, D_EvalVizBlock *block);
|
||||
internal void d_append_expr_eval_viz_blocks__rec(Arena *arena, D_EvalView *view, D_ExpandKey parent_key, D_ExpandKey key, String8 string, E_Expr *expr, D_CfgTable *cfg_table, S32 depth, D_EvalVizBlockList *list_out);
|
||||
internal D_EvalVizBlockList d_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, D_EvalView *eval_view, D_CfgTable *cfg_table, String8 expr, D_ExpandKey parent_key, D_ExpandKey key);
|
||||
internal void d_eval_viz_block_list_concat__in_place(D_EvalVizBlockList *dst, D_EvalVizBlockList *to_push);
|
||||
|
||||
//- rjf: viz block list <-> table coordinates
|
||||
internal S64 d_row_num_from_viz_block_list_key(D_EvalVizBlockList *blocks, D_ExpandKey key);
|
||||
internal D_ExpandKey d_key_from_viz_block_list_row_num(D_EvalVizBlockList *blocks, S64 row_num);
|
||||
internal D_ExpandKey d_parent_key_from_viz_block_list_row_num(D_EvalVizBlockList *blocks, S64 row_num);
|
||||
|
||||
//- rjf: viz block * index -> expression
|
||||
internal E_Expr *d_expr_from_eval_viz_block_index(Arena *arena, D_EvalVizBlock *block, U64 index);
|
||||
|
||||
//- rjf: viz row list building
|
||||
internal D_EvalVizRow *d_eval_viz_row_list_push_new(Arena *arena, D_EvalView *eval_view, D_EvalVizWindowedRowList *rows, D_EvalVizBlock *block, D_ExpandKey key, E_Expr *expr);
|
||||
internal D_EvalVizWindowedRowList d_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, D_EvalView *eval_view, Rng1S64 visible_range, D_EvalVizBlockList *blocks);
|
||||
|
||||
//- rjf: viz row -> strings
|
||||
internal String8 d_expr_string_from_viz_row(Arena *arena, D_EvalVizRow *row);
|
||||
|
||||
//- rjf: viz row -> expandability/editability
|
||||
internal B32 d_viz_row_is_expandable(D_EvalVizRow *row);
|
||||
internal B32 d_viz_row_is_editable(D_EvalVizRow *row);
|
||||
|
||||
//- rjf: eval / view rule params tree info extraction
|
||||
internal U64 d_base_offset_from_eval(E_Eval eval);
|
||||
internal E_Value d_value_from_params(MD_Node *params);
|
||||
internal E_TypeKey d_type_key_from_params(MD_Node *params);
|
||||
internal E_Value d_value_from_params_key(MD_Node *params, String8 key);
|
||||
internal Rng1U64 d_range_from_eval_params(E_Eval eval, MD_Node *params);
|
||||
internal TXT_LangKind d_lang_kind_from_eval_params(E_Eval eval, MD_Node *params);
|
||||
|
||||
@@ -287,27 +287,27 @@ D_CmdSpecInfo d_core_cmd_kind_spec_info_table[38] =
|
||||
|
||||
D_ViewRuleSpecInfo d_core_view_rule_spec_info_table[21] =
|
||||
{
|
||||
{str8_lit_comp("default"), str8_lit_comp("Default"), str8_lit_comp(""), str8_lit_comp(""), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(default) , },
|
||||
{str8_lit_comp("array"), str8_lit_comp("Array"), str8_lit_comp("x:{expr}"), str8_lit_comp("Specifies that a pointer points to N elements, rather than only 1."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(array) , 0, },
|
||||
{str8_lit_comp("slice"), str8_lit_comp("Slice"), str8_lit_comp(""), str8_lit_comp("Specifies that a pointer within a struct, also containing an integer, points to the number of elements encoded by the integer."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(slice) , 0, },
|
||||
{str8_lit_comp("list"), str8_lit_comp("List"), str8_lit_comp("x:{member}"), str8_lit_comp("Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(list) , },
|
||||
{str8_lit_comp("bswap"), str8_lit_comp("Byte Swap"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should be byte-swapped, such that their endianness is reversed."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(bswap) , 0, },
|
||||
{str8_lit_comp("cast"), str8_lit_comp("Cast"), str8_lit_comp("x:{type}"), str8_lit_comp("Specifies that the expression to which the view rule is applied should be casted to the provided type."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_NAME(cast) , 0, },
|
||||
{str8_lit_comp("dec"), str8_lit_comp("Decimal Base (Base 10)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-10 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
|
||||
{str8_lit_comp("bin"), str8_lit_comp("Binary Base (Base 2)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-2 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
|
||||
{str8_lit_comp("oct"), str8_lit_comp("Octal Base (Base 8)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-8 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
|
||||
{str8_lit_comp("hex"), str8_lit_comp("Hexadecimal Base (Base 16)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-16 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
|
||||
{str8_lit_comp("only"), str8_lit_comp("Only Specified Members"), str8_lit_comp("x:{member}"), str8_lit_comp("Specifies that only the specified members should appear in struct, union, or class evaluations."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(only) , },
|
||||
{str8_lit_comp("omit"), str8_lit_comp("Omit Specified Members"), str8_lit_comp("x:{member}"), str8_lit_comp("Omits a list of member names from appearing in struct, union, or class evaluations."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(omit) , },
|
||||
{str8_lit_comp("no_addr"), str8_lit_comp("Disable Address Values"), str8_lit_comp(""), str8_lit_comp("Displays only what pointers point to, if possible, without the pointer's address value."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
|
||||
{str8_lit_comp("checkbox"), str8_lit_comp("Checkbox"), str8_lit_comp(""), str8_lit_comp("Displays simple integer values as checkboxes, encoding zero or nonzero values."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
|
||||
{str8_lit_comp("color_rgba"), str8_lit_comp("Color (RGBA)"), str8_lit_comp(""), str8_lit_comp("Displays as a color, interpreting the data as encoding R, G, B, and A values."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(color_rgba) , },
|
||||
{str8_lit_comp("text"), str8_lit_comp("Text"), str8_lit_comp("x:{'lang':lang, 'size':expr}"), str8_lit_comp("Displays as text."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(text) , },
|
||||
{str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), str8_lit_comp("x:{'arch':arch, 'size':expr}"), str8_lit_comp("Displays as disassembled instructions, interpreting the data as raw machine code."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(disasm) , },
|
||||
{str8_lit_comp("memory"), str8_lit_comp("Memory"), str8_lit_comp("x:{'size':expr}"), str8_lit_comp("Displays as a raw memory grid."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(memory) , },
|
||||
{str8_lit_comp("graph"), str8_lit_comp("Graph"), str8_lit_comp(""), str8_lit_comp("Displays as a pointer graph, visualizing nodes and edges formed by pointers directly."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(graph) , },
|
||||
{str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), str8_lit_comp("x:{'w':expr, 'h':expr, 'fmt':tex2dformat}"), str8_lit_comp("Displays as a bitmap, interpreting the data as raw pixel data."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(bitmap) , },
|
||||
{str8_lit_comp("geo3d"), str8_lit_comp("Geometry (3D)"), str8_lit_comp("x:{'count':expr, 'vtx':expr, 'vtx_size':expr}"), str8_lit_comp("Displays as geometry, interpreting the data as index or vertex data."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), 0, D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(geo3d) , },
|
||||
{str8_lit_comp("default"), str8_lit_comp("Default"), str8_lit_comp(""), str8_lit_comp(""), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("array"), str8_lit_comp("Array"), str8_lit_comp("x:{expr}"), str8_lit_comp("Specifies that a pointer points to N elements, rather than only 1."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("slice"), str8_lit_comp("Slice"), str8_lit_comp(""), str8_lit_comp("Specifies that a pointer within a struct, also containing an integer, points to the number of elements encoded by the integer."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("list"), str8_lit_comp("List"), str8_lit_comp("x:{member}"), str8_lit_comp("Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("bswap"), str8_lit_comp("Byte Swap"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should be byte-swapped, such that their endianness is reversed."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("cast"), str8_lit_comp("Cast"), str8_lit_comp("x:{type}"), str8_lit_comp("Specifies that the expression to which the view rule is applied should be casted to the provided type."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*1)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("dec"), str8_lit_comp("Decimal Base (Base 10)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-10 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("bin"), str8_lit_comp("Binary Base (Base 2)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-2 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("oct"), str8_lit_comp("Octal Base (Base 8)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-8 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("hex"), str8_lit_comp("Hexadecimal Base (Base 16)"), str8_lit_comp(""), str8_lit_comp("Specifies that all integral evaluations should appear in base-16 form."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("only"), str8_lit_comp("Only Specified Members"), str8_lit_comp("x:{member}"), str8_lit_comp("Specifies that only the specified members should appear in struct, union, or class evaluations."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("omit"), str8_lit_comp("Omit Specified Members"), str8_lit_comp("x:{member}"), str8_lit_comp("Omits a list of member names from appearing in struct, union, or class evaluations."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("no_addr"), str8_lit_comp("Disable Address Values"), str8_lit_comp(""), str8_lit_comp("Displays only what pointers point to, if possible, without the pointer's address value."), (D_ViewRuleSpecInfoFlag_Inherited*1)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("checkbox"), str8_lit_comp("Checkbox"), str8_lit_comp(""), str8_lit_comp("Displays simple integer values as checkboxes, encoding zero or nonzero values."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*0), },
|
||||
{str8_lit_comp("color_rgba"), str8_lit_comp("Color (RGBA)"), str8_lit_comp(""), str8_lit_comp("Displays as a color, interpreting the data as encoding R, G, B, and A values."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("text"), str8_lit_comp("Text"), str8_lit_comp("x:{'lang':lang, 'size':expr}"), str8_lit_comp("Displays as text."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), str8_lit_comp("x:{'arch':arch, 'size':expr}"), str8_lit_comp("Displays as disassembled instructions, interpreting the data as raw machine code."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("memory"), str8_lit_comp("Memory"), str8_lit_comp("x:{'size':expr}"), str8_lit_comp("Displays as a raw memory grid."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("graph"), str8_lit_comp("Graph"), str8_lit_comp(""), str8_lit_comp("Displays as a pointer graph, visualizing nodes and edges formed by pointers directly."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), str8_lit_comp("x:{'w':expr, 'h':expr, 'fmt':tex2dformat}"), str8_lit_comp("Displays as a bitmap, interpreting the data as raw pixel data."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
{str8_lit_comp("geo3d"), str8_lit_comp("Geometry (3D)"), str8_lit_comp("x:{'count':expr, 'vtx':expr, 'vtx_size':expr}"), str8_lit_comp("Displays as geometry, interpreting the data as index or vertex data."), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*1)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
|
||||
};
|
||||
|
||||
C_LINKAGE_END
|
||||
|
||||
@@ -273,21 +273,6 @@ U64 inline_depth;
|
||||
.string = d_regs()->string,\
|
||||
.params_tree = d_regs()->params_tree,\
|
||||
|
||||
D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(array);
|
||||
D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(slice);
|
||||
D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(bswap);
|
||||
D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(cast);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(default);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(list);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(only);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(omit);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(color_rgba);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(memory);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(graph);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap);
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo3d);
|
||||
global B32 DEV_telemetry_capture = 0;
|
||||
global B32 DEV_simulate_lag = 0;
|
||||
global B32 DEV_draw_ui_text_pos = 0;
|
||||
|
||||
@@ -6025,7 +6025,7 @@ df_append_value_strings_from_eval(Arena *arena, D_EvalVizStringFlags flags, U32
|
||||
default:
|
||||
{
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
String8 string = d_string_from_simple_typed_eval(arena, flags, radix, value_eval);
|
||||
String8 string = ev_string_from_simple_typed_eval(arena, flags, radix, value_eval);
|
||||
space_taken += fnt_dim_from_tag_size_string(font, font_size, 0, 0, string).x;
|
||||
str8_list_push(arena, out, string);
|
||||
}break;
|
||||
@@ -6076,7 +6076,7 @@ df_append_value_strings_from_eval(Arena *arena, D_EvalVizStringFlags flags, U32
|
||||
case 2: {string = str8_from_16(arena, str16_cstring((U16 *)string_buffer));}break;
|
||||
case 4: {string = str8_from_32(arena, str32_cstring((U32 *)string_buffer));}break;
|
||||
}
|
||||
String8 string_escaped = d_escaped_from_raw_string(arena, string);
|
||||
String8 string_escaped = ev_escaped_from_raw_string(arena, string);
|
||||
space_taken += fnt_dim_from_tag_size_string(font, font_size, 0, 0, string_escaped).x;
|
||||
space_taken += 2*fnt_dim_from_tag_size_string(font, font_size, 0, 0, str8_lit("\"")).x;
|
||||
str8_list_push(arena, out, str8_lit("\""));
|
||||
@@ -6136,7 +6136,7 @@ df_append_value_strings_from_eval(Arena *arena, D_EvalVizStringFlags flags, U32
|
||||
space_taken += fnt_dim_from_tag_size_string(font, font_size, 0, 0, ptr_prefix).x;
|
||||
str8_list_push(arena, out, ptr_prefix);
|
||||
}
|
||||
String8 string = d_string_from_simple_typed_eval(arena, flags, radix, value_eval);
|
||||
String8 string = ev_string_from_simple_typed_eval(arena, flags, radix, value_eval);
|
||||
space_taken += fnt_dim_from_tag_size_string(font, font_size, 0, 0, string).x;
|
||||
str8_list_push(arena, out, string);
|
||||
if(did_content)
|
||||
@@ -6197,7 +6197,7 @@ df_append_value_strings_from_eval(Arena *arena, D_EvalVizStringFlags flags, U32
|
||||
case 2: {string = str8_from_16(arena, str16_cstring((U16 *)string_buffer));}break;
|
||||
case 4: {string = str8_from_32(arena, str32_cstring((U32 *)string_buffer));}break;
|
||||
}
|
||||
String8 string_escaped = d_escaped_from_raw_string(arena, string);
|
||||
String8 string_escaped = ev_escaped_from_raw_string(arena, string);
|
||||
space_taken += fnt_dim_from_tag_size_string(font, font_size, 0, 0, string_escaped).x;
|
||||
space_taken += 2*fnt_dim_from_tag_size_string(font, font_size, 0, 0, str8_lit("\"")).x;
|
||||
str8_list_push(arena, out, str8_lit("\""));
|
||||
|
||||
@@ -1,293 +1,12 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: default
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(default)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: unpack expression type info
|
||||
//
|
||||
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(scratch.arena, expr);
|
||||
E_TypeKey type_key = e_type_unwrap(irtree.type_key);
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
E_TypeKey direct_type_key = e_type_unwrap(e_type_direct_from_key(type_key));
|
||||
E_TypeKind direct_type_kind = e_type_kind_from_key(direct_type_key);
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: do struct/union/class member block generation
|
||||
//
|
||||
if((type_kind == E_TypeKind_Struct ||
|
||||
type_kind == E_TypeKind_Union ||
|
||||
type_kind == E_TypeKind_Class) ||
|
||||
(e_type_kind_is_pointer_or_ref(type_kind) && (direct_type_kind == E_TypeKind_Struct ||
|
||||
direct_type_kind == E_TypeKind_Union ||
|
||||
direct_type_kind == E_TypeKind_Class)))
|
||||
{
|
||||
// rjf: type -> filtered data members
|
||||
E_MemberArray data_members = e_type_data_members_from_key(arena, e_type_kind_is_pointer_or_ref(type_kind) ? direct_type_key : type_key);
|
||||
E_MemberArray filtered_data_members = d_filtered_data_members_from_members_cfg_table(arena, data_members, cfg_table);
|
||||
|
||||
// rjf: build blocks for all members, split by sub-expansions
|
||||
D_EvalVizBlock *last_vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Members, key, d_expand_key_make(df_hash_from_expand_key(key), 0), depth);
|
||||
{
|
||||
last_vb->expr = expr;
|
||||
last_vb->cfg_table = cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, filtered_data_members.count);
|
||||
last_vb->members = filtered_data_members;
|
||||
}
|
||||
for(D_ExpandNode *child = expand_node->first; child != 0; child = child->next)
|
||||
{
|
||||
// rjf: unpack expansion info; skip out-of-bounds splits
|
||||
U64 child_num = child->key.child_num;
|
||||
U64 child_idx = child_num-1;
|
||||
E_Expr *child_expr = d_expr_from_eval_viz_block_index(arena, last_vb, child_idx);
|
||||
if(child_idx >= last_vb->semantic_idx_range.max)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: form split: truncate & complete last block; begin next block
|
||||
last_vb = d_eval_viz_block_split_and_continue(arena, out, last_vb, child_idx);
|
||||
|
||||
// rjf: build child config table
|
||||
D_CfgTable *child_cfg_table = push_array(arena, D_CfgTable, 1);
|
||||
*child_cfg_table = d_cfg_table_from_inheritance(arena, cfg_table);
|
||||
{
|
||||
String8 view_rule_string = d_eval_view_rule_from_key(eval_view, child->key);
|
||||
if(view_rule_string.size != 0)
|
||||
{
|
||||
d_cfg_table_push_unparsed_string(arena, child_cfg_table, view_rule_string, D_CfgSrc_User);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: recurse for child
|
||||
d_append_expr_eval_viz_blocks__rec(arena, eval_view, key, child->key, str8_zero(), child_expr, child_cfg_table, depth, out);
|
||||
}
|
||||
d_eval_viz_block_end(out, last_vb);
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: do enum member block generation
|
||||
//
|
||||
// (just a single block for all enum members; enum members can never be expanded)
|
||||
//
|
||||
else if(type_kind == E_TypeKind_Enum ||
|
||||
(e_type_kind_is_pointer_or_ref(type_kind) && direct_type_kind == E_TypeKind_Enum))
|
||||
{
|
||||
E_Type *type = e_type_from_key(arena, e_type_kind_is_pointer_or_ref(type_kind) ? direct_type_key : type_key);
|
||||
D_EvalVizBlock *last_vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_EnumMembers, key, d_expand_key_make(df_hash_from_expand_key(key), 0), depth);
|
||||
{
|
||||
last_vb->expr = expr;
|
||||
last_vb->cfg_table = cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, type->count);
|
||||
last_vb->enum_vals.v = type->enum_vals;
|
||||
last_vb->enum_vals.count = type->count;
|
||||
}
|
||||
d_eval_viz_block_end(out, last_vb);
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: do array element block generation
|
||||
//
|
||||
else if(type_kind == E_TypeKind_Array ||
|
||||
(e_type_kind_is_pointer_or_ref(type_kind) && direct_type_kind == E_TypeKind_Array))
|
||||
{
|
||||
// rjf: unpack array type info
|
||||
E_Type *array_type = e_type_from_key(scratch.arena, e_type_kind_is_pointer_or_ref(type_kind) ? direct_type_key : type_key);
|
||||
U64 array_count = array_type->count;
|
||||
B32 need_extra_deref = e_type_kind_is_pointer_or_ref(type_kind);
|
||||
|
||||
// rjf: build blocks for all elements, split by sub-expansions
|
||||
D_EvalVizBlock *last_vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Elements, key, d_expand_key_make(df_hash_from_expand_key(key), 0), depth);
|
||||
{
|
||||
last_vb->expr = need_extra_deref ? e_expr_ref_deref(arena, expr) : expr;
|
||||
last_vb->cfg_table = cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, array_count);
|
||||
}
|
||||
for(D_ExpandNode *child = expand_node->first; child != 0; child = child->next)
|
||||
{
|
||||
// rjf: unpack expansion info; skip out-of-bounds splits
|
||||
U64 child_num = child->key.child_num;
|
||||
U64 child_idx = child_num-1;
|
||||
E_Expr *child_expr = d_expr_from_eval_viz_block_index(arena, last_vb, child_idx);
|
||||
if(child_idx >= last_vb->semantic_idx_range.max)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: form split: truncate & complete last block; begin next block
|
||||
last_vb = d_eval_viz_block_split_and_continue(arena, out, last_vb, child_idx);
|
||||
|
||||
// rjf: build child config table
|
||||
D_CfgTable *child_cfg_table = push_array(arena, D_CfgTable, 1);
|
||||
*child_cfg_table = d_cfg_table_from_inheritance(arena, cfg_table);
|
||||
{
|
||||
String8 view_rule_string = d_eval_view_rule_from_key(eval_view, child->key);
|
||||
if(view_rule_string.size != 0)
|
||||
{
|
||||
d_cfg_table_push_unparsed_string(arena, child_cfg_table, view_rule_string, D_CfgSrc_User);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: recurse for child
|
||||
d_append_expr_eval_viz_blocks__rec(arena, eval_view, key, child->key, str8_zero(), child_expr, child_cfg_table, depth, out);
|
||||
}
|
||||
d_eval_viz_block_end(out, last_vb);
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: do pointer-to-pointer block generation
|
||||
//
|
||||
else if(e_type_kind_is_pointer_or_ref(type_kind) && e_type_kind_is_pointer_or_ref(direct_type_kind))
|
||||
{
|
||||
// rjf: compute key
|
||||
D_ExpandKey child_key = d_expand_key_make(df_hash_from_expand_key(key), 1);
|
||||
|
||||
// rjf: build child config table
|
||||
D_CfgTable *child_cfg_table = push_array(arena, D_CfgTable, 1);
|
||||
*child_cfg_table = d_cfg_table_from_inheritance(arena, cfg_table);
|
||||
{
|
||||
String8 view_rule_string = d_eval_view_rule_from_key(eval_view, child_key);
|
||||
if(view_rule_string.size != 0)
|
||||
{
|
||||
d_cfg_table_push_unparsed_string(arena, child_cfg_table, view_rule_string, D_CfgSrc_User);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: recurse for child
|
||||
E_Expr *child_expr = e_expr_ref_deref(arena, expr);
|
||||
d_append_expr_eval_viz_blocks__rec(arena, eval_view, key, child_key, str8_zero(), child_expr, child_cfg_table, depth, out);
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "array"
|
||||
|
||||
D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(array)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(scratch.arena, expr);
|
||||
E_TypeKey type_key = irtree.type_key;
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
if(e_type_kind_is_pointer_or_ref(type_kind))
|
||||
{
|
||||
E_Value count = d_value_from_params(params);
|
||||
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 ptr_type_key = e_type_key_cons_ptr(e_type_state->ctx->primary_module->arch, array_type_key);
|
||||
expr = e_expr_ref_cast(arena, ptr_type_key, expr);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return expr;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "slice"
|
||||
|
||||
D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(slice)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(scratch.arena, expr);
|
||||
E_TypeKind type_kind = e_type_kind_from_key(irtree.type_key);
|
||||
if(type_kind == E_TypeKind_Struct || type_kind == E_TypeKind_Class)
|
||||
{
|
||||
// rjf: unpack members
|
||||
E_MemberArray members = e_type_data_members_from_key(scratch.arena, irtree.type_key);
|
||||
|
||||
// rjf: choose base pointer & count members
|
||||
E_Member *base_ptr_member = 0;
|
||||
E_Member *count_member = 0;
|
||||
for(U64 idx = 0; idx < members.count; idx += 1)
|
||||
{
|
||||
E_Member *member = &members.v[idx];
|
||||
E_TypeKey member_type = e_type_unwrap(member->type_key);
|
||||
E_TypeKind member_type_kind = e_type_kind_from_key(member_type);
|
||||
if(count_member == 0 && e_type_kind_is_integer(member_type_kind))
|
||||
{
|
||||
count_member = member;
|
||||
}
|
||||
if(base_ptr_member == 0 && e_type_kind_is_pointer_or_ref(member_type_kind))
|
||||
{
|
||||
base_ptr_member = &members.v[idx];
|
||||
}
|
||||
if(count_member != 0 && base_ptr_member != 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: evaluate count member, determine count
|
||||
U64 count = 0;
|
||||
if(count_member != 0)
|
||||
{
|
||||
E_Expr *count_member_expr = e_expr_ref_member_access(scratch.arena, expr, count_member->name);
|
||||
E_Eval count_member_eval = e_eval_from_expr(scratch.arena, count_member_expr);
|
||||
E_Eval count_member_value_eval = e_value_eval_from_eval(count_member_eval);
|
||||
count = count_member_value_eval.value.u64;
|
||||
}
|
||||
|
||||
// rjf: generate new struct slice type
|
||||
E_TypeKey slice_type_key = zero_struct;
|
||||
if(base_ptr_member != 0 && count_member != 0)
|
||||
{
|
||||
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 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_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, &(E_Member){.kind = E_MemberKind_DataField, .type_key = sized_base_ptr_type_key, .name = base_ptr_member->name, .off = base_ptr_member->off});
|
||||
E_MemberArray slice_type_members_array = e_member_array_from_list(scratch.arena, &slice_type_members);
|
||||
slice_type_key = e_type_key_cons(.arch = e_type_state->ctx->primary_module->arch,
|
||||
.kind = E_TypeKind_Struct,
|
||||
.name = struct_name,
|
||||
.members = slice_type_members_array.v,
|
||||
.count = slice_type_members_array.count);
|
||||
}
|
||||
|
||||
// rjf: generate new expression tree - addr of struct, cast-to-ptr, deref
|
||||
if(base_ptr_member != 0 && count_member != 0)
|
||||
{
|
||||
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_deref(arena, expr);
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return expr;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "list"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(list){}
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(list){}
|
||||
DF_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(list){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "bswap"
|
||||
|
||||
D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(bswap)
|
||||
{
|
||||
expr = e_expr_ref_bswap(arena, expr);
|
||||
return expr;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "cast"
|
||||
|
||||
D_VIEW_RULE_EXPR_RESOLUTION_FUNCTION_DEF(cast)
|
||||
{
|
||||
E_TypeKey type_key = d_type_key_from_params(params);
|
||||
expr = e_expr_ref_cast(arena, type_key, expr);
|
||||
return expr;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "dec"
|
||||
|
||||
@@ -311,14 +30,14 @@ DF_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(hex){}
|
||||
////////////////////////////////
|
||||
//~ rjf: "only"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(only){}
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(only){}
|
||||
DF_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(only){}
|
||||
DF_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(only){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "omit"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(omit){}
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(omit){}
|
||||
DF_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(omit){}
|
||||
DF_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(omit){}
|
||||
|
||||
@@ -345,15 +64,15 @@ DF_VIEW_RULE_ROW_UI_FUNCTION_DEF(checkbox)
|
||||
////////////////////////////////
|
||||
//~ rjf: "rgba"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(color_rgba)
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(color_rgba)
|
||||
{
|
||||
D_EvalVizBlock *vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Canvas, key, d_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
EV_Block *vb = ev_block_begin(arena, EV_BlockKind_Canvas, key, ev_key_make(ev_hash_from_key(key), 1), depth);
|
||||
vb->string = string;
|
||||
vb->expr = expr;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
vb->cfg_table = cfg_table;
|
||||
d_eval_viz_block_end(out, vb);
|
||||
vb->view_rules = view_rules;
|
||||
ev_block_end(out, vb);
|
||||
}
|
||||
|
||||
DF_VIEW_RULE_ROW_UI_FUNCTION_DEF(color_rgba)
|
||||
@@ -418,83 +137,83 @@ DF_VIEW_RULE_ROW_UI_FUNCTION_DEF(color_rgba)
|
||||
////////////////////////////////
|
||||
//~ rjf: "text"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text)
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(text)
|
||||
{
|
||||
D_EvalVizBlock *vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Canvas, key, d_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
EV_Block *vb = ev_block_begin(arena, EV_BlockKind_Canvas, key, ev_key_make(ev_hash_from_key(key), 1), depth);
|
||||
vb->string = string;
|
||||
vb->expr = expr;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
vb->cfg_table = cfg_table;
|
||||
d_eval_viz_block_end(out, vb);
|
||||
vb->view_rules = view_rules;
|
||||
ev_block_end(out, vb);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "disasm"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm)
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(disasm)
|
||||
{
|
||||
D_EvalVizBlock *vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Canvas, key, d_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
EV_Block *vb = ev_block_begin(arena, EV_BlockKind_Canvas, key, ev_key_make(ev_hash_from_key(key), 1), depth);
|
||||
vb->string = string;
|
||||
vb->expr = expr;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
vb->cfg_table = cfg_table;
|
||||
d_eval_viz_block_end(out, vb);
|
||||
vb->view_rules = view_rules;
|
||||
ev_block_end(out, vb);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "memory"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(memory)
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(memory)
|
||||
{
|
||||
D_EvalVizBlock *vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Canvas, key, d_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
EV_Block *vb = ev_block_begin(arena, EV_BlockKind_Canvas, key, ev_key_make(ev_hash_from_key(key), 1), depth);
|
||||
vb->string = string;
|
||||
vb->expr = expr;
|
||||
vb->visual_idx_range = r1u64(0, 16);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
vb->cfg_table = cfg_table;
|
||||
d_eval_viz_block_end(out, vb);
|
||||
vb->view_rules = view_rules;
|
||||
ev_block_end(out, vb);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "graph"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(graph)
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(graph)
|
||||
{
|
||||
D_EvalVizBlock *vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Canvas, key, d_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
EV_Block *vb = ev_block_begin(arena, EV_BlockKind_Canvas, key, ev_key_make(ev_hash_from_key(key), 1), depth);
|
||||
vb->string = string;
|
||||
vb->expr = expr;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
vb->cfg_table = cfg_table;
|
||||
d_eval_viz_block_end(out, vb);
|
||||
vb->view_rules = view_rules;
|
||||
ev_block_end(out, vb);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "bitmap"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap)
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
D_EvalVizBlock *vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Canvas, key, d_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
EV_Block *vb = ev_block_begin(arena, EV_BlockKind_Canvas, key, ev_key_make(ev_hash_from_key(key), 1), depth);
|
||||
vb->string = string;
|
||||
vb->expr = expr;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
vb->cfg_table = cfg_table;
|
||||
d_eval_viz_block_end(out, vb);
|
||||
vb->view_rules = view_rules;
|
||||
ev_block_end(out, vb);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "geo3d"
|
||||
|
||||
D_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo3d)
|
||||
EV_VIEW_RULE_BLOCK_PROD_FUNCTION_DEF(geo3d)
|
||||
{
|
||||
D_EvalVizBlock *vb = d_eval_viz_block_begin(arena, D_EvalVizBlockKind_Canvas, key, d_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
EV_Block *vb = ev_block_begin(arena, EV_BlockKind_Canvas, key, ev_key_make(ev_hash_from_key(key), 1), depth);
|
||||
vb->string = string;
|
||||
vb->expr = expr;
|
||||
vb->visual_idx_range = r1u64(0, 16);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
vb->cfg_table = cfg_table;
|
||||
d_eval_viz_block_end(out, vb);
|
||||
vb->view_rules = view_rules;
|
||||
ev_block_end(out, vb);
|
||||
}
|
||||
|
||||
@@ -2489,7 +2489,7 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
|
||||
cell_ui_hook = value_ui_rule_spec->info.row_ui;
|
||||
cell_ui_params = value_ui_rule_root;
|
||||
}
|
||||
cell_can_edit = d_type_key_is_editable(cell_eval.type_key);
|
||||
cell_can_edit = ev_type_key_is_editable(cell_eval.type_key);
|
||||
}break;
|
||||
case DF_WatchViewColumnKind_Type:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user