mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-12 23:31:38 -07:00
first pass at converting frontend over to using new eval system
This commit is contained in:
@@ -43,7 +43,7 @@ if "%asan%"=="1" set auto_compile_flags=%auto_compile_flags% -fsanitize=add
|
||||
|
||||
:: --- Compile/Link Line Definitions ------------------------------------------
|
||||
set cl_common= /I..\src\ /I..\local\ /nologo /FC /Z7
|
||||
set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Wno-initializer-overrides -Wno-incompatible-pointer-types-discards-qualifiers -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf
|
||||
set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Wno-initializer-overrides -Wno-incompatible-pointer-types-discards-qualifiers -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf -ferror-limit=10000
|
||||
set cl_debug= call cl /Od /Ob1 /DBUILD_DEBUG=1 %cl_common% %auto_compile_flags%
|
||||
set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% %auto_compile_flags%
|
||||
set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags%
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
#endif
|
||||
|
||||
#if !defined(BUILD_ISSUES_LINK_STRING_LITERAL)
|
||||
# define BUILD_ISSUES_LINK_STRING_LITERAL "https://github.com/EpicGames/raddebugger/issues"
|
||||
# define BUILD_ISSUES_LINK_STRING_LITERAL "https://github.com/EpicGamesExt/raddebugger/issues"
|
||||
#endif
|
||||
|
||||
#define BUILD_TITLE_STRING_LITERAL BUILD_TITLE " (" BUILD_VERSION_STRING_LITERAL " " BUILD_RELEASE_PHASE_STRING_LITERAL ") - " __DATE__ "" BUILD_GIT_HASH_STRING_LITERAL_APPEND BUILD_MODE_STRING_LITERAL_APPEND
|
||||
|
||||
+89
-58
@@ -900,15 +900,15 @@ ctrl_init(void)
|
||||
U64 reg_count = regs_reg_code_count_from_architecture(arch);
|
||||
String8 *alias_names = regs_alias_code_string_table_from_architecture(arch);
|
||||
U64 alias_count = regs_alias_code_count_from_architecture(arch);
|
||||
ctrl_state->arch_string2reg_tables[arch] = eval_string2num_map_make(ctrl_state->arena, 256);
|
||||
ctrl_state->arch_string2alias_tables[arch] = eval_string2num_map_make(ctrl_state->arena, 256);
|
||||
ctrl_state->arch_string2reg_tables[arch] = e_string2num_map_make(ctrl_state->arena, 256);
|
||||
ctrl_state->arch_string2alias_tables[arch] = e_string2num_map_make(ctrl_state->arena, 256);
|
||||
for(U64 idx = 1; idx < reg_count; idx += 1)
|
||||
{
|
||||
eval_string2num_map_insert(ctrl_state->arena, &ctrl_state->arch_string2reg_tables[arch], reg_names[idx], idx);
|
||||
e_string2num_map_insert(ctrl_state->arena, &ctrl_state->arch_string2reg_tables[arch], reg_names[idx], idx);
|
||||
}
|
||||
for(U64 idx = 1; idx < alias_count; idx += 1)
|
||||
{
|
||||
eval_string2num_map_insert(ctrl_state->arena, &ctrl_state->arch_string2alias_tables[arch], alias_names[idx], idx);
|
||||
e_string2num_map_insert(ctrl_state->arena, &ctrl_state->arch_string2alias_tables[arch], alias_names[idx], idx);
|
||||
}
|
||||
}
|
||||
ctrl_state->process_memory_cache.slots_count = 256;
|
||||
@@ -2713,13 +2713,13 @@ ctrl_reg_gen(void)
|
||||
|
||||
//- rjf: name -> register/alias hash tables, for eval
|
||||
|
||||
internal EVAL_String2NumMap *
|
||||
internal E_String2NumMap *
|
||||
ctrl_string2reg_from_arch(Architecture arch)
|
||||
{
|
||||
return &ctrl_state->arch_string2reg_tables[arch];
|
||||
}
|
||||
|
||||
internal EVAL_String2NumMap *
|
||||
internal E_String2NumMap *
|
||||
ctrl_string2alias_from_arch(Architecture arch)
|
||||
{
|
||||
return &ctrl_state->arch_string2alias_tables[arch];
|
||||
@@ -3789,11 +3789,11 @@ ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg,
|
||||
//- rjf: eval helpers
|
||||
|
||||
internal B32
|
||||
ctrl_eval_memory_read(void *u, void *out, U64 addr, U64 size)
|
||||
ctrl_eval_memory_read(void *u, void *out, Rng1U64 vaddr_range)
|
||||
{
|
||||
DMN_Handle process = *(DMN_Handle *)u;
|
||||
U64 read_size = dmn_process_read(process, r1u64(addr, addr+size), out);
|
||||
B32 result = (read_size == size);
|
||||
U64 read_size = dmn_process_read(process, vaddr_range, out);
|
||||
B32 result = (read_size == dim_1u64(vaddr_range));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -4518,11 +4518,11 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
//- rjf: unpack info about thread attached to event
|
||||
//
|
||||
CTRL_Entity *thread = ctrl_entity_from_machine_id_handle(ctrl_state->ctrl_thread_entity_store, CTRL_MachineID_Local, event->thread);
|
||||
CTRL_Entity *process = ctrl_entity_from_machine_id_handle(ctrl_state->ctrl_thread_entity_store, CTRL_MachineID_Local, event->process);
|
||||
Architecture arch = thread->arch;
|
||||
U64 thread_rip_vaddr = dmn_rip_from_thread(event->thread);
|
||||
CTRL_Entity *module = &ctrl_entity_nil;
|
||||
{
|
||||
CTRL_Entity *process = ctrl_entity_from_machine_id_handle(ctrl_state->ctrl_thread_entity_store, CTRL_MachineID_Local, event->process);
|
||||
for(CTRL_Entity *m = process->first; m != &ctrl_entity_nil; m = m->next)
|
||||
{
|
||||
if(m->kind == CTRL_EntityKind_Module && contains_1u64(m->vaddr_range, thread_rip_vaddr))
|
||||
@@ -4536,7 +4536,6 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
//////////////////////////
|
||||
//- rjf: extract module-dependent info
|
||||
//
|
||||
CTRL_Entity *dbg_path = ctrl_entity_child_from_kind(module, CTRL_EntityKind_DebugInfoPath);
|
||||
U64 thread_rip_voff = thread_rip_vaddr - module->vaddr_range.min;
|
||||
|
||||
//////////////////////////
|
||||
@@ -4630,61 +4629,93 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
if(conditions.node_count != 0) ProfScope("evaluate hit stop conditions")
|
||||
{
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
DI_Key dbgi_key = {dbg_path->string, dbg_path->timestamp};
|
||||
RDI_Parsed *rdi = di_rdi_from_key(di_scope, &dbgi_key, max_U64);
|
||||
for(String8Node *condition_n = conditions.first; condition_n != 0; condition_n = condition_n->next)
|
||||
{
|
||||
ProfBegin("compile expression");
|
||||
String8 string = condition_n->string;
|
||||
EVAL_ParseCtx parse_ctx = zero_struct;
|
||||
// rjf: count all modules
|
||||
U64 all_modules_count = 0;
|
||||
for(CTRL_Entity *child = process->first; child != &ctrl_entity_nil; child = child->next)
|
||||
{
|
||||
parse_ctx.arch = arch;
|
||||
parse_ctx.ip_voff = thread_rip_voff;
|
||||
parse_ctx.rdi = rdi;
|
||||
parse_ctx.type_graph = tg_graph_begin(bit_size_from_arch(arch)/8, 256);
|
||||
parse_ctx.regs_map = ctrl_string2reg_from_arch(arch);
|
||||
parse_ctx.reg_alias_map = ctrl_string2alias_from_arch(arch);
|
||||
parse_ctx.locals_map = eval_push_locals_map_from_rdi_voff(temp.arena, rdi, thread_rip_voff);
|
||||
parse_ctx.member_map = eval_push_member_map_from_rdi_voff(temp.arena, rdi, thread_rip_voff);
|
||||
if(child->kind == CTRL_EntityKind_Module)
|
||||
{
|
||||
all_modules_count += 1;
|
||||
}
|
||||
}
|
||||
EVAL_TokenArray tokens = eval_token_array_from_text(temp.arena, string);
|
||||
EVAL_ParseResult parse = eval_parse_expr_from_text_tokens(temp.arena, &parse_ctx, string, &tokens);
|
||||
EVAL_ErrorList errors = parse.errors;
|
||||
B32 parse_has_expr = (parse.expr != &eval_expr_nil);
|
||||
B32 parse_is_type = (parse_has_expr && parse.expr->kind == EVAL_ExprKind_TypeIdent);
|
||||
EVAL_IRTreeAndType ir_tree_and_type = {&eval_irtree_nil};
|
||||
if(parse_has_expr && errors.count == 0)
|
||||
|
||||
// rjf: form evaluation context
|
||||
E_Ctx ectx = zero_struct;
|
||||
ProfScope("form evaluation context")
|
||||
{
|
||||
ir_tree_and_type = eval_irtree_and_type_from_expr(temp.arena, parse_ctx.type_graph, rdi, &eval_string2expr_map_nil, parse.expr, &errors);
|
||||
E_Ctx *ctx = &ectx;
|
||||
ctx->arch = arch;
|
||||
ctx->ip_vaddr = thread_rip_vaddr;
|
||||
ctx->ip_voff = thread_rip_voff;
|
||||
ctx->rdis_count = all_modules_count;
|
||||
ctx->rdis = push_array(temp.arena, RDI_Parsed *, ctx->rdis_count);
|
||||
ctx->rdis_vaddr_ranges = push_array(temp.arena, Rng1U64, ctx->rdis_count);
|
||||
RDI_Parsed *primary_rdi = &di_rdi_parsed_nil;
|
||||
{
|
||||
U64 primary_idx = 0;
|
||||
U64 idx = 0;
|
||||
for(CTRL_Entity *m = process->first;
|
||||
m != &ctrl_entity_nil && idx < all_modules_count;
|
||||
m = m->next)
|
||||
{
|
||||
if(m->kind != CTRL_EntityKind_Module)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: unpack
|
||||
CTRL_Entity *dbg_path = ctrl_entity_child_from_kind(m, CTRL_EntityKind_DebugInfoPath);
|
||||
DI_Key dbgi_key = {dbg_path->string, dbg_path->timestamp};
|
||||
|
||||
// rjf: fill
|
||||
ctx->rdis[idx] = di_rdi_from_key(di_scope, &dbgi_key, max_U64);
|
||||
ctx->rdis_vaddr_ranges[idx] = m->vaddr_range;
|
||||
|
||||
// rjf: pick primary module
|
||||
if(m == module)
|
||||
{
|
||||
primary_idx = idx;
|
||||
}
|
||||
|
||||
// rjf: inc
|
||||
idx += 1;
|
||||
}
|
||||
if(primary_idx != 0)
|
||||
{
|
||||
Swap(RDI_Parsed *, ctx->rdis[0], ctx->rdis[primary_idx]);
|
||||
Swap(Rng1U64, ctx->rdis_vaddr_ranges[0], ctx->rdis_vaddr_ranges[primary_idx]);
|
||||
}
|
||||
primary_rdi = ctx->rdis[0];
|
||||
}
|
||||
ctx->regs_map = ctrl_string2reg_from_arch(ctx->arch);
|
||||
ctx->reg_alias_map = ctrl_string2alias_from_arch(ctx->arch);
|
||||
ctx->locals_map = e_push_locals_map_from_rdi_voff(temp.arena, primary_rdi, thread_rip_voff);
|
||||
ctx->member_map = e_push_member_map_from_rdi_voff(temp.arena, primary_rdi, thread_rip_voff);
|
||||
ctx->macro_map = &e_string2expr_map_nil;
|
||||
// TODO(rjf): ctx->macro_map = ...;
|
||||
ctx->memory_read_user_data = &event->process;
|
||||
ctx->memory_read = ctrl_eval_memory_read;
|
||||
ctx->reg_size = regs_block_size_from_architecture(ctx->arch);
|
||||
ctx->reg_data = push_array(temp.arena, U8, ctx->reg_size);
|
||||
dmn_thread_read_reg_block(event->thread, ctx->reg_data);
|
||||
ctx->module_base = push_array(temp.arena, U64, 1);
|
||||
ctx->module_base[0]= module->vaddr_range.min;
|
||||
ctx->tls_base = push_array(temp.arena, U64, 1);
|
||||
// TODO(rjf): ctx->tls_base[0]= ...;
|
||||
e_select_ctx(ctx);
|
||||
}
|
||||
EVAL_OpList op_list = {0};
|
||||
if(parse_has_expr && ir_tree_and_type.tree != &eval_irtree_nil)
|
||||
|
||||
// rjf: evaluate
|
||||
E_Eval eval = zero_struct;
|
||||
ProfScope("evaluate expression")
|
||||
{
|
||||
eval_oplist_from_irtree(scratch.arena, ir_tree_and_type.tree, &op_list);
|
||||
eval = e_eval_from_string(temp.arena, condition_n->string);
|
||||
}
|
||||
String8 bytecode = {0};
|
||||
if(parse_has_expr && parse_is_type == 0 && op_list.encoded_size != 0)
|
||||
{
|
||||
bytecode = eval_bytecode_from_oplist(scratch.arena, &op_list);
|
||||
}
|
||||
ProfEnd();
|
||||
EVAL_Result eval = {0};
|
||||
if(bytecode.size != 0) ProfScope("evaluate expression")
|
||||
{
|
||||
U64 module_base = module->vaddr_range.min;
|
||||
U64 tls_base = dmn_tls_root_vaddr_from_thread(event->thread);
|
||||
EVAL_Machine machine = {0};
|
||||
machine.u = &event->process;
|
||||
machine.arch = arch;
|
||||
machine.memory_read = ctrl_eval_memory_read;
|
||||
machine.reg_size = regs_block_size_from_architecture(arch);
|
||||
machine.reg_data = push_array(scratch.arena, U8, machine.reg_size);
|
||||
dmn_thread_read_reg_block(event->thread, machine.reg_data);
|
||||
machine.module_base = &module_base;
|
||||
machine.tls_base = &tls_base;
|
||||
eval = eval_interpret(&machine, bytecode);
|
||||
}
|
||||
if(eval.code == EVAL_ResultCode_Good && eval.value.u64 == 0)
|
||||
|
||||
// rjf: interpret evaluation
|
||||
if(eval.code == E_InterpretationCode_Good && eval.value.u64 == 0)
|
||||
{
|
||||
hit_user_bp = 0;
|
||||
hit_conditional_bp_but_filtered = 1;
|
||||
|
||||
@@ -561,8 +561,8 @@ struct CTRL_State
|
||||
CTRL_WakeupFunctionType *wakeup_hook;
|
||||
|
||||
// rjf: name -> register/alias hash tables for eval
|
||||
EVAL_String2NumMap arch_string2reg_tables[Architecture_COUNT];
|
||||
EVAL_String2NumMap arch_string2alias_tables[Architecture_COUNT];
|
||||
E_String2NumMap arch_string2reg_tables[Architecture_COUNT];
|
||||
E_String2NumMap arch_string2alias_tables[Architecture_COUNT];
|
||||
|
||||
// rjf: caches
|
||||
CTRL_ProcessMemoryCache process_memory_cache;
|
||||
@@ -788,8 +788,8 @@ internal U64 ctrl_mem_gen(void);
|
||||
internal U64 ctrl_reg_gen(void);
|
||||
|
||||
//- rjf: name -> register/alias hash tables, for eval
|
||||
internal EVAL_String2NumMap *ctrl_string2reg_from_arch(Architecture arch);
|
||||
internal EVAL_String2NumMap *ctrl_string2alias_from_arch(Architecture arch);
|
||||
internal E_String2NumMap *ctrl_string2reg_from_arch(Architecture arch);
|
||||
internal E_String2NumMap *ctrl_string2alias_from_arch(Architecture arch);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Control-Thread Functions
|
||||
@@ -817,7 +817,7 @@ internal void ctrl_thread__module_close(CTRL_MachineID machine_id, DMN_Handle mo
|
||||
internal DMN_Event *ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg, DMN_RunCtrls *run_ctrls, CTRL_Spoof *spoof);
|
||||
|
||||
//- rjf: eval helpers
|
||||
internal B32 ctrl_eval_memory_read(void *u, void *out, U64 addr, U64 size);
|
||||
internal B32 ctrl_eval_memory_read(void *u, void *out, Rng1U64 vaddr_range);
|
||||
|
||||
//- rjf: log flusher
|
||||
internal void ctrl_thread__flush_info_log(String8 string);
|
||||
|
||||
@@ -492,15 +492,15 @@ dasm_parse_thread__entry_point(void *p)
|
||||
for(;;)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
TXT_Scope *txt_scope = txt_scope_open();
|
||||
|
||||
//- rjf: get next request
|
||||
U128 hash = {0};
|
||||
DASM_Params params = {0};
|
||||
dasm_u2p_dequeue_req(scratch.arena, &hash, ¶ms);
|
||||
U64 change_gen = fs_change_gen();
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
TXT_Scope *txt_scope = txt_scope_open();
|
||||
|
||||
//- rjf: unpack hash
|
||||
U64 slot_idx = hash.u64[1]%dasm_shared->slots_count;
|
||||
|
||||
+7
-1
@@ -140,11 +140,11 @@ di_scope_close(DI_Scope *scope)
|
||||
for(DI_Touch *t = scope->first_touch, *next = 0; t != 0; t = next)
|
||||
{
|
||||
next = t->next;
|
||||
SLLStackPush(di_tctx->free_touch, t);
|
||||
if(t->node != 0)
|
||||
{
|
||||
ins_atomic_u64_dec_eval(&t->node->touch_count);
|
||||
}
|
||||
SLLStackPush(di_tctx->free_touch, t);
|
||||
}
|
||||
SLLStackPush(di_tctx->free_scope, scope);
|
||||
}
|
||||
@@ -435,6 +435,12 @@ di_rdi_from_key(DI_Scope *scope, DI_Key *key, U64 endt_us)
|
||||
break;
|
||||
}
|
||||
|
||||
//- rjf: node refcount == 0? this node is being destroyed
|
||||
if(node->ref_count == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
//- rjf: parse done -> touch, grab result
|
||||
if(node != 0 && node->parse_done)
|
||||
{
|
||||
|
||||
+327
-710
File diff suppressed because it is too large
Load Diff
+30
-69
@@ -68,17 +68,6 @@ struct DF_ExpandTreeTable
|
||||
DF_ExpandNode *free_node;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Control Context Types
|
||||
|
||||
typedef struct DF_CtrlCtx DF_CtrlCtx;
|
||||
struct DF_CtrlCtx
|
||||
{
|
||||
DF_Handle thread;
|
||||
U64 unwind_count;
|
||||
U64 inline_depth;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Entity Kind Flags
|
||||
|
||||
@@ -177,26 +166,6 @@ struct DF_CtrlFlowInfo
|
||||
U64 total_size;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation Types
|
||||
|
||||
typedef struct DF_Eval DF_Eval;
|
||||
struct DF_Eval
|
||||
{
|
||||
TG_Key type_key;
|
||||
EVAL_EvalMode mode;
|
||||
U64 offset;
|
||||
union
|
||||
{
|
||||
S64 imm_s64;
|
||||
U64 imm_u64;
|
||||
F32 imm_f32;
|
||||
F64 imm_f64;
|
||||
U64 imm_u128[2];
|
||||
};
|
||||
EVAL_ErrorList errors;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Rule Hook Types
|
||||
|
||||
@@ -205,10 +174,10 @@ typedef struct DF_CfgVal DF_CfgVal;
|
||||
typedef struct DF_CfgTable DF_CfgTable;
|
||||
typedef struct DF_EvalView DF_EvalView;
|
||||
typedef struct DF_EvalVizBlockList DF_EvalVizBlockList;
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(name) DF_Eval name(Arena *arena, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, DF_CfgVal *val)
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(name) E_Eval name(Arena *arena, E_Eval eval, DF_CfgVal *val)
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name) df_core_view_rule_eval_resolution__##name
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name))
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_EvalView *eval_view, DF_Eval eval, String8 string, DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, DF_CfgNode *cfg, struct DF_EvalVizBlockList *out)
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DF_EvalView *eval_view, E_Eval eval, String8 string, DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, DF_CfgNode *cfg, struct DF_EvalVizBlockList *out)
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name) df_core_view_rule_viz_block_prod__##name
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name))
|
||||
typedef DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CoreViewRuleEvalResolutionHookFunctionType);
|
||||
@@ -682,7 +651,7 @@ struct DF_EvalViewCache
|
||||
typedef struct DF_EvalLinkBase DF_EvalLinkBase;
|
||||
struct DF_EvalLinkBase
|
||||
{
|
||||
EVAL_EvalMode mode;
|
||||
E_Mode mode;
|
||||
U64 offset;
|
||||
};
|
||||
|
||||
@@ -733,19 +702,19 @@ struct DF_EvalVizBlock
|
||||
S32 depth;
|
||||
|
||||
// rjf: evaluation info
|
||||
DF_Eval eval;
|
||||
E_Eval eval;
|
||||
String8 string;
|
||||
TG_Member *member;
|
||||
E_Member *member;
|
||||
|
||||
// rjf: info about ranges that this block spans
|
||||
Rng1U64 visual_idx_range;
|
||||
Rng1U64 semantic_idx_range;
|
||||
FZY_Target fzy_target;
|
||||
RDI_SectionKind fzy_target;
|
||||
FZY_ItemArray fzy_backing_items;
|
||||
|
||||
// rjf: visualization config extensions
|
||||
DF_CfgTable cfg_table;
|
||||
TG_Key link_member_type_key;
|
||||
E_TypeKey link_member_type_key;
|
||||
U64 link_member_off;
|
||||
};
|
||||
|
||||
@@ -804,14 +773,14 @@ struct DF_EvalVizRow
|
||||
DF_ExpandKey key;
|
||||
|
||||
// rjf: evaluation artifacts
|
||||
DF_Eval eval;
|
||||
E_Eval eval;
|
||||
|
||||
// rjf: basic visualization contents
|
||||
String8 display_expr;
|
||||
String8 edit_expr;
|
||||
String8 display_value;
|
||||
String8 edit_value;
|
||||
TG_KeyList inherited_type_key_chain;
|
||||
E_TypeKeyList inherited_type_key_chain;
|
||||
|
||||
// rjf: variable-size & hook info
|
||||
U64 size_in_rows;
|
||||
@@ -1042,7 +1011,7 @@ struct DF_RunLocalsCacheNode
|
||||
DF_RunLocalsCacheNode *hash_next;
|
||||
DI_Key dbgi_key;
|
||||
U64 voff;
|
||||
EVAL_String2NumMap *locals_map;
|
||||
E_String2NumMap *locals_map;
|
||||
};
|
||||
|
||||
typedef struct DF_RunLocalsCacheSlot DF_RunLocalsCacheSlot;
|
||||
@@ -1154,8 +1123,11 @@ struct DF_State
|
||||
F32 dt;
|
||||
F32 seconds_til_autosave;
|
||||
|
||||
// rjf: interaction registers
|
||||
// rjf: frame info
|
||||
Arena *frame_arenas[2];
|
||||
DI_Scope *frame_di_scope;
|
||||
|
||||
// rjf: interaction registers
|
||||
DF_InteractRegsNode base_interact_regs;
|
||||
DF_InteractRegsNode *top_interact_regs;
|
||||
|
||||
@@ -1218,9 +1190,6 @@ struct DF_State
|
||||
DF_HandleList frozen_threads;
|
||||
DF_HandleNode *free_handle_node;
|
||||
|
||||
// rjf: main control context
|
||||
DF_CtrlCtx ctrl_ctx;
|
||||
|
||||
// rjf: control thread user -> ctrl driving state
|
||||
Arena *ctrl_last_run_arena;
|
||||
DF_RunKind ctrl_last_run_kind;
|
||||
@@ -1401,7 +1370,7 @@ internal String8 df_cmd_arg_part_from_string(String8 string);
|
||||
internal DF_CmdParams df_cmd_params_zero(void);
|
||||
internal void df_cmd_params_mark_slot(DF_CmdParams *params, DF_CmdParamSlot slot);
|
||||
internal B32 df_cmd_params_has_slot(DF_CmdParams *params, DF_CmdParamSlot slot);
|
||||
internal String8 df_cmd_params_apply_spec_query(Arena *arena, DF_CtrlCtx *ctrl_ctx, DF_CmdParams *params, DF_CmdSpec *spec, String8 query);
|
||||
internal String8 df_cmd_params_apply_spec_query(Arena *arena, DF_CmdParams *params, DF_CmdSpec *spec, String8 query);
|
||||
|
||||
//- rjf: command lists
|
||||
internal void df_cmd_list_push(Arena *arena, DF_CmdList *cmds, DF_CmdParams *params, DF_CmdSpec *spec);
|
||||
@@ -1581,8 +1550,8 @@ internal DF_Entity *df_module_from_process_vaddr(DF_Entity *process, U64 vaddr);
|
||||
internal DF_Entity *df_module_from_thread(DF_Entity *thread);
|
||||
internal U64 df_tls_base_vaddr_from_process_root_rip(DF_Entity *process, U64 root_vaddr, U64 rip_vaddr);
|
||||
internal Architecture df_architecture_from_entity(DF_Entity *entity);
|
||||
internal EVAL_String2NumMap *df_push_locals_map_from_dbgi_key_voff(Arena *arena, DI_Scope *scope, DI_Key *dbgi_key, U64 voff);
|
||||
internal EVAL_String2NumMap *df_push_member_map_from_dbgi_key_voff(Arena *arena, DI_Scope *scope, DI_Key *dbgi_key, U64 voff);
|
||||
internal E_String2NumMap *df_push_locals_map_from_dbgi_key_voff(Arena *arena, DI_Scope *scope, DI_Key *dbgi_key, U64 voff);
|
||||
internal E_String2NumMap *df_push_member_map_from_dbgi_key_voff(Arena *arena, DI_Scope *scope, DI_Key *dbgi_key, U64 voff);
|
||||
internal B32 df_set_thread_rip(DF_Entity *thread, U64 vaddr);
|
||||
internal DF_Entity *df_module_from_thread_candidates(DF_Entity *thread, DF_EntityList *candidates);
|
||||
internal DF_Unwind df_unwind_from_ctrl_unwind(Arena *arena, DI_Scope *di_scope, DF_Entity *process, CTRL_Unwind *base_unwind);
|
||||
@@ -1600,15 +1569,10 @@ internal void df_ctrl_run(DF_RunKind run, DF_Entity *run_thread, CTRL_RunFlags f
|
||||
internal CTRL_Event df_ctrl_last_stop_event(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation
|
||||
//~ rjf: Evaluation Context
|
||||
|
||||
internal B32 df_eval_memory_read(void *u, void *out, U64 addr, U64 size);
|
||||
internal EVAL_ParseCtx df_eval_parse_ctx_from_process_vaddr(DI_Scope *scope, DF_Entity *process, U64 vaddr);
|
||||
internal EVAL_ParseCtx df_eval_parse_ctx_from_src_loc(DI_Scope *scope, DF_Entity *file, TxtPt pt);
|
||||
internal DF_Eval df_eval_from_string(Arena *arena, DI_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 *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, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, DF_CfgTable *cfg);
|
||||
internal B32 df_eval_memory_read(void *u, void *out, Rng1U64 vaddr_range);
|
||||
internal E_Eval df_eval_from_eval_cfg_table(Arena *arena, E_Eval eval, DF_CfgTable *cfg);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation Views
|
||||
@@ -1631,14 +1595,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 *rdi, DF_EvalVizStringFlags flags, U32 radix, DF_Eval eval);
|
||||
internal String8 df_string_from_simple_typed_eval(Arena *arena, DF_EvalVizStringFlags flags, U32 radix, E_Eval eval);
|
||||
|
||||
//- rjf: writing values back to child processes
|
||||
internal B32 df_commit_eval_value(TG_Graph *graph, RDI_Parsed *rdi, DF_CtrlCtx *ctrl_ctx, DF_Eval dst_eval, DF_Eval src_eval);
|
||||
internal B32 df_commit_eval_value(E_Eval dst_eval, E_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 *rdi, TG_Key link_member_type_key, U64 link_member_off, DF_CtrlCtx *ctrl_ctx, DF_Eval eval, U64 cap);
|
||||
internal E_MemberArray df_filtered_data_members_from_members_cfg_table(Arena *arena, E_MemberArray members, DF_CfgTable *cfg);
|
||||
internal DF_EvalLinkBaseChunkList df_eval_link_base_chunk_list_from_eval(Arena *arena, E_TypeKey link_member_type_key, U64 link_member_off, E_Eval eval, U64 cap);
|
||||
internal 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);
|
||||
|
||||
@@ -1646,8 +1610,8 @@ internal DF_EvalLinkBaseArray df_eval_link_base_array_from_chunk_list(Arena *are
|
||||
internal DF_EvalVizBlock *df_eval_viz_block_begin(Arena *arena, DF_EvalVizBlockKind kind, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth);
|
||||
internal DF_EvalVizBlock *df_eval_viz_block_split_and_continue(Arena *arena, DF_EvalVizBlockList *list, DF_EvalVizBlock *split_block, U64 split_idx);
|
||||
internal void df_eval_viz_block_end(DF_EvalVizBlockList *list, DF_EvalVizBlock *block);
|
||||
internal void df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView *view, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, DF_Eval eval, TG_Member *opt_member, DF_CfgTable *cfg_table, S32 depth, DF_EvalVizBlockList *list_out);
|
||||
internal DF_EvalVizBlockList df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_EvalView *eval_view, String8 expr, DF_ExpandKey parent_key, DF_ExpandKey key);
|
||||
internal void df_append_viz_blocks_for_parent__rec(Arena *arena, DI_Scope *scope, DF_EvalView *view, DF_ExpandKey parent_key, DF_ExpandKey key, String8 string, E_Eval eval, E_Member *opt_member, DF_CfgTable *cfg_table, S32 depth, DF_EvalVizBlockList *list_out);
|
||||
internal DF_EvalVizBlockList df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DI_Scope *scope, DF_EvalView *eval_view, String8 expr, DF_ExpandKey parent_key, DF_ExpandKey key);
|
||||
internal void df_eval_viz_block_list_concat__in_place(DF_EvalVizBlockList *dst, DF_EvalVizBlockList *to_push);
|
||||
|
||||
//- rjf: viz block list <-> table coordinates
|
||||
@@ -1656,7 +1620,7 @@ internal DF_ExpandKey df_key_from_viz_block_list_row_num(DF_EvalVizBlockList *bl
|
||||
internal DF_ExpandKey df_parent_key_from_viz_block_list_row_num(DF_EvalVizBlockList *blocks, S64 row_num);
|
||||
|
||||
//- rjf: viz row list building
|
||||
internal DF_EvalVizRow *df_eval_viz_row_list_push_new(Arena *arena, EVAL_ParseCtx *parse_ctx, DF_EvalVizWindowedRowList *rows, DF_EvalVizBlock *block, DF_ExpandKey key, DF_Eval eval);
|
||||
internal DF_EvalVizRow *df_eval_viz_row_list_push_new(Arena *arena, DF_EvalVizWindowedRowList *rows, DF_EvalVizBlock *block, DF_ExpandKey key, E_Eval eval);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Main State Accessors/Mutators
|
||||
@@ -1669,6 +1633,7 @@ internal F64 df_time_in_seconds(void);
|
||||
|
||||
//- rjf: interaction registers
|
||||
internal DF_InteractRegs *df_interact_regs(void);
|
||||
internal DF_InteractRegs *df_base_interact_regs(void);
|
||||
internal DF_InteractRegs *df_push_interact_regs(void);
|
||||
internal DF_InteractRegs *df_pop_interact_regs(void);
|
||||
|
||||
@@ -1681,10 +1646,6 @@ internal U64 df_ctrl_last_run_frame_idx(void);
|
||||
internal U64 df_ctrl_run_gen(void);
|
||||
internal B32 df_ctrl_targets_running(void);
|
||||
|
||||
//- rjf: control context
|
||||
internal DF_CtrlCtx df_ctrl_ctx(void);
|
||||
internal void df_ctrl_ctx_apply_overrides(DF_CtrlCtx *ctx, DF_CtrlCtx *overrides);
|
||||
|
||||
//- rjf: config paths
|
||||
internal String8 df_cfg_path_from_src(DF_CfgSrc src);
|
||||
|
||||
@@ -1716,8 +1677,8 @@ internal CTRL_Unwind df_query_cached_unwind_from_thread(DF_Entity *thread);
|
||||
internal U64 df_query_cached_rip_from_thread(DF_Entity *thread);
|
||||
internal U64 df_query_cached_rip_from_thread_unwind(DF_Entity *thread, U64 unwind_count);
|
||||
internal U64 df_query_cached_tls_base_vaddr_from_process_root_rip(DF_Entity *process, U64 root_vaddr, U64 rip_vaddr);
|
||||
internal EVAL_String2NumMap *df_query_cached_locals_map_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff);
|
||||
internal EVAL_String2NumMap *df_query_cached_member_map_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff);
|
||||
internal E_String2NumMap *df_query_cached_locals_map_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff);
|
||||
internal E_String2NumMap *df_query_cached_member_map_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff);
|
||||
|
||||
//- rjf: top-level command dispatch
|
||||
internal void df_push_cmd__root(DF_CmdParams *params, DF_CmdSpec *spec);
|
||||
|
||||
@@ -144,8 +144,6 @@ DF_CoreCmdTable:// | | |
|
||||
|
||||
//- rjf: debug control context management operations
|
||||
{SelectThread 0 Entity Thread 0 0 0 0 0 1 Null "select_thread" "Select Thread" "Selects a thread." "" }
|
||||
{SelectThreadWindow 0 Entity Thread 0 0 0 0 0 1 Null "select_thread_window" "Select Thread On Window" "Selects a thread for the active window, overriding the global selected thread." "" }
|
||||
{SelectThreadView 0 Entity Thread 0 0 0 0 0 1 Null "select_thread_view" "Select Thread On View" "Selects a thread for the active view, overriding the global and per-window selected threads." "" }
|
||||
{SelectUnwind 1 Null Nil 0 0 0 0 0 0 Null "select_unwind" "Select Unwind" "Selects an unwind frame number for the selected thread." "" }
|
||||
{UpOneFrame 0 Null Nil 0 0 0 0 0 0 UpArrow "up_one_frame" "Up One Frame" "Selects the call stack frame above the currently selected." "" }
|
||||
{DownOneFrame 0 Null Nil 0 0 0 0 0 0 DownArrow "down_one_frame" "Down One Frame" "Selects the call stack frame below the currently selected." "callstack,unwind" }
|
||||
|
||||
@@ -209,7 +209,7 @@ DF_CoreCmdKind_Null,
|
||||
DF_CoreCmdKind_Null,
|
||||
};
|
||||
|
||||
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[221] =
|
||||
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[219] =
|
||||
{
|
||||
{ str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("exit"), str8_lit_comp("Exits the debugger."), str8_lit_comp("quit,close,abort"), str8_lit_comp("Exit"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_X},
|
||||
@@ -239,8 +239,6 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[221] =
|
||||
{ str8_lit_comp("run_to_cursor"), str8_lit_comp("Runs the selected thread to the current cursor."), str8_lit_comp(""), str8_lit_comp("Run To Cursor"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Play},
|
||||
{ str8_lit_comp("set_next_statement"), str8_lit_comp("Sets the selected thread's instruction pointer to the cursor's position."), str8_lit_comp(""), str8_lit_comp("Set Next Statement"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_RightArrow},
|
||||
{ str8_lit_comp("select_thread"), str8_lit_comp("Selects a thread."), str8_lit_comp(""), str8_lit_comp("Select Thread"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("select_thread_window"), str8_lit_comp("Selects a thread for the active window, overriding the global selected thread."), str8_lit_comp(""), str8_lit_comp("Select Thread On Window"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("select_thread_view"), str8_lit_comp("Selects a thread for the active view, overriding the global and per-window selected threads."), str8_lit_comp(""), str8_lit_comp("Select Thread On View"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Entity, DF_EntityKind_Thread, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("select_unwind"), str8_lit_comp("Selects an unwind frame number for the selected thread."), str8_lit_comp(""), str8_lit_comp("Select Unwind"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("up_one_frame"), str8_lit_comp("Selects the call stack frame above the currently selected."), str8_lit_comp(""), str8_lit_comp("Up One Frame"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_UpArrow},
|
||||
{ str8_lit_comp("down_one_frame"), str8_lit_comp("Selects the call stack frame below the currently selected."), str8_lit_comp("callstack,unwind"), str8_lit_comp("Down One Frame"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_DownArrow},
|
||||
|
||||
@@ -75,8 +75,6 @@ DF_CoreCmdKind_StepOver,
|
||||
DF_CoreCmdKind_RunToCursor,
|
||||
DF_CoreCmdKind_SetNextStatement,
|
||||
DF_CoreCmdKind_SelectThread,
|
||||
DF_CoreCmdKind_SelectThreadWindow,
|
||||
DF_CoreCmdKind_SelectThreadView,
|
||||
DF_CoreCmdKind_SelectUnwind,
|
||||
DF_CoreCmdKind_UpOneFrame,
|
||||
DF_CoreCmdKind_DownOneFrame,
|
||||
|
||||
+214
-255
File diff suppressed because it is too large
Load Diff
+9
-24
@@ -202,9 +202,6 @@ struct DF_View
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
|
||||
// rjf: ctrl context overrides
|
||||
DF_CtrlCtx ctrl_ctx_overrides;
|
||||
|
||||
// rjf: allocation & user data extensions
|
||||
Arena *arena;
|
||||
DF_ArenaExt *first_arena_ext;
|
||||
@@ -324,11 +321,11 @@ enum
|
||||
#define DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name) df_gfx_view_rule_line_stringize__##name
|
||||
#define DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(name) internal DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name))
|
||||
|
||||
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg)
|
||||
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, E_Eval eval, struct DF_CfgNode *cfg)
|
||||
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name) df_gfx_view_rule_row_ui__##name
|
||||
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name))
|
||||
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, String8 string, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg, Vec2F32 dim)
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, E_Eval eval, String8 string, struct DF_CfgNode *cfg, Vec2F32 dim)
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name) df_gfx_view_rule_block_ui__##name
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name))
|
||||
|
||||
@@ -602,7 +599,6 @@ struct DF_Window
|
||||
B32 autocomp_force_closed;
|
||||
B32 autocomp_query_dirty;
|
||||
UI_Key autocomp_root_key;
|
||||
DF_CtrlCtx autocomp_ctrl_ctx;
|
||||
Arena *autocomp_lister_params_arena;
|
||||
DF_AutoCompListerParams autocomp_lister_params;
|
||||
U64 autocomp_cursor_off;
|
||||
@@ -636,7 +632,6 @@ struct DF_Window
|
||||
U64 hover_eval_last_frame_idx;
|
||||
|
||||
// rjf: hover eval params
|
||||
DF_CtrlCtx hover_eval_ctrl_ctx;
|
||||
DF_Handle hover_eval_file;
|
||||
TxtPt hover_eval_file_pt;
|
||||
U64 hover_eval_vaddr;
|
||||
@@ -648,9 +643,6 @@ struct DF_Window
|
||||
U64 error_string_size;
|
||||
F32 error_t;
|
||||
|
||||
// rjf: context overrides
|
||||
DF_CtrlCtx ctrl_ctx_overrides;
|
||||
|
||||
// rjf: panel state
|
||||
DF_Panel *root_panel;
|
||||
DF_Panel *free_panel;
|
||||
@@ -834,7 +826,6 @@ read_only global DF_View df_g_nil_view =
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
@@ -907,7 +898,7 @@ internal void df_panel_remove_tab_view(DF_Panel *panel, DF_View *view);
|
||||
internal DF_View *df_selected_tab_from_panel(DF_Panel *panel);
|
||||
|
||||
//- rjf: icons & display strings
|
||||
internal String8 df_display_string_from_view(Arena *arena, DF_CtrlCtx ctrl_ctx, DF_View *view);
|
||||
internal String8 df_display_string_from_view(Arena *arena, DF_View *view);
|
||||
internal DF_IconKind df_icon_kind_from_view(DF_View *view);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -916,12 +907,6 @@ internal DF_IconKind df_icon_kind_from_view(DF_View *view);
|
||||
internal DF_Handle df_handle_from_window(DF_Window *window);
|
||||
internal DF_Window *df_window_from_handle(DF_Handle handle);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Control Context
|
||||
|
||||
internal DF_CtrlCtx df_ctrl_ctx_from_window(DF_Window *ws);
|
||||
internal DF_CtrlCtx df_ctrl_ctx_from_view(DF_Window *ws, DF_View *view);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Command Parameters From Context
|
||||
|
||||
@@ -998,13 +983,13 @@ internal void df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdLis
|
||||
//~ 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 *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, DI_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);
|
||||
internal String8List df_single_line_eval_value_strings_from_eval(Arena *arena, DF_EvalVizStringFlags flags, U32 default_radix, F_Tag font, F32 font_size, F32 max_size, S32 depth, E_Eval eval, E_Member *opt_member, DF_CfgTable *cfg_table);
|
||||
internal DF_EvalVizWindowedRowList df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DI_Scope *scope, DF_EvalView *eval_view, U32 default_radix, F_Tag font, F32 font_size, Rng1S64 visible_range, DF_EvalVizBlockList *blocks);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Hover Eval
|
||||
|
||||
internal void df_set_hover_eval(DF_Window *ws, Vec2F32 pos, DF_CtrlCtx ctrl_ctx, DF_Entity *file, TxtPt pt, U64 vaddr, String8 string);
|
||||
internal void df_set_hover_eval(DF_Window *ws, Vec2F32 pos, DF_Entity *file, TxtPt pt, U64 vaddr, String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Auto-Complete Lister
|
||||
@@ -1016,7 +1001,7 @@ internal void df_autocomp_lister_item_array_sort__in_place(DF_AutoCompListerItem
|
||||
|
||||
internal String8 df_autocomp_query_word_from_input_string_off(String8 input, U64 cursor_off);
|
||||
internal DF_AutoCompListerParams df_view_rule_autocomp_lister_params_from_input_cursor(Arena *arena, String8 string, U64 cursor_off);
|
||||
internal void df_set_autocomp_lister_query(DF_Window *ws, UI_Key root_key, DF_CtrlCtx ctrl_ctx, DF_AutoCompListerParams *params, String8 input, U64 cursor_off);
|
||||
internal void df_set_autocomp_lister_query(DF_Window *ws, UI_Key root_key, DF_AutoCompListerParams *params, String8 input, U64 cursor_off);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Search Strings
|
||||
@@ -1085,8 +1070,8 @@ internal void df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt p
|
||||
|
||||
internal UI_BOX_CUSTOM_DRAW(df_thread_box_draw_extensions);
|
||||
internal UI_BOX_CUSTOM_DRAW(df_bp_box_draw_extensions);
|
||||
internal DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string);
|
||||
internal DF_CodeSliceSignal df_code_slicef(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...);
|
||||
internal DF_CodeSliceSignal df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, String8 string);
|
||||
internal DF_CodeSliceSignal df_code_slicef(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *preferred_column, char *fmt, ...);
|
||||
|
||||
internal B32 df_do_txt_controls(TXT_TextInfo *info, String8 data, U64 line_count_per_page, TxtPt *cursor, TxtPt *mark, S64 *preferred_column);
|
||||
|
||||
|
||||
+137
-145
@@ -7,9 +7,9 @@
|
||||
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(array)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
TG_Key type_key = eval.type_key;
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
if(type_kind == TG_Kind_Ptr || type_kind == TG_Kind_LRef || type_kind == TG_Kind_RRef)
|
||||
E_TypeKey type_key = eval.type_key;
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
if(type_kind == E_TypeKind_Ptr || type_kind == E_TypeKind_LRef || type_kind == E_TypeKind_RRef)
|
||||
{
|
||||
DF_CfgNode *array_node = val->last;
|
||||
if(array_node != &df_g_nil_cfg_node)
|
||||
@@ -23,16 +23,16 @@ DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(array)
|
||||
str8_list_push(scratch.arena, &array_size_expr_strs, child->string);
|
||||
}
|
||||
String8 array_size_expr = str8_list_join(scratch.arena, &array_size_expr_strs, 0);
|
||||
DF_Eval array_size_eval = df_eval_from_string(arena, di_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->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;
|
||||
E_Eval array_size_eval = e_eval_from_string(arena, array_size_expr);
|
||||
E_Eval array_size_eval_value = e_value_eval_from_eval(array_size_eval);
|
||||
e_msg_list_concat_in_place(&eval.msgs, &array_size_eval.msgs);
|
||||
array_size = array_size_eval_value.value.u64;
|
||||
}
|
||||
|
||||
// rjf: apply array size to type
|
||||
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);
|
||||
E_TypeKey pointee = e_type_ptee_from_key(type_key);
|
||||
E_TypeKey array_type = e_type_key_cons(E_TypeKind_Array, pointee, array_size);
|
||||
eval.type_key = e_type_key_cons(E_TypeKind_Ptr, array_type, 0);
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
@@ -59,23 +59,23 @@ DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(list){}
|
||||
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->rdi, type_key);
|
||||
if(TG_Kind_Char8 <= type_kind && type_kind <= TG_Kind_S256 &&
|
||||
E_TypeKey type_key = eval.type_key;
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
U64 type_size_bytes = e_type_byte_size_from_key(type_key);
|
||||
if(E_TypeKind_Char8 <= type_kind && type_kind <= E_TypeKind_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->rdi, ctrl_ctx, eval);
|
||||
if(value_eval.mode == EVAL_EvalMode_Value)
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
if(value_eval.mode == E_Mode_Value)
|
||||
{
|
||||
switch(type_size_bytes)
|
||||
{
|
||||
default:{}break;
|
||||
case 2:{U16 v = (U16)value_eval.imm_u64; v = bswap_u16(v); value_eval.imm_u64 = (U64)v;}break;
|
||||
case 4:{U32 v = (U32)value_eval.imm_u64; v = bswap_u32(v); value_eval.imm_u64 = (U64)v;}break;
|
||||
case 8:{U64 v = value_eval.imm_u64; v = bswap_u64(v); value_eval.imm_u64 = v;}break;
|
||||
case 2:{U16 v = (U16)value_eval.value.u64; v = bswap_u16(v); value_eval.value.u64 = (U64)v;}break;
|
||||
case 4:{U32 v = (U32)value_eval.value.u64; v = bswap_u32(v); value_eval.value.u64 = (U64)v;}break;
|
||||
case 8:{U64 v = value_eval.value.u64; v = bswap_u64(v); value_eval.value.u64 = v;}break;
|
||||
}
|
||||
}
|
||||
eval = value_eval;
|
||||
@@ -127,36 +127,36 @@ DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(no_addr){}
|
||||
//~ rjf: "rgba"
|
||||
|
||||
internal Vec4F32
|
||||
df_vr_rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entity *process)
|
||||
df_vr_rgba_from_eval(E_Eval eval, DF_Entity *process)
|
||||
{
|
||||
Vec4F32 rgba = {0};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
TG_Key type_key = eval.type_key;
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
E_TypeKey type_key = eval.type_key;
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
switch(type_kind)
|
||||
{
|
||||
default:{}break;
|
||||
|
||||
// rjf: extract r/g/b/a bytes from u32
|
||||
case TG_Kind_U32:
|
||||
case TG_Kind_S32:
|
||||
case E_TypeKind_U32:
|
||||
case E_TypeKind_S32:
|
||||
{
|
||||
U32 hex_val = (U32)eval.imm_u64;
|
||||
U32 hex_val = (U32)eval.value.u64;
|
||||
rgba = rgba_from_u32(hex_val);
|
||||
}break;
|
||||
|
||||
// rjf: extract r/g/b/a values from array
|
||||
case TG_Kind_Array:
|
||||
if(eval.mode == EVAL_EvalMode_Addr)
|
||||
case E_TypeKind_Array:
|
||||
if(eval.mode == E_Mode_Addr)
|
||||
{
|
||||
U64 array_total_size = tg_byte_size_from_graph_rdi_key(graph, raddbg, type_key);
|
||||
U64 array_total_size = e_type_byte_size_from_key(type_key);
|
||||
U64 array_total_size_capped = ClampTop(array_total_size, 64);
|
||||
Rng1U64 array_memory_vaddr_rng = r1u64(eval.offset, eval.offset + array_total_size_capped);
|
||||
Rng1U64 array_memory_vaddr_rng = r1u64(eval.value.u64, eval.value.u64 + array_total_size_capped);
|
||||
CTRL_ProcessMemorySlice array_slice = ctrl_query_cached_data_from_process_vaddr_range(scratch.arena, process->ctrl_machine_id, process->ctrl_handle, array_memory_vaddr_rng, 0);
|
||||
String8 array_memory = array_slice.data;
|
||||
TG_Key element_type_key = tg_unwrapped_direct_from_graph_rdi_key(graph, raddbg, type_key);
|
||||
TG_Kind element_type_kind = tg_kind_from_key(element_type_key);
|
||||
U64 element_type_size = tg_byte_size_from_graph_rdi_key(graph, raddbg, element_type_key);
|
||||
E_TypeKey element_type_key = e_type_unwrap(e_type_direct_from_key(e_type_unwrap(type_key)));
|
||||
E_TypeKind element_type_kind = e_type_kind_from_key(element_type_key);
|
||||
U64 element_type_size = e_type_byte_size_from_key(element_type_key);
|
||||
for(U64 element_idx = 0; element_idx < 4; element_idx += 1)
|
||||
{
|
||||
U64 offset = element_idx*element_type_size;
|
||||
@@ -167,12 +167,12 @@ df_vr_rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entit
|
||||
switch(element_type_kind)
|
||||
{
|
||||
default:{}break;
|
||||
case TG_Kind_U8:
|
||||
case E_TypeKind_U8:
|
||||
{
|
||||
U8 byte = array_memory.str[offset];
|
||||
rgba.v[element_idx] = byte/255.f;
|
||||
}break;
|
||||
case TG_Kind_F32:
|
||||
case E_TypeKind_F32:
|
||||
{
|
||||
rgba.v[element_idx] = *(F32 *)(array_memory.str+offset);
|
||||
}break;
|
||||
@@ -181,33 +181,33 @@ df_vr_rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entit
|
||||
}break;
|
||||
|
||||
// rjf: extract r/g/b/a values from struct
|
||||
case TG_Kind_Struct:
|
||||
case TG_Kind_Class:
|
||||
case TG_Kind_Union:
|
||||
if(eval.mode == EVAL_EvalMode_Addr)
|
||||
case E_TypeKind_Struct:
|
||||
case E_TypeKind_Class:
|
||||
case E_TypeKind_Union:
|
||||
if(eval.mode == E_Mode_Addr)
|
||||
{
|
||||
U64 struct_total_size = tg_byte_size_from_graph_rdi_key(graph, raddbg, type_key);
|
||||
U64 struct_total_size = e_type_byte_size_from_key(type_key);
|
||||
U64 struct_total_size_capped = ClampTop(struct_total_size, 64);
|
||||
Rng1U64 struct_memory_vaddr_rng = r1u64(eval.offset, eval.offset + struct_total_size_capped);
|
||||
Rng1U64 struct_memory_vaddr_rng = r1u64(eval.value.u64, eval.value.u64 + struct_total_size_capped);
|
||||
CTRL_ProcessMemorySlice struct_slice = ctrl_query_cached_data_from_process_vaddr_range(scratch.arena, process->ctrl_machine_id, process->ctrl_handle, struct_memory_vaddr_rng, 0);
|
||||
String8 struct_memory = struct_slice.data;
|
||||
TG_Type *type = tg_type_from_graph_rdi_key(scratch.arena, graph, raddbg, type_key);
|
||||
E_Type *type = e_type_from_key(scratch.arena, type_key);
|
||||
for(U64 element_idx = 0, member_idx = 0;
|
||||
element_idx < 4 && member_idx < type->count;
|
||||
member_idx += 1)
|
||||
{
|
||||
TG_Member *member = &type->members[member_idx];
|
||||
TG_Key member_type_key = member->type_key;
|
||||
TG_Kind member_type_kind = tg_kind_from_key(member_type_key);
|
||||
E_Member *member = &type->members[member_idx];
|
||||
E_TypeKey member_type_key = member->type_key;
|
||||
E_TypeKind member_type_kind = e_type_kind_from_key(member_type_key);
|
||||
B32 member_is_component = 1;
|
||||
switch(member_type_kind)
|
||||
{
|
||||
default:{member_is_component = 0;}break;
|
||||
case TG_Kind_U8:
|
||||
case E_TypeKind_U8:
|
||||
{
|
||||
rgba.v[element_idx] = struct_memory.str[member->off]/255.f;
|
||||
}break;
|
||||
case TG_Kind_F32:
|
||||
case E_TypeKind_F32:
|
||||
{
|
||||
rgba.v[element_idx] = *(F32 *)(struct_memory.str + member->off);
|
||||
}break;
|
||||
@@ -224,37 +224,37 @@ df_vr_rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entit
|
||||
}
|
||||
|
||||
internal void
|
||||
df_vr_eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_CtrlCtx *ctrl_ctx, Vec4F32 rgba)
|
||||
df_vr_eval_commit_rgba(E_Eval eval, Vec4F32 rgba)
|
||||
{
|
||||
TG_Key type_key = eval.type_key;
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
E_TypeKey type_key = eval.type_key;
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
switch(type_kind)
|
||||
{
|
||||
default:{}break;
|
||||
|
||||
// rjf: extract r/g/b/a bytes from u32
|
||||
case TG_Kind_U32:
|
||||
case TG_Kind_S32:
|
||||
case E_TypeKind_U32:
|
||||
case E_TypeKind_S32:
|
||||
{
|
||||
U32 val = u32_from_rgba(rgba);
|
||||
DF_Eval src_eval = eval;
|
||||
src_eval.mode = EVAL_EvalMode_Value;
|
||||
src_eval.imm_u64 = (U64)val;
|
||||
df_commit_eval_value(graph, raddbg, ctrl_ctx, eval, src_eval);
|
||||
E_Eval src_eval = eval;
|
||||
src_eval.mode = E_Mode_Value;
|
||||
src_eval.value.u64 = (U64)val;
|
||||
df_commit_eval_value(eval, src_eval);
|
||||
}break;
|
||||
|
||||
#if 0
|
||||
// rjf: extract r/g/b/a values from array
|
||||
case TG_Kind_Array:
|
||||
if(eval.mode == EVAL_EvalMode_Addr)
|
||||
case E_TypeKind_Array:
|
||||
if(eval.mode == E_Mode_Addr)
|
||||
{
|
||||
U64 array_total_size = tg_byte_size_from_graph_rdi_key(graph, raddbg, type_key);
|
||||
U64 array_total_size = e_type_byte_size_from_key(type_key);
|
||||
U64 array_total_size_capped = ClampTop(array_total_size, 64);
|
||||
Rng1U64 array_memory_vaddr_rng = r1u64(eval.offset, eval.offset + array_total_size_capped);
|
||||
String8 array_memory = ctrl_query_cached_data_from_process_vaddr_range(scratch.arena, process->ctrl_machine_id, process->ctrl_handle, array_memory_vaddr_rng);
|
||||
TG_Key element_type_key = tg_unwrapped_direct_from_graph_rdi_key(graph, raddbg, type_key);
|
||||
TG_Kind element_type_kind = tg_kind_from_key(element_type_key);
|
||||
U64 element_type_size = tg_byte_size_from_graph_rdi_key(graph, raddbg, element_type_key);
|
||||
E_TypeKey element_type_key = e_type_unwrap(e_type_direct_from_key(e_type_unwrap(type_key)));
|
||||
E_TypeKind element_type_kind = e_type_kind_from_key(element_type_key);
|
||||
U64 element_type_size = e_type_byte_size_from_key(element_type_key);
|
||||
for(U64 element_idx = 0; element_idx < 4; element_idx += 1)
|
||||
{
|
||||
U64 offset = element_idx*element_type_size;
|
||||
@@ -265,12 +265,12 @@ df_vr_eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Ctr
|
||||
switch(element_type_kind)
|
||||
{
|
||||
default:{}break;
|
||||
case TG_Kind_U8:
|
||||
case E_TypeKind_U8:
|
||||
{
|
||||
U8 byte = array_memory.str[offset];
|
||||
rgba.v[element_idx] = byte/255.f;
|
||||
}break;
|
||||
case TG_Kind_F32:
|
||||
case E_TypeKind_F32:
|
||||
{
|
||||
rgba.v[element_idx] = *(F32 *)(array_memory.str+offset);
|
||||
}break;
|
||||
@@ -279,32 +279,32 @@ df_vr_eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Ctr
|
||||
}break;
|
||||
|
||||
// rjf: extract r/g/b/a values from struct
|
||||
case TG_Kind_Struct:
|
||||
case TG_Kind_Class:
|
||||
case TG_Kind_Union:
|
||||
if(eval.mode == EVAL_EvalMode_Addr)
|
||||
case E_TypeKind_Struct:
|
||||
case E_TypeKind_Class:
|
||||
case E_TypeKind_Union:
|
||||
if(eval.mode == E_Mode_Addr)
|
||||
{
|
||||
U64 struct_total_size = tg_byte_size_from_graph_rdi_key(graph, raddbg, type_key);
|
||||
U64 struct_total_size = e_type_byte_size_from_key(type_key);
|
||||
U64 struct_total_size_capped = ClampTop(struct_total_size, 64);
|
||||
Rng1U64 struct_memory_vaddr_rng = r1u64(eval.offset, eval.offset + struct_total_size_capped);
|
||||
String8 struct_memory = ctrl_query_cached_data_from_process_vaddr_range(scratch.arena, process->ctrl_machine_id, process->ctrl_handle, struct_memory_vaddr_rng);
|
||||
TG_Type *type = tg_type_from_graph_rdi_key(scratch.arena, graph, raddbg, type_key);
|
||||
E_Type *type = e_type_from_key(scratch.arena, graph, raddbg, type_key);
|
||||
for(U64 element_idx = 0, member_idx = 0;
|
||||
element_idx < 4 && member_idx < type->count;
|
||||
member_idx += 1)
|
||||
{
|
||||
TG_Member *member = &type->members[member_idx];
|
||||
TG_Key member_type_key = member->type_key;
|
||||
TG_Kind member_type_kind = tg_kind_from_key(member_type_key);
|
||||
E_Member *member = &type->members[member_idx];
|
||||
E_TypeKey member_type_key = member->type_key;
|
||||
E_TypeKind member_type_kind = e_type_kind_from_key(member_type_key);
|
||||
B32 member_is_component = 1;
|
||||
switch(member_type_kind)
|
||||
{
|
||||
default:{member_is_component = 0;}break;
|
||||
case TG_Kind_U8:
|
||||
case E_TypeKind_U8:
|
||||
{
|
||||
rgba.v[element_idx] = struct_memory.str[member->off]/255.f;
|
||||
}break;
|
||||
case TG_Kind_F32:
|
||||
case E_TypeKind_F32:
|
||||
{
|
||||
rgba.v[element_idx] = *(F32 *)(struct_memory.str + member->off);
|
||||
}break;
|
||||
@@ -333,12 +333,12 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(rgba)
|
||||
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
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->rdi, ctrl_ctx, eval);
|
||||
Vec4F32 rgba = df_vr_rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdi, process);
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
Vec4F32 rgba = df_vr_rgba_from_eval(value_eval, process);
|
||||
Vec4F32 hsva = hsva_from_rgba(rgba);
|
||||
|
||||
//- rjf: build text box
|
||||
@@ -396,7 +396,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
|
||||
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
DF_VR_RGBAState *state = df_view_rule_block_user_state(key, DF_VR_RGBAState);
|
||||
|
||||
@@ -411,8 +411,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->rdi, ctrl_ctx, eval);
|
||||
rgba = df_vr_rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdi, process);
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
rgba = df_vr_rgba_from_eval(value_eval, process);
|
||||
state->hsva = hsva = hsva_from_rgba(rgba);
|
||||
state->memgen_idx = ctrl_mem_gen();
|
||||
}
|
||||
@@ -462,7 +462,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
if(commit)
|
||||
{
|
||||
Vec4F32 rgba = rgba_from_hsva(hsva);
|
||||
df_vr_eval_commit_rgba(eval, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, rgba);
|
||||
df_vr_eval_commit_rgba(eval, rgba);
|
||||
state->memgen_idx = ctrl_mem_gen();
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
//~ rjf: "text"
|
||||
|
||||
internal DF_TxtTopologyInfo
|
||||
df_vr_txt_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg)
|
||||
df_vr_txt_topology_info_from_cfg(DF_CfgNode *cfg)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_TxtTopologyInfo result = zero_struct;
|
||||
@@ -493,10 +493,10 @@ df_vr_txt_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_Par
|
||||
}
|
||||
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->rdi, ctrl_ctx, size_eval);
|
||||
E_Eval size_eval = e_eval_from_string(scratch.arena, size_expr);
|
||||
E_Eval size_val_eval = e_value_eval_from_eval(size_eval);
|
||||
result.lang = txt_lang_kind_from_extension(lang_string);
|
||||
result.size_cap = size_val_eval.imm_u64;
|
||||
result.size_cap = size_val_eval.value.u64;
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
@@ -532,11 +532,11 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
//////////////////////////////
|
||||
//- rjf: unpack evaluation / view rule params
|
||||
//
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
DF_TxtTopologyInfo top = df_vr_txt_topology_info_from_cfg(di_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
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_TxtTopologyInfo top = df_vr_txt_topology_info_from_cfg(cfg);
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
U64 base_vaddr = value_eval.value.u64;
|
||||
Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr + (top.size_cap ? top.size_cap : 2048));
|
||||
|
||||
//////////////////////////////
|
||||
@@ -600,7 +600,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
//- rjf: build code slice
|
||||
UI_WidthFill UI_HeightFill UI_Parent(container)
|
||||
{
|
||||
DF_CodeSliceSignal slice_sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###slice"));
|
||||
DF_CodeSliceSignal slice_sig = df_code_slice(ws, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###slice"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ DF_VIEW_UI_FUNCTION_DEF(text)
|
||||
//~ rjf: "disasm"
|
||||
|
||||
internal DF_DisasmTopologyInfo
|
||||
df_vr_disasm_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg)
|
||||
df_vr_disasm_topology_info_from_cfg(DF_CfgNode *cfg)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_DisasmTopologyInfo result = zero_struct;
|
||||
@@ -637,13 +637,13 @@ df_vr_disasm_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_
|
||||
}
|
||||
arch_string = arch_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->rdi, ctrl_ctx, size_eval);
|
||||
E_Eval size_eval = e_eval_from_string(scratch.arena, size_expr);
|
||||
E_Eval size_val_eval = e_value_eval_from_eval(size_eval);
|
||||
if(str8_match(arch_string, str8_lit("x64"), StringMatchFlag_CaseInsensitive))
|
||||
{
|
||||
result.arch = Architecture_x64;
|
||||
}
|
||||
result.size_cap = size_val_eval.imm_u64;
|
||||
result.size_cap = size_val_eval.value.u64;
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
@@ -679,15 +679,15 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
state->last_open_frame_idx = df_frame_index();
|
||||
{
|
||||
//- rjf: unpack params
|
||||
DF_DisasmTopologyInfo top = df_vr_disasm_topology_info_from_cfg(di_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
DF_DisasmTopologyInfo top = df_vr_disasm_topology_info_from_cfg(cfg);
|
||||
|
||||
//- rjf: resolve to address value & range
|
||||
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;
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
U64 base_vaddr = value_eval.value.u64;
|
||||
Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr + (top.size_cap ? top.size_cap : 2048));
|
||||
|
||||
//- rjf: unpack thread/process of eval
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
|
||||
//- rjf: unpack key for this region in memory
|
||||
@@ -752,7 +752,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
if(dasm_info.lines.count != 0 && dasm_text_info.lines_count != 0)
|
||||
UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_px(dasm_text_info.lines_max_size*ui_top_font_size()*1.2f, 1.f)) UI_Column UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
DF_CodeSliceSignal sig = df_code_slice(ws, ctrl_ctx, parse_ctx, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###code_slice"));
|
||||
DF_CodeSliceSignal sig = df_code_slice(ws, &code_slice_params, &state->cursor, &state->mark, &state->preferred_column, str8_lit("###code_slice"));
|
||||
}
|
||||
}
|
||||
dasm_scope_close(dasm_scope);
|
||||
@@ -833,7 +833,7 @@ df_bitmap_view_state__canvas_from_screen_rect(DF_BitmapViewState *bvs, Rng2F32 r
|
||||
}
|
||||
|
||||
internal DF_BitmapTopologyInfo
|
||||
df_vr_bitmap_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg)
|
||||
df_vr_bitmap_topology_info_from_cfg(DF_CfgNode *cfg)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_BitmapTopologyInfo info = {0};
|
||||
@@ -857,12 +857,12 @@ df_vr_bitmap_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_
|
||||
String8 width_expr = str8_list_join(scratch.arena, &width_expr_strs, 0);
|
||||
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->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->rdi, ctrl_ctx, height_eval);
|
||||
info.height = height_eval_value.imm_u64;
|
||||
E_Eval width_eval = e_eval_from_string(scratch.arena, width_expr);
|
||||
E_Eval width_eval_value = e_value_eval_from_eval(width_eval);
|
||||
info.width = width_eval_value.value.u64;
|
||||
E_Eval height_eval = e_eval_from_string(scratch.arena, height_expr);
|
||||
E_Eval height_eval_value = e_value_eval_from_eval(height_eval);
|
||||
info.height = height_eval_value.value.u64;
|
||||
if(fmt_string.size != 0)
|
||||
{
|
||||
for(R_Tex2DFormat fmt = (R_Tex2DFormat)0; fmt < R_Tex2DFormat_COUNT; fmt = (R_Tex2DFormat)(fmt+1))
|
||||
@@ -926,9 +926,9 @@ 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->rdi, ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
DF_BitmapTopologyInfo topology = df_vr_bitmap_topology_info_from_cfg(scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
U64 base_vaddr = value_eval.value.u64;
|
||||
DF_BitmapTopologyInfo topology = df_vr_bitmap_topology_info_from_cfg(cfg);
|
||||
U64 expected_size = topology.width*topology.height*r_tex2d_format_bytes_per_pixel_table[topology.fmt];
|
||||
DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
|
||||
ui_labelf("0x%I64x -> Bitmap (%I64u x %I64u)", base_vaddr, topology.width, topology.height);
|
||||
@@ -949,15 +949,15 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap)
|
||||
//////////////////////////////
|
||||
//- rjf: unpack context
|
||||
//
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: evaluate expression
|
||||
//
|
||||
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_info = df_vr_bitmap_topology_info_from_cfg(di_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
U64 base_vaddr = value_eval.value.u64;
|
||||
DF_BitmapTopologyInfo topology_info = df_vr_bitmap_topology_info_from_cfg(cfg);
|
||||
U64 expected_size = topology_info.width*topology_info.height*r_tex2d_format_bytes_per_pixel_table[topology_info.fmt];
|
||||
Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr+expected_size);
|
||||
|
||||
@@ -1012,24 +1012,20 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap)
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_BitmapViewState *bvs = df_view_user_state(view, DF_BitmapViewState);
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
DF_CfgNode *view_center_cfg = df_cfg_node_child_from_string(cfg_root, str8_lit("view_center"), StringMatchFlag_CaseInsensitive);
|
||||
DF_CfgNode *zoom_cfg = df_cfg_node_child_from_string(cfg_root, str8_lit("zoom"), StringMatchFlag_CaseInsensitive);
|
||||
DF_CfgNode *bitmap_cfg = df_cfg_node_child_from_string(cfg_root, str8_lit("bitmap"), StringMatchFlag_CaseInsensitive);
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
U64 thread_unwind_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(di_scope, process, thread_unwind_rip_vaddr);
|
||||
U64 thread_unwind_rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, df_interact_regs()->unwind_count);
|
||||
bvs->view_center_pos.x = (F32)f64_from_str8(bitmap_cfg->first->string);
|
||||
bvs->view_center_pos.y = (F32)f64_from_str8(bitmap_cfg->first->next->string);
|
||||
bvs->zoom = (F32)f64_from_str8(zoom_cfg->first->string);
|
||||
bvs->top = df_vr_bitmap_topology_info_from_cfg(di_scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, bitmap_cfg);
|
||||
bvs->top = df_vr_bitmap_topology_info_from_cfg(bitmap_cfg);
|
||||
if(bvs->zoom == 0)
|
||||
{
|
||||
bvs->zoom = 1.f;
|
||||
}
|
||||
di_scope_close(di_scope);
|
||||
}
|
||||
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(bitmap)
|
||||
@@ -1080,26 +1076,23 @@ DF_VIEW_UI_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_BitmapViewState *bvs = df_view_user_state(view, DF_BitmapViewState);
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
TEX_Scope *tex_scope = tex_scope_open();
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: unpack context
|
||||
//
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
U64 thread_unwind_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(di_scope, process, thread_unwind_rip_vaddr);
|
||||
U64 thread_unwind_rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, df_interact_regs()->unwind_count);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: evaluate expression
|
||||
//
|
||||
String8 expr = str8(view->query_buffer, view->query_string_size);
|
||||
DF_Eval eval = df_eval_from_string(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, expr);
|
||||
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;
|
||||
E_Eval eval = e_eval_from_string(scratch.arena, expr);
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
U64 base_vaddr = value_eval.value.u64;
|
||||
U64 expected_size = bvs->top.width*bvs->top.height*r_tex2d_format_bytes_per_pixel_table[bvs->top.fmt];
|
||||
Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr+expected_size);
|
||||
|
||||
@@ -1245,7 +1238,6 @@ DF_VIEW_UI_FUNCTION_DEF(bitmap)
|
||||
|
||||
hs_scope_close(hs_scope);
|
||||
tex_scope_close(tex_scope);
|
||||
di_scope_close(di_scope);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
@@ -1253,7 +1245,7 @@ DF_VIEW_UI_FUNCTION_DEF(bitmap)
|
||||
//~ rjf: "geo"
|
||||
|
||||
internal DF_GeoTopologyInfo
|
||||
df_vr_geo_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg)
|
||||
df_vr_geo_topology_info_from_cfg(DF_CfgNode *cfg)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_GeoTopologyInfo result = {0};
|
||||
@@ -1281,15 +1273,15 @@ df_vr_geo_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_Par
|
||||
String8 count_expr = str8_list_join(scratch.arena, &count_expr_strs, &join);
|
||||
String8 vertices_base_expr = str8_list_join(scratch.arena, &vertices_base_expr_strs, &join);
|
||||
String8 vertices_size_expr = str8_list_join(scratch.arena, &vertices_size_expr_strs, &join);
|
||||
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->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);
|
||||
E_Eval count_eval = e_eval_from_string(scratch.arena, count_expr);
|
||||
E_Eval vertices_base_eval = e_eval_from_string(scratch.arena, vertices_base_expr);
|
||||
E_Eval vertices_size_eval = e_eval_from_string(scratch.arena, vertices_size_expr);
|
||||
E_Eval count_val_eval = e_value_eval_from_eval(count_eval);
|
||||
E_Eval vertices_base_val_eval = e_value_eval_from_eval(vertices_base_eval);
|
||||
E_Eval vertices_size_val_eval = e_value_eval_from_eval(vertices_size_eval);
|
||||
U64 vertices_base_vaddr = vertices_base_val_eval.value.u64;
|
||||
result.index_count = count_val_eval.value.u64;
|
||||
result.vertices_vaddr_range = r1u64(vertices_base_vaddr, vertices_base_vaddr+vertices_size_val_eval.value.u64);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
@@ -1344,8 +1336,8 @@ 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->rdi, ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
U64 base_vaddr = value_eval.value.u64;
|
||||
DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
|
||||
ui_labelf("0x%I64x -> Geometry", base_vaddr);
|
||||
}
|
||||
@@ -1369,16 +1361,16 @@ 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->rdi, ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
U64 base_vaddr = value_eval.value.u64;
|
||||
|
||||
//- rjf: extract extra geo topology info from view rule
|
||||
DF_GeoTopologyInfo top = df_vr_geo_topology_info_from_cfg(di_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
DF_GeoTopologyInfo top = df_vr_geo_topology_info_from_cfg(cfg);
|
||||
Rng1U64 index_buffer_vaddr_range = r1u64(base_vaddr, base_vaddr+top.index_count*sizeof(U32));
|
||||
Rng1U64 vertex_buffer_vaddr_range = top.vertices_vaddr_range;
|
||||
|
||||
//- rjf: unpack thread/process of eval
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
|
||||
//- rjf: obtain keys for index buffer & vertex buffer memory
|
||||
|
||||
@@ -14,8 +14,8 @@ struct DF_VR_RGBAState
|
||||
U64 memgen_idx;
|
||||
};
|
||||
|
||||
internal Vec4F32 df_vr_rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entity *process);
|
||||
internal void df_vr_eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_CtrlCtx *ctrl_ctx, Vec4F32 rgba);
|
||||
internal Vec4F32 df_vr_rgba_from_eval(E_Eval eval, DF_Entity *process);
|
||||
internal void df_vr_eval_commit_rgba(E_Eval eval, Vec4F32 rgba);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "text"
|
||||
@@ -38,7 +38,7 @@ struct DF_VR_TextState
|
||||
F32 loaded_t;
|
||||
};
|
||||
|
||||
internal DF_TxtTopologyInfo df_vr_txt_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
internal DF_TxtTopologyInfo df_vr_txt_topology_info_from_cfg(DF_CfgNode *cfg);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "disasm"
|
||||
@@ -61,7 +61,7 @@ struct DF_VR_DisasmState
|
||||
F32 loaded_t;
|
||||
};
|
||||
|
||||
internal DF_DisasmTopologyInfo df_vr_disasm_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
internal DF_DisasmTopologyInfo df_vr_disasm_topology_info_from_cfg(DF_CfgNode *cfg);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "bitmap"
|
||||
@@ -104,7 +104,7 @@ internal Vec2F32 df_bitmap_view_state__screen_from_canvas_pos(DF_BitmapViewState
|
||||
internal Rng2F32 df_bitmap_view_state__screen_from_canvas_rect(DF_BitmapViewState *bvs, Rng2F32 rect, Rng2F32 cvs);
|
||||
internal Vec2F32 df_bitmap_view_state__canvas_from_screen_pos(DF_BitmapViewState *bvs, Rng2F32 rect, Vec2F32 scr);
|
||||
internal Rng2F32 df_bitmap_view_state__canvas_from_screen_rect(DF_BitmapViewState *bvs, Rng2F32 rect, Rng2F32 scr);
|
||||
internal DF_BitmapTopologyInfo df_vr_bitmap_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
internal DF_BitmapTopologyInfo df_vr_bitmap_topology_info_from_cfg(DF_CfgNode *cfg);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "geo"
|
||||
@@ -139,6 +139,6 @@ struct DF_VR_GeoBoxDrawData
|
||||
F32 loaded_t;
|
||||
};
|
||||
|
||||
internal DF_GeoTopologyInfo df_vr_geo_topology_info_from_cfg(DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
internal DF_GeoTopologyInfo df_vr_geo_topology_info_from_cfg(DF_CfgNode *cfg);
|
||||
|
||||
#endif // DF_VIEW_RULES_H
|
||||
|
||||
+122
-180
@@ -464,13 +464,11 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view,
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
TXT_Scope *txt_scope = txt_scope_open();
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: extract invariants
|
||||
//
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
F_Tag code_font = df_font_from_slot(DF_FontSlot_Code);
|
||||
F32 code_font_size = df_font_size_from_slot(ws, DF_FontSlot_Code);
|
||||
F32 code_tab_size = f_column_size_from_tag_size(code_font, code_font_size)*df_setting_val_from_code(ws, DF_SettingCode_TabWidth).s32;
|
||||
@@ -481,15 +479,8 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view,
|
||||
F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f);
|
||||
Vec2F32 code_area_dim = v2f32(panel_box_dim.x - scroll_bar_dim, panel_box_dim.y - scroll_bar_dim);
|
||||
S64 num_possible_visible_lines = (S64)(code_area_dim.y/code_line_height)+1;
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: unpack ctrl ctx & make parse ctx
|
||||
//
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
U64 unwind_count = ctrl_ctx.unwind_count;
|
||||
U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(di_scope, process, rip_vaddr);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: determine visible line range / count
|
||||
@@ -616,14 +607,14 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view,
|
||||
ProfScope("find live threads mapping to this file")
|
||||
{
|
||||
DF_Entity *file = df_entity_from_handle(df_interact_regs()->file);
|
||||
DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *selected_thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_EntityList threads = df_query_cached_entity_list_with_kind(DF_EntityKind_Thread);
|
||||
for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next)
|
||||
{
|
||||
DF_Entity *thread = thread_n->entity;
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
U64 unwind_count = (thread == selected_thread) ? ctrl_ctx.unwind_count : 0;
|
||||
U64 inline_depth = (thread == selected_thread) ? ctrl_ctx.inline_depth : 0;
|
||||
U64 unwind_count = (thread == selected_thread) ? df_interact_regs()->unwind_count : 0;
|
||||
U64 inline_depth = (thread == selected_thread) ? df_interact_regs()->inline_depth : 0;
|
||||
U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count);
|
||||
U64 last_inst_on_unwound_rip_vaddr = rip_vaddr - !!unwind_count;
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, last_inst_on_unwound_rip_vaddr);
|
||||
@@ -671,12 +662,12 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view,
|
||||
// rjf: find live threads mapping to disasm
|
||||
if(dasm_lines) ProfScope("find live threads mapping to this disassembly")
|
||||
{
|
||||
DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *selected_thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_EntityList threads = df_query_cached_entity_list_with_kind(DF_EntityKind_Thread);
|
||||
for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next)
|
||||
{
|
||||
DF_Entity *thread = thread_n->entity;
|
||||
U64 unwind_count = (thread == selected_thread) ? ctrl_ctx.unwind_count : 0;
|
||||
U64 unwind_count = (thread == selected_thread) ? df_interact_regs()->unwind_count : 0;
|
||||
U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count);
|
||||
if(df_entity_ancestor_from_kind(thread, DF_EntityKind_Process) == process && contains_1u64(dasm_vaddr_range, rip_vaddr))
|
||||
{
|
||||
@@ -945,7 +936,7 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view,
|
||||
DF_CodeSliceSignal sig = {0};
|
||||
UI_Focus(UI_FocusKind_On)
|
||||
{
|
||||
sig = df_code_slicef(ws, &ctrl_ctx, &parse_ctx, &code_slice_params, &view->cursor, &view->mark, &cv->preferred_column, "txt_view_%p", view);
|
||||
sig = df_code_slicef(ws, &code_slice_params, &view->cursor, &view->mark, &cv->preferred_column, "txt_view_%p", view);
|
||||
}
|
||||
|
||||
//- rjf: press code slice? -> focus panel
|
||||
@@ -1159,7 +1150,6 @@ df_code_view_build(Arena *arena, DF_Window *ws, DF_Panel *panel, DF_View *view,
|
||||
}
|
||||
|
||||
txt_scope_close(txt_scope);
|
||||
di_scope_close(di_scope);
|
||||
hs_scope_close(hs_scope);
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
@@ -1301,7 +1291,7 @@ df_tbl_from_watch_view_point(DF_EvalVizBlockList *blocks, DF_WatchViewPoint pt)
|
||||
//- rjf: table coordinates -> strings
|
||||
|
||||
internal String8
|
||||
df_string_from_eval_viz_row_column_kind(Arena *arena, DF_EvalView *ev, TG_Graph *graph, RDI_Parsed *rdi, DF_EvalVizRow *row, DF_WatchViewColumnKind col_kind, B32 editable)
|
||||
df_string_from_eval_viz_row_column_kind(Arena *arena, DF_EvalView *ev, DF_EvalVizRow *row, DF_WatchViewColumnKind col_kind, B32 editable)
|
||||
{
|
||||
String8 result = {0};
|
||||
switch(col_kind)
|
||||
@@ -1309,7 +1299,7 @@ df_string_from_eval_viz_row_column_kind(Arena *arena, DF_EvalView *ev, TG_Graph
|
||||
default:{}break;
|
||||
case DF_WatchViewColumnKind_Expr: {result = editable ? row->edit_expr : row->display_expr;}break;
|
||||
case DF_WatchViewColumnKind_Value: {result = editable ? row->edit_value : row->display_value;}break;
|
||||
case DF_WatchViewColumnKind_Type: {result = !tg_key_match(row->eval.type_key, tg_key_zero()) ? tg_string_from_key(arena, graph, rdi, row->eval.type_key) : str8_zero();}break;
|
||||
case DF_WatchViewColumnKind_Type: {result = !e_type_key_match(row->eval.type_key, e_type_key_zero()) ? e_type_string_from_key(arena, row->eval.type_key) : str8_zero();}break;
|
||||
case DF_WatchViewColumnKind_ViewRule:{result = df_eval_view_rule_from_key(ev, row->key);}break;
|
||||
}
|
||||
return result;
|
||||
@@ -1340,7 +1330,7 @@ df_watch_view_text_edit_state_from_pt(DF_WatchViewState *wv, DF_WatchViewPoint p
|
||||
//- rjf: windowed watch tree visualization (both single-line and multi-line)
|
||||
|
||||
internal DF_EvalVizBlockList
|
||||
df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, FZY_Scope *fzy_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_View *view, DF_WatchViewState *ews)
|
||||
df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, FZY_Scope *fzy_scope, DF_View *view, DF_WatchViewState *ews)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
@@ -1348,7 +1338,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
DF_EvalViewKey eval_view_key = df_eval_view_key_from_eval_watch_view(ews);
|
||||
DF_EvalView *eval_view = df_eval_view_from_key(eval_view_key);
|
||||
String8 filter = str8(view->query_buffer, view->query_string_size);
|
||||
FZY_Target fzy_target = FZY_Target_UDTs;
|
||||
RDI_SectionKind fzy_target = RDI_SectionKind_UDTs;
|
||||
switch(ews->fill_kind)
|
||||
{
|
||||
////////////////////////////
|
||||
@@ -1365,7 +1355,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
{
|
||||
DF_ExpandKey parent_key = df_parent_expand_key_from_eval_root(root);
|
||||
DF_ExpandKey key = df_expand_key_from_eval_root(root);
|
||||
DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, ctrl_ctx, parse_ctx, macro_map, eval_view, root_expr_string, parent_key, key);
|
||||
DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, eval_view, root_expr_string, parent_key, key);
|
||||
df_eval_viz_block_list_concat__in_place(&blocks, &root_blocks);
|
||||
}
|
||||
}
|
||||
@@ -1376,7 +1366,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
//
|
||||
case DF_WatchViewFillKind_Registers:
|
||||
{
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
Architecture arch = df_architecture_from_entity(thread);
|
||||
U64 reg_count = regs_reg_code_count_from_architecture(arch);
|
||||
String8 *reg_strings = regs_reg_code_string_table_from_architecture(arch);
|
||||
@@ -1391,7 +1381,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
{
|
||||
DF_ExpandKey parent_key = df_expand_key_make(5381, 0);
|
||||
DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(parent_key), num);
|
||||
DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, ctrl_ctx, parse_ctx, macro_map, eval_view, root_expr_string, parent_key, key);
|
||||
DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, eval_view, root_expr_string, parent_key, key);
|
||||
df_eval_viz_block_list_concat__in_place(&blocks, &root_blocks);
|
||||
}
|
||||
}
|
||||
@@ -1403,7 +1393,7 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
{
|
||||
DF_ExpandKey parent_key = df_expand_key_make(5381, 0);
|
||||
DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(parent_key), num);
|
||||
DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, ctrl_ctx, parse_ctx, macro_map, eval_view, root_expr_string, parent_key, key);
|
||||
DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, eval_view, root_expr_string, parent_key, key);
|
||||
df_eval_viz_block_list_concat__in_place(&blocks, &root_blocks);
|
||||
}
|
||||
}
|
||||
@@ -1414,18 +1404,18 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
//
|
||||
case DF_WatchViewFillKind_Locals:
|
||||
{
|
||||
EVAL_String2NumMapNodeArray nodes = eval_string2num_map_node_array_from_map(scratch.arena, parse_ctx->locals_map);
|
||||
eval_string2num_map_node_array_sort__in_place(&nodes);
|
||||
E_String2NumMapNodeArray nodes = e_string2num_map_node_array_from_map(scratch.arena, e_state->ctx->locals_map);
|
||||
e_string2num_map_node_array_sort__in_place(&nodes);
|
||||
for(U64 idx = 0; idx < nodes.count; idx += 1)
|
||||
{
|
||||
EVAL_String2NumMapNode *n = nodes.v[idx];
|
||||
E_String2NumMapNode *n = nodes.v[idx];
|
||||
String8 root_expr_string = n->string;
|
||||
FuzzyMatchRangeList matches = fuzzy_match_find(arena, filter, root_expr_string);
|
||||
if(matches.count == matches.needle_part_count)
|
||||
{
|
||||
DF_ExpandKey parent_key = df_expand_key_make(5381, 0);
|
||||
DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(parent_key), idx+1);
|
||||
DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, ctrl_ctx, parse_ctx, macro_map, eval_view, root_expr_string, parent_key, key);
|
||||
DF_EvalVizBlockList root_blocks = df_eval_viz_block_list_from_eval_view_expr_keys(arena, di_scope, eval_view, root_expr_string, parent_key, key);
|
||||
df_eval_viz_block_list_concat__in_place(&blocks, &root_blocks);
|
||||
}
|
||||
}
|
||||
@@ -1434,18 +1424,23 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
////////////////////////////
|
||||
//- rjf: debug info table fill -> build split debug info table blocks
|
||||
//
|
||||
case DF_WatchViewFillKind_Globals: fzy_target = FZY_Target_GlobalVariables; goto dbgi_table;
|
||||
case DF_WatchViewFillKind_ThreadLocals: fzy_target = FZY_Target_ThreadVariables; goto dbgi_table;
|
||||
case DF_WatchViewFillKind_Types: fzy_target = FZY_Target_UDTs; goto dbgi_table;
|
||||
case DF_WatchViewFillKind_Procedures: fzy_target = FZY_Target_Procedures; goto dbgi_table;
|
||||
case DF_WatchViewFillKind_Globals: fzy_target = RDI_SectionKind_GlobalVariables; goto dbgi_table;
|
||||
case DF_WatchViewFillKind_ThreadLocals: fzy_target = RDI_SectionKind_ThreadVariables; goto dbgi_table;
|
||||
case DF_WatchViewFillKind_Types: fzy_target = RDI_SectionKind_UDTs; goto dbgi_table;
|
||||
case DF_WatchViewFillKind_Procedures: fzy_target = RDI_SectionKind_Procedures; goto dbgi_table;
|
||||
dbgi_table:;
|
||||
{
|
||||
U64 endt_us = os_now_microseconds()+200;
|
||||
|
||||
//- rjf: unpack context
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
U64 thread_rip_unwind_vaddr = df_query_cached_rip_from_thread_unwind(thread, ctrl_ctx->unwind_count);
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, thread_rip_unwind_vaddr);
|
||||
DI_Key dbgi_key = df_dbgi_key_from_module(module);
|
||||
DI_KeyList dbgi_keys_list = df_push_active_dbgi_key_list(scratch.arena);
|
||||
DI_KeyArray dbgi_keys = di_key_array_from_list(scratch.arena, &dbgi_keys_list);
|
||||
U64 rdis_count = dbgi_keys.count;
|
||||
RDI_Parsed **rdis = push_array(scratch.arena, RDI_Parsed *, rdis_count);
|
||||
for(U64 idx = 0; idx < rdis_count; idx += 1)
|
||||
{
|
||||
rdis[idx] = di_rdi_from_key(di_scope, &dbgi_keys.v[idx], endt_us);
|
||||
}
|
||||
|
||||
//- rjf: calculate top-level keys, expand root-level, grab root expansion node
|
||||
DF_ExpandKey parent_key = df_expand_key_make(5381, 0);
|
||||
@@ -1456,12 +1451,8 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
//- rjf: query all filtered items from dbgi searching system
|
||||
U128 fuzzy_search_key = {(U64)view, df_hash_from_string(str8_struct(&view))};
|
||||
B32 items_stale = 0;
|
||||
FZY_Params params = {fzy_target};
|
||||
{
|
||||
params.dbgi_keys.count = 1;
|
||||
params.dbgi_keys.v = &dbgi_key;
|
||||
}
|
||||
FZY_ItemArray items = fzy_items_from_key_params_query(fzy_scope, fuzzy_search_key, ¶ms, filter, os_now_microseconds()+100, &items_stale);
|
||||
FZY_Params params = {fzy_target, dbgi_keys};
|
||||
FZY_ItemArray items = fzy_items_from_key_params_query(fzy_scope, fuzzy_search_key, ¶ms, filter, endt_us, &items_stale);
|
||||
if(items_stale)
|
||||
{
|
||||
df_gfx_request_frame();
|
||||
@@ -1537,11 +1528,30 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
}
|
||||
for(U64 sub_expand_idx = 0; sub_expand_idx < sub_expand_keys_count; sub_expand_idx += 1)
|
||||
{
|
||||
FZY_Item *item = &items.v[sub_expand_item_idxs[sub_expand_idx]];
|
||||
|
||||
// rjf: form split: truncate & complete last block; begin next block
|
||||
last_vb = df_eval_viz_block_split_and_continue(arena, &blocks, last_vb, sub_expand_item_idxs[sub_expand_idx]);
|
||||
|
||||
// rjf: grab rdi for this item
|
||||
RDI_Parsed *rdi = &di_rdi_parsed_nil;
|
||||
U64 base_idx = 0;
|
||||
{
|
||||
for(U64 rdi_idx = 0; rdi_idx < rdis_count; rdi_idx += 1)
|
||||
{
|
||||
U64 procedures_count = 0;
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], RDI_SectionKind_Procedures, &procedures_count);
|
||||
if(base_idx <= item->idx && item->idx < base_idx + procedures_count)
|
||||
{
|
||||
rdi = rdis[rdi_idx];
|
||||
break;
|
||||
}
|
||||
base_idx += procedures_count;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: grab name for the expanded row
|
||||
String8 name = fzy_item_string_from_rdi_target_element_idx(parse_ctx->rdi, fzy_target, sub_expand_keys[sub_expand_idx].child_num);
|
||||
String8 name = fzy_item_string_from_rdi_target_element_idx(rdi, fzy_target, sub_expand_keys[sub_expand_idx].child_num-base_idx);
|
||||
|
||||
// rjf: recurse for sub-expansion
|
||||
{
|
||||
@@ -1553,8 +1563,8 @@ df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, F
|
||||
df_cfg_table_push_unparsed_string(arena, &child_cfg, view_rule_string, DF_CfgSrc_User);
|
||||
}
|
||||
}
|
||||
DF_Eval eval = df_eval_from_string(arena, di_scope, ctrl_ctx, parse_ctx, macro_map, name);
|
||||
df_append_viz_blocks_for_parent__rec(arena, di_scope, eval_view, ctrl_ctx, parse_ctx, macro_map, parent_key, sub_expand_keys[sub_expand_idx], name, eval, 0, &child_cfg, 0, &blocks);
|
||||
E_Eval eval = e_eval_from_string(arena, name);
|
||||
df_append_viz_blocks_for_parent__rec(arena, di_scope, eval_view, parent_key, sub_expand_keys[sub_expand_idx], name, eval, 0, &child_cfg, 0, &blocks);
|
||||
}
|
||||
}
|
||||
df_eval_viz_block_end(&blocks, last_vb);
|
||||
@@ -1626,21 +1636,15 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
//- rjf: unpack arguments
|
||||
//
|
||||
F_Tag code_font = df_font_from_slot(DF_FontSlot_Code);
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
U64 thread_ip_vaddr = df_query_cached_rip_from_thread_unwind(thread, ctrl_ctx.unwind_count);
|
||||
U64 thread_ip_vaddr = df_query_cached_rip_from_thread_unwind(thread, df_interact_regs()->unwind_count);
|
||||
DF_EvalViewKey eval_view_key = df_eval_view_key_from_eval_watch_view(ewv);
|
||||
DF_EvalView *eval_view = df_eval_view_from_key(eval_view_key);
|
||||
String8 filter = str8(view->query_buffer, view->query_string_size);
|
||||
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
|
||||
S64 num_possible_visible_rows = (S64)(dim_2f32(rect).y/row_height_px);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: process * thread info -> parse_ctx
|
||||
//
|
||||
EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(di_scope, process, thread_ip_vaddr);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: determine autocompletion string
|
||||
//
|
||||
@@ -1660,7 +1664,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
//////////////////////////////
|
||||
//- rjf: consume events & perform navigations/edits - calculate state
|
||||
//
|
||||
EVAL_String2ExprMap macro_map = {0};
|
||||
E_String2ExprMap macro_map = {0};
|
||||
DF_EvalVizBlockList blocks = {0};
|
||||
UI_ScrollListRowBlockArray row_blocks = {0};
|
||||
Vec2S64 cursor_tbl = {0};
|
||||
@@ -1679,14 +1683,14 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
//
|
||||
if(state_dirty)
|
||||
{
|
||||
macro_map = eval_string2expr_map_make(scratch.arena, 256);
|
||||
macro_map = e_string2expr_map_make(scratch.arena, 256);
|
||||
for(DF_EvalRoot *root = ewv->first_root; root != 0; root = root->next)
|
||||
{
|
||||
String8 root_expr = str8(root->expr_buffer, root->expr_buffer_string_size);
|
||||
|
||||
//- rjf: unpack arguments
|
||||
DF_Entity *process = thread->parent;
|
||||
U64 unwind_count = ctrl_ctx.unwind_count;
|
||||
U64 unwind_count = df_interact_regs()->unwind_count;
|
||||
CTRL_Unwind unwind = df_query_cached_unwind_from_thread(thread);
|
||||
Architecture arch = df_architecture_from_entity(thread);
|
||||
U64 reg_size = regs_block_size_from_architecture(arch);
|
||||
@@ -1699,12 +1703,11 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
}
|
||||
|
||||
//- rjf: lex & parse
|
||||
EVAL_TokenArray tokens = eval_token_array_from_text(scratch.arena, root_expr);
|
||||
EVAL_ParseResult parse = eval_parse_expr_from_text_tokens(scratch.arena, &parse_ctx, root_expr, &tokens);
|
||||
EVAL_ErrorList errors = parse.errors;
|
||||
if(errors.count == 0)
|
||||
E_TokenArray tokens = e_token_array_from_text(scratch.arena, root_expr);
|
||||
E_Parse parse = e_parse_expr_from_text_tokens(scratch.arena, root_expr, &tokens);
|
||||
if(parse.msgs.max_kind == E_MsgKind_Null)
|
||||
{
|
||||
eval_push_leaf_ident_exprs_from_expr__in_place(scratch.arena, ¯o_map, parse.expr, &errors);
|
||||
e_push_leaf_ident_exprs_from_expr__in_place(scratch.arena, ¯o_map, parse.expr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1714,7 +1717,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
//
|
||||
if(state_dirty)
|
||||
{
|
||||
blocks = df_eval_viz_block_list_from_watch_view_state(scratch.arena, di_scope, fzy_scope, &ctrl_ctx, &parse_ctx, ¯o_map, view, ewv);
|
||||
blocks = df_eval_viz_block_list_from_watch_view_state(scratch.arena, di_scope, fzy_scope, view, ewv);
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
@@ -1852,7 +1855,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
ewv->text_edit_state_slots_count = u64_up_to_pow2(selection_dim.y+1);
|
||||
ewv->text_edit_state_slots_count = Max(ewv->text_edit_state_slots_count, 64);
|
||||
ewv->text_edit_state_slots = push_array(ewv->text_edit_arena, DF_WatchViewTextEditState*, ewv->text_edit_state_slots_count);
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
r1s64(ui_scroll_list_row_from_item(&row_blocks, selection_tbl.min.y-1),
|
||||
ui_scroll_list_row_from_item(&row_blocks, selection_tbl.max.y-1)+1), &blocks);
|
||||
DF_EvalVizRow *row = rows.first;
|
||||
@@ -1860,7 +1863,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
{
|
||||
for(S64 x = selection_tbl.min.x; x <= selection_tbl.max.x; x += 1)
|
||||
{
|
||||
String8 string = df_string_from_eval_viz_row_column_kind(scratch.arena, eval_view, parse_ctx.type_graph, parse_ctx.rdi, row, (DF_WatchViewColumnKind)x, 1);
|
||||
String8 string = df_string_from_eval_viz_row_column_kind(scratch.arena, eval_view, row, (DF_WatchViewColumnKind)x, 1);
|
||||
string.size = Min(string.size, sizeof(ewv->dummy_text_edit_state.input_buffer));
|
||||
DF_WatchViewPoint pt = {(DF_WatchViewColumnKind)x, row->parent_key, row->key};
|
||||
U64 hash = df_hash_from_expand_key(pt.key);
|
||||
@@ -1884,7 +1887,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
if(!ewv->text_editing && evt->slot == UI_EventActionSlot_Accept && selection_tbl.min.x <= 0)
|
||||
{
|
||||
taken = 1;
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
r1s64(ui_scroll_list_row_from_item(&row_blocks, selection_tbl.min.y-1),
|
||||
ui_scroll_list_row_from_item(&row_blocks, selection_tbl.max.y-1)+1), &blocks);
|
||||
DF_EvalVizRow *row = rows.first;
|
||||
@@ -1926,15 +1929,13 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
selection_tbl.min.x == 1)
|
||||
{
|
||||
taken = 1;
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
r1s64(ui_scroll_list_row_from_item(&row_blocks, selection_tbl.min.y-1),
|
||||
ui_scroll_list_row_from_item(&row_blocks, selection_tbl.max.y-1)+1), &blocks);
|
||||
DF_EvalVizRow *row = rows.first;
|
||||
if(!(row->flags & DF_EvalVizRowFlag_CanEditValue))
|
||||
{
|
||||
U64 vaddr = 0;
|
||||
if(vaddr == 0) { vaddr = row->eval.offset; }
|
||||
if(vaddr == 0) { vaddr = row->eval.imm_u64; }
|
||||
U64 vaddr = row->eval.value.u64;
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, vaddr);
|
||||
DI_Key dbgi_key = df_dbgi_key_from_module(module);
|
||||
U64 voff = df_voff_from_vaddr(module, vaddr);
|
||||
@@ -2042,14 +2043,14 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
case DF_WatchViewColumnKind_Value:
|
||||
if(editing_complete && evt->slot != UI_EventActionSlot_Cancel)
|
||||
{
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
r1s64(ui_scroll_list_row_from_item(&row_blocks, y-1),
|
||||
ui_scroll_list_row_from_item(&row_blocks, y-1)+1), &blocks);
|
||||
B32 success = 0;
|
||||
if(rows.first != 0)
|
||||
{
|
||||
DF_Eval write_eval = df_eval_from_string(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, new_string);
|
||||
success = df_commit_eval_value(parse_ctx.type_graph, parse_ctx.rdi, &ctrl_ctx, rows.first->eval, write_eval);
|
||||
E_Eval write_eval = e_eval_from_string(scratch.arena, new_string);
|
||||
success = df_commit_eval_value(rows.first->eval, write_eval);
|
||||
}
|
||||
if(!success)
|
||||
{
|
||||
@@ -2084,7 +2085,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
{
|
||||
taken = 1;
|
||||
String8List strs = {0};
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
DF_EvalVizWindowedRowList rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, eval_view, default_radix, code_font, ui_top_font_size(),
|
||||
r1s64(ui_scroll_list_row_from_item(&row_blocks, selection_tbl.min.y-1),
|
||||
ui_scroll_list_row_from_item(&row_blocks, selection_tbl.max.y-1)+1), &blocks);
|
||||
DF_EvalVizRow *row = rows.first;
|
||||
@@ -2092,7 +2093,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
{
|
||||
for(S64 x = selection_tbl.min.x; x <= selection_tbl.max.x; x += 1)
|
||||
{
|
||||
String8 cell_string = df_string_from_eval_viz_row_column_kind(scratch.arena, eval_view, parse_ctx.type_graph, parse_ctx.rdi, row, (DF_WatchViewColumnKind)x, 0);
|
||||
String8 cell_string = df_string_from_eval_viz_row_column_kind(scratch.arena, eval_view, row, (DF_WatchViewColumnKind)x, 0);
|
||||
cell_string = str8_skip_chop_whitespace(cell_string);
|
||||
U64 comma_pos = str8_find_needle(cell_string, 0, str8_lit(","), 0);
|
||||
if(selection_tbl.min.x != selection_tbl.max.x || selection_tbl.min.y != selection_tbl.max.y)
|
||||
@@ -2431,7 +2432,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
//
|
||||
DF_EvalVizWindowedRowList rows = {0};
|
||||
{
|
||||
rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, eval_view, default_radix, code_font, ui_top_font_size(), r1s64(visible_row_rng.min-1, visible_row_rng.max), &blocks);
|
||||
rows = df_eval_viz_windowed_row_list_from_viz_block_list(scratch.arena, di_scope, eval_view, default_radix, code_font, ui_top_font_size(), r1s64(visible_row_rng.min-1, visible_row_rng.max), &blocks);
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
@@ -2458,11 +2459,11 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
switch(row->eval.mode)
|
||||
{
|
||||
default:{}break;
|
||||
case EVAL_EvalMode_Addr:
|
||||
case E_Mode_Addr:
|
||||
{
|
||||
U64 size = tg_byte_size_from_graph_rdi_key(parse_ctx.type_graph, parse_ctx.rdi, row->eval.type_key);
|
||||
U64 size = e_type_byte_size_from_key(row->eval.type_key);
|
||||
size = Min(size, 64);
|
||||
Rng1U64 vaddr_rng = r1u64(row->eval.offset, row->eval.offset+size);
|
||||
Rng1U64 vaddr_rng = r1u64(row->eval.value.u64, row->eval.value.u64+size);
|
||||
CTRL_ProcessMemorySlice slice = ctrl_query_cached_data_from_process_vaddr_range(scratch.arena, process->ctrl_machine_id, process->ctrl_handle, vaddr_rng, 0);
|
||||
for(U64 idx = 0; idx < (slice.data.size+63)/64; idx += 1)
|
||||
{
|
||||
@@ -2519,7 +2520,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
{
|
||||
Vec2F32 canvas_dim = v2f32(scroll_list_params.dim_px.x - ui_top_font_size()*1.5f,
|
||||
(row->skipped_size_in_rows+row->size_in_rows+row->chopped_size_in_rows)*scroll_list_params.row_height_px);
|
||||
row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, row->edit_expr, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->expand_ui_rule_node, canvas_dim);
|
||||
row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, row->edit_expr, row->expand_ui_rule_node, canvas_dim);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2566,9 +2567,9 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
////////////////////
|
||||
//- rjf: draw start of cache lines in expansions
|
||||
//
|
||||
if((row->eval.mode == EVAL_EvalMode_Addr || row->eval.mode == EVAL_EvalMode_NULL) &&
|
||||
row->eval.errors.count == 0 &&
|
||||
row->eval.offset%64 == 0 && row->depth > 0 &&
|
||||
if((row->eval.mode == E_Mode_Addr || row->eval.mode == E_Mode_Null) &&
|
||||
row->eval.msgs.count == 0 &&
|
||||
row->eval.value.u64%64 == 0 && row->depth > 0 &&
|
||||
!row_expanded)
|
||||
{
|
||||
ui_set_next_fixed_x(0);
|
||||
@@ -2581,14 +2582,14 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
////////////////////
|
||||
//- rjf: draw mid-row cache line boundaries in expansions
|
||||
//
|
||||
if((row->eval.mode == EVAL_EvalMode_Addr || row->eval.mode == EVAL_EvalMode_NULL) &&
|
||||
row->eval.errors.count == 0 &&
|
||||
row->eval.offset%64 != 0 &&
|
||||
if((row->eval.mode == E_Mode_Addr || row->eval.mode == E_Mode_Null) &&
|
||||
row->eval.msgs.max_kind == E_MsgKind_Null &&
|
||||
row->eval.value.u64%64 != 0 &&
|
||||
row->depth > 0 &&
|
||||
!row_expanded)
|
||||
{
|
||||
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)
|
||||
U64 next_off = (row->eval.value.u64 + e_type_byte_size_from_key(row->eval.type_key));
|
||||
if(next_off%64 != 0 && row->eval.value.u64/64 < next_off/64)
|
||||
{
|
||||
ui_set_next_fixed_x(0);
|
||||
ui_set_next_fixed_y(scroll_list_params.row_height_px - ui_top_font_size()*0.5f);
|
||||
@@ -2641,9 +2642,9 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
if(is_inherited && ui_hovering(sig)) UI_Tooltip
|
||||
{
|
||||
String8List inheritance_chain_type_names = {0};
|
||||
for(TG_KeyNode *n = row->inherited_type_key_chain.first; n != 0; n = n->next)
|
||||
for(E_TypeKeyNode *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.rdi, n->v);
|
||||
String8 inherited_type_name = e_type_string_from_key(scratch.arena, n->v);
|
||||
inherited_type_name = str8_skip_chop_whitespace(inherited_type_name);
|
||||
str8_list_push(scratch.arena, &inheritance_chain_type_names, inherited_type_name);
|
||||
}
|
||||
@@ -2657,53 +2658,6 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 1.f, df_rgba_from_theme_color(DF_ThemeColor_CodeType), inheritance_type);
|
||||
}
|
||||
}
|
||||
if(DEV_eval_watch_key_tooltips && ui_hovering(sig)) UI_Tooltip DF_Font(ws, DF_FontSlot_Code)
|
||||
{
|
||||
ui_labelf("Parent Key: %I64x, %I64x", row->parent_key.parent_hash, row->parent_key.child_num);
|
||||
ui_labelf("Hover Key: %I64x, %I64x", row->key.parent_hash, row->key.child_num);
|
||||
ui_labelf("Cursor Key: %I64x, %I64x", ewv->cursor.key.parent_hash, ewv->cursor.key.child_num);
|
||||
}
|
||||
if(DEV_eval_compiler_tooltips && row->depth == 0 && ui_hovering(sig)) UI_Tooltip
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 string = row->display_expr;
|
||||
|
||||
// rjf: lex & parse
|
||||
EVAL_TokenArray tokens = eval_token_array_from_text(scratch.arena, string);
|
||||
EVAL_ParseResult parse = eval_parse_expr_from_text_tokens(scratch.arena, &parse_ctx, string, &tokens);
|
||||
EVAL_ErrorList errors = parse.errors;
|
||||
ui_labelf("Tokens:");
|
||||
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) for(U64 idx = 0; idx < tokens.count; idx += 1)
|
||||
{
|
||||
EVAL_Token *token = tokens.v+idx;
|
||||
String8 token_string = str8_substr(string, token->range);
|
||||
String8 token_kind_name = str8_lit("Token");
|
||||
switch(token->kind)
|
||||
{
|
||||
default:break;
|
||||
case EVAL_TokenKind_Identifier: {token_kind_name = str8_lit("Identifier");}break;
|
||||
case EVAL_TokenKind_Numeric: {token_kind_name = str8_lit("Numeric");}break;
|
||||
case EVAL_TokenKind_StringLiteral:{token_kind_name = str8_lit("StringLiteral");}break;
|
||||
case EVAL_TokenKind_CharLiteral: {token_kind_name = str8_lit("CharLiteral");}break;
|
||||
case EVAL_TokenKind_Symbol: {token_kind_name = str8_lit("Symbol");}break;
|
||||
}
|
||||
ui_labelf("%S -> \"%S\"", token_kind_name, token_string);
|
||||
}
|
||||
|
||||
// rjf: produce IR tree & type
|
||||
EVAL_IRTreeAndType ir_tree_and_type = {&eval_irtree_nil};
|
||||
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.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.rdi, type_key);
|
||||
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
|
||||
ui_label(type_string);
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
// rjf: autocomplete lister
|
||||
if(expr_editing_active &&
|
||||
@@ -2712,7 +2666,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
{
|
||||
String8 input = str8(edit_state->input_buffer, edit_state->input_size);
|
||||
DF_AutoCompListerParams params = {DF_AutoCompListerFlag_Locals};
|
||||
df_set_autocomp_lister_query(ws, sig.box->key, ctrl_ctx, ¶ms, input, edit_state->cursor.column-1);
|
||||
df_set_autocomp_lister_query(ws, sig.box->key, ¶ms, input, edit_state->cursor.column-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2746,7 +2700,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Value, row->parent_key, row->key};
|
||||
DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt);
|
||||
B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x);
|
||||
B32 value_is_error = (row->eval.errors.count != 0);
|
||||
B32 value_is_error = (row->eval.msgs.max_kind != E_MsgKind_Null);
|
||||
B32 value_is_hook = (!value_is_error && row->value_ui_rule_spec != &df_g_nil_gfx_view_rule_spec && row->value_ui_rule_spec != 0);
|
||||
B32 value_is_complex = (!value_is_error && !value_is_hook && !(row->flags & DF_EvalVizRowFlag_CanEditValue));
|
||||
B32 value_is_simple = (!value_is_error && !value_is_hook && (row->flags & DF_EvalVizRowFlag_CanEditValue));
|
||||
@@ -2773,9 +2727,9 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
if(value_is_error) DF_Font(ws, DF_FontSlot_Main)
|
||||
{
|
||||
String8List strings = {0};
|
||||
for(EVAL_Error *error = row->eval.errors.first; error != 0; error = error->next)
|
||||
for(E_Msg *msg = row->eval.msgs.first; msg != 0; msg = msg->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &strings, error->text);
|
||||
str8_list_push(scratch.arena, &strings, msg->text);
|
||||
}
|
||||
StringJoin join = {str8_lit(""), str8_lit(" "), str8_lit("")};
|
||||
String8 error_string = str8_list_join(scratch.arena, &strings, &join);
|
||||
@@ -2788,7 +2742,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###val_%I64x", row_hash);
|
||||
UI_Parent(box)
|
||||
{
|
||||
row->value_ui_rule_spec->info.row_ui(ws, row->key, row->eval, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->value_ui_rule_node);
|
||||
row->value_ui_rule_spec->info.row_ui(ws, row->key, row->eval, row->value_ui_rule_node);
|
||||
}
|
||||
sig = ui_signal_from_box(box);
|
||||
}
|
||||
@@ -2835,9 +2789,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
// rjf: double-click, not editable -> go-to-location
|
||||
if(ui_double_clicked(sig) && !(row->flags & DF_EvalVizRowFlag_CanEditValue))
|
||||
{
|
||||
U64 vaddr = 0;
|
||||
if(vaddr == 0) { vaddr = row->eval.offset; }
|
||||
if(vaddr == 0) { vaddr = row->eval.imm_u64; }
|
||||
U64 vaddr = row->eval.value.u64;
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, vaddr);
|
||||
DI_Key dbgi_key = df_dbgi_key_from_module(module);
|
||||
U64 voff = df_voff_from_vaddr(module, vaddr);
|
||||
@@ -2866,11 +2818,11 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((cell_selected && ewv->text_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.rdi, key);
|
||||
E_TypeKey key = row->eval.type_key;
|
||||
String8 string = e_type_string_from_key(scratch.arena, 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)
|
||||
if(!e_type_key_match(key, e_type_key_zero())) UI_Parent(box)
|
||||
{
|
||||
df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeType), string);
|
||||
}
|
||||
@@ -2923,7 +2875,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS
|
||||
{
|
||||
params.flags = DF_AutoCompListerFlag_ViewRules;
|
||||
}
|
||||
df_set_autocomp_lister_query(ws, sig.box->key, ctrl_ctx, ¶ms, input, edit_state->cursor.column-1);
|
||||
df_set_autocomp_lister_query(ws, sig.box->key, ¶ms, input, edit_state->cursor.column-1);
|
||||
}
|
||||
|
||||
// rjf: double-click -> begin editing
|
||||
@@ -4098,20 +4050,18 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
String8 query = str8(view->query_buffer, view->query_string_size);
|
||||
DI_KeyList dbgi_keys_list = df_push_active_dbgi_key_list(scratch.arena);
|
||||
DI_KeyArray dbgi_keys = di_key_array_from_list(scratch.arena, &dbgi_keys_list);
|
||||
FZY_Params params = {FZY_Target_Procedures, dbgi_keys};
|
||||
FZY_Params params = {RDI_SectionKind_Procedures, dbgi_keys};
|
||||
U64 endt_us = os_now_microseconds()+200;
|
||||
|
||||
//- rjf: grab rdis, make type graphs for each
|
||||
U64 rdis_count = dbgi_keys.count;
|
||||
RDI_Parsed **rdis = push_array(scratch.arena, RDI_Parsed *, rdis_count);
|
||||
TG_Graph **graphs = push_array(scratch.arena, TG_Graph *, rdis_count);
|
||||
{
|
||||
for(U64 idx = 0; idx < rdis_count; idx += 1)
|
||||
{
|
||||
RDI_Parsed *rdi = di_rdi_from_key(di_scope, &dbgi_keys.v[idx], endt_us);
|
||||
RDI_TopLevelInfo *tli = rdi_element_from_name_idx(rdi, TopLevelInfo, 0);
|
||||
rdis[idx] = rdi;
|
||||
graphs[idx] = tg_graph_begin(rdi_addr_size_from_arch(tli->arch), 256);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4195,7 +4145,6 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
//- rjf: determine dbgi/rdi to which this item belongs
|
||||
DI_Key dbgi_key = {0};
|
||||
RDI_Parsed *rdi = &di_rdi_parsed_nil;
|
||||
TG_Graph *graph = 0;
|
||||
U64 base_idx = 0;
|
||||
{
|
||||
for(U64 rdi_idx = 0; rdi_idx < rdis_count; rdi_idx += 1)
|
||||
@@ -4206,7 +4155,6 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
{
|
||||
dbgi_key = dbgi_keys.v[rdi_idx];
|
||||
rdi = rdis[rdi_idx];
|
||||
graph = graphs[rdi_idx];
|
||||
break;
|
||||
}
|
||||
base_idx += procedures_count;
|
||||
@@ -4219,7 +4167,7 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
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_name_idx(rdi, TypeNodes, procedure->type_idx);
|
||||
TG_Key type_key = tg_key_ext(tg_kind_from_rdi_type_kind(type_node->kind), procedure->type_idx);
|
||||
E_TypeKey type_key = e_type_key_ext(e_type_kind_from_rdi(type_node->kind), procedure->type_idx, e_idx_from_rdi(rdi));
|
||||
|
||||
//- rjf: build item button
|
||||
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
|
||||
@@ -4234,9 +4182,9 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
{
|
||||
UI_Box *box = df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name);
|
||||
ui_box_equip_fuzzy_match_ranges(box, &item->match_ranges);
|
||||
if(!tg_key_match(tg_key_zero(), type_key) && graph != 0)
|
||||
if(!e_type_key_match(e_type_key_zero(), type_key))
|
||||
{
|
||||
String8 type_string = tg_string_from_key(scratch.arena, graph, rdi, type_key);
|
||||
String8 type_string = e_type_string_from_key(scratch.arena, type_key);
|
||||
df_code_label(0.5f, 0, df_rgba_from_theme_color(DF_ThemeColor_TextWeak), type_string);
|
||||
}
|
||||
}
|
||||
@@ -5430,7 +5378,6 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler)
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 query = str8(view->query_buffer, view->query_string_size);
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
|
||||
//- rjf: get state
|
||||
typedef struct DF_SchedulerViewState DF_SchedulerViewState;
|
||||
@@ -5672,10 +5619,9 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DI_Scope *scope = di_scope_open();
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
Architecture arch = df_architecture_from_entity(thread);
|
||||
DF_Entity *process = thread->parent;
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
Vec4F32 thread_color = ui_top_palette()->text;
|
||||
if(thread->flags & DF_EntityFlag_HasColor)
|
||||
{
|
||||
@@ -5812,20 +5758,19 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
|
||||
U64 rip_vaddr = regs_rip_from_arch_block(thread->arch, row->regs);
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, rip_vaddr);
|
||||
B32 frame_valid = (rip_vaddr != 0);
|
||||
TG_Graph *graph = tg_graph_begin(bit_size_from_arch(thread->arch)/8, 256);
|
||||
String8 symbol_name = {0};
|
||||
String8 symbol_type_string = {0};
|
||||
if(row->procedure != 0)
|
||||
{
|
||||
symbol_name.str = rdi_name_from_procedure(row->rdi, row->procedure, &symbol_name.size);
|
||||
RDI_TypeNode *type = rdi_element_from_name_idx(row->rdi, TypeNodes, row->procedure->type_idx);
|
||||
symbol_type_string = tg_string_from_key(scratch.arena, graph, row->rdi, tg_key_ext(tg_kind_from_rdi_type_kind(type->kind), row->procedure->type_idx));
|
||||
symbol_type_string = e_type_string_from_key(scratch.arena, e_type_key_ext(e_type_kind_from_rdi(type->kind), row->procedure->type_idx, e_idx_from_rdi(row->rdi)));
|
||||
}
|
||||
if(row->inline_site != 0)
|
||||
{
|
||||
symbol_name.str = rdi_string_from_idx(row->rdi, row->inline_site->name_string_idx, &symbol_name.size);
|
||||
RDI_TypeNode *type = rdi_element_from_name_idx(row->rdi, TypeNodes, row->inline_site->type_idx);
|
||||
symbol_type_string = tg_string_from_key(scratch.arena, graph, row->rdi, tg_key_ext(tg_kind_from_rdi_type_kind(type->kind), row->inline_site->type_idx));
|
||||
symbol_type_string = e_type_string_from_key(scratch.arena, e_type_key_ext(e_type_kind_from_rdi(type->kind), row->inline_site->type_idx, e_idx_from_rdi(row->rdi)));
|
||||
}
|
||||
|
||||
// rjf: build row
|
||||
@@ -5840,8 +5785,8 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
|
||||
UI_FocusHot((row_selected && cs->cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
String8 selected_string = {0};
|
||||
if(ctrl_ctx.unwind_count == row->unwind_idx &&
|
||||
ctrl_ctx.inline_depth == row->inline_depth)
|
||||
if(df_interact_regs()->unwind_count == row->unwind_idx &&
|
||||
df_interact_regs()->inline_depth == row->inline_depth)
|
||||
{
|
||||
selected_string = df_g_icon_kind_text_table[DF_IconKind_RightArrow];
|
||||
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = thread_color));
|
||||
@@ -7259,8 +7204,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
|
||||
//////////////////////////////
|
||||
//- rjf: unpack entity params
|
||||
//
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *thread = df_entity_from_handle(df_interact_regs()->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
|
||||
//////////////////////////////
|
||||
@@ -7586,6 +7530,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
|
||||
|
||||
//- rjf: fill local variable annotations
|
||||
{
|
||||
DI_Scope *scope = di_scope_open();
|
||||
Vec4F32 color_gen_table[] =
|
||||
{
|
||||
df_rgba_from_theme_color(DF_ThemeColor_Thread0),
|
||||
@@ -7597,19 +7542,16 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
|
||||
df_rgba_from_theme_color(DF_ThemeColor_Thread6),
|
||||
df_rgba_from_theme_color(DF_ThemeColor_Thread7),
|
||||
};
|
||||
DI_Scope *scope = di_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 *rdi = parse_ctx.rdi;
|
||||
for(EVAL_String2NumMapNode *n = parse_ctx.locals_map->first; n != 0; n = n->order_next)
|
||||
U64 thread_rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, df_interact_regs()->unwind_count);
|
||||
for(E_String2NumMapNode *n = e_ctx()->locals_map->first; n != 0; n = n->order_next)
|
||||
{
|
||||
String8 local_name = n->string;
|
||||
DF_Eval local_eval = df_eval_from_string(scratch.arena, scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, local_name);
|
||||
if(local_eval.mode == EVAL_EvalMode_Addr)
|
||||
E_Eval local_eval = e_eval_from_string(scratch.arena, local_name);
|
||||
if(local_eval.mode == E_Mode_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, rdi, local_eval.type_key);
|
||||
Rng1U64 vaddr_rng = r1u64(local_eval.offset, local_eval.offset+local_eval_type_size);
|
||||
E_TypeKind local_eval_type_kind = e_type_kind_from_key(local_eval.type_key);
|
||||
U64 local_eval_type_size = e_type_byte_size_from_key(local_eval.type_key);
|
||||
Rng1U64 vaddr_rng = r1u64(local_eval.value.u64, local_eval.value.u64+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)
|
||||
{
|
||||
@@ -7617,7 +7559,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.rdi, local_eval.type_key);
|
||||
annotation->type_string = e_type_string_from_key(scratch.arena, local_eval.type_key);
|
||||
annotation->color = color_gen_table[(vaddr_rng.min/8)%ArrayCount(color_gen_table)];
|
||||
annotation->vaddr_range = vaddr_rng;
|
||||
}
|
||||
|
||||
@@ -555,13 +555,13 @@ internal DF_WatchViewPoint df_watch_view_point_from_tbl(DF_EvalVizBlockList *blo
|
||||
internal Vec2S64 df_tbl_from_watch_view_point(DF_EvalVizBlockList *blocks, DF_WatchViewPoint pt);
|
||||
|
||||
//- rjf: table coordinates -> strings
|
||||
internal String8 df_string_from_eval_viz_row_column_kind(Arena *arena, DF_EvalView *ev, TG_Graph *graph, RDI_Parsed *rdi, DF_EvalVizRow *row, DF_WatchViewColumnKind col_kind, B32 editable);
|
||||
internal String8 df_string_from_eval_viz_row_column_kind(Arena *arena, DF_EvalView *ev, DF_EvalVizRow *row, DF_WatchViewColumnKind col_kind, B32 editable);
|
||||
|
||||
//- rjf: table coordinates -> text edit state
|
||||
internal DF_WatchViewTextEditState *df_watch_view_text_edit_state_from_pt(DF_WatchViewState *wv, DF_WatchViewPoint pt);
|
||||
|
||||
//- rjf: windowed watch tree visualization
|
||||
internal DF_EvalVizBlockList df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, FZY_Scope *fzy_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_View *view, DF_WatchViewState *ews);
|
||||
internal DF_EvalVizBlockList df_eval_viz_block_list_from_watch_view_state(Arena *arena, DI_Scope *di_scope, FZY_Scope *fzy_scope, DF_View *view, DF_WatchViewState *ews);
|
||||
|
||||
//- rjf: eval/watch views main hooks
|
||||
internal void df_watch_view_init(DF_WatchViewState *ewv, DF_View *view, DF_WatchViewFillKind fill_kind);
|
||||
|
||||
+333
-58
@@ -918,6 +918,7 @@ e_push_expr(Arena *arena, E_ExprKind kind, void *location)
|
||||
e->first = e->last = e->next = &e_expr_nil;
|
||||
e->location = location;
|
||||
e->kind = kind;
|
||||
return e;
|
||||
}
|
||||
|
||||
internal void
|
||||
@@ -927,7 +928,13 @@ e_expr_push_child(E_Expr *parent, E_Expr *child)
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Context Selection Functions (Required For All Subsequent APIs)
|
||||
//~ rjf: Context Selection Functions (Selection Required For All Subsequent APIs)
|
||||
|
||||
internal E_Ctx *
|
||||
e_ctx(void)
|
||||
{
|
||||
return e_state->ctx;
|
||||
}
|
||||
|
||||
internal void
|
||||
e_select_ctx(E_Ctx *ctx)
|
||||
@@ -947,6 +954,21 @@ e_select_ctx(E_Ctx *ctx)
|
||||
e_state->cons_key_slots = push_array(e_state->arena, E_ConsTypeSlot, e_state->cons_key_slots_count);
|
||||
}
|
||||
|
||||
internal U32
|
||||
e_idx_from_rdi(RDI_Parsed *rdi)
|
||||
{
|
||||
U32 result = 0;
|
||||
for(U64 idx = 0; idx < e_state->ctx->rdis_count; idx += 1)
|
||||
{
|
||||
if(e_state->ctx->rdis[idx] == rdi)
|
||||
{
|
||||
result = (U32)idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Type Operation Functions
|
||||
|
||||
@@ -972,8 +994,15 @@ e_type_key_ext(E_TypeKind kind, U32 type_idx, U32 rdi_idx)
|
||||
{
|
||||
E_TypeKey key = {E_TypeKeyKind_Ext};
|
||||
key.u32[0] = (U32)kind;
|
||||
key.u32[1] = type_idx;
|
||||
key.u32[2] = rdi_idx;
|
||||
if(E_TypeKind_FirstBasic <= kind && kind <= E_TypeKind_LastBasic)
|
||||
{
|
||||
key.kind = E_TypeKeyKind_Basic;
|
||||
}
|
||||
else
|
||||
{
|
||||
key.u32[1] = type_idx;
|
||||
key.u32[2] = rdi_idx;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
@@ -1138,7 +1167,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
RDI_TypeNode *rdi_type = rdi_element_from_name_idx(rdi, TypeNodes, type_node_idx);
|
||||
if(rdi_type->kind != RDI_TypeKind_NULL)
|
||||
{
|
||||
E_TypeKind kind = e_kind_from_rdi_type_kind(rdi_type->kind);
|
||||
E_TypeKind kind = e_type_kind_from_rdi(rdi_type->kind);
|
||||
|
||||
//- rjf: record types => unpack name * members & produce
|
||||
if(RDI_TypeKind_FirstRecord <= rdi_type->kind && rdi_type->kind <= RDI_TypeKind_LastRecord)
|
||||
@@ -1165,9 +1194,9 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
RDI_Member *src = rdi_element_from_name_idx(rdi, Members, member_idx);
|
||||
E_TypeKind member_type_kind = E_TypeKind_Null;
|
||||
RDI_TypeNode *member_type = rdi_element_from_name_idx(rdi, TypeNodes, src->type_idx);
|
||||
member_type_kind = e_kind_from_rdi_type_kind(member_type->kind);
|
||||
member_type_kind = e_type_kind_from_rdi(member_type->kind);
|
||||
E_Member *dst = &members[member_idx-udt->member_first];
|
||||
dst->kind = e_member_kind_from_rdi_member_kind(src->kind);
|
||||
dst->kind = e_member_kind_from_rdi(src->kind);
|
||||
dst->type_key = e_type_key_ext(member_type_kind, src->type_idx, rdi_idx);
|
||||
dst->name.str = rdi_string_from_idx(rdi, src->name_string_idx, &dst->name.size);
|
||||
dst->off = (U64)src->off;
|
||||
@@ -1196,7 +1225,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
if(rdi_type->user_defined.direct_type_idx < type_node_idx)
|
||||
{
|
||||
RDI_TypeNode *direct_type_node = rdi_element_from_name_idx(rdi, TypeNodes, rdi_type->user_defined.direct_type_idx);
|
||||
E_TypeKind direct_type_kind = e_kind_from_rdi_type_kind(direct_type_node->kind);
|
||||
E_TypeKind direct_type_kind = e_type_kind_from_rdi(direct_type_node->kind);
|
||||
direct_type_key = e_type_key_ext(direct_type_kind, rdi_type->user_defined.direct_type_idx, rdi_idx);
|
||||
}
|
||||
|
||||
@@ -1239,7 +1268,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
if(rdi_type->constructed.direct_type_idx < type_node_idx)
|
||||
{
|
||||
RDI_TypeNode *direct_type_node = rdi_element_from_name_idx(rdi, TypeNodes, rdi_type->constructed.direct_type_idx);
|
||||
E_TypeKind direct_type_kind = e_kind_from_rdi_type_kind(direct_type_node->kind);
|
||||
E_TypeKind direct_type_kind = e_type_kind_from_rdi(direct_type_node->kind);
|
||||
direct_type_key = e_type_key_ext(direct_type_kind, rdi_type->constructed.direct_type_idx, rdi_idx);
|
||||
direct_type_is_good = 1;
|
||||
direct_type_byte_size = (U64)direct_type_node->byte_size;
|
||||
@@ -1303,7 +1332,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
if(param_type_idx < type_node_idx)
|
||||
{
|
||||
RDI_TypeNode *param_type_node = rdi_element_from_name_idx(rdi, TypeNodes, param_type_idx);
|
||||
E_TypeKind param_kind = e_kind_from_rdi_type_kind(param_type_node->kind);
|
||||
E_TypeKind param_kind = e_type_kind_from_rdi(param_type_node->kind);
|
||||
type->param_type_keys[idx] = e_type_key_ext(param_kind, param_type_idx, rdi_idx);
|
||||
}
|
||||
else
|
||||
@@ -1336,7 +1365,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
if(param_type_idx < type_node_idx)
|
||||
{
|
||||
RDI_TypeNode *param_type_node = rdi_element_from_name_idx(rdi, TypeNodes, param_type_idx);
|
||||
E_TypeKind param_kind = e_kind_from_rdi_type_kind(param_type_node->kind);
|
||||
E_TypeKind param_kind = e_type_kind_from_rdi(param_type_node->kind);
|
||||
type->param_type_keys[idx] = e_type_key_ext(param_kind, param_type_idx, rdi_idx);
|
||||
}
|
||||
else
|
||||
@@ -1359,7 +1388,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
if(rdi_type->constructed.owner_type_idx < type_node_idx)
|
||||
{
|
||||
RDI_TypeNode *owner_type_node = rdi_element_from_name_idx(rdi, TypeNodes, rdi_type->constructed.owner_type_idx);
|
||||
E_TypeKind owner_type_kind = e_kind_from_rdi_type_kind(owner_type_node->kind);
|
||||
E_TypeKind owner_type_kind = e_type_kind_from_rdi(owner_type_node->kind);
|
||||
owner_type_key = e_type_key_ext(owner_type_kind, rdi_type->constructed.owner_type_idx, rdi_idx);
|
||||
}
|
||||
type = push_array(arena, E_Type, 1);
|
||||
@@ -1384,7 +1413,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
if(rdi_type->user_defined.direct_type_idx < type_node_idx)
|
||||
{
|
||||
RDI_TypeNode *direct_type_node = rdi_element_from_name_idx(rdi, TypeNodes, rdi_type->user_defined.direct_type_idx);
|
||||
E_TypeKind direct_type_kind = e_kind_from_rdi_type_kind(direct_type_node->kind);
|
||||
E_TypeKind direct_type_kind = e_type_kind_from_rdi(direct_type_node->kind);
|
||||
direct_type_key = e_type_key_ext(direct_type_kind, rdi_type->user_defined.direct_type_idx, rdi_idx);
|
||||
direct_type_byte_size = direct_type_node->byte_size;
|
||||
}
|
||||
@@ -1406,7 +1435,7 @@ e_type_from_key(Arena *arena, E_TypeKey key)
|
||||
if(rdi_type->bitfield.direct_type_idx < type_node_idx)
|
||||
{
|
||||
RDI_TypeNode *direct_type_node = rdi_element_from_name_idx(rdi, TypeNodes, rdi_type->bitfield.direct_type_idx);
|
||||
E_TypeKind direct_type_kind = e_kind_from_rdi_type_kind(direct_type_node->kind);
|
||||
E_TypeKind direct_type_kind = e_type_kind_from_rdi(direct_type_node->kind);
|
||||
direct_type_key = e_type_key_ext(direct_type_kind, rdi_type->bitfield.direct_type_idx, rdi_idx);
|
||||
direct_type_byte_size = direct_type_node->byte_size;
|
||||
}
|
||||
@@ -1669,6 +1698,38 @@ e_type_owner_from_key(E_TypeKey key)
|
||||
return result;
|
||||
}
|
||||
|
||||
internal E_TypeKey
|
||||
e_type_ptee_from_key(E_TypeKey key)
|
||||
{
|
||||
E_TypeKey result = key;
|
||||
B32 passed_ptr = 0;
|
||||
for(;;)
|
||||
{
|
||||
E_TypeKind kind = e_type_kind_from_key(result);
|
||||
result = e_type_direct_from_key(result);
|
||||
if(kind == E_TypeKind_Ptr || kind == E_TypeKind_LRef || kind == E_TypeKind_RRef)
|
||||
{
|
||||
passed_ptr = 1;
|
||||
}
|
||||
E_TypeKind next_kind = e_type_kind_from_key(result);
|
||||
if(passed_ptr &&
|
||||
next_kind != E_TypeKind_IncompleteStruct &&
|
||||
next_kind != E_TypeKind_IncompleteUnion &&
|
||||
next_kind != E_TypeKind_IncompleteEnum &&
|
||||
next_kind != E_TypeKind_IncompleteClass &&
|
||||
next_kind != E_TypeKind_Alias &&
|
||||
next_kind != E_TypeKind_Modifier)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(kind == E_TypeKind_Null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal E_TypeKey
|
||||
e_type_unwrap_enum(E_TypeKey key)
|
||||
{
|
||||
@@ -2369,6 +2430,30 @@ e_type_from_expr(E_Expr *expr)
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void
|
||||
e_push_leaf_ident_exprs_from_expr__in_place(Arena *arena, E_String2ExprMap *map, E_Expr *expr)
|
||||
{
|
||||
switch(expr->kind)
|
||||
{
|
||||
default:
|
||||
{
|
||||
for(E_Expr *child = expr->first; child != &e_expr_nil; child = child->next)
|
||||
{
|
||||
e_push_leaf_ident_exprs_from_expr__in_place(arena, map, child);
|
||||
}
|
||||
}break;
|
||||
case E_ExprKind_Define:
|
||||
{
|
||||
E_Expr *exprl = expr->first;
|
||||
E_Expr *exprr = exprl->next;
|
||||
if(exprl->kind == E_ExprKind_LeafIdent)
|
||||
{
|
||||
e_string2expr_map_insert(arena, map, exprl->string, exprr);
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
internal E_Parse
|
||||
e_parse_type_from_text_tokens(Arena *arena, String8 text, E_TokenArray *tokens)
|
||||
{
|
||||
@@ -2814,7 +2899,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
U32 match_idx = matches[matches_count-1];
|
||||
RDI_GlobalVariable *global_var = rdi_element_from_name_idx(rdi, GlobalVariables, match_idx);
|
||||
E_OpList oplist = {0};
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_ModuleOff, global_var->voff);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_ModuleOff, global_var->voff);
|
||||
loc_kind = RDI_LocationKind_AddrBytecodeStream;
|
||||
loc_bytecode = e_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = global_var->type_idx;
|
||||
@@ -2851,7 +2936,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
U32 match_idx = matches[0];
|
||||
RDI_ThreadVariable *thread_var = rdi_element_from_name_idx(rdi, ThreadVariables, match_idx);
|
||||
E_OpList oplist = {0};
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_TLSOff, thread_var->tls_off);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_TLSOff, thread_var->tls_off);
|
||||
loc_kind = RDI_LocationKind_AddrBytecodeStream;
|
||||
loc_bytecode = e_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = thread_var->type_idx;
|
||||
@@ -2890,7 +2975,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
RDI_Scope *scope = rdi_element_from_name_idx(rdi, Scopes, procedure->root_scope_idx);
|
||||
U64 voff = *rdi_element_from_name_idx(rdi, ScopeVOffData, scope->voff_range_first);
|
||||
E_OpList oplist = {0};
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_ModuleOff, voff);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_ModuleOff, voff);
|
||||
loc_kind = RDI_LocationKind_ValBytecodeStream;
|
||||
loc_bytecode = e_bytecode_from_oplist(arena, &oplist);
|
||||
U32 type_idx = procedure->type_idx;
|
||||
@@ -2977,9 +3062,9 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
E_OpList oplist = {0};
|
||||
U64 byte_size = bit_size_from_arch(e_state->ctx->arch)/8;
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg_u16.reg_code, byte_size, 0);
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_ConstU16, loc_reg_u16.offset);
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_Add, 0);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_ConstU16, loc_reg_u16.offset);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_Add, 0);
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafBytecode, token_string.str);
|
||||
atom->mode = E_Mode_Addr;
|
||||
atom->type_key = type_key;
|
||||
@@ -2990,10 +3075,10 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
E_OpList oplist = {0};
|
||||
U64 byte_size = bit_size_from_arch(e_state->ctx->arch)/8;
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg_u16.reg_code, byte_size, 0);
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_ConstU16, loc_reg_u16.offset);
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_Add, 0);
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_MemRead, bit_size_from_arch(e_state->ctx->arch)/8);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_ConstU16, loc_reg_u16.offset);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_Add, 0);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_MemRead, bit_size_from_arch(e_state->ctx->arch)/8);
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafBytecode, token_string.str);
|
||||
atom->mode = E_Mode_Addr;
|
||||
atom->type_key = type_key;
|
||||
@@ -3007,7 +3092,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
U64 byte_size = (U64)reg_rng.byte_size;
|
||||
U64 byte_pos = 0;
|
||||
U64 regread_param = RDI_EncodeRegReadParam(loc_reg.reg_code, byte_size, byte_pos);
|
||||
e_oplist_push_op(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
e_oplist_push(arena, &oplist, RDI_EvalOp_RegRead, regread_param);
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafBytecode, token_string.str);
|
||||
atom->mode = E_Mode_Value;
|
||||
atom->type_key = type_key;
|
||||
@@ -4538,10 +4623,10 @@ e_bytecode_from_oplist(Arena *arena, E_OpList *oplist)
|
||||
////////////////////////////////
|
||||
//~ rjf: Interpretation Functions
|
||||
|
||||
internal E_Result
|
||||
internal E_Interpretation
|
||||
e_interpret(String8 bytecode)
|
||||
{
|
||||
E_Result result = {0};
|
||||
E_Interpretation result = {0};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
|
||||
//- rjf: allocate stack
|
||||
@@ -4558,7 +4643,7 @@ e_interpret(String8 bytecode)
|
||||
RDI_EvalOp op = (RDI_EvalOp)*ptr;
|
||||
if(op >= RDI_EvalOp_COUNT)
|
||||
{
|
||||
result.code = E_ResultCode_BadOp;
|
||||
result.code = E_InterpretationCode_BadOp;
|
||||
goto done;
|
||||
}
|
||||
U8 ctrlbits = rdi_eval_op_ctrlbits_table[op];
|
||||
@@ -4571,7 +4656,7 @@ e_interpret(String8 bytecode)
|
||||
U8 *next_ptr = ptr + decode_size;
|
||||
if(next_ptr > opl)
|
||||
{
|
||||
result.code = E_ResultCode_BadOp;
|
||||
result.code = E_InterpretationCode_BadOp;
|
||||
goto done;
|
||||
}
|
||||
// TODO(rjf): guarantee 8 bytes padding after the end of serialized
|
||||
@@ -4592,7 +4677,7 @@ e_interpret(String8 bytecode)
|
||||
U32 pop_count = RDI_POPN_FROM_CTRLBITS(ctrlbits);
|
||||
if(pop_count > stack_count)
|
||||
{
|
||||
result.code = E_ResultCode_BadOp;
|
||||
result.code = E_InterpretationCode_BadOp;
|
||||
goto done;
|
||||
}
|
||||
if(pop_count <= stack_count)
|
||||
@@ -4638,7 +4723,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
if(!good_read)
|
||||
{
|
||||
result.code = E_ResultCode_BadMemRead;
|
||||
result.code = E_InterpretationCode_BadMemRead;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4658,7 +4743,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadRegRead;
|
||||
result.code = E_InterpretationCode_BadRegRead;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4673,7 +4758,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadRegRead;
|
||||
result.code = E_InterpretationCode_BadRegRead;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4686,7 +4771,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadFrameBase;
|
||||
result.code = E_InterpretationCode_BadFrameBase;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4699,7 +4784,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadModuleBase;
|
||||
result.code = E_InterpretationCode_BadModuleBase;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4712,7 +4797,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadTLSBase;
|
||||
result.code = E_InterpretationCode_BadTLSBase;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4827,7 +4912,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_DivideByZero;
|
||||
result.code = E_InterpretationCode_DivideByZero;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@@ -4839,7 +4924,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_DivideByZero;
|
||||
result.code = E_InterpretationCode_DivideByZero;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@@ -4852,13 +4937,13 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_DivideByZero;
|
||||
result.code = E_InterpretationCode_DivideByZero;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4875,7 +4960,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4889,7 +4974,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4906,7 +4991,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4920,7 +5005,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4934,7 +5019,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4948,7 +5033,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4962,7 +5047,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4976,7 +5061,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -4990,7 +5075,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -5004,7 +5089,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -5039,7 +5124,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -5064,7 +5149,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -5089,7 +5174,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -5114,7 +5199,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOpTypes;
|
||||
result.code = E_InterpretationCode_BadOpTypes;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -5213,7 +5298,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOp;
|
||||
result.code = E_InterpretationCode_BadOp;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -5238,7 +5323,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_BadOp;
|
||||
result.code = E_InterpretationCode_BadOp;
|
||||
goto done;
|
||||
}
|
||||
}break;
|
||||
@@ -5256,7 +5341,7 @@ e_interpret(String8 bytecode)
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_ResultCode_InsufficientStackSpace;
|
||||
result.code = E_InterpretationCode_InsufficientStackSpace;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@@ -5268,11 +5353,201 @@ e_interpret(String8 bytecode)
|
||||
{
|
||||
result.value = stack[0];
|
||||
}
|
||||
else if(result.code == E_ResultCode_Good)
|
||||
else if(result.code == E_InterpretationCode_Good)
|
||||
{
|
||||
result.code = E_ResultCode_MalformedBytecode;
|
||||
result.code = E_InterpretationCode_MalformedBytecode;
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Bundled Evaluation Functions
|
||||
|
||||
internal E_Eval
|
||||
e_eval_from_string(Arena *arena, String8 string)
|
||||
{
|
||||
E_TokenArray tokens = e_token_array_from_text(arena, string);
|
||||
E_Parse parse = e_parse_expr_from_text_tokens(arena, string, &tokens);
|
||||
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(arena, parse.expr);
|
||||
E_OpList oplist = e_oplist_from_irtree(arena, irtree.root);
|
||||
String8 bytecode = e_bytecode_from_oplist(arena, &oplist);
|
||||
E_Interpretation interp = e_interpret(bytecode);
|
||||
E_Eval eval =
|
||||
{
|
||||
.value = interp.value,
|
||||
.mode = irtree.mode,
|
||||
.type_key = irtree.type_key,
|
||||
.code = interp.code,
|
||||
};
|
||||
e_msg_list_concat_in_place(&eval.msgs, &parse.msgs);
|
||||
e_msg_list_concat_in_place(&eval.msgs, &irtree.msgs);
|
||||
if(E_InterpretationCode_Good < eval.code && eval.code < E_InterpretationCode_COUNT)
|
||||
{
|
||||
e_msg(arena, &eval.msgs, E_MsgKind_InterpretationError, 0, e_interpretation_code_display_strings[eval.code]);
|
||||
}
|
||||
return eval;
|
||||
}
|
||||
|
||||
internal E_Eval
|
||||
e_autoresolved_eval_from_eval(E_Eval eval)
|
||||
{
|
||||
if(e_state->ctx->rdis_count > 0 &&
|
||||
e_state->ctx->module_base != 0 &&
|
||||
(eval.mode == E_Mode_Value || eval.mode == E_Mode_Reg) &&
|
||||
(e_type_key_match(eval.type_key, e_type_key_basic(E_TypeKind_S64)) ||
|
||||
e_type_key_match(eval.type_key, e_type_key_basic(E_TypeKind_U64)) ||
|
||||
e_type_key_match(eval.type_key, e_type_key_basic(E_TypeKind_S32)) ||
|
||||
e_type_key_match(eval.type_key, e_type_key_basic(E_TypeKind_U32))))
|
||||
{
|
||||
U64 vaddr = eval.value.u64;
|
||||
U64 voff = vaddr - e_state->ctx->module_base[0];
|
||||
RDI_Parsed *rdi = e_state->ctx->rdis[0];
|
||||
RDI_Scope *scope = rdi_scope_from_voff(rdi, voff);
|
||||
RDI_Procedure *procedure = rdi_procedure_from_voff(rdi, voff);
|
||||
RDI_GlobalVariable *gvar = rdi_global_variable_from_voff(rdi, voff);
|
||||
U32 string_idx = 0;
|
||||
if(string_idx == 0) { string_idx = procedure->name_string_idx; }
|
||||
if(string_idx == 0) { string_idx = gvar->name_string_idx; }
|
||||
if(string_idx != 0)
|
||||
{
|
||||
eval.type_key = e_type_key_cons(E_TypeKind_Ptr, e_type_key_basic(E_TypeKind_Void), 0);
|
||||
}
|
||||
}
|
||||
return eval;
|
||||
}
|
||||
|
||||
internal E_Eval
|
||||
e_dynamically_typed_eval_from_eval(E_Eval eval)
|
||||
{
|
||||
E_TypeKey type_key = eval.type_key;
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
if(e_state->ctx->memory_read != 0 &&
|
||||
e_state->ctx->module_base != 0 &&
|
||||
type_kind == E_TypeKind_Ptr)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
E_TypeKey ptee_type_key = e_type_unwrap(e_type_direct_from_key(e_type_unwrap(type_key)));
|
||||
E_TypeKind ptee_type_kind = e_type_kind_from_key(ptee_type_key);
|
||||
if(ptee_type_kind == E_TypeKind_Struct || ptee_type_kind == E_TypeKind_Class)
|
||||
{
|
||||
E_Type *ptee_type = e_type_from_key(scratch.arena, ptee_type_key);
|
||||
B32 has_vtable = 0;
|
||||
for(U64 idx = 0; idx < ptee_type->count; idx += 1)
|
||||
{
|
||||
if(ptee_type->members[idx].kind == E_MemberKind_VirtualMethod)
|
||||
{
|
||||
has_vtable = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(has_vtable)
|
||||
{
|
||||
U64 ptr_vaddr = eval.value.u64;
|
||||
U64 addr_size = bit_size_from_arch(e_state->ctx->arch)/8;
|
||||
U64 class_base_vaddr = 0;
|
||||
U64 vtable_vaddr = 0;
|
||||
if(e_state->ctx->memory_read(e_state->ctx->memory_read_user_data, &class_base_vaddr, r1u64(ptr_vaddr, ptr_vaddr+addr_size)) &&
|
||||
e_state->ctx->memory_read(e_state->ctx->memory_read_user_data, &vtable_vaddr, r1u64(class_base_vaddr, class_base_vaddr+addr_size)))
|
||||
{
|
||||
U32 rdi_idx = 0;
|
||||
RDI_Parsed *rdi = 0;
|
||||
U64 module_base = 0;
|
||||
for(U64 idx = 0; idx < e_state->ctx->rdis_count; idx += 1)
|
||||
{
|
||||
if(contains_1u64(e_state->ctx->rdis_vaddr_ranges[idx], vtable_vaddr))
|
||||
{
|
||||
rdi_idx = (U32)idx;
|
||||
rdi = e_state->ctx->rdis[idx];
|
||||
module_base = e_state->ctx->rdis_vaddr_ranges[idx].min;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(rdi != 0)
|
||||
{
|
||||
U64 vtable_voff = vtable_vaddr - module_base;
|
||||
U64 global_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_GlobalVMap, vtable_voff);
|
||||
RDI_GlobalVariable *global_var = rdi_element_from_name_idx(rdi, GlobalVariables, global_idx);
|
||||
if(global_var->link_flags & RDI_LinkFlag_TypeScoped)
|
||||
{
|
||||
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, global_var->container_idx);
|
||||
RDI_TypeNode *type = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx);
|
||||
E_TypeKey derived_type_key = e_type_key_ext(e_type_kind_from_rdi(type->kind), udt->self_type_idx, rdi_idx);
|
||||
E_TypeKey ptr_to_derived_type_key = e_type_key_cons(E_TypeKind_Ptr, derived_type_key, 0);
|
||||
eval.type_key = ptr_to_derived_type_key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
return eval;
|
||||
}
|
||||
|
||||
internal E_Eval
|
||||
e_value_eval_from_eval(E_Eval eval)
|
||||
{
|
||||
switch(eval.mode)
|
||||
{
|
||||
//- rjf: no work to be done. already in value mode
|
||||
default:
|
||||
case E_Mode_Value:{}break;
|
||||
|
||||
//- rjf: address => resolve into value, if leaf
|
||||
case E_Mode_Addr:
|
||||
if(e_state->ctx->memory_read != 0)
|
||||
{
|
||||
E_TypeKey type_key = eval.type_key;
|
||||
E_TypeKind type_kind = e_type_kind_from_key(type_key);
|
||||
U64 type_byte_size = e_type_byte_size_from_key(type_key);
|
||||
Rng1U64 value_vaddr_range = r1u64(eval.value.u64, eval.value.u64 + type_byte_size);
|
||||
MemoryZeroStruct(&eval.value);
|
||||
if(!e_type_key_match(type_key, e_type_key_zero()) &&
|
||||
type_byte_size <= sizeof(E_Value) &&
|
||||
e_state->ctx->memory_read(e_state->ctx->memory_read_user_data, &eval.value, value_vaddr_range))
|
||||
{
|
||||
eval.mode = E_Mode_Value;
|
||||
|
||||
// rjf: mask&shift, for bitfields
|
||||
if(type_kind == E_TypeKind_Bitfield && type_byte_size <= sizeof(U64))
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
E_Type *type = e_type_from_key(scratch.arena, type_key);
|
||||
U64 valid_bits_mask = 0;
|
||||
for(U64 idx = 0; idx < type->count; idx += 1)
|
||||
{
|
||||
valid_bits_mask |= (1<<idx);
|
||||
}
|
||||
eval.value.u64 = eval.value.u64 >> type->off;
|
||||
eval.value.u64 = eval.value.u64 & valid_bits_mask;
|
||||
eval.type_key = type->direct_type_key;
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
// rjf: manually sign-extend
|
||||
switch(type_kind)
|
||||
{
|
||||
default: break;
|
||||
case E_TypeKind_S8: {eval.value.s64 = (S64)*((S8 *)&eval.value.u64);}break;
|
||||
case E_TypeKind_S16: {eval.value.s64 = (S64)*((S16 *)&eval.value.u64);}break;
|
||||
case E_TypeKind_S32: {eval.value.s64 = (S64)*((S32 *)&eval.value.u64);}break;
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: register => resolve into value
|
||||
case E_Mode_Reg:
|
||||
{
|
||||
E_TypeKey type_key = eval.type_key;
|
||||
U64 type_byte_size = e_type_byte_size_from_key(type_key);
|
||||
U64 reg_off = eval.value.u64;
|
||||
MemoryZeroStruct(&eval.value);
|
||||
MemoryCopy(&eval.value.u256, ((U8 *)e_state->ctx->reg_data + reg_off), Min(type_byte_size, sizeof(U64)*4));
|
||||
eval.mode = E_Mode_Value;
|
||||
}break;
|
||||
}
|
||||
|
||||
return eval;
|
||||
}
|
||||
|
||||
+52
-23
@@ -298,27 +298,6 @@ struct E_OpList
|
||||
U64 encoded_size;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation Types
|
||||
|
||||
typedef union E_Value E_Value;
|
||||
union E_Value
|
||||
{
|
||||
U64 u256[4];
|
||||
U64 u128[2];
|
||||
U64 u64;
|
||||
S64 s64;
|
||||
F64 f64;
|
||||
F32 f32;
|
||||
};
|
||||
|
||||
typedef struct E_Result E_Result;
|
||||
struct E_Result
|
||||
{
|
||||
E_Value value;
|
||||
E_ResultCode code;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Map Types
|
||||
|
||||
@@ -416,6 +395,7 @@ struct E_Ctx
|
||||
|
||||
// rjf: debug info
|
||||
RDI_Parsed **rdis;
|
||||
Rng1U64 *rdis_vaddr_ranges;
|
||||
U64 rdis_count;
|
||||
|
||||
// rjf: identifier resolution maps
|
||||
@@ -463,9 +443,46 @@ struct E_Parse
|
||||
E_MsgList msgs;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Bytecode Interpretation Types
|
||||
|
||||
typedef union E_Value E_Value;
|
||||
union E_Value
|
||||
{
|
||||
U64 u512[8];
|
||||
U64 u256[4];
|
||||
U64 u128[2];
|
||||
U64 u64;
|
||||
S64 s64;
|
||||
F64 f64;
|
||||
F32 f32;
|
||||
};
|
||||
|
||||
typedef struct E_Interpretation E_Interpretation;
|
||||
struct E_Interpretation
|
||||
{
|
||||
E_Value value;
|
||||
E_InterpretationCode code;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Bundled Evaluation Path Types
|
||||
|
||||
typedef struct E_Eval E_Eval;
|
||||
struct E_Eval
|
||||
{
|
||||
E_Value value;
|
||||
E_Mode mode;
|
||||
E_TypeKey type_key;
|
||||
E_InterpretationCode code;
|
||||
E_MsgList msgs;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
global read_only E_String2NumMap e_string2num_map_nil = {0};
|
||||
global read_only E_String2ExprMap e_string2expr_map_nil = {0};
|
||||
global read_only E_Expr e_expr_nil = {&e_expr_nil, &e_expr_nil, &e_expr_nil};
|
||||
global read_only E_Type e_type_nil = {E_TypeKind_Null};
|
||||
global read_only E_IRNode e_irnode_nil = {&e_irnode_nil, &e_irnode_nil, &e_irnode_nil};
|
||||
@@ -540,9 +557,11 @@ internal E_Expr *e_push_expr(Arena *arena, E_ExprKind kind, void *location);
|
||||
internal void e_expr_push_child(E_Expr *parent, E_Expr *child);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Context Selection Functions (Required For All Subsequent APIs)
|
||||
//~ rjf: Context Selection Functions (Selection Required For All Subsequent APIs)
|
||||
|
||||
internal E_Ctx *e_ctx(void);
|
||||
internal void e_select_ctx(E_Ctx *ctx);
|
||||
internal U32 e_idx_from_rdi(RDI_Parsed *rdi);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Type Operation Functions
|
||||
@@ -564,6 +583,7 @@ internal U64 e_type_byte_size_from_key(E_TypeKey key);
|
||||
internal E_Type *e_type_from_key(Arena *arena, E_TypeKey key);
|
||||
internal E_TypeKey e_type_direct_from_key(E_TypeKey key);
|
||||
internal E_TypeKey e_type_owner_from_key(E_TypeKey key);
|
||||
internal E_TypeKey e_type_ptee_from_key(E_TypeKey key);
|
||||
internal E_TypeKey e_type_unwrap_enum(E_TypeKey key);
|
||||
internal E_TypeKey e_type_unwrap(E_TypeKey key);
|
||||
internal E_TypeKey e_type_promote(E_TypeKey key);
|
||||
@@ -584,6 +604,7 @@ internal E_TypeKeyList e_type_key_list_copy(Arena *arena, E_TypeKeyList *src);
|
||||
|
||||
internal E_TypeKey e_leaf_type_from_name(String8 name);
|
||||
internal E_TypeKey e_type_from_expr(E_Expr *expr);
|
||||
internal void e_push_leaf_ident_exprs_from_expr__in_place(Arena *arena, E_String2ExprMap *map, E_Expr *expr);
|
||||
internal E_Parse e_parse_type_from_text_tokens(Arena *arena, String8 text, E_TokenArray *tokens);
|
||||
internal E_Parse e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *tokens, S64 max_precedence);
|
||||
internal E_Parse e_parse_expr_from_text_tokens(Arena *arena, String8 text, E_TokenArray *tokens);
|
||||
@@ -626,6 +647,14 @@ internal String8 e_bytecode_from_oplist(Arena *arena, E_OpList *oplist);
|
||||
////////////////////////////////
|
||||
//~ rjf: Interpretation Functions
|
||||
|
||||
internal E_Result e_interpret(String8 bytecode);
|
||||
internal E_Interpretation e_interpret(String8 bytecode);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Bundled Evaluation Functions
|
||||
|
||||
internal E_Eval e_eval_from_string(Arena *arena, String8 string);
|
||||
internal E_Eval e_autoresolved_eval_from_eval(E_Eval eval);
|
||||
internal E_Eval e_dynamically_typed_eval_from_eval(E_Eval eval);
|
||||
internal E_Eval e_value_eval_from_eval(E_Eval eval);
|
||||
|
||||
#endif // EVAL_H
|
||||
|
||||
@@ -115,7 +115,7 @@ E_ExprKindTable:
|
||||
}
|
||||
|
||||
@table(name display_string)
|
||||
E_ResultCodeTable:
|
||||
E_InterpretationCodeTable:
|
||||
{
|
||||
{ Good "" }
|
||||
{ DivideByZero "Cannot divide by zero." }
|
||||
@@ -152,9 +152,9 @@ E_ResultCodeTable:
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@enum E_ResultCode:
|
||||
@enum E_InterpretationCode:
|
||||
{
|
||||
@expand(E_ResultCodeTable a) `$(a.name)`,
|
||||
@expand(E_InterpretationCodeTable a) `$(a.name)`,
|
||||
COUNT,
|
||||
}
|
||||
|
||||
@@ -164,9 +164,9 @@ e_expr_kind_strings:
|
||||
@expand(E_ExprKindTable a) `str8_lit_comp("$(a.name)")`
|
||||
}
|
||||
|
||||
@data(String8) e_result_code_display_strings:
|
||||
@data(String8) e_interpretation_code_display_strings:
|
||||
{
|
||||
@expand(E_ResultCodeTable a) `str8_lit_comp("$(a.display_string)")`
|
||||
@expand(E_InterpretationCodeTable a) `str8_lit_comp("$(a.display_string)")`
|
||||
}
|
||||
|
||||
@data(String8) e_expr_op_strings:
|
||||
|
||||
@@ -48,7 +48,7 @@ str8_lit_comp("Define"),
|
||||
str8_lit_comp("LeafIdent"),
|
||||
};
|
||||
|
||||
String8 e_result_code_display_strings[11] =
|
||||
String8 e_interpretation_code_display_strings[11] =
|
||||
{
|
||||
str8_lit_comp(""),
|
||||
str8_lit_comp("Cannot divide by zero."),
|
||||
|
||||
@@ -121,25 +121,25 @@ E_ExprKind_LeafIdent,
|
||||
E_ExprKind_COUNT,
|
||||
} E_ExprKindEnum;
|
||||
|
||||
typedef enum E_ResultCode
|
||||
typedef enum E_InterpretationCode
|
||||
{
|
||||
E_ResultCode_Good,
|
||||
E_ResultCode_DivideByZero,
|
||||
E_ResultCode_BadOp,
|
||||
E_ResultCode_BadOpTypes,
|
||||
E_ResultCode_BadMemRead,
|
||||
E_ResultCode_BadRegRead,
|
||||
E_ResultCode_BadFrameBase,
|
||||
E_ResultCode_BadModuleBase,
|
||||
E_ResultCode_BadTLSBase,
|
||||
E_ResultCode_InsufficientStackSpace,
|
||||
E_ResultCode_MalformedBytecode,
|
||||
E_ResultCode_COUNT,
|
||||
} E_ResultCode;
|
||||
E_InterpretationCode_Good,
|
||||
E_InterpretationCode_DivideByZero,
|
||||
E_InterpretationCode_BadOp,
|
||||
E_InterpretationCode_BadOpTypes,
|
||||
E_InterpretationCode_BadMemRead,
|
||||
E_InterpretationCode_BadRegRead,
|
||||
E_InterpretationCode_BadFrameBase,
|
||||
E_InterpretationCode_BadModuleBase,
|
||||
E_InterpretationCode_BadTLSBase,
|
||||
E_InterpretationCode_InsufficientStackSpace,
|
||||
E_InterpretationCode_MalformedBytecode,
|
||||
E_InterpretationCode_COUNT,
|
||||
} E_InterpretationCode;
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 e_expr_kind_strings[40];
|
||||
extern String8 e_result_code_display_strings[11];
|
||||
extern String8 e_interpretation_code_display_strings[11];
|
||||
extern String8 e_expr_op_strings[40];
|
||||
extern U8 e_kind_basic_byte_size_table[54];
|
||||
extern String8 e_kind_basic_string_table[54];
|
||||
|
||||
@@ -44,34 +44,34 @@ fzy_item_num_from_array_element_idx__linear_search(FZY_ItemArray *array, U64 ele
|
||||
}
|
||||
|
||||
internal String8
|
||||
fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, FZY_Target target, U64 element_idx)
|
||||
fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, RDI_SectionKind target, U64 element_idx)
|
||||
{
|
||||
String8 result = {0};
|
||||
switch(target)
|
||||
{
|
||||
// NOTE(rjf): no default - warn if we miss a case
|
||||
case FZY_Target_Procedures:
|
||||
default:{}break;
|
||||
case RDI_SectionKind_Procedures:
|
||||
{
|
||||
RDI_Procedure *proc = rdi_element_from_name_idx(rdi, Procedures, element_idx);
|
||||
U64 name_size = 0;
|
||||
U8 *name_base = rdi_string_from_idx(rdi, proc->name_string_idx, &name_size);
|
||||
result = str8(name_base, name_size);
|
||||
}break;
|
||||
case FZY_Target_GlobalVariables:
|
||||
case RDI_SectionKind_GlobalVariables:
|
||||
{
|
||||
RDI_GlobalVariable *gvar = rdi_element_from_name_idx(rdi, GlobalVariables, element_idx);
|
||||
U64 name_size = 0;
|
||||
U8 *name_base = rdi_string_from_idx(rdi, gvar->name_string_idx, &name_size);
|
||||
result = str8(name_base, name_size);
|
||||
}break;
|
||||
case FZY_Target_ThreadVariables:
|
||||
case RDI_SectionKind_ThreadVariables:
|
||||
{
|
||||
RDI_ThreadVariable *tvar = rdi_element_from_name_idx(rdi, ThreadVariables, element_idx);
|
||||
U64 name_size = 0;
|
||||
U8 *name_base = rdi_string_from_idx(rdi, tvar->name_string_idx, &name_size);
|
||||
result = str8(name_base, name_size);
|
||||
}break;
|
||||
case FZY_Target_UDTs:
|
||||
case RDI_SectionKind_UDTs:
|
||||
{
|
||||
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, element_idx);
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx);
|
||||
@@ -79,7 +79,6 @@ fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, FZY_Target target,
|
||||
U8 *name_base = rdi_string_from_idx(rdi, type_node->user_defined.name_string_idx, &name_size);
|
||||
result = str8(name_base, name_size);
|
||||
}break;
|
||||
case FZY_Target_COUNT:{}break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -372,7 +371,7 @@ fzy_search_thread__entry_point(void *p)
|
||||
B32 task_is_good = 0;
|
||||
Arena *task_arena = 0;
|
||||
String8 query = {0};
|
||||
FZY_Params params = {FZY_Target_Procedures};
|
||||
FZY_Params params = {RDI_SectionKind_Procedures};
|
||||
U64 initial_submit_gen = 0;
|
||||
OS_MutexScopeW(stripe->rw_mutex)
|
||||
{
|
||||
@@ -407,32 +406,27 @@ fzy_search_thread__entry_point(void *p)
|
||||
////////////////////////////
|
||||
//- rjf: search target -> info about search space
|
||||
//
|
||||
RDI_SectionKind section_kind = RDI_SectionKind_NULL;
|
||||
U64 element_name_idx_off = 0;
|
||||
if(task_is_good)
|
||||
{
|
||||
switch(params.target)
|
||||
{
|
||||
// NOTE(rjf): no default!
|
||||
case FZY_Target_COUNT:{}break;
|
||||
case FZY_Target_Procedures:
|
||||
default:{}break;
|
||||
case RDI_SectionKind_Procedures:
|
||||
{
|
||||
section_kind = RDI_SectionKind_Procedures;
|
||||
element_name_idx_off = OffsetOf(RDI_Procedure, name_string_idx);
|
||||
}break;
|
||||
case FZY_Target_GlobalVariables:
|
||||
case RDI_SectionKind_GlobalVariables:
|
||||
{
|
||||
section_kind = RDI_SectionKind_GlobalVariables;
|
||||
element_name_idx_off = OffsetOf(RDI_GlobalVariable, name_string_idx);
|
||||
}break;
|
||||
case FZY_Target_ThreadVariables:
|
||||
case RDI_SectionKind_ThreadVariables:
|
||||
{
|
||||
section_kind = RDI_SectionKind_ThreadVariables;
|
||||
element_name_idx_off = OffsetOf(RDI_ThreadVariable, name_string_idx);
|
||||
}break;
|
||||
case FZY_Target_UDTs:
|
||||
case RDI_SectionKind_UDTs:
|
||||
{
|
||||
section_kind = RDI_SectionKind_UDTs;
|
||||
// NOTE(rjf): name must be determined from self_type_idx
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@@ -448,13 +442,13 @@ fzy_search_thread__entry_point(void *p)
|
||||
{
|
||||
RDI_Parsed *rdi = rdis[rdi_idx];
|
||||
U64 element_count = 0;
|
||||
void *table_base = rdi_section_raw_table_from_kind(rdi, section_kind, &element_count);
|
||||
U64 element_size = rdi_section_element_size_table[section_kind];
|
||||
void *table_base = rdi_section_raw_table_from_kind(rdi, params.target, &element_count);
|
||||
U64 element_size = rdi_section_element_size_table[params.target];
|
||||
for(U64 idx = 1; task_is_good && idx < element_count; idx += 1)
|
||||
{
|
||||
void *element = (U8 *)table_base + element_size*idx;
|
||||
U32 *name_idx_ptr = (U32 *)((U8 *)element + element_name_idx_off);
|
||||
if(params.target == FZY_Target_UDTs)
|
||||
if(params.target == RDI_SectionKind_UDTs)
|
||||
{
|
||||
RDI_UDT *udt = (RDI_UDT *)element;
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx);
|
||||
|
||||
@@ -43,20 +43,10 @@ struct FZY_ItemArray
|
||||
////////////////////////////////
|
||||
//~ rjf: Search Parameter Types
|
||||
|
||||
typedef enum FZY_Target
|
||||
{
|
||||
FZY_Target_Procedures,
|
||||
FZY_Target_GlobalVariables,
|
||||
FZY_Target_ThreadVariables,
|
||||
FZY_Target_UDTs,
|
||||
FZY_Target_COUNT
|
||||
}
|
||||
FZY_Target;
|
||||
|
||||
typedef struct FZY_Params FZY_Params;
|
||||
struct FZY_Params
|
||||
{
|
||||
FZY_Target target;
|
||||
RDI_SectionKind target;
|
||||
DI_KeyArray dbgi_keys;
|
||||
};
|
||||
|
||||
@@ -169,7 +159,7 @@ thread_static FZY_TCTX *fzy_tctx = 0;
|
||||
internal U64 fzy_hash_from_string(U64 seed, String8 string);
|
||||
internal U64 fzy_hash_from_params(FZY_Params *params);
|
||||
internal U64 fzy_item_num_from_array_element_idx__linear_search(FZY_ItemArray *array, U64 element_idx);
|
||||
internal String8 fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, FZY_Target target, U64 element_idx);
|
||||
internal String8 fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, RDI_SectionKind target, U64 element_idx);
|
||||
internal FZY_Params fzy_params_copy(Arena *arena, FZY_Params *src);
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -643,6 +643,16 @@ rdi_procedure_from_scope(RDI_Parsed *rdi, RDI_Scope *scope)
|
||||
return procedure;
|
||||
}
|
||||
|
||||
//- global variables
|
||||
|
||||
RDI_PROC RDI_GlobalVariable *
|
||||
rdi_global_variable_from_voff(RDI_Parsed *rdi, RDI_U64 voff)
|
||||
{
|
||||
RDI_U32 idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_GlobalVMap, voff);
|
||||
RDI_GlobalVariable *gvar = rdi_element_from_name_idx(rdi, GlobalVariables, idx);
|
||||
return gvar;
|
||||
}
|
||||
|
||||
//- units
|
||||
|
||||
RDI_PROC RDI_Unit *
|
||||
|
||||
@@ -191,6 +191,9 @@ RDI_PROC RDI_U64 rdi_opl_voff_from_scope(RDI_Parsed *rdi, RDI_Scope *scope);
|
||||
RDI_PROC RDI_Scope *rdi_scope_from_voff(RDI_Parsed *rdi, RDI_U64 voff);
|
||||
RDI_PROC RDI_Procedure *rdi_procedure_from_scope(RDI_Parsed *rdi, RDI_Scope *scope);
|
||||
|
||||
//- global variables
|
||||
RDI_PROC RDI_GlobalVariable *rdi_global_variable_from_voff(RDI_Parsed *rdi, RDI_U64 voff);
|
||||
|
||||
//- units
|
||||
RDI_PROC RDI_Unit *rdi_unit_from_voff(RDI_Parsed *rdi, RDI_U64 voff);
|
||||
RDI_PROC RDI_LineTable *rdi_line_table_from_unit(RDI_Parsed *rdi, RDI_Unit *unit);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_VERSION_PATCH 12
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "The RAD Debugger"
|
||||
#define OS_FEATURE_GRAPHICAL 1
|
||||
@@ -50,12 +50,12 @@
|
||||
#include "rdi_from_pdb/rdi_from_pdb.h"
|
||||
#include "regs/regs.h"
|
||||
#include "regs/rdi/regs_rdi.h"
|
||||
#include "type_graph/type_graph.h"
|
||||
//#include "type_graph/type_graph.h"
|
||||
#include "dbgi/dbgi.h"
|
||||
#include "dasm_cache/dasm_cache.h"
|
||||
#include "fuzzy_search/fuzzy_search.h"
|
||||
#include "demon/demon_inc.h"
|
||||
#include "eval/eval_inc.h"
|
||||
//#include "eval/eval_inc.h"
|
||||
#include "eval2/eval2.h"
|
||||
#include "ctrl/ctrl_inc.h"
|
||||
#include "font_provider/font_provider_inc.h"
|
||||
@@ -91,12 +91,12 @@
|
||||
#include "rdi_from_pdb/rdi_from_pdb.c"
|
||||
#include "regs/regs.c"
|
||||
#include "regs/rdi/regs_rdi.c"
|
||||
#include "type_graph/type_graph.c"
|
||||
//#include "type_graph/type_graph.c"
|
||||
#include "dbgi/dbgi.c"
|
||||
#include "dasm_cache/dasm_cache.c"
|
||||
#include "fuzzy_search/fuzzy_search.c"
|
||||
#include "demon/demon_inc.c"
|
||||
#include "eval/eval_inc.c"
|
||||
//#include "eval/eval_inc.c"
|
||||
#include "eval2/eval2.c"
|
||||
#include "ctrl/ctrl_inc.c"
|
||||
#include "font_provider/font_provider_inc.c"
|
||||
@@ -360,8 +360,7 @@ entry_point(CmdLine *cmd_line)
|
||||
if(!df_cmd_spec_is_nil(cmd_spec))
|
||||
{
|
||||
DF_CmdParams params = df_cmd_params_from_window(dst_window);
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_window(dst_window);
|
||||
String8 error = df_cmd_params_apply_spec_query(scratch.arena, &ctrl_ctx, ¶ms, cmd_spec, df_cmd_arg_part_from_string(msg));
|
||||
String8 error = df_cmd_params_apply_spec_query(scratch.arena, ¶ms, cmd_spec, df_cmd_arg_part_from_string(msg));
|
||||
if(error.size == 0)
|
||||
{
|
||||
df_push_cmd__root(¶ms, cmd_spec);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_VERSION_PATCH 12
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "rdi_breakpad_from_pdb"
|
||||
#define BUILD_CONSOLE_INTERFACE 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_VERSION_PATCH 12
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "rdi_dump"
|
||||
#define BUILD_CONSOLE_INTERFACE 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_VERSION_PATCH 12
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "rdi_from_dwarf"
|
||||
#define BUILD_CONSOLE_INTERFACE 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#define BUILD_VERSION_MAJOR 0
|
||||
#define BUILD_VERSION_MINOR 9
|
||||
#define BUILD_VERSION_PATCH 11
|
||||
#define BUILD_VERSION_PATCH 12
|
||||
#define BUILD_RELEASE_PHASE_STRING_LITERAL "ALPHA"
|
||||
#define BUILD_TITLE "rdi_from_pdb"
|
||||
#define BUILD_CONSOLE_INTERFACE 1
|
||||
|
||||
Reference in New Issue
Block a user