mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-12 23:31:38 -07:00
switch eval viz stringification, and lister completions, over to working correctly with process-less (but not debug-info-less) evaluations
This commit is contained in:
@@ -760,6 +760,18 @@ e_dbg_info_from_module(E_Module *module)
|
||||
return result;
|
||||
}
|
||||
|
||||
internal E_DbgInfo *
|
||||
e_dbg_info_from_type_key(E_TypeKey type_key)
|
||||
{
|
||||
E_DbgInfo *result = &e_dbg_info_nil;
|
||||
if(type_key.kind == E_TypeKeyKind_Ext &&
|
||||
0 < type_key.u32[2] && type_key.u32[2] <= e_base_ctx->dbg_infos_count)
|
||||
{
|
||||
result = &e_base_ctx->dbg_infos[type_key.u32[2]-1];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Cache Accessing Functions
|
||||
|
||||
|
||||
@@ -174,8 +174,8 @@ struct E_TypeKey
|
||||
E_TypeKeyKind kind;
|
||||
U32 u32[3];
|
||||
// [0] -> E_TypeKind (Basic, Cons, Ext); Arch (Reg, RegAlias)
|
||||
// [1] -> Type Index In RDI (Ext); Code (Reg, RegAlias); Type Index In Constructed (Cons)
|
||||
// [2] -> RDI Index (Ext)
|
||||
// [1] -> Type Index In Debug Info (Ext); Code (Reg, RegAlias); Type Index In Constructed (Cons)
|
||||
// [2] -> Debug Info Number (Ext)
|
||||
};
|
||||
|
||||
typedef struct E_TypeKeyNode E_TypeKeyNode;
|
||||
@@ -1222,6 +1222,7 @@ internal void e_select_ir_ctx(E_IRCtx *ctx);
|
||||
//~ rjf: Context Accessors
|
||||
|
||||
internal E_DbgInfo *e_dbg_info_from_module(E_Module *module);
|
||||
internal E_DbgInfo *e_dbg_info_from_type_key(E_TypeKey type_key);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Base Cache Accessing Functions
|
||||
|
||||
@@ -1915,6 +1915,15 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
||||
}
|
||||
}
|
||||
E_DbgInfo *dbg_info = e_dbg_info_from_module(module);
|
||||
if(dbg_info == &e_dbg_info_nil)
|
||||
{
|
||||
dbg_info = e_dbg_info_from_type_key(type_key);
|
||||
}
|
||||
U32 dbg_info_num = 0;
|
||||
if(dbg_info != &e_dbg_info_nil)
|
||||
{
|
||||
dbg_info_num = (U32)(dbg_info - e_base_ctx->dbg_infos) + 1;
|
||||
}
|
||||
RDI_Parsed *rdi = dbg_info->rdi;
|
||||
U64 voff = vaddr - module->vaddr_range.min;
|
||||
B32 good_symbol_match = 0;
|
||||
@@ -1964,7 +1973,7 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
||||
if(inline_site != 0)
|
||||
{
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, inline_site->type_idx);
|
||||
E_TypeKey type = e_type_key_ext(e_type_kind_from_rdi(type_node->kind), inline_site->type_idx, module->dbg_info_num);
|
||||
E_TypeKey type = e_type_key_ext(e_type_kind_from_rdi(type_node->kind), inline_site->type_idx, dbg_info_num);
|
||||
String8 name = {0};
|
||||
name.str = rdi_string_from_idx(rdi, inline_site->name_string_idx, &name.size);
|
||||
if(inline_site->type_idx != 0)
|
||||
@@ -1994,7 +2003,7 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
||||
U64 proc_idx = scope->proc_idx;
|
||||
RDI_Procedure *procedure = rdi_element_from_name_idx(rdi, Procedures, proc_idx);
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, procedure->type_idx);
|
||||
E_TypeKey type = e_type_key_ext(e_type_kind_from_rdi(type_node->kind), procedure->type_idx, module->dbg_info_num);
|
||||
E_TypeKey type = e_type_key_ext(e_type_kind_from_rdi(type_node->kind), procedure->type_idx, dbg_info_num);
|
||||
String8 name = {0};
|
||||
name.str = rdi_string_from_idx(rdi, procedure->name_string_idx, &name.size);
|
||||
if(procedure->type_idx != 0)
|
||||
|
||||
@@ -2224,11 +2224,22 @@ rd_view_ui(Rng2F32 rect)
|
||||
{
|
||||
default:
|
||||
{
|
||||
U64 vaddr = eval.value.u64;
|
||||
CTRL_Entity *process = rd_ctrl_entity_from_eval_space(eval.space);
|
||||
CTRL_Entity *module = ctrl_module_from_process_vaddr(process, vaddr);
|
||||
DI_Key dbgi_key = ctrl_dbgi_key_from_module(module);
|
||||
U64 voff = ctrl_voff_from_vaddr(module, vaddr);
|
||||
U64 voff = 0;
|
||||
DI_Key dbgi_key = {0};
|
||||
if(eval.space.kind == CTRL_EvalSpaceKind_Entity)
|
||||
{
|
||||
U64 vaddr = eval.value.u64;
|
||||
CTRL_Entity *process = rd_ctrl_entity_from_eval_space(eval.space);
|
||||
CTRL_Entity *module = ctrl_module_from_process_vaddr(process, vaddr);
|
||||
dbgi_key = ctrl_dbgi_key_from_module(module);
|
||||
voff = ctrl_voff_from_vaddr(module, vaddr);
|
||||
}
|
||||
else
|
||||
{
|
||||
voff = eval.value.u64;
|
||||
E_DbgInfo *dbg_info = e_dbg_info_from_type_key(eval.irtree.type_key);
|
||||
dbgi_key = dbg_info->dbgi_key;
|
||||
}
|
||||
{
|
||||
Access *access = access_open();
|
||||
RDI_Parsed *rdi = di_rdi_from_key(access, dbgi_key, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user