Merge remote-tracking branch 'gingerbill/master' into odin

This commit is contained in:
2024-04-02 15:48:04 -04:00
11 changed files with 252 additions and 113 deletions
+2 -1
View File
@@ -6972,7 +6972,8 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
}
//- rjf: clear members cache
if(df_state->member_cache_reggen_idx != new_reg_gen && !df_ctrl_targets_running())
if(df_state->member_cache_reggen_idx != new_reg_gen &&
!df_ctrl_targets_running())
{
df_state->member_cache_gen += 1;
DF_RunLocalsCache *cache = &df_state->member_caches[df_state->member_cache_gen%ArrayCount(df_state->member_caches)];
+1 -1
View File
@@ -500,7 +500,7 @@ DF_CoreViewRuleTable:
{Disasm disasm "disasm" - x - x "Disassembly" x "Displays as disassembled instructions, interpreting the data as raw machine code." }
{Bitmap bitmap "bitmap" - x - x "Bitmap" x "Displays as a bitmap, interpreting the data as raw pixel data." }
{Geo geo "geo" - x - x "Geometry" x "Displays as geometry, interpreting the data as vertex data." }
{OdinMap odin_map "odin_map" - - x - "Odin map" x "Specifies that a struct to be rendered as an Odin map type." }
{OdinMap odin_map "odin_map" - x - x "Odin map" x "Specifies that a struct to be rendered as an Odin map type." }
}
////////////////////////////////
+1 -1
View File
@@ -438,7 +438,7 @@ DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[18] =
{str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), str8_lit_comp("Displays as disassembled instructions, interpreting the data as raw machine code."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(disasm) , },
{str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), str8_lit_comp("Displays as a bitmap, interpreting the data as raw pixel data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(bitmap) , },
{str8_lit_comp("geo"), str8_lit_comp("Geometry"), str8_lit_comp("Displays as geometry, interpreting the data as vertex data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(geo) , },
{str8_lit_comp("odin_map"), str8_lit_comp("Odin map"), str8_lit_comp("Specifies that a struct to be rendered as an Odin map type."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(odin_map) , 0, },
{str8_lit_comp("odin_map"), str8_lit_comp("Odin map"), str8_lit_comp("Specifies that a struct to be rendered as an Odin map type."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(odin_map) , },
};
String8 df_g_icon_kind_text_table[69] =
+1 -1
View File
@@ -405,7 +405,6 @@ B32 force_confirm;
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(array);
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(slice);
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(bswap);
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(odin_map);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(list);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(only);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(omit);
@@ -414,6 +413,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo);
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(odin_map);
struct{String8 mnemonic; String8 summary;} df_g_inst_table_x64[] =
{
+2
View File
@@ -244,6 +244,7 @@ DF_CmdParamSlot2ViewSpecMap:
DF_GfxViewRuleTable:
{
{"array" - - - - - }
{"slice" - - - - - }
{"list" x - - - - }
{"dec" - x - - - }
{"bin" - x - - - }
@@ -256,6 +257,7 @@ DF_GfxViewRuleTable:
{"text" - - - x - }
{"disasm" - - - x - }
{"bitmap" - - x x x }
{"odin_map" - - x x x }
{"geo" - - x x - }
}
+202 -93
View File
@@ -463,9 +463,9 @@ DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(slice)
////////////////////////////////
//~ bill: "odin_map"
typedef struct DF_OdinMapCellInfo DF_OdinMapCellInfo;
struct DF_OdinMapCellInfo {
struct DF_OdinMapCellInfo
{
U64 size_of_type;
U64 size_of_cell;
U64 elements_per_cell;
@@ -565,112 +565,221 @@ internal U64 df_evaluate_hash_from_offset(EVAL_ParseCtx *parse_ctx, DF_CtrlCtx *
}
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(odin_map)
typedef struct DF_OdinMapData DF_OdinMapData;
struct DF_OdinMapData
{
U64 len;
U64 cap;
TG_Key key;
TG_Key value;
TG_Key hash;
TG_Key key_cell;
TG_Key value_cell;
DF_Eval allocator_eval;
U64 key_ptr;
U64 value_ptr;
U64 hash_ptr;
DF_OdinMapCellInfo key_cell_info;
DF_OdinMapCellInfo value_cell_info;
U64 size_of_hash;
};
internal B32 df_odin_map_data(Arena *arena, EVAL_ParseCtx *parse_ctx, DF_CtrlCtx *ctrl_ctx, DF_Eval eval, DF_OdinMapData *md)
{
B32 ok = false;
*md = zero_struct;
TG_Key type_key = eval.type_key;
TG_Kind type_kind = tg_kind_from_key(type_key);
if (type_kind == TG_Kind_Struct)
{
DF_CfgNode *struct_node = val->last;
if (struct_node != &df_g_nil_cfg_node)
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(arena, parse_ctx->type_graph, parse_ctx->rdi, type_key);
TG_Member *member_data = tg_member_from_name(data_members, str8_lit("data"), 0);
TG_Member *member_len = tg_member_from_name(data_members, str8_lit("len"), 0);
TG_Member *member_allocator = tg_member_from_name(data_members, str8_lit("allocator"), 0);
if (member_data && member_len && member_allocator)
{
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(arena, parse_ctx->type_graph, parse_ctx->rdi, type_key);
TG_Member *member_data = tg_member_from_name(data_members, str8_lit("data"), 0);
TG_Member *member_len = tg_member_from_name(data_members, str8_lit("len"), 0);
if (member_data && member_len)
TG_Key metadata = member_data->type_key;
metadata = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, metadata);
if (tg_kind_from_key(metadata) != TG_Kind_Struct)
{
TG_Key metadata = member_data->type_key;
metadata = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, metadata);
if (tg_kind_from_key(metadata) != TG_Kind_Struct)
{
return eval;
}
TG_MemberArray md_members = tg_data_members_from_graph_rdi_key(arena, parse_ctx->type_graph, parse_ctx->rdi, metadata);
TG_Member *m_key = tg_member_from_name(md_members, str8_lit("key"), 0);
TG_Member *m_value = tg_member_from_name(md_members, str8_lit("value"), 0);
TG_Member *m_hash = tg_member_from_name(md_members, str8_lit("hash"), 0);
TG_Member *m_key_cell = tg_member_from_name(md_members, str8_lit("key_cell"), 0);
TG_Member *m_value_cell = tg_member_from_name(md_members, str8_lit("value_cell"), 0);
if (m_key == NULL ||
m_value == NULL ||
m_hash == NULL ||
m_key_cell == NULL ||
m_value_cell == NULL)
{
return eval;
}
TG_Key key = m_key->type_key;
TG_Key value = m_value->type_key;
TG_Key hash = m_hash->type_key;
TG_Key key_cell = m_key_cell->type_key;
TG_Key value_cell = m_value_cell->type_key;
U64 raw_data = df_evaluate_integer_from_eval(parse_ctx, ctrl_ctx, eval, member_data);
U64 ptr = raw_data & ~(U64)63;
U64 len = df_evaluate_integer_from_eval(parse_ctx, ctrl_ctx, eval, member_len);
U64 cap_log2 = raw_data & 63;
U64 cap = cap_log2 ? ((U64)1)<<cap_log2 : 0;
TG_Key array_type = zero_struct;
DF_OdinMapCellInfo key_cell_info = df_odin_map_cell_info(arena, parse_ctx, key, key_cell);
DF_OdinMapCellInfo value_cell_info = df_odin_map_cell_info(arena, parse_ctx, value, value_cell);
U64 size_of_hash = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, hash);
U64 key_ptr = ptr;
U64 value_ptr = df_odin_map_cell_index(key_ptr, &key_cell_info, cap);
U64 hash_ptr = df_odin_map_cell_index(value_ptr, &value_cell_info, cap);
(void)value_ptr;
(void)hash_ptr;
U64 TOMBSTONE_MASK = ((U64)1u)<<(size_of_hash*8 - 1);
for (U64 i = 0; i < cap; i += 1)
{
U64 offset_hash = hash_ptr + i*size_of_hash;
U64 h = df_evaluate_hash_from_offset(parse_ctx, ctrl_ctx, offset_hash, hash);
if (h != 0 && (h & TOMBSTONE_MASK) == 0)
{
U64 offset_key = df_odin_map_cell_index(key_ptr, &key_cell_info, i);
U64 offset_value = df_odin_map_cell_index(value_ptr, &value_cell_info, i);
DF_Eval addr_key = zero_struct;
addr_key.mode = EVAL_EvalMode_Addr;
addr_key.offset = offset_key;
addr_key.type_key = key;
DF_Eval addr_value = zero_struct;
addr_value.mode = EVAL_EvalMode_Addr;
addr_value.offset = offset_value;
addr_value.type_key = value;
// render element
}
}
TG_Key key_array_type = tg_cons_type_make(parse_ctx->type_graph, TG_Kind_Array, key_cell, cap/key_cell_info.elements_per_cell);
DF_Eval new_eval = zero_struct;
new_eval.mode = EVAL_EvalMode_Value;
new_eval.imm_u64 = key_ptr;
new_eval.type_key = tg_cons_type_make(parse_ctx->type_graph, TG_Kind_Ptr, key_array_type, 0);
eval = new_eval;
goto end;
}
md->allocator_eval = eval;
md->allocator_eval.offset += member_allocator->off;
md->allocator_eval.type_key = member_allocator->type_key;
TG_MemberArray md_members = tg_data_members_from_graph_rdi_key(arena, parse_ctx->type_graph, parse_ctx->rdi, metadata);
TG_Member *m_key = tg_member_from_name(md_members, str8_lit("key"), 0);
TG_Member *m_value = tg_member_from_name(md_members, str8_lit("value"), 0);
TG_Member *m_hash = tg_member_from_name(md_members, str8_lit("hash"), 0);
TG_Member *m_key_cell = tg_member_from_name(md_members, str8_lit("key_cell"), 0);
TG_Member *m_value_cell = tg_member_from_name(md_members, str8_lit("value_cell"), 0);
if (m_key == NULL ||
m_value == NULL ||
m_hash == NULL ||
m_key_cell == NULL ||
m_value_cell == NULL)
{
goto end;
}
md->key = m_key->type_key;
md->value = m_value->type_key;
md->hash = m_hash->type_key;
md->key_cell = m_key_cell->type_key;
md->value_cell = m_value_cell->type_key;
U64 raw_data = df_evaluate_integer_from_eval(parse_ctx, ctrl_ctx, eval, member_data);
U64 ptr = raw_data & ~(U64)63;
md->len = df_evaluate_integer_from_eval(parse_ctx, ctrl_ctx, eval, member_len);
U64 cap_log2 = raw_data & 63;
md->cap = cap_log2 ? ((U64)1)<<cap_log2 : 0;
TG_Key array_type = zero_struct;
md->key_cell_info = df_odin_map_cell_info(arena, parse_ctx, md->key, md->key_cell);
md->value_cell_info = df_odin_map_cell_info(arena, parse_ctx, md->value, md->value_cell);
md->size_of_hash = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, md->hash);
md->key_ptr = ptr;
md->value_ptr = df_odin_map_cell_index(md->key_ptr, &md->key_cell_info, md->cap);
md->hash_ptr = df_odin_map_cell_index(md->value_ptr, &md->value_cell_info, md->cap);
ok = true;
}
}
return eval;
end:;
return ok;
}
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(odin_map)
{
Temp scratch = scratch_begin(&arena, 1);
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
vb->eval = eval;
vb->cfg_table = *cfg_table;
DF_OdinMapData md = zero_struct;
if (df_odin_map_data(scratch.arena, parse_ctx, ctrl_ctx, eval, &md))
{
U64 const TOMBSTONE_MASK = ((U64)1u)<<(md.size_of_hash*8 - 1);
U64 key_index = 0;
for (U64 i = 0; i < md.cap; i += 1)
{
U64 offset_hash = md.hash_ptr + i*md.size_of_hash;
U64 h = df_evaluate_hash_from_offset(parse_ctx, ctrl_ctx, offset_hash, md.hash);
if (h == 0 || (h & TOMBSTONE_MASK) != 0)
{
continue;
}
U64 offset_key = df_odin_map_cell_index(md.key_ptr, &md.key_cell_info, i);
U64 offset_value = df_odin_map_cell_index(md.value_ptr, &md.value_cell_info, i);
DF_Eval addr_key = zero_struct;
addr_key.mode = EVAL_EvalMode_Addr;
addr_key.offset = offset_key;
addr_key.type_key = md.key;
DF_Eval addr_value = zero_struct;
addr_value.mode = EVAL_EvalMode_Addr;
addr_value.offset = offset_value;
addr_value.type_key = md.value;
// render element
DF_CfgTable child_cfg = *cfg_table;
child_cfg = df_cfg_table_from_inheritance(arena, cfg_table);
DF_ExpandKey row_key = df_expand_key_make(df_hash_from_expand_key(vb->key), i);
B32 row_expanded = df_expand_key_is_set(&eval_view->expand_tree_table, row_key);
DF_EvalVizBlock *block = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Root, vb->key, row_key, depth+1);
block->eval = addr_key;
block->cfg_table = child_cfg;
block->string = row_expanded ? push_str8f(arena, "key") : push_str8f(arena, "key (hash: %I64x)", h);
block->visual_idx_range = r1u64(0, 1);
block->semantic_idx_range = r1u64(0, 1);
df_eval_viz_block_end(out, block);
if (row_expanded)
{
DF_EvalVizBlock * value_block = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Root, row_key, zero_struct, depth+2);
value_block->eval = addr_value;
value_block->cfg_table = child_cfg;
value_block->string = push_str8f(arena, "value");
value_block->visual_idx_range = r1u64(0, 1);
value_block->semantic_idx_range = r1u64(0, 1);
df_eval_viz_block_end(out, value_block);
DF_Eval eval_hash = zero_struct;
eval_hash.type_key = md.hash;
eval_hash.mode = EVAL_EvalMode_Value;
eval_hash.imm_u64 = h;
DF_EvalVizBlock * hash_block = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Root, row_key, zero_struct, depth+2);
hash_block->eval = eval_hash;
hash_block->cfg_table = child_cfg;
hash_block->string = push_str8f(arena, "hash");
hash_block->visual_idx_range = r1u64(0, 1);
hash_block->semantic_idx_range = r1u64(0, 1);
df_eval_viz_block_end(out, hash_block);
}
key_index += 1;
}
}
df_eval_viz_block_end(out, vb);
scratch_end(scratch);
}
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(odin_map)
{
Temp scratch = scratch_begin(0, 0);
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
DF_OdinMapData md = zero_struct;
df_odin_map_data(scratch.arena, parse_ctx, ctrl_ctx, eval, &md);
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
ui_labelf("0x%I64x -> Odin map len: %I64u cap: %I64u", base_vaddr, md.len, md.cap);
scratch_end(scratch);
}
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(odin_map)
{
}
DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(odin_map)
{
}
////////////////////////////////
//~ rjf: "list"
+3 -1
View File
@@ -713,9 +713,10 @@ str8_lit_comp("open_user"),
str8_lit_comp("open_profile"),
};
DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[14] =
DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[16] =
{
{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, 0 },
{ str8_lit_comp("slice"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, 0 },
{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, 0 },
{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, 0 },
{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, 0 },
@@ -728,6 +729,7 @@ DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[14] =
{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , 0 },
{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , 0 },
{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(bitmap) },
{ str8_lit_comp("odin_map"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(odin_map) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(odin_map) , DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(odin_map) },
{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , 0 },
};
+3
View File
@@ -255,13 +255,16 @@ DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(omit);
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(no_addr);
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba);
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(bitmap);
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(odin_map);
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(geo);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(odin_map);
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo);
DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(bitmap);
DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(odin_map);
C_LINKAGE_BEGIN
extern String8 df_g_theme_preset_display_string_table[9];
extern String8 df_g_theme_preset_code_string_table[9];
+1
View File
@@ -2723,6 +2723,7 @@ rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringM
//- rjf: fill shared type node info
dst->kind = src->kind;
dst->flags = (RDI_U16)src->flags; // TODO(rjf): @u32_to_u16
dst->byte_size = src->byte_size;
//- rjf: fill built-in-only type node info
@@ -167,11 +167,14 @@ internal TS_TASK_FUNCTION_DEF(p2b_dump_proc_chunk_task__entry_point)
RDI_Line *line = &line_info.lines[line_info_idx];
U64 line_voff_min = line_info.voffs[line_info_idx];
U64 line_voff_opl = line_info.voffs[line_info_idx+1];
str8_list_pushf(arena, out, "%I64x %I64x %I64u %I64u\n",
line_voff_min,
line_voff_opl-line_voff_min,
(U64)line->line_num,
(U64)line->file_idx);
if(line->file_idx != 0)
{
str8_list_pushf(arena, out, "%I64x %I64x %I64u %I64u\n",
line_voff_min,
line_voff_opl-line_voff_min,
(U64)line->line_num,
(U64)line->file_idx);
}
last_voff = voff;
voff = line_voff_opl;
}
+28 -10
View File
@@ -1257,7 +1257,7 @@ internal TS_TASK_FUNCTION_DEF(p2r_udt_convert_task__entry_point)
CV_LeafKind field_kind = *(CV_LeafKind *)read_ptr;
U64 field_leaf_header_size = cv_header_struct_size_from_leaf_kind(field_kind);
U8 *field_leaf_first = read_ptr+2;
U8 *field_leaf_opl = field_leaf_first+range->hdr.size-2;
U8 *field_leaf_opl = field_list_opl;
next_read_ptr = field_leaf_opl;
// rjf: skip out-of-bounds fields
@@ -1282,6 +1282,9 @@ internal TS_TASK_FUNCTION_DEF(p2r_udt_convert_task__entry_point)
CV_LeafIndex *lf = (CV_LeafIndex *)field_leaf_first;
CV_TypeId new_itype = lf->itype;
// rjf: bump next read pointer past header
next_read_ptr = (U8 *)(lf+1);
// rjf: determine if index itype is new
B32 is_new = 1;
for(FieldListTask *t = fl_done_stack; t != 0; t = t->next)
@@ -1573,6 +1576,9 @@ internal TS_TASK_FUNCTION_DEF(p2r_udt_convert_task__entry_point)
U8 *num2_ptr = num1_ptr + num1.encoded_size;
CV_NumericParsed num2 = cv_numeric_from_data_range(num2_ptr, field_leaf_opl);
// rjf: bump next read pointer past header
next_read_ptr = (U8 *)(lf+1);
// rjf: emit member
RDIM_UDTMember *mem = rdim_udt_push_member(arena, udts, dst_udt);
mem->kind = RDI_MemberKind_VirtualBase;
@@ -1583,6 +1589,10 @@ internal TS_TASK_FUNCTION_DEF(p2r_udt_convert_task__entry_point)
case CV_LeafKind_VFUNCTAB:
{
CV_LeafVFuncTab *lf = (CV_LeafVFuncTab *)field_leaf_first;
// rjf: bump next read pointer past header
next_read_ptr = (U8 *)(lf+1);
// NOTE(rjf): currently no-op this case
(void)lf;
}break;
@@ -1970,7 +1980,7 @@ internal TS_TASK_FUNCTION_DEF(p2r_symbol_stream_convert_task__entry_point)
if(container_name_opl > 2)
{
String8 container_name = str8(name.str, container_name_opl - 2);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, name, 0);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, container_name, 0);
container_type = p2r_type_ptr_from_itype(cv_type_id);
}
@@ -2007,7 +2017,7 @@ internal TS_TASK_FUNCTION_DEF(p2r_symbol_stream_convert_task__entry_point)
if(container_name_opl > 2)
{
String8 container_name = str8(name.str, container_name_opl - 2);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, name, 0);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, container_name, 0);
container_type = p2r_type_ptr_from_itype(cv_type_id);
}
@@ -2182,7 +2192,7 @@ internal TS_TASK_FUNCTION_DEF(p2r_symbol_stream_convert_task__entry_point)
if(container_name_opl > 2)
{
String8 container_name = str8(name.str, container_name_opl - 2);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, name, 0);
CV_TypeId cv_type_id = pdb_tpi_first_itype_from_name(in->tpi_hash, in->tpi_leaf, container_name, 0);
container_type = p2r_type_ptr_from_itype(cv_type_id);
}
@@ -3026,11 +3036,18 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
if(lf->flags & CV_ModifierFlag_Volatile) {flags |= RDI_TypeModifierFlag_Volatile;}
// rjf: fill type
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type->kind = RDI_TypeKind_Modifier;
dst_type->flags = flags;
dst_type->direct_type = p2r_type_ptr_from_itype(lf->itype);
dst_type->byte_size = dst_type->direct_type ? dst_type->direct_type->byte_size : 0;
if(flags == 0)
{
dst_type = p2r_type_ptr_from_itype(lf->itype);
}
else
{
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type->kind = RDI_TypeKind_Modifier;
dst_type->flags = flags;
dst_type->direct_type = p2r_type_ptr_from_itype(lf->itype);
dst_type->byte_size = dst_type->direct_type ? dst_type->direct_type->byte_size : 0;
}
}break;
//- rjf: POINTER
@@ -3072,10 +3089,10 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
}
// rjf: fill type
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
if(modifier_flags != 0)
{
RDIM_Type *pointer_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type->kind = RDI_TypeKind_Modifier;
dst_type->flags = modifier_flags;
dst_type->direct_type = pointer_type;
@@ -3086,6 +3103,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
}
else
{
dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
dst_type->kind = type_kind;
dst_type->byte_size = arch_addr_size;
dst_type->direct_type = direct_type;