mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-09-24 02:00:05 +00:00
get debugger onto new location info & symbol format
This commit is contained in:
@@ -2284,12 +2284,12 @@ rd_view_ui(Rng2F32 rect)
|
||||
String8 name = {0};
|
||||
if(name.size == 0)
|
||||
{
|
||||
RDI_Procedure *procedure = rdi_procedure_from_voff(rdi, voff);
|
||||
RDI_Symbol *procedure = rdi_procedure_from_voff(rdi, voff);
|
||||
name.str = rdi_name_from_procedure(rdi, procedure, &name.size);
|
||||
}
|
||||
if(name.size == 0)
|
||||
{
|
||||
RDI_GlobalVariable *gvar = rdi_global_variable_from_voff(rdi, voff);
|
||||
RDI_Symbol *gvar = rdi_global_variable_from_voff(rdi, voff);
|
||||
name.str = rdi_string_from_idx(rdi, gvar->name_string_idx, &name.size);
|
||||
}
|
||||
if(name.size != 0)
|
||||
@@ -2370,12 +2370,12 @@ rd_view_ui(Rng2F32 rect)
|
||||
RDI_Parsed *rdi = di_rdi_from_key(access, dbgi_key, 1, 0);
|
||||
if(name.size == 0)
|
||||
{
|
||||
RDI_Procedure *procedure = rdi_procedure_from_voff(rdi, voff);
|
||||
RDI_Symbol *procedure = rdi_procedure_from_voff(rdi, voff);
|
||||
name.str = rdi_name_from_procedure(rdi, procedure, &name.size);
|
||||
}
|
||||
if(name.size == 0)
|
||||
{
|
||||
RDI_GlobalVariable *gvar = rdi_global_variable_from_voff(rdi, voff);
|
||||
RDI_Symbol *gvar = rdi_global_variable_from_voff(rdi, voff);
|
||||
name.str = rdi_string_from_idx(rdi, gvar->name_string_idx, &name.size);
|
||||
}
|
||||
access_close(access);
|
||||
@@ -9508,9 +9508,9 @@ rd_code_color_slot_from_txt_token_kind_lookup_string(TXT_TokenKind kind, String8
|
||||
switch(section_kind)
|
||||
{
|
||||
default:{mapped = 0;}break;
|
||||
case RDI_SectionKind_Procedures:
|
||||
case RDI_SectionKind_GlobalVariables:
|
||||
case RDI_SectionKind_ThreadVariables:
|
||||
case RDI_SectionKind_ProcedureSymbols:
|
||||
case RDI_SectionKind_GlobalVariableSymbols:
|
||||
case RDI_SectionKind_ThreadVariableSymbols:
|
||||
{
|
||||
color = RD_CodeColorSlot_CodeSymbol;
|
||||
}break;
|
||||
@@ -14060,13 +14060,13 @@ rd_frame(void)
|
||||
{
|
||||
match = di_match_from_string(name, 0, di_key_zero(), rd_state->frame_eval_memread_endt_us);
|
||||
}
|
||||
if(match.section_kind == RDI_SectionKind_Procedures)
|
||||
if(match.section_kind == RDI_SectionKind_ProcedureSymbols)
|
||||
{
|
||||
Access *access = access_open();
|
||||
{
|
||||
name_resolved = 1;
|
||||
RDI_Parsed *rdi = di_rdi_from_key(access, match.key, 0, 0);
|
||||
RDI_Procedure *procedure = rdi_element_from_name_idx(rdi, Procedures, match.idx);
|
||||
RDI_Symbol *procedure = rdi_element_from_name_idx(rdi, ProcedureSymbols, match.idx);
|
||||
voff = rdi_first_voff_from_procedure(rdi, procedure);
|
||||
voff_dbgi_key = match.key;
|
||||
}
|
||||
|
||||
+10
-28
@@ -1751,10 +1751,10 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(debug_info_table)
|
||||
E_TypeKey lhs_type_key = eval.irtree.type_key;
|
||||
E_Type *lhs_type = e_type_from_key(lhs_type_key);
|
||||
if(0){}
|
||||
else if(str8_match(lhs_type->name, str8_lit("procedures"), 0)) {section = RDI_SectionKind_Procedures;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("globals"), 0)) {section = RDI_SectionKind_GlobalVariables;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("thread_locals"), 0)) {section = RDI_SectionKind_ThreadVariables;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("constants"), 0)) {section = RDI_SectionKind_Constants;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("procedures"), 0)) {section = RDI_SectionKind_ProcedureSymbols;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("globals"), 0)) {section = RDI_SectionKind_GlobalVariableSymbols;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("thread_locals"), 0)) {section = RDI_SectionKind_ThreadVariableSymbols;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("constants"), 0)) {section = RDI_SectionKind_ConstantSymbols;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("types"), 0)) {section = RDI_SectionKind_UDTs;}
|
||||
else if(str8_match(lhs_type->name, str8_lit("source_files"), 0)) {section = RDI_SectionKind_SourceFiles;}
|
||||
}
|
||||
@@ -1806,32 +1806,14 @@ E_TYPE_EXPAND_RANGE_FUNCTION_DEF(debug_info_table)
|
||||
switch(accel->section)
|
||||
{
|
||||
default:{}break;
|
||||
case RDI_SectionKind_Procedures:
|
||||
case RDI_SectionKind_ProcedureSymbols:
|
||||
case RDI_SectionKind_GlobalVariableSymbols:
|
||||
case RDI_SectionKind_ThreadVariableSymbols:
|
||||
case RDI_SectionKind_ConstantSymbols:
|
||||
{
|
||||
RDI_Procedure *procedure = rdi_element_from_name_idx(rdi, Procedures, element_idx);
|
||||
RDI_Symbol *symbol = (RDI_Symbol *)rdi_section_raw_element_from_kind_idx(rdi, accel->section, element_idx);
|
||||
String8 symbol_name = {0};
|
||||
symbol_name.str = rdi_string_from_idx(rdi, procedure->name_string_idx, &symbol_name.size);
|
||||
item_string = symbol_name;
|
||||
}break;
|
||||
case RDI_SectionKind_GlobalVariables:
|
||||
{
|
||||
RDI_GlobalVariable *gvar = rdi_element_from_name_idx(rdi, GlobalVariables, element_idx);
|
||||
String8 symbol_name = {0};
|
||||
symbol_name.str = rdi_string_from_idx(rdi, gvar->name_string_idx, &symbol_name.size);
|
||||
item_string = symbol_name;
|
||||
}break;
|
||||
case RDI_SectionKind_ThreadVariables:
|
||||
{
|
||||
RDI_ThreadVariable *tvar = rdi_element_from_name_idx(rdi, ThreadVariables, element_idx);
|
||||
String8 symbol_name = {0};
|
||||
symbol_name.str = rdi_string_from_idx(rdi, tvar->name_string_idx, &symbol_name.size);
|
||||
item_string = symbol_name;
|
||||
}break;
|
||||
case RDI_SectionKind_Constants:
|
||||
{
|
||||
RDI_Constant *cnst = rdi_element_from_name_idx(rdi, Constants, element_idx);
|
||||
String8 symbol_name = {0};
|
||||
symbol_name.str = rdi_string_from_idx(rdi, cnst->name_string_idx, &symbol_name.size);
|
||||
symbol_name.str = rdi_string_from_idx(rdi, symbol->name_string_idx, &symbol_name.size);
|
||||
item_string = symbol_name;
|
||||
}break;
|
||||
case RDI_SectionKind_UDTs:
|
||||
|
||||
@@ -3313,7 +3313,7 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
|
||||
U64 f_rip_voff = ctrl_voff_from_vaddr(module, f_rip_vaddr);
|
||||
DI_Key dbgi_key = ctrl_dbgi_key_from_module(module);
|
||||
RDI_Parsed *rdi = di_rdi_from_key(access, dbgi_key, 0, 0);
|
||||
RDI_Procedure *procedure = rdi_procedure_from_voff(rdi, f_rip_voff);
|
||||
RDI_Symbol *procedure = rdi_procedure_from_voff(rdi, f_rip_voff);
|
||||
String8 procedure_name = {0};
|
||||
procedure_name.str = rdi_string_from_idx(rdi, procedure->name_string_idx, &procedure_name.size);
|
||||
access_close(access);
|
||||
@@ -3358,7 +3358,7 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
|
||||
U64 voff = ctrl_voff_from_vaddr(module, vaddr);
|
||||
DI_Key dbgi_key = ctrl_dbgi_key_from_module(module);
|
||||
RDI_Parsed *rdi = di_rdi_from_key(access, dbgi_key, 0, 0);
|
||||
RDI_Procedure *procedure = rdi_procedure_from_voff(rdi, voff);
|
||||
RDI_Symbol *procedure = rdi_procedure_from_voff(rdi, voff);
|
||||
RDI_Scope *root_scope = rdi_element_from_name_idx(rdi, Scopes, procedure->root_scope_idx);
|
||||
if(procedure->root_scope_idx != 0)
|
||||
{
|
||||
@@ -3416,11 +3416,12 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
|
||||
E_DbgInfo *dbg_info = e_dbg_info_from_module(module);
|
||||
DI_Key dbgi_key = dbg_info->dbgi_key;
|
||||
RDI_Parsed *rdi = di_rdi_from_key(access, dbgi_key, 0, 0);
|
||||
RDI_GlobalVariable *gvar = rdi_global_variable_from_voff(rdi, voff);
|
||||
if(gvar->voff != 0)
|
||||
RDI_Symbol *gvar = rdi_global_variable_from_voff(rdi, voff);
|
||||
U64 gvar_voff = rdi_voff_from_location(gvar->location);
|
||||
if(gvar_voff != 0)
|
||||
{
|
||||
RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, gvar->type_idx);
|
||||
Rng1U64 voff_range = r1u64(gvar->voff, gvar->voff + type_node->byte_size);
|
||||
Rng1U64 voff_range = r1u64(gvar_voff, gvar_voff + type_node->byte_size);
|
||||
Rng1U64 vaddr_range = r1u64(voff_range.min + module->vaddr_range.min, voff_range.max + module->vaddr_range.min);
|
||||
next_vaddr = vaddr_range.max;
|
||||
next_vaddr = Max(next_vaddr, vaddr+1);
|
||||
|
||||
@@ -567,7 +567,7 @@ rd_title_fstrs_from_ctrl_entity(Arena *arena, CTRL_Entity *entity, B32 include_e
|
||||
RDI_Parsed *rdi = di_rdi_from_key(access, dbgi_key, 0, 0);
|
||||
if(rdi != &rdi_parsed_nil)
|
||||
{
|
||||
RDI_Procedure *procedure = rdi_procedure_from_voff(rdi, rip_voff);
|
||||
RDI_Symbol *procedure = rdi_procedure_from_voff(rdi, rip_voff);
|
||||
name.str = rdi_string_from_idx(rdi, procedure->name_string_idx, &name.size);
|
||||
name = push_str8_copy(arena, name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user