mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-27 05:51:48 -07:00
further raddbgi -> rdi naming pass
This commit is contained in:
+102
-102
@@ -1085,10 +1085,10 @@ df_cmd_params_apply_spec_query(Arena *arena, DF_CtrlCtx *ctrl_ctx, DF_CmdParams
|
||||
DF_Eval eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, query);
|
||||
if(eval.errors.count == 0)
|
||||
{
|
||||
TG_Kind eval_type_kind = tg_kind_from_key(tg_unwrapped_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdbg, eval.type_key));
|
||||
TG_Kind eval_type_kind = tg_kind_from_key(tg_unwrapped_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdi, eval.type_key));
|
||||
if(eval_type_kind == TG_Kind_Ptr || eval_type_kind == TG_Kind_LRef || eval_type_kind == TG_Kind_RRef)
|
||||
{
|
||||
eval = df_value_mode_eval_from_eval(parse_ctx.type_graph, parse_ctx.rdbg, ctrl_ctx, eval);
|
||||
eval = df_value_mode_eval_from_eval(parse_ctx.type_graph, parse_ctx.rdi, ctrl_ctx, eval);
|
||||
prefer_imm = 1;
|
||||
}
|
||||
U64 u64 = !prefer_imm && eval.offset ? eval.offset : eval.imm_u64;
|
||||
@@ -3196,23 +3196,23 @@ df_symbol_name_from_binary_voff(Arena *arena, DF_Entity *binary, U64 voff)
|
||||
DBGI_Scope *scope = dbgi_scope_open();
|
||||
String8 path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
if(result.size == 0 && rdbg->scope_vmap != 0)
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
if(result.size == 0 && rdi->scope_vmap != 0)
|
||||
{
|
||||
U64 scope_idx = rdi_vmap_idx_from_voff(rdbg->scope_vmap, rdbg->scope_vmap_count, voff);
|
||||
RDI_Scope *scope = &rdbg->scopes[scope_idx];
|
||||
U64 scope_idx = rdi_vmap_idx_from_voff(rdi->scope_vmap, rdi->scope_vmap_count, voff);
|
||||
RDI_Scope *scope = &rdi->scopes[scope_idx];
|
||||
U64 proc_idx = scope->proc_idx;
|
||||
RDI_Procedure *procedure = &rdbg->procedures[proc_idx];
|
||||
RDI_Procedure *procedure = &rdi->procedures[proc_idx];
|
||||
U64 name_size = 0;
|
||||
U8 *name_ptr = rdi_string_from_idx(rdbg, procedure->name_string_idx, &name_size);
|
||||
U8 *name_ptr = rdi_string_from_idx(rdi, procedure->name_string_idx, &name_size);
|
||||
result = push_str8_copy(arena, str8(name_ptr, name_size));
|
||||
}
|
||||
if(result.size == 0 && rdbg->global_vmap != 0)
|
||||
if(result.size == 0 && rdi->global_vmap != 0)
|
||||
{
|
||||
U64 global_idx = rdi_vmap_idx_from_voff(rdbg->global_vmap, rdbg->global_vmap_count, voff);
|
||||
RDI_GlobalVariable *global_var = &rdbg->global_variables[global_idx];
|
||||
U64 global_idx = rdi_vmap_idx_from_voff(rdi->global_vmap, rdi->global_vmap_count, voff);
|
||||
RDI_GlobalVariable *global_var = &rdi->global_variables[global_idx];
|
||||
U64 name_size = 0;
|
||||
U8 *name_ptr = rdi_string_from_idx(rdbg, global_var->name_string_idx, &name_size);
|
||||
U8 *name_ptr = rdi_string_from_idx(rdi, global_var->name_string_idx, &name_size);
|
||||
result = push_str8_copy(arena, str8(name_ptr, name_size));
|
||||
}
|
||||
dbgi_scope_close(scope);
|
||||
@@ -3259,27 +3259,27 @@ df_text_line_src2dasm_info_list_array_from_src_line_range(Arena *arena, DF_Entit
|
||||
binary_n != 0;
|
||||
binary_n = binary_n->next)
|
||||
{
|
||||
// rjf: binary -> rdbg
|
||||
// rjf: binary -> rdi
|
||||
DF_Entity *binary = binary_n->entity;
|
||||
String8 binary_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, binary_path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
|
||||
// rjf: file_path_normalized * rdbg -> src_id
|
||||
// rjf: file_path_normalized * rdi -> src_id
|
||||
B32 good_src_id = 0;
|
||||
U32 src_id = 0;
|
||||
if(dbgi != &dbgi_parse_nil)
|
||||
{
|
||||
RDI_NameMap *mapptr = rdi_name_map_from_kind(rdbg, RDI_NameMapKind_NormalSourcePaths);
|
||||
RDI_NameMap *mapptr = rdi_name_map_from_kind(rdi, RDI_NameMapKind_NormalSourcePaths);
|
||||
if(mapptr != 0)
|
||||
{
|
||||
RDI_ParsedNameMap map = {0};
|
||||
rdi_name_map_parse(rdbg, mapptr, &map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdbg, &map, file_path_normalized.str, file_path_normalized.size);
|
||||
rdi_name_map_parse(rdi, mapptr, &map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &map, file_path_normalized.str, file_path_normalized.size);
|
||||
if(node != 0)
|
||||
{
|
||||
U32 id_count = 0;
|
||||
U32 *ids = rdi_matches_from_map_node(rdbg, node, &id_count);
|
||||
U32 *ids = rdi_matches_from_map_node(rdi, node, &id_count);
|
||||
if(id_count > 0)
|
||||
{
|
||||
good_src_id = 1;
|
||||
@@ -3292,9 +3292,9 @@ df_text_line_src2dasm_info_list_array_from_src_line_range(Arena *arena, DF_Entit
|
||||
// rjf: good src-id -> look up line info for visible range
|
||||
if(good_src_id)
|
||||
{
|
||||
RDI_SourceFile *src = rdbg->source_files+src_id;
|
||||
RDI_SourceFile *src = rdi->source_files+src_id;
|
||||
RDI_ParsedLineMap line_map = {0};
|
||||
rdi_line_map_from_source_file(rdbg, src, &line_map);
|
||||
rdi_line_map_from_source_file(rdi, src, &line_map);
|
||||
U64 line_idx = 0;
|
||||
for(S64 line_num = line_num_range.min;
|
||||
line_num <= line_num_range.max;
|
||||
@@ -3306,10 +3306,10 @@ df_text_line_src2dasm_info_list_array_from_src_line_range(Arena *arena, DF_Entit
|
||||
for(U64 idx = 0; idx < voff_count; idx += 1)
|
||||
{
|
||||
U64 base_voff = voffs[idx];
|
||||
U64 unit_idx = rdi_vmap_idx_from_voff(rdbg->unit_vmap, rdbg->unit_vmap_count, base_voff);
|
||||
RDI_Unit *unit = &rdbg->units[unit_idx];
|
||||
U64 unit_idx = rdi_vmap_idx_from_voff(rdi->unit_vmap, rdi->unit_vmap_count, base_voff);
|
||||
RDI_Unit *unit = &rdi->units[unit_idx];
|
||||
RDI_ParsedLineInfo unit_line_info = {0};
|
||||
rdi_line_info_from_unit(rdbg, unit, &unit_line_info);
|
||||
rdi_line_info_from_unit(rdi, unit, &unit_line_info);
|
||||
U64 line_info_idx = rdi_line_info_idx_from_voff(&unit_line_info, base_voff);
|
||||
if(unit_line_info.voffs != 0)
|
||||
{
|
||||
@@ -3347,23 +3347,23 @@ df_text_line_dasm2src_info_from_binary_voff(DF_Entity *binary, U64 voff)
|
||||
DBGI_Scope *scope = dbgi_scope_open();
|
||||
String8 path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
DF_TextLineDasm2SrcInfo result = {0};
|
||||
result.file = result.binary = &df_g_nil_entity;
|
||||
if(rdbg->unit_vmap != 0 && rdbg->units != 0 && rdbg->source_files != 0)
|
||||
if(rdi->unit_vmap != 0 && rdi->units != 0 && rdi->source_files != 0)
|
||||
{
|
||||
U64 unit_idx = rdi_vmap_idx_from_voff(rdbg->unit_vmap, rdbg->unit_vmap_count, voff);
|
||||
RDI_Unit *unit = &rdbg->units[unit_idx];
|
||||
U64 unit_idx = rdi_vmap_idx_from_voff(rdi->unit_vmap, rdi->unit_vmap_count, voff);
|
||||
RDI_Unit *unit = &rdi->units[unit_idx];
|
||||
RDI_ParsedLineInfo unit_line_info = {0};
|
||||
rdi_line_info_from_unit(rdbg, unit, &unit_line_info);
|
||||
rdi_line_info_from_unit(rdi, unit, &unit_line_info);
|
||||
U64 line_info_idx = rdi_line_info_idx_from_voff(&unit_line_info, voff);
|
||||
if(line_info_idx < unit_line_info.count)
|
||||
{
|
||||
RDI_Line *line = &unit_line_info.lines[line_info_idx];
|
||||
RDI_Column *column = (line_info_idx < unit_line_info.col_count) ? &unit_line_info.cols[line_info_idx] : 0;
|
||||
RDI_SourceFile *file = &rdbg->source_files[line->file_idx];
|
||||
RDI_SourceFile *file = &rdi->source_files[line->file_idx];
|
||||
String8 file_normalized_full_path = {0};
|
||||
file_normalized_full_path.str = rdi_string_from_idx(rdbg, file->normal_full_path_string_idx, &file_normalized_full_path.size);
|
||||
file_normalized_full_path.str = rdi_string_from_idx(rdi, file->normal_full_path_string_idx, &file_normalized_full_path.size);
|
||||
result.binary = binary;
|
||||
if(line->file_idx != 0 && file_normalized_full_path.size != 0)
|
||||
{
|
||||
@@ -3412,7 +3412,7 @@ df_voff_from_binary_symbol_name(DF_Entity *binary, String8 symbol_name)
|
||||
{
|
||||
String8 binary_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, binary_path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
RDI_NameMapKind name_map_kinds[] =
|
||||
{
|
||||
RDI_NameMapKind_GlobalVariables,
|
||||
@@ -3425,10 +3425,10 @@ df_voff_from_binary_symbol_name(DF_Entity *binary, String8 symbol_name)
|
||||
name_map_kind_idx += 1)
|
||||
{
|
||||
RDI_NameMapKind name_map_kind = name_map_kinds[name_map_kind_idx];
|
||||
RDI_NameMap *name_map = rdi_name_map_from_kind(rdbg, name_map_kind);
|
||||
RDI_NameMap *name_map = rdi_name_map_from_kind(rdi, name_map_kind);
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_name_map_parse(rdbg, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdbg, &parsed_name_map, symbol_name.str, symbol_name.size);
|
||||
rdi_name_map_parse(rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &parsed_name_map, symbol_name.str, symbol_name.size);
|
||||
|
||||
// rjf: node -> num
|
||||
U64 entity_num = 0;
|
||||
@@ -3443,7 +3443,7 @@ df_voff_from_binary_symbol_name(DF_Entity *binary, String8 symbol_name)
|
||||
default:
|
||||
{
|
||||
U32 num = 0;
|
||||
U32 *run = rdi_matches_from_map_node(rdbg, node, &num);
|
||||
U32 *run = rdi_matches_from_map_node(rdi, node, &num);
|
||||
if(num != 0)
|
||||
{
|
||||
entity_num = run[0]+1;
|
||||
@@ -3459,14 +3459,14 @@ df_voff_from_binary_symbol_name(DF_Entity *binary, String8 symbol_name)
|
||||
default:{}break;
|
||||
case RDI_NameMapKind_GlobalVariables:
|
||||
{
|
||||
RDI_GlobalVariable *global_var = rdi_element_from_idx(rdbg, global_variables, entity_num-1);
|
||||
RDI_GlobalVariable *global_var = rdi_element_from_idx(rdi, global_variables, entity_num-1);
|
||||
voff = global_var->voff;
|
||||
}break;
|
||||
case RDI_NameMapKind_Procedures:
|
||||
{
|
||||
RDI_Procedure *procedure = rdi_element_from_idx(rdbg, procedures, entity_num-1);
|
||||
RDI_Scope *scope = rdi_element_from_idx(rdbg, scopes, procedure->root_scope_idx);
|
||||
voff = rdbg->scope_voffs[scope->voff_range_first];
|
||||
RDI_Procedure *procedure = rdi_element_from_idx(rdi, procedures, entity_num-1);
|
||||
RDI_Scope *scope = rdi_element_from_idx(rdi, scopes, procedure->root_scope_idx);
|
||||
voff = rdi->scope_voffs[scope->voff_range_first];
|
||||
}break;
|
||||
}
|
||||
|
||||
@@ -3495,11 +3495,11 @@ df_type_num_from_binary_name(DF_Entity *binary, String8 name)
|
||||
{
|
||||
String8 binary_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, binary_path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
RDI_NameMap *name_map = rdi_name_map_from_kind(rdbg, RDI_NameMapKind_Types);
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
RDI_NameMap *name_map = rdi_name_map_from_kind(rdi, RDI_NameMapKind_Types);
|
||||
RDI_ParsedNameMap parsed_name_map = {0};
|
||||
rdi_name_map_parse(rdbg, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdbg, &parsed_name_map, name.str, name.size);
|
||||
rdi_name_map_parse(rdi, name_map, &parsed_name_map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &parsed_name_map, name.str, name.size);
|
||||
U64 entity_num = 0;
|
||||
if(node != 0)
|
||||
{
|
||||
@@ -3512,7 +3512,7 @@ df_type_num_from_binary_name(DF_Entity *binary, String8 name)
|
||||
default:
|
||||
{
|
||||
U32 num = 0;
|
||||
U32 *run = rdi_matches_from_map_node(rdbg, node, &num);
|
||||
U32 *run = rdi_matches_from_map_node(rdi, node, &num);
|
||||
if(num != 0)
|
||||
{
|
||||
entity_num = run[0]+1;
|
||||
@@ -3697,8 +3697,8 @@ df_push_locals_map_from_binary_voff(Arena *arena, DBGI_Scope *scope, DF_Entity *
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
String8 binary_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, binary_path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
EVAL_String2NumMap *result = eval_push_locals_map_from_rdi_voff(arena, rdbg, voff);
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
EVAL_String2NumMap *result = eval_push_locals_map_from_rdi_voff(arena, rdi, voff);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
@@ -3709,8 +3709,8 @@ df_push_member_map_from_binary_voff(Arena *arena, DBGI_Scope *scope, DF_Entity *
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
String8 binary_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, binary_path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
EVAL_String2NumMap *result = eval_push_member_map_from_rdi_voff(arena, rdbg, voff);
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
EVAL_String2NumMap *result = eval_push_member_map_from_rdi_voff(arena, rdi, voff);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
@@ -3987,7 +3987,7 @@ df_eval_parse_ctx_from_process_vaddr(DBGI_Scope *scope, DF_Entity *process, U64
|
||||
DF_Entity *binary = df_binary_file_from_module(module);
|
||||
String8 binary_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, binary_path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
Architecture arch = df_architecture_from_entity(process);
|
||||
EVAL_String2NumMap *reg_map = ctrl_string2reg_from_arch(arch);
|
||||
EVAL_String2NumMap *reg_alias_map = ctrl_string2alias_from_arch(arch);
|
||||
@@ -3999,7 +3999,7 @@ df_eval_parse_ctx_from_process_vaddr(DBGI_Scope *scope, DF_Entity *process, U64
|
||||
{
|
||||
ctx.arch = arch;
|
||||
ctx.ip_voff = voff;
|
||||
ctx.rdbg = rdbg;
|
||||
ctx.rdi = rdi;
|
||||
ctx.type_graph = tg_graph_begin(bit_size_from_arch(arch)/8, 256);
|
||||
ctx.regs_map = reg_map;
|
||||
ctx.reg_alias_map = reg_alias_map;
|
||||
@@ -4031,26 +4031,26 @@ df_eval_parse_ctx_from_src_loc(DBGI_Scope *scope, DF_Entity *file, TxtPt pt)
|
||||
binary_n != 0;
|
||||
binary_n = binary_n->next)
|
||||
{
|
||||
// rjf: binary -> rdbg
|
||||
// rjf: binary -> rdi
|
||||
DF_Entity *binary = binary_n->entity;
|
||||
String8 binary_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, binary_path, 0);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
|
||||
// rjf: file_path_normalized * rdbg -> src_id
|
||||
// rjf: file_path_normalized * rdi -> src_id
|
||||
B32 good_src_id = 0;
|
||||
U32 src_id = 0;
|
||||
{
|
||||
RDI_NameMap *mapptr = rdi_name_map_from_kind(rdbg, RDI_NameMapKind_NormalSourcePaths);
|
||||
RDI_NameMap *mapptr = rdi_name_map_from_kind(rdi, RDI_NameMapKind_NormalSourcePaths);
|
||||
if(mapptr != 0)
|
||||
{
|
||||
RDI_ParsedNameMap map = {0};
|
||||
rdi_name_map_parse(rdbg, mapptr, &map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdbg, &map, file_path_normalized.str, file_path_normalized.size);
|
||||
rdi_name_map_parse(rdi, mapptr, &map);
|
||||
RDI_NameMapNode *node = rdi_name_map_lookup(rdi, &map, file_path_normalized.str, file_path_normalized.size);
|
||||
if(node != 0)
|
||||
{
|
||||
U32 id_count = 0;
|
||||
U32 *ids = rdi_matches_from_map_node(rdbg, node, &id_count);
|
||||
U32 *ids = rdi_matches_from_map_node(rdi, node, &id_count);
|
||||
if(id_count > 0)
|
||||
{
|
||||
good_src_id = 1;
|
||||
@@ -4063,18 +4063,18 @@ df_eval_parse_ctx_from_src_loc(DBGI_Scope *scope, DF_Entity *file, TxtPt pt)
|
||||
// rjf: good src-id -> look up line info for visible range
|
||||
if(good_src_id)
|
||||
{
|
||||
RDI_SourceFile *src = rdbg->source_files+src_id;
|
||||
RDI_SourceFile *src = rdi->source_files+src_id;
|
||||
RDI_ParsedLineMap line_map = {0};
|
||||
rdi_line_map_from_source_file(rdbg, src, &line_map);
|
||||
rdi_line_map_from_source_file(rdi, src, &line_map);
|
||||
U32 voff_count = 0;
|
||||
U64 *voffs = rdi_line_voffs_from_num(&line_map, (U32)pt.line, &voff_count);
|
||||
for(U64 idx = 0; idx < voff_count; idx += 1)
|
||||
{
|
||||
U64 base_voff = voffs[idx];
|
||||
U64 unit_idx = rdi_vmap_idx_from_voff(rdbg->unit_vmap, rdbg->unit_vmap_count, base_voff);
|
||||
RDI_Unit *unit = &rdbg->units[unit_idx];
|
||||
U64 unit_idx = rdi_vmap_idx_from_voff(rdi->unit_vmap, rdi->unit_vmap_count, base_voff);
|
||||
RDI_Unit *unit = &rdi->units[unit_idx];
|
||||
RDI_ParsedLineInfo unit_line_info = {0};
|
||||
rdi_line_info_from_unit(rdbg, unit, &unit_line_info);
|
||||
rdi_line_info_from_unit(rdi, unit, &unit_line_info);
|
||||
U64 line_info_idx = rdi_line_info_idx_from_voff(&unit_line_info, base_voff);
|
||||
Rng1U64 range = r1u64(base_voff, unit_line_info.voffs[line_info_idx+1]);
|
||||
S64 actual_line = (S64)unit_line_info.lines[line_info_idx].line_num;
|
||||
@@ -4113,7 +4113,7 @@ df_eval_parse_ctx_from_src_loc(DBGI_Scope *scope, DF_Entity *file, TxtPt pt)
|
||||
//- rjf: bad ctx -> reset with graceful defaults
|
||||
if(good_ctx == 0)
|
||||
{
|
||||
ctx.rdbg = &dbgi_parse_nil.rdbg;
|
||||
ctx.rdi = &dbgi_parse_nil.rdi;
|
||||
ctx.type_graph = tg_graph_begin(8, 256);
|
||||
ctx.regs_map = &eval_string2num_map_nil;
|
||||
ctx.regs_map = &eval_string2num_map_nil;
|
||||
@@ -4179,7 +4179,7 @@ df_eval_from_string(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_
|
||||
EVAL_IRTreeAndType ir_tree_and_type = {&eval_irtree_nil};
|
||||
if(parse_has_expr && errors.count == 0)
|
||||
{
|
||||
ir_tree_and_type = eval_irtree_and_type_from_expr(arena, parse_ctx->type_graph, parse_ctx->rdbg, macro_map, parse.expr, &errors);
|
||||
ir_tree_and_type = eval_irtree_and_type_from_expr(arena, parse_ctx->type_graph, parse_ctx->rdi, macro_map, parse.expr, &errors);
|
||||
}
|
||||
|
||||
//- rjf: get list of ops
|
||||
@@ -4237,7 +4237,7 @@ df_eval_from_string(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_
|
||||
//- rjf: apply dynamic type overrides
|
||||
if(parse.expr != 0 && parse.expr->kind != EVAL_ExprKind_Cast)
|
||||
{
|
||||
result = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, result);
|
||||
result = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, result);
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
@@ -4246,7 +4246,7 @@ df_eval_from_string(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_
|
||||
}
|
||||
|
||||
internal DF_Eval
|
||||
df_value_mode_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF_Eval eval)
|
||||
df_value_mode_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval eval)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
@@ -4262,7 +4262,7 @@ df_value_mode_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl
|
||||
{
|
||||
TG_Key type_key = eval.type_key;
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
U64 type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdbg, type_key);
|
||||
U64 type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdi, type_key);
|
||||
if(!tg_key_match(type_key, tg_key_zero()) && type_byte_size <= 8)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
@@ -4292,7 +4292,7 @@ df_value_mode_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl
|
||||
case EVAL_EvalMode_Reg:
|
||||
{
|
||||
TG_Key type_key = eval.type_key;
|
||||
U64 type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdbg, type_key);
|
||||
U64 type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdi, type_key);
|
||||
U64 reg_off = eval.offset;
|
||||
CTRL_Unwind unwind = df_query_cached_unwind_from_thread(thread);
|
||||
if(unwind.first != 0)
|
||||
@@ -4316,7 +4316,7 @@ df_value_mode_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl
|
||||
}
|
||||
|
||||
internal DF_Eval
|
||||
df_dynamically_typed_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF_Eval eval)
|
||||
df_dynamically_typed_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval eval)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
@@ -4330,11 +4330,11 @@ df_dynamically_typed_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCt
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
if(type_kind == TG_Kind_Ptr)
|
||||
{
|
||||
TG_Key ptee_type_key = tg_unwrapped_direct_from_graph_rdi_key(graph, rdbg, type_key);
|
||||
TG_Key ptee_type_key = tg_unwrapped_direct_from_graph_rdi_key(graph, rdi, type_key);
|
||||
TG_Kind ptee_type_kind = tg_kind_from_key(ptee_type_key);
|
||||
if(ptee_type_kind == TG_Kind_Struct || ptee_type_kind == TG_Kind_Class)
|
||||
{
|
||||
TG_Type *ptee_type = tg_type_from_graph_rdi_key(scratch.arena, graph, rdbg, ptee_type_key);
|
||||
TG_Type *ptee_type = tg_type_from_graph_rdi_key(scratch.arena, graph, rdi, ptee_type_key);
|
||||
B32 has_vtable = 0;
|
||||
for(U64 idx = 0; idx < ptee_type->count; idx += 1)
|
||||
{
|
||||
@@ -4363,12 +4363,12 @@ df_dynamically_typed_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCt
|
||||
U64 vtable_vaddr = 0;
|
||||
MemoryCopy(&vtable_vaddr, vtable_base_ptr_memory.str, addr_size);
|
||||
U64 vtable_voff = df_voff_from_vaddr(module, vtable_vaddr);
|
||||
U64 global_idx = rdi_vmap_idx_from_voff(rdbg->global_vmap, rdbg->global_vmap_count, vtable_voff);
|
||||
RDI_GlobalVariable *global_var = rdi_element_from_idx(rdbg, global_variables, global_idx);
|
||||
U64 global_idx = rdi_vmap_idx_from_voff(rdi->global_vmap, rdi->global_vmap_count, vtable_voff);
|
||||
RDI_GlobalVariable *global_var = rdi_element_from_idx(rdi, global_variables, global_idx);
|
||||
if(global_var->link_flags & RDI_LinkFlag_TypeScoped)
|
||||
{
|
||||
RDI_UDT *udt = rdi_element_from_idx(rdbg, udts, global_var->container_idx);
|
||||
RDI_TypeNode *type = rdi_element_from_idx(rdbg, type_nodes, udt->self_type_idx);
|
||||
RDI_UDT *udt = rdi_element_from_idx(rdi, udts, global_var->container_idx);
|
||||
RDI_TypeNode *type = rdi_element_from_idx(rdi, type_nodes, udt->self_type_idx);
|
||||
TG_Key derived_type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type->kind), (U64)udt->self_type_idx);
|
||||
TG_Key ptr_to_derived_type_key = tg_cons_type_make(graph, TG_Kind_Ptr, derived_type_key, 0);
|
||||
eval.type_key = ptr_to_derived_type_key;
|
||||
@@ -4579,13 +4579,13 @@ df_string_from_ascii_value(Arena *arena, U8 val)
|
||||
}
|
||||
|
||||
internal String8
|
||||
df_string_from_simple_typed_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdbg, DF_EvalVizStringFlags flags, U32 radix, DF_Eval eval)
|
||||
df_string_from_simple_typed_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, DF_EvalVizStringFlags flags, U32 radix, DF_Eval eval)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
String8 result = {0};
|
||||
TG_Key type_key = tg_unwrapped_from_graph_rdi_key(graph, rdbg, eval.type_key);
|
||||
TG_Key type_key = tg_unwrapped_from_graph_rdi_key(graph, rdi, eval.type_key);
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
U64 type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdbg, type_key);
|
||||
U64 type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdi, type_key);
|
||||
U8 digit_group_separator = 0;
|
||||
if(!(flags & DF_EvalVizStringFlag_ReadOnlyDisplayRules))
|
||||
{
|
||||
@@ -4653,7 +4653,7 @@ df_string_from_simple_typed_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdbg
|
||||
case TG_Kind_Enum:
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
TG_Type *type = tg_type_from_graph_rdi_key(scratch.arena, graph, rdbg, type_key);
|
||||
TG_Type *type = tg_type_from_graph_rdi_key(scratch.arena, graph, rdi, type_key);
|
||||
String8 constant_name = {0};
|
||||
for(U64 val_idx = 0; val_idx < type->count; val_idx += 1)
|
||||
{
|
||||
@@ -4693,7 +4693,7 @@ df_string_from_simple_typed_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdbg
|
||||
//- rjf: writing values back to child processes
|
||||
|
||||
internal B32
|
||||
df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF_Eval dst_eval, DF_Eval src_eval)
|
||||
df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval dst_eval, DF_Eval src_eval)
|
||||
{
|
||||
B32 result = 0;
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
@@ -4705,8 +4705,8 @@ df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF
|
||||
TG_Key src_type_key = src_eval.type_key;
|
||||
TG_Kind dst_type_kind = tg_kind_from_key(dst_type_key);
|
||||
TG_Kind src_type_kind = tg_kind_from_key(src_type_key);
|
||||
U64 dst_type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdbg, dst_type_key);
|
||||
U64 src_type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdbg, src_type_key);
|
||||
U64 dst_type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdi, dst_type_key);
|
||||
U64 src_type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdi, src_type_key);
|
||||
|
||||
//- rjf: get commit data based on destination type
|
||||
String8 commit_data = {0};
|
||||
@@ -4726,7 +4726,7 @@ df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF
|
||||
case TG_Kind_LRef:
|
||||
if((TG_Kind_Char8 <= src_type_kind && src_type_kind <= TG_Kind_Bool) || src_type_kind == TG_Kind_Ptr)
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdbg, ctrl_ctx, src_eval);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdi, ctrl_ctx, src_eval);
|
||||
commit_data = str8((U8 *)&value_eval.imm_u64, dst_type_byte_size);
|
||||
commit_data = push_str8_copy(scratch.arena, commit_data);
|
||||
}break;
|
||||
@@ -4749,7 +4749,7 @@ df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF
|
||||
case TG_Kind_Bool:
|
||||
if(TG_Kind_Char8 <= src_type_kind && src_type_kind <= TG_Kind_Bool)
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdbg, ctrl_ctx, src_eval);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdi, ctrl_ctx, src_eval);
|
||||
commit_data = str8((U8 *)&value_eval.imm_u64, dst_type_byte_size);
|
||||
commit_data = push_str8_copy(scratch.arena, commit_data);
|
||||
}break;
|
||||
@@ -4761,7 +4761,7 @@ df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF
|
||||
src_type_kind == TG_Kind_F64)
|
||||
{
|
||||
F32 value = 0;
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdbg, ctrl_ctx, src_eval);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdi, ctrl_ctx, src_eval);
|
||||
switch(src_type_kind)
|
||||
{
|
||||
case TG_Kind_F32:{value = value_eval.imm_f32;}break;
|
||||
@@ -4779,7 +4779,7 @@ df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF
|
||||
src_type_kind == TG_Kind_F64)
|
||||
{
|
||||
F64 value = 0;
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdbg, ctrl_ctx, src_eval);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdi, ctrl_ctx, src_eval);
|
||||
switch(src_type_kind)
|
||||
{
|
||||
case TG_Kind_F32:{value = (F64)value_eval.imm_f32;}break;
|
||||
@@ -4794,7 +4794,7 @@ df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF
|
||||
case TG_Kind_Enum:
|
||||
if(TG_Kind_Char8 <= src_type_kind && src_type_kind <= TG_Kind_Bool)
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdbg, ctrl_ctx, src_eval);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdi, ctrl_ctx, src_eval);
|
||||
commit_data = str8((U8 *)&value_eval.imm_u64, dst_type_byte_size);
|
||||
commit_data = push_str8_copy(scratch.arena, commit_data);
|
||||
}break;
|
||||
@@ -4914,7 +4914,7 @@ df_filtered_data_members_from_members_cfg_table(Arena *arena, TG_MemberArray mem
|
||||
}
|
||||
|
||||
internal DF_EvalLinkBaseChunkList
|
||||
df_eval_link_base_chunk_list_from_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdbg, TG_Key link_member_type_key, U64 link_member_off, DF_CtrlCtx *ctrl_ctx, DF_Eval eval, U64 cap)
|
||||
df_eval_link_base_chunk_list_from_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, TG_Key link_member_type_key, U64 link_member_off, DF_CtrlCtx *ctrl_ctx, DF_Eval eval, U64 cap)
|
||||
{
|
||||
DF_EvalLinkBaseChunkList list = {0};
|
||||
for(DF_Eval base_eval = eval, last_eval = zero_struct; list.count < cap;)
|
||||
@@ -4948,7 +4948,7 @@ df_eval_link_base_chunk_list_from_eval(Arena *arena, TG_Graph *graph, RDI_Parsed
|
||||
base_eval.mode,
|
||||
base_eval.offset + link_member_off,
|
||||
};
|
||||
DF_Eval link_member_value_eval = df_value_mode_eval_from_eval(graph, rdbg, ctrl_ctx, link_member_eval);
|
||||
DF_Eval link_member_value_eval = df_value_mode_eval_from_eval(graph, rdi, ctrl_ctx, link_member_eval);
|
||||
|
||||
// rjf: advance to next link
|
||||
last_eval = base_eval;
|
||||
@@ -5047,13 +5047,13 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
//////////////////////////////
|
||||
//- rjf: apply view rules & resolve eval
|
||||
//
|
||||
eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
eval = df_eval_from_eval_cfg_table(arena, scope, ctrl_ctx, parse_ctx, macro_map, eval, cfg_table);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: unpack eval
|
||||
//
|
||||
TG_Key eval_type_key = tg_unwrapped_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, eval.type_key);
|
||||
TG_Key eval_type_key = tg_unwrapped_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, eval.type_key);
|
||||
TG_Kind eval_type_kind = tg_kind_from_key(eval_type_key);
|
||||
|
||||
//////////////////////////////
|
||||
@@ -5084,9 +5084,9 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
TG_Kind ptr_type_kind = TG_Kind_Null;
|
||||
if(eval_type_kind == TG_Kind_Ptr || eval_type_kind == TG_Kind_LRef || eval_type_kind == TG_Kind_RRef)
|
||||
{
|
||||
TG_Key direct_type_key = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, eval_type_key);
|
||||
TG_Key direct_type_key = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, eval_type_key);
|
||||
TG_Kind direct_type_kind = tg_kind_from_key(direct_type_key);
|
||||
DF_Eval ptr_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
DF_Eval ptr_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
|
||||
// rjf: ptrs to udts
|
||||
if(parent_is_expanded &&
|
||||
@@ -5199,7 +5199,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
ProfScope("build viz blocks for UDT members")
|
||||
{
|
||||
//- rjf: type -> filtered data members
|
||||
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdbg, udt_eval.type_key);
|
||||
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, udt_eval.type_key);
|
||||
TG_MemberArray filtered_data_members = df_filtered_data_members_from_members_cfg_table(scratch.arena, data_members, cfg_table);
|
||||
|
||||
//- rjf: build blocks for all members, split by sub-expansions
|
||||
@@ -5255,7 +5255,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
ProfScope("build viz blocks for UDT type-eval enums")
|
||||
{
|
||||
//- rjf: type -> full type info
|
||||
TG_Type *type = tg_type_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdbg, udt_eval.type_key);
|
||||
TG_Type *type = tg_type_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, udt_eval.type_key);
|
||||
|
||||
//- rjf: build block for all members (cannot be expanded)
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_EnumMembers, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
@@ -5277,7 +5277,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
ProfScope("(structs, unions, classes) descend to members & make block(s), with linked list view")
|
||||
{
|
||||
//- rjf: type -> data members
|
||||
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdbg, udt_eval.type_key);
|
||||
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, udt_eval.type_key);
|
||||
|
||||
//- rjf: find link member
|
||||
TG_Member *link_member = 0;
|
||||
@@ -5290,7 +5290,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
{
|
||||
link_member = mem;
|
||||
link_member_type_kind = tg_kind_from_key(link_member->type_key);
|
||||
link_member_ptee_type_key = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, link_member->type_key);
|
||||
link_member_ptee_type_key = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, link_member->type_key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -5308,7 +5308,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalLinkBaseChunkList link_bases = {0};
|
||||
if(link_member_is_good)
|
||||
{
|
||||
link_bases = df_eval_link_base_chunk_list_from_eval(scratch.arena, parse_ctx->type_graph, parse_ctx->rdbg, link_member->type_key, link_member->off, ctrl_ctx, udt_eval, 512);
|
||||
link_bases = df_eval_link_base_chunk_list_from_eval(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, link_member->type_key, link_member->off, ctrl_ctx, udt_eval, 512);
|
||||
}
|
||||
|
||||
//- rjf: build blocks for all links, split by sub-expansions
|
||||
@@ -5371,10 +5371,10 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
ProfScope("(arrays) descend to elements & make block(s)")
|
||||
{
|
||||
//- rjf: unpack array type info
|
||||
TG_Type *array_type = tg_type_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdbg, arr_eval.type_key);
|
||||
TG_Type *array_type = tg_type_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, arr_eval.type_key);
|
||||
U64 array_count = array_type->count;
|
||||
TG_Key element_type_key = array_type->direct_type_key;
|
||||
U64 element_type_byte_size = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, element_type_key);
|
||||
U64 element_type_byte_size = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, element_type_key);
|
||||
|
||||
//- rjf: build blocks for all elements, split by sub-expansions
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Elements, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
@@ -5612,7 +5612,7 @@ df_eval_viz_row_list_push_new(Arena *arena, EVAL_ParseCtx *parse_ctx, DF_EvalViz
|
||||
// rjf: determine exandability, editability
|
||||
if(tg_kind_from_key(eval.type_key) != TG_Kind_Null)
|
||||
{
|
||||
for(TG_Key t = eval.type_key;; t = tg_unwrapped_direct_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, t))
|
||||
for(TG_Key t = eval.type_key;; t = tg_unwrapped_direct_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, t))
|
||||
{
|
||||
TG_Kind kind = tg_kind_from_key(t);
|
||||
if(kind == TG_Kind_Null)
|
||||
|
||||
@@ -1579,8 +1579,8 @@ internal B32 df_eval_memory_read(void *u, void *out, U64 addr, U64 size);
|
||||
internal EVAL_ParseCtx df_eval_parse_ctx_from_process_vaddr(DBGI_Scope *scope, DF_Entity *process, U64 vaddr);
|
||||
internal EVAL_ParseCtx df_eval_parse_ctx_from_src_loc(DBGI_Scope *scope, DF_Entity *file, TxtPt pt);
|
||||
internal DF_Eval df_eval_from_string(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, String8 string);
|
||||
internal DF_Eval df_value_mode_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF_Eval eval);
|
||||
internal DF_Eval df_dynamically_typed_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF_Eval eval);
|
||||
internal DF_Eval df_value_mode_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval eval);
|
||||
internal DF_Eval df_dynamically_typed_eval_from_eval(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval eval);
|
||||
internal DF_Eval df_eval_from_eval_cfg_table(Arena *arena, DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, DF_CfgTable *cfg);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1604,14 +1604,14 @@ internal String8 df_eval_view_rule_from_key(DF_EvalView *eval_view, DF_ExpandKey
|
||||
|
||||
//- rjf: evaluation value string builder helpers
|
||||
internal String8 df_string_from_ascii_value(Arena *arena, U8 val);
|
||||
internal String8 df_string_from_simple_typed_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdbg, DF_EvalVizStringFlags flags, U32 radix, DF_Eval eval);
|
||||
internal String8 df_string_from_simple_typed_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, DF_EvalVizStringFlags flags, U32 radix, DF_Eval eval);
|
||||
|
||||
//- rjf: writing values back to child processes
|
||||
internal B32 df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, DF_Eval dst_eval, DF_Eval src_eval);
|
||||
internal B32 df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval dst_eval, DF_Eval src_eval);
|
||||
|
||||
//- rjf: type helpers
|
||||
internal TG_MemberArray df_filtered_data_members_from_members_cfg_table(Arena *arena, TG_MemberArray members, DF_CfgTable *cfg);
|
||||
internal DF_EvalLinkBaseChunkList df_eval_link_base_chunk_list_from_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdbg, TG_Key link_member_type_key, U64 link_member_off, DF_CtrlCtx *ctrl_ctx, DF_Eval eval, U64 cap);
|
||||
internal DF_EvalLinkBaseChunkList df_eval_link_base_chunk_list_from_eval(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, TG_Key link_member_type_key, U64 link_member_off, DF_CtrlCtx *ctrl_ctx, DF_Eval eval, U64 cap);
|
||||
internal DF_EvalLinkBase df_eval_link_base_from_chunk_list_index(DF_EvalLinkBaseChunkList *list, U64 idx);
|
||||
internal DF_EvalLinkBaseArray df_eval_link_base_array_from_chunk_list(Arena *arena, DF_EvalLinkBaseChunkList *chunks);
|
||||
|
||||
|
||||
+41
-41
@@ -5232,7 +5232,7 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
default:{}break;
|
||||
case EVAL_EvalMode_Addr:
|
||||
{
|
||||
U64 size = tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdbg, row->eval.type_key);
|
||||
U64 size = tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdi, row->eval.type_key);
|
||||
size = Min(size, 64);
|
||||
Rng1U64 vaddr_rng = r1u64(row->eval.offset, row->eval.offset+size);
|
||||
CTRL_ProcessMemorySlice slice = ctrl_query_cached_data_from_process_vaddr_range(scratch.arena, process->ctrl_machine_id, process->ctrl_handle, vaddr_rng, 0);
|
||||
@@ -5289,7 +5289,7 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
{
|
||||
String8 commit_string = str8(ws->hover_eval_txt_buffer, ws->hover_eval_txt_size);
|
||||
DF_Eval write_eval = df_eval_from_string(scratch.arena, scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, commit_string);
|
||||
B32 success = df_commit_eval_value(parse_ctx.type_graph, parse_ctx.rdbg, &ctrl_ctx, row->eval, write_eval);
|
||||
B32 success = df_commit_eval_value(parse_ctx.type_graph, parse_ctx.rdi, &ctrl_ctx, row->eval, write_eval);
|
||||
if(success == 0)
|
||||
{
|
||||
DF_CmdParams params = df_cmd_params_from_window(ws);
|
||||
@@ -6858,7 +6858,7 @@ 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, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, U32 default_radix, F_Tag font, F32 font_size, F32 max_size, S32 depth, DF_Eval eval, TG_Member *opt_member, DF_CfgTable *cfg_table)
|
||||
df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags flags, TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, U32 default_radix, F_Tag font, F32 font_size, F32 max_size, S32 depth, DF_Eval eval, TG_Member *opt_member, DF_CfgTable *cfg_table)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
String8List list = {0};
|
||||
@@ -6869,13 +6869,13 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
{
|
||||
if(opt_member != 0)
|
||||
{
|
||||
U64 member_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdbg, opt_member->type_key);
|
||||
U64 member_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdi, opt_member->type_key);
|
||||
str8_list_pushf(arena, &list, "member (%I64u offset, %I64u byte%s)", opt_member->off, member_byte_size, member_byte_size > 1 ? "s" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
String8 basic_type_kind_string = tg_kind_basic_string_table[tg_kind_from_key(eval.type_key)];
|
||||
U64 byte_size = tg_byte_size_from_graph_rdi_key(graph, rdbg, eval.type_key);
|
||||
U64 byte_size = tg_byte_size_from_graph_rdi_key(graph, rdi, eval.type_key);
|
||||
str8_list_pushf(arena, &list, "%S (%I64u byte%s)", basic_type_kind_string, byte_size, byte_size > 1 ? "s" : "");
|
||||
}
|
||||
}
|
||||
@@ -6883,7 +6883,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
//- rjf: non-type path: descend recursively & produce single-line value strings
|
||||
else if(max_size > 0)
|
||||
{
|
||||
TG_Kind eval_type_kind = tg_kind_from_key(tg_unwrapped_from_graph_rdi_key(graph, rdbg, eval.type_key));
|
||||
TG_Kind eval_type_kind = tg_kind_from_key(tg_unwrapped_from_graph_rdi_key(graph, rdi, eval.type_key));
|
||||
U32 radix = default_radix;
|
||||
DF_CfgVal *dec_cfg = df_cfg_val_from_string(cfg_table, str8_lit("dec"));
|
||||
DF_CfgVal *hex_cfg = df_cfg_val_from_string(cfg_table, str8_lit("hex"));
|
||||
@@ -6899,8 +6899,8 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
//- rjf: default - leaf cases
|
||||
default:
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdbg, ctrl_ctx, eval);
|
||||
String8 string = df_string_from_simple_typed_eval(arena, graph, rdbg, flags, radix, value_eval);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdi, ctrl_ctx, eval);
|
||||
String8 string = df_string_from_simple_typed_eval(arena, graph, rdi, flags, radix, value_eval);
|
||||
space_taken += f_dim_from_tag_size_string(font, font_size, string).x;
|
||||
str8_list_push(arena, &list, string);
|
||||
}break;
|
||||
@@ -6920,11 +6920,11 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
B32 has_array = (array_cfg != &df_g_nil_cfg_val);
|
||||
|
||||
// rjf: get ptr value
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdbg, ctrl_ctx, eval);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(graph, rdi, ctrl_ctx, eval);
|
||||
|
||||
// rjf: get pointed-at info
|
||||
TG_Kind type_kind = tg_kind_from_key(eval.type_key);
|
||||
TG_Key direct_type_key = tg_ptee_from_graph_rdi_key(graph, rdbg, eval.type_key);
|
||||
TG_Key direct_type_key = tg_ptee_from_graph_rdi_key(graph, rdi, eval.type_key);
|
||||
TG_Kind direct_type_kind = tg_kind_from_key(direct_type_key);
|
||||
B32 direct_type_has_content = (direct_type_kind != TG_Kind_Null && direct_type_kind != TG_Kind_Void && value_eval.imm_u64 != 0);
|
||||
B32 direct_type_is_string = (direct_type_kind != TG_Kind_Null && value_eval.imm_u64 != 0 &&
|
||||
@@ -6940,7 +6940,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
if(!no_addr || (direct_type_has_content == 0 && direct_type_is_string == 0))
|
||||
{
|
||||
did_ptr_value = 1;
|
||||
String8 string = df_string_from_simple_typed_eval(arena, graph, rdbg, flags, radix, value_eval);
|
||||
String8 string = df_string_from_simple_typed_eval(arena, graph, rdi, flags, radix, value_eval);
|
||||
space_taken += f_dim_from_tag_size_string(font, font_size, string).x;
|
||||
str8_list_push(arena, &list, string);
|
||||
}
|
||||
@@ -6985,7 +6985,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
pted_eval.type_key = direct_type_key;
|
||||
pted_eval.mode = EVAL_EvalMode_Addr;
|
||||
pted_eval.offset = value_eval.imm_u64;
|
||||
String8List pted_strs = df_single_line_eval_value_strings_from_eval(arena, flags, graph, rdbg, ctrl_ctx, default_radix, font, font_size, max_size-space_taken, depth+1, pted_eval, opt_member, cfg_table);
|
||||
String8List pted_strs = df_single_line_eval_value_strings_from_eval(arena, flags, graph, rdi, ctrl_ctx, default_radix, font, font_size, max_size-space_taken, depth+1, pted_eval, opt_member, cfg_table);
|
||||
if(pted_strs.total_size == 0)
|
||||
{
|
||||
String8 unknown = str8_lit("???");
|
||||
@@ -7011,7 +7011,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
case TG_Kind_Array:
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
TG_Type *eval_type = tg_type_from_graph_rdi_key(scratch.arena, graph, rdbg, eval.type_key);
|
||||
TG_Type *eval_type = tg_type_from_graph_rdi_key(scratch.arena, graph, rdi, eval.type_key);
|
||||
TG_Key direct_type_key = eval_type->direct_type_key;
|
||||
TG_Kind direct_type_kind = tg_kind_from_key(direct_type_key);
|
||||
U64 array_count = eval_type->count;
|
||||
@@ -7055,7 +7055,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
{
|
||||
if(depth < 3)
|
||||
{
|
||||
U64 direct_type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdbg, direct_type_key);
|
||||
U64 direct_type_byte_size = tg_byte_size_from_graph_rdi_key(graph, rdi, direct_type_key);
|
||||
for(U64 idx = 0; idx < array_count && max_size > space_taken; idx += 1)
|
||||
{
|
||||
DF_Eval element_eval = zero_struct;
|
||||
@@ -7063,7 +7063,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
element_eval.mode = eval.mode;
|
||||
element_eval.offset = eval.offset + direct_type_byte_size*idx;
|
||||
MemoryCopyArray(element_eval.imm_u128, eval.imm_u128);
|
||||
String8List element_strs = df_single_line_eval_value_strings_from_eval(arena, flags, graph, rdbg, ctrl_ctx, default_radix, font, font_size, max_size-space_taken, depth+1, element_eval, opt_member, cfg_table);
|
||||
String8List element_strs = df_single_line_eval_value_strings_from_eval(arena, flags, graph, rdi, ctrl_ctx, default_radix, font, font_size, max_size-space_taken, depth+1, element_eval, opt_member, cfg_table);
|
||||
space_taken += f_dim_from_tag_size_string_list(font, font_size, element_strs).x;
|
||||
str8_list_concat_in_place(&list, &element_strs);
|
||||
if(idx+1 < array_count)
|
||||
@@ -7111,7 +7111,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
if(depth < 4)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(scratch.arena, graph, rdbg, eval.type_key);
|
||||
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(scratch.arena, graph, rdi, eval.type_key);
|
||||
TG_MemberArray filtered_data_members = df_filtered_data_members_from_members_cfg_table(scratch.arena, data_members, cfg_table);
|
||||
for(U64 member_idx = 0; member_idx < filtered_data_members.count && max_size > space_taken; member_idx += 1)
|
||||
{
|
||||
@@ -7121,7 +7121,7 @@ df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags
|
||||
member_eval.mode = eval.mode;
|
||||
member_eval.offset = eval.offset + mem->off;
|
||||
MemoryCopyArray(member_eval.imm_u128, eval.imm_u128);
|
||||
String8List member_strs = df_single_line_eval_value_strings_from_eval(arena, flags, graph, rdbg, ctrl_ctx, default_radix, font, font_size, max_size-space_taken, depth+1, member_eval, opt_member, cfg_table);
|
||||
String8List member_strs = df_single_line_eval_value_strings_from_eval(arena, flags, graph, rdi, ctrl_ctx, default_radix, font, font_size, max_size-space_taken, depth+1, member_eval, opt_member, cfg_table);
|
||||
space_taken += f_dim_from_tag_size_string_list(font, font_size, member_strs).x;
|
||||
str8_list_concat_in_place(&list, &member_strs);
|
||||
if(member_idx+1 < filtered_data_members.count)
|
||||
@@ -7286,8 +7286,8 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
case DF_EvalVizBlockKind_Root:
|
||||
if(visible_idx_range.max > visible_idx_range.min)
|
||||
{
|
||||
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->member, &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->member, &block->cfg_table);
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, block->eval, block->member, &block->cfg_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, block->eval, block->member, &block->cfg_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, block->key, block->eval);
|
||||
row->expr = block->string;
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -7312,7 +7312,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
case DF_EvalVizBlockKind_Members:
|
||||
if(block_type_kind != TG_Kind_Null)
|
||||
{
|
||||
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdbg, block->eval.type_key);
|
||||
TG_MemberArray data_members = tg_data_members_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, block->eval.type_key);
|
||||
TG_MemberArray filtered_data_members = df_filtered_data_members_from_members_cfg_table(scratch.arena, data_members, &block->cfg_table);
|
||||
for(U64 idx = visible_idx_range.min; idx < visible_idx_range.max && idx < filtered_data_members.count; idx += 1)
|
||||
{
|
||||
@@ -7337,13 +7337,13 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
|
||||
// rjf: apply view rules to eval
|
||||
{
|
||||
member_eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, member_eval);
|
||||
member_eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, member_eval);
|
||||
member_eval = df_eval_from_eval_cfg_table(arena, scope, ctrl_ctx, parse_ctx, macro_map, member_eval, &view_rule_table);
|
||||
}
|
||||
|
||||
// rjf: build & push row
|
||||
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, member, &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, member, &view_rule_table);
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, member_eval, member, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, member_eval, member, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, member_eval);
|
||||
if(member->kind == TG_MemberKind_Padding)
|
||||
{
|
||||
@@ -7370,7 +7370,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
case DF_EvalVizBlockKind_EnumMembers:
|
||||
if(block_type_kind == TG_Kind_Enum)
|
||||
{
|
||||
TG_Type *type = tg_type_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdbg, block->eval.type_key);
|
||||
TG_Type *type = tg_type_from_graph_rdi_key(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, block->eval.type_key);
|
||||
for(U64 idx = visible_idx_range.min; idx < visible_idx_range.max && idx < type->count; idx += 1)
|
||||
{
|
||||
TG_EnumVal *enum_val = &type->enum_vals[idx];
|
||||
@@ -7391,13 +7391,13 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
|
||||
// rjf: apply view rules to eval
|
||||
{
|
||||
eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
eval = df_eval_from_eval_cfg_table(arena, scope, ctrl_ctx, parse_ctx, macro_map, eval, &view_rule_table);
|
||||
}
|
||||
|
||||
// rjf: build & push row
|
||||
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, eval, 0, &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, eval, 0, &view_rule_table);
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, eval, 0, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, eval, 0, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, eval);
|
||||
row->expr = push_str8_copy(arena, enum_val->name);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -7414,9 +7414,9 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
//
|
||||
case DF_EvalVizBlockKind_Elements:
|
||||
{
|
||||
TG_Key direct_type_key = tg_unwrapped_direct_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, block->eval.type_key);
|
||||
TG_Key direct_type_key = tg_unwrapped_direct_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, block->eval.type_key);
|
||||
TG_Kind direct_type_kind = tg_kind_from_key(direct_type_key);
|
||||
U64 direct_type_key_byte_size = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, direct_type_key);
|
||||
U64 direct_type_key_byte_size = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, direct_type_key);
|
||||
for(U64 idx = visible_idx_range.min; idx < visible_idx_range.max; idx += 1)
|
||||
{
|
||||
// rjf: get keys for this row
|
||||
@@ -7438,13 +7438,13 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
|
||||
// rjf: apply view rules to eval
|
||||
{
|
||||
elem_eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, elem_eval);
|
||||
elem_eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, elem_eval);
|
||||
elem_eval = df_eval_from_eval_cfg_table(arena, scope, ctrl_ctx, parse_ctx, macro_map, elem_eval, &view_rule_table);
|
||||
}
|
||||
|
||||
// rjf: build row
|
||||
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, 0, &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, 0, &view_rule_table);
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, elem_eval, 0, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, elem_eval, 0, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, elem_eval);
|
||||
row->expr = push_str8f(arena, "[%I64u]", idx);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -7465,7 +7465,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
//
|
||||
case DF_EvalVizBlockKind_Links:
|
||||
{
|
||||
DF_EvalLinkBaseChunkList link_base_chunks = df_eval_link_base_chunk_list_from_eval(scratch.arena, parse_ctx->type_graph, parse_ctx->rdbg, block->link_member_type_key, block->link_member_off, ctrl_ctx, block->eval, 512);
|
||||
DF_EvalLinkBaseChunkList link_base_chunks = df_eval_link_base_chunk_list_from_eval(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, block->link_member_type_key, block->link_member_off, ctrl_ctx, block->eval, 512);
|
||||
DF_EvalLinkBaseArray link_bases = df_eval_link_base_array_from_chunk_list(scratch.arena, &link_base_chunks);
|
||||
for(U64 idx = visible_idx_range.min; idx < visible_idx_range.max; idx += 1)
|
||||
{
|
||||
@@ -7489,13 +7489,13 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
df_cfg_table_push_unparsed_string(scratch.arena, &view_rule_table, view_rule_string, DF_CfgSrc_User);
|
||||
|
||||
// rjf: apply view rules to eval
|
||||
link_eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, link_eval);
|
||||
link_eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, link_eval);
|
||||
link_eval = df_eval_from_eval_cfg_table(arena, scope, ctrl_ctx, parse_ctx, macro_map, link_eval, &view_rule_table);
|
||||
TG_Kind link_type_kind = tg_kind_from_key(link_eval.type_key);
|
||||
|
||||
// rjf: build row
|
||||
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, 0, &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, 0, &view_rule_table);
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, link_eval, 0, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, link_eval, 0, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, link_eval);
|
||||
row->expr = push_str8f(arena, "[%I64u]", idx);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -7534,7 +7534,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
for(U64 idx = visible_idx_range.min; idx < visible_idx_range.max; idx += 1)
|
||||
{
|
||||
// rjf: unpack info about this row
|
||||
String8 name = dbgi_fuzzy_item_string_from_rdbg_target_element_idx(parse_ctx->rdbg, block->dbgi_target, block->backing_search_items.v[idx].idx);
|
||||
String8 name = dbgi_fuzzy_item_string_from_rdi_target_element_idx(parse_ctx->rdi, block->dbgi_target, block->backing_search_items.v[idx].idx);
|
||||
|
||||
// rjf: get keys for this row
|
||||
DF_ExpandKey parent_key = block->parent_key;
|
||||
@@ -7551,13 +7551,13 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
|
||||
// rjf: apply view rules to eval
|
||||
{
|
||||
eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
eval = df_dynamically_typed_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
eval = df_eval_from_eval_cfg_table(arena, scope, ctrl_ctx, parse_ctx, macro_map, eval, &view_rule_table);
|
||||
}
|
||||
|
||||
// rjf: build row
|
||||
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, eval, 0, &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, eval, 0, &view_rule_table);
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, eval, 0, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, eval, 0, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, eval);
|
||||
row->expr = name;
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
@@ -9735,7 +9735,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
if(!tg_key_match(tg_key_zero(), eval.type_key))
|
||||
{
|
||||
DF_CfgTable cfg_table = {0};
|
||||
String8List eval_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, 10, params->font, params->font_size, params->font_size*60.f, 0, eval, 0, &cfg_table);
|
||||
String8List eval_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, 10, params->font, params->font_size, params->font_size*60.f, 0, eval, 0, &cfg_table);
|
||||
eval_string = str8_list_join(scratch.arena, &eval_strings, 0);
|
||||
}
|
||||
ui_spacer(ui_em(1.5f, 1.f));
|
||||
|
||||
+1
-1
@@ -961,7 +961,7 @@ internal void df_window_update_and_render(Arena *arena, OS_EventList *events, DF
|
||||
//~ rjf: Eval Viz
|
||||
|
||||
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, RDI_Parsed *rdbg, DF_CtrlCtx *ctrl_ctx, U32 default_radix, F_Tag font, F32 font_size, F32 max_size, S32 depth, DF_Eval eval, TG_Member *opt_member, DF_CfgTable *cfg_table);
|
||||
internal String8List df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags flags, TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, U32 default_radix, F_Tag font, F32 font_size, F32 max_size, S32 depth, DF_Eval eval, TG_Member *opt_member, 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, EVAL_String2ExprMap *macro_map, DF_EvalView *eval_view, U32 default_radix, F_Tag font, F32 font_size, Rng1S64 visible_range, DF_EvalVizBlockList *blocks);
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -223,10 +223,10 @@ df_view_rule_hooks__bitmap_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx
|
||||
String8 height_expr = str8_list_join(scratch.arena, &height_expr_strs, 0);
|
||||
String8 fmt_string = fmt_cfg->first->string;
|
||||
DF_Eval width_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, width_expr);
|
||||
DF_Eval width_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, width_eval);
|
||||
DF_Eval width_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, width_eval);
|
||||
info.width = width_eval_value.imm_u64;
|
||||
DF_Eval height_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, height_expr);
|
||||
DF_Eval height_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, height_eval);
|
||||
DF_Eval height_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, height_eval);
|
||||
info.height = height_eval_value.imm_u64;
|
||||
if(fmt_string.size != 0)
|
||||
{
|
||||
@@ -276,9 +276,9 @@ df_view_rule_hooks__geo_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ct
|
||||
DF_Eval count_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, count_expr);
|
||||
DF_Eval vertices_base_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, vertices_base_expr);
|
||||
DF_Eval vertices_size_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, vertices_size_expr);
|
||||
DF_Eval count_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, count_eval);
|
||||
DF_Eval vertices_base_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, vertices_base_eval);
|
||||
DF_Eval vertices_size_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, vertices_size_eval);
|
||||
DF_Eval count_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, count_eval);
|
||||
DF_Eval vertices_base_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, vertices_base_eval);
|
||||
DF_Eval vertices_size_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, vertices_size_eval);
|
||||
U64 vertices_base_vaddr = vertices_base_val_eval.imm_u64 ? vertices_base_val_eval.imm_u64 : vertices_base_val_eval.offset;
|
||||
result.index_count = count_val_eval.imm_u64;
|
||||
result.vertices_vaddr_range = r1u64(vertices_base_vaddr, vertices_base_vaddr+vertices_size_val_eval.imm_u64);
|
||||
@@ -306,7 +306,7 @@ df_view_rule_hooks__txt_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ct
|
||||
lang_string = lang_cfg->first->string;
|
||||
String8 size_expr = str8_list_join(scratch.arena, &size_expr_strs, &join);
|
||||
DF_Eval size_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, size_expr);
|
||||
DF_Eval size_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, size_eval);
|
||||
DF_Eval size_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, size_eval);
|
||||
result.lang = txt_lang_kind_from_extension(lang_string);
|
||||
result.size_cap = size_val_eval.imm_u64;
|
||||
}
|
||||
@@ -337,13 +337,13 @@ DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(array)
|
||||
}
|
||||
String8 array_size_expr = str8_list_join(scratch.arena, &array_size_expr_strs, 0);
|
||||
DF_Eval array_size_eval = df_eval_from_string(arena, dbgi_scope, ctrl_ctx, parse_ctx, macro_map, array_size_expr);
|
||||
DF_Eval array_size_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, array_size_eval);
|
||||
DF_Eval array_size_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, array_size_eval);
|
||||
eval_error_list_concat_in_place(&eval.errors, &array_size_eval.errors);
|
||||
array_size = array_size_eval_value.imm_u64;
|
||||
}
|
||||
|
||||
// rjf: apply array size to type
|
||||
TG_Key pointee = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, type_key);
|
||||
TG_Key pointee = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, type_key);
|
||||
TG_Key array_type = tg_cons_type_make(parse_ctx->type_graph, TG_Kind_Array, pointee, array_size);
|
||||
eval.type_key = tg_cons_type_make(parse_ctx->type_graph, TG_Kind_Ptr, array_type, 0);
|
||||
}
|
||||
@@ -373,13 +373,13 @@ DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(bswap)
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
TG_Key type_key = eval.type_key;
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
U64 type_size_bytes = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdbg, type_key);
|
||||
U64 type_size_bytes = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, type_key);
|
||||
if(TG_Kind_Char8 <= type_kind && type_kind <= TG_Kind_S256 &&
|
||||
(type_size_bytes == 2 ||
|
||||
type_size_bytes == 4 ||
|
||||
type_size_bytes == 8))
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
if(value_eval.mode == EVAL_EvalMode_Value)
|
||||
{
|
||||
switch(type_size_bytes)
|
||||
@@ -498,8 +498,8 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
|
||||
//- rjf: grab hsva
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
Vec4F32 rgba = df_view_rule_hooks__rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdbg, process);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
Vec4F32 rgba = df_view_rule_hooks__rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdi, process);
|
||||
Vec4F32 hsva = hsva_from_rgba(rgba);
|
||||
|
||||
//- rjf: build text box
|
||||
@@ -572,8 +572,8 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
}
|
||||
else
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
rgba = df_view_rule_hooks__rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdbg, process);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
rgba = df_view_rule_hooks__rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdi, process);
|
||||
state->hsva = hsva = hsva_from_rgba(rgba);
|
||||
state->memgen_idx = ctrl_memgen_idx();
|
||||
}
|
||||
@@ -623,7 +623,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
if(commit)
|
||||
{
|
||||
Vec4F32 rgba = rgba_from_hsva(hsva);
|
||||
df_view_rule_hooks__eval_commit_rgba(eval, parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, rgba);
|
||||
df_view_rule_hooks__eval_commit_rgba(eval, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, rgba);
|
||||
state->memgen_idx = ctrl_memgen_idx();
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
DF_TxtTopologyInfo top = df_view_rule_hooks__txt_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
|
||||
//- rjf: resolve to address value & range
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
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;
|
||||
Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr + (top.size_cap ? top.size_cap : 2048));
|
||||
|
||||
@@ -844,7 +844,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap)
|
||||
|
||||
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
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_BitmapTopologyInfo topology = df_view_rule_hooks__bitmap_topology_info_from_cfg(scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
U64 expected_size = topology.width*topology.height*r_tex2d_format_bytes_per_pixel_table[topology.fmt];
|
||||
@@ -865,7 +865,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap)
|
||||
state->last_open_frame_idx = df_frame_index();
|
||||
|
||||
//- rjf: resolve to address value
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
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;
|
||||
|
||||
//- rjf: unpack thread/process of eval
|
||||
@@ -1087,7 +1087,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo)
|
||||
|
||||
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(geo)
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
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;
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
ui_labelf("0x%I64x -> Geometry", base_vaddr);
|
||||
@@ -1112,7 +1112,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo)
|
||||
state->last_open_frame_idx = df_frame_index();
|
||||
|
||||
//- rjf: resolve to address value
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdbg, ctrl_ctx, eval);
|
||||
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;
|
||||
|
||||
//- rjf: extract extra geo topology info from view rule
|
||||
|
||||
+19
-19
@@ -751,7 +751,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF
|
||||
DF_Entity *binary = df_binary_file_from_module(module);
|
||||
String8 exe_path = df_full_path_from_entity(scratch.arena, binary);
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, exe_path, os_now_microseconds()+100);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
|
||||
//- rjf: calculate top-level keys, expand root-level, grab root expansion node
|
||||
DF_ExpandKey parent_key = df_expand_key_make(5381, 0);
|
||||
@@ -842,7 +842,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DBGI_Scope *scope, DF
|
||||
last_vb = df_eval_viz_block_split_and_continue(arena, &blocks, last_vb, sub_expand_item_idxs[sub_expand_idx]);
|
||||
|
||||
// rjf: grab name for the expanded row
|
||||
String8 name = dbgi_fuzzy_item_string_from_rdbg_target_element_idx(&dbgi->rdbg, dbgi_target, sub_expand_keys[sub_expand_idx].child_num);
|
||||
String8 name = dbgi_fuzzy_item_string_from_rdi_target_element_idx(&dbgi->rdi, dbgi_target, sub_expand_keys[sub_expand_idx].child_num);
|
||||
|
||||
// rjf: recurse for sub-expansion
|
||||
{
|
||||
@@ -1180,7 +1180,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
default:{}break;
|
||||
case EVAL_EvalMode_Addr:
|
||||
{
|
||||
U64 size = tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdbg, row->eval.type_key);
|
||||
U64 size = tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdi, row->eval.type_key);
|
||||
size = Min(size, 64);
|
||||
Rng1U64 vaddr_rng = r1u64(row->eval.offset, row->eval.offset+size);
|
||||
CTRL_ProcessMemorySlice slice = ctrl_query_cached_data_from_process_vaddr_range(scratch.arena, process->ctrl_machine_id, process->ctrl_handle, vaddr_rng, 0);
|
||||
@@ -1270,7 +1270,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
row->depth > 0 &&
|
||||
!row_expanded)
|
||||
{
|
||||
U64 next_off = (row->eval.offset + tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdbg, row->eval.type_key));
|
||||
U64 next_off = (row->eval.offset + tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdi, row->eval.type_key));
|
||||
if(next_off%64 != 0 && row->eval.offset/64 < next_off/64)
|
||||
{
|
||||
ui_set_next_fixed_x(0);
|
||||
@@ -1346,7 +1346,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
String8List inheritance_chain_type_names = {0};
|
||||
for(TG_KeyNode *n = row->inherited_type_key_chain.first; n != 0; n = n->next)
|
||||
{
|
||||
String8 inherited_type_name = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdbg, n->v);
|
||||
String8 inherited_type_name = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, n->v);
|
||||
inherited_type_name = str8_skip_chop_whitespace(inherited_type_name);
|
||||
str8_list_push(scratch.arena, &inheritance_chain_type_names, inherited_type_name);
|
||||
}
|
||||
@@ -1399,9 +1399,9 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
if(parse.expr != &eval_expr_nil && errors.count == 0)
|
||||
{
|
||||
ui_labelf("Type:");
|
||||
ir_tree_and_type = eval_irtree_and_type_from_expr(scratch.arena, parse_ctx.type_graph, parse_ctx.rdbg, &eval_string2expr_map_nil, parse.expr, &errors);
|
||||
ir_tree_and_type = eval_irtree_and_type_from_expr(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, &eval_string2expr_map_nil, parse.expr, &errors);
|
||||
TG_Key type_key = ir_tree_and_type.type_key;
|
||||
String8 type_string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdbg, type_key);
|
||||
String8 type_string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, type_key);
|
||||
UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
ui_label(type_string);
|
||||
}
|
||||
@@ -1554,7 +1554,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
UI_FocusActive((cell_selected && ewv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
TG_Key key = row->eval.type_key;
|
||||
String8 string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdbg, key);
|
||||
String8 string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, key);
|
||||
string = str8_skip_chop_whitespace(string);
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###type_%I64x", row_hash);
|
||||
if(!tg_key_match(key, tg_key_zero())) UI_Parent(box)
|
||||
@@ -1691,7 +1691,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_Eval write_eval = df_eval_from_string(scratch.arena, scope, &ctrl_ctx, &parse_ctx, ¯o_map, commit_string);
|
||||
B32 success = df_commit_eval_value(parse_ctx.type_graph, parse_ctx.rdbg, &ctrl_ctx, commit_row->eval, write_eval);
|
||||
B32 success = df_commit_eval_value(parse_ctx.type_graph, parse_ctx.rdi, &ctrl_ctx, commit_row->eval, write_eval);
|
||||
if(success == 0)
|
||||
{
|
||||
DF_CmdParams params = df_cmd_params_from_view(ws, panel, view);
|
||||
@@ -2918,7 +2918,7 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
//- rjf: query -> raddbg, filtered items
|
||||
U128 fuzzy_search_key = {(U64)view, df_hash_from_string(str8_struct(&view))};
|
||||
DBGI_Parse *dbgi = dbgi_parse_from_exe_path(scope, exe_path, os_now_microseconds()+100);
|
||||
RDI_Parsed *rdbg = &dbgi->rdbg;
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
B32 items_stale = 0;
|
||||
DBGI_FuzzySearchItemArray items = dbgi_fuzzy_search_items_from_key_exe_query(scope, fuzzy_search_key, exe_path, query, DBGI_FuzzySearchTarget_Procedures, os_now_microseconds()+100, &items_stale);
|
||||
if(items_stale)
|
||||
@@ -2929,9 +2929,9 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
//- rjf: submit best match when hitting enter w/ no selection
|
||||
if(slv->cursor.y == 0 && items.count != 0 && os_key_press(ui_events(), ui_window(), 0, OS_Key_Return))
|
||||
{
|
||||
RDI_Procedure *procedure = rdi_element_from_idx(rdbg, procedures, items.v[0].idx);
|
||||
RDI_Procedure *procedure = rdi_element_from_idx(rdi, procedures, items.v[0].idx);
|
||||
U64 name_size = 0;
|
||||
U8 *name_base = rdi_string_from_idx(rdbg, procedure->name_string_idx, &name_size);
|
||||
U8 *name_base = rdi_string_from_idx(rdi, procedure->name_string_idx, &name_size);
|
||||
String8 name = str8(name_base, name_size);
|
||||
if(name.size != 0)
|
||||
{
|
||||
@@ -2967,11 +2967,11 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
UI_Focus((slv->cursor.y == idx+1) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
DBGI_FuzzySearchItem *item = &items.v[idx];
|
||||
RDI_Procedure *procedure = rdi_element_from_idx(rdbg, procedures, item->idx);
|
||||
RDI_Procedure *procedure = rdi_element_from_idx(rdi, procedures, item->idx);
|
||||
U64 name_size = 0;
|
||||
U8 *name_base = rdi_string_from_idx(rdbg, procedure->name_string_idx, &name_size);
|
||||
U8 *name_base = rdi_string_from_idx(rdi, procedure->name_string_idx, &name_size);
|
||||
String8 name = str8(name_base, name_size);
|
||||
RDI_TypeNode *type_node = rdi_element_from_idx(rdbg, type_nodes, procedure->type_idx);
|
||||
RDI_TypeNode *type_node = rdi_element_from_idx(rdi, type_nodes, procedure->type_idx);
|
||||
TG_Key type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), procedure->type_idx);
|
||||
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|
|
||||
@@ -2987,7 +2987,7 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
ui_box_equip_fuzzy_match_ranges(box, &item->match_ranges);
|
||||
if(!tg_key_match(tg_key_zero(), type_key))
|
||||
{
|
||||
String8 type_string = tg_string_from_key(scratch.arena, graph, rdbg, type_key);
|
||||
String8 type_string = tg_string_from_key(scratch.arena, graph, rdi, type_key);
|
||||
df_code_label(0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_WeakText), type_string);
|
||||
}
|
||||
}
|
||||
@@ -7902,7 +7902,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
|
||||
DBGI_Scope *scope = dbgi_scope_open();
|
||||
U64 thread_rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, ctrl_ctx.unwind_count);
|
||||
EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(scope, process, thread_rip_vaddr);
|
||||
RDI_Parsed *rdbg = parse_ctx.rdbg;
|
||||
RDI_Parsed *rdi = parse_ctx.rdi;
|
||||
for(EVAL_String2NumMapNode *n = parse_ctx.locals_map->first; n != 0; n = n->order_next)
|
||||
{
|
||||
String8 local_name = n->string;
|
||||
@@ -7910,7 +7910,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
|
||||
if(local_eval.mode == EVAL_EvalMode_Addr)
|
||||
{
|
||||
TG_Kind local_eval_type_kind = tg_kind_from_key(local_eval.type_key);
|
||||
U64 local_eval_type_size = tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, rdbg, local_eval.type_key);
|
||||
U64 local_eval_type_size = tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, rdi, local_eval.type_key);
|
||||
Rng1U64 vaddr_rng = r1u64(local_eval.offset, local_eval.offset+local_eval_type_size);
|
||||
Rng1U64 vaddr_rng_in_visible = intersect_1u64(viz_range_bytes, vaddr_rng);
|
||||
if(vaddr_rng_in_visible.max != vaddr_rng_in_visible.min)
|
||||
@@ -7919,7 +7919,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
|
||||
{
|
||||
annotation->name_string = push_str8_copy(scratch.arena, local_name);
|
||||
annotation->kind_string = str8_lit("Local");
|
||||
annotation->type_string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdbg, local_eval.type_key);
|
||||
annotation->type_string = tg_string_from_key(scratch.arena, parse_ctx.type_graph, parse_ctx.rdi, local_eval.type_key);
|
||||
annotation->color = color_gen_table[(vaddr_rng.min/8)%ArrayCount(color_gen_table)];
|
||||
annotation->vaddr_range = vaddr_rng;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user