use fully qualified symbol names when doing dbg info searches & when producing strings in debug info table evals

This commit is contained in:
Ryan Fleury
2026-04-22 16:24:23 -07:00
parent 0d3539d707
commit a027a0ea16
2 changed files with 9 additions and 37 deletions
+4 -27
View File
@@ -1152,27 +1152,7 @@ di_search_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out, U64 *
void *table_base = rdi_section_raw_table_from_kind(rdi, section_kind, &element_count); void *table_base = rdi_section_raw_table_from_kind(rdi, section_kind, &element_count);
U64 element_size = rdi_section_element_size_table[section_kind]; U64 element_size = rdi_section_element_size_table[section_kind];
// rjf: determine name string index offset, depending on table kind // rjf: do search
U64 element_name_idx_off = 0;
switch(section_kind)
{
default:{}break;
case RDI_SectionKind_Procedures:
case RDI_SectionKind_GlobalVariables:
case RDI_SectionKind_ThreadVariables:
{
element_name_idx_off = OffsetOf(RDI_Symbol, name_string_idx);
}break;
case RDI_SectionKind_UDTs:
{
// NOTE(rjf): name must be determined from self_type_idx
}break;
case RDI_SectionKind_SourceFiles:
{
// NOTE(rjf): name must be determined from file path node chain
}break;
}
Rng1U64 range = lane_range(element_count); Rng1U64 range = lane_range(element_count);
for EachInRange(idx, range) for EachInRange(idx, range)
{ {
@@ -1191,8 +1171,7 @@ di_search_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out, U64 *
{ {
RDI_UDT *udt = (RDI_UDT *)element; RDI_UDT *udt = (RDI_UDT *)element;
RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx); RDI_TypeNode *type_node = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx);
name.str = rdi_string_from_idx(rdi, type_node->user_defined.name_string_idx, &name.size); name = fully_qualified_from_rdi_string_and_container(arena, rdi, type_node->user_defined.name_string_idx, udt->container_idx, udt->container_flags);
name = str8_copy(arena, name);
}break; }break;
case RDI_SectionKind_SourceFiles: case RDI_SectionKind_SourceFiles:
{ {
@@ -1214,10 +1193,8 @@ di_search_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out, U64 *
}break; }break;
default: default:
{ {
U32 name_idx = *(U32 *)((U8 *)element + element_name_idx_off); RDI_Symbol *symbol = (RDI_Symbol *)element;
U64 name_size = 0; name = fully_qualified_str8_from_rdi_symbol(arena, rdi, symbol);
U8 *name_base = rdi_string_from_idx(rdi, name_idx, &name_size);
name = str8(name_base, name_size);
}break; }break;
} }
if(name.size == 0) { continue; } if(name.size == 0) { continue; }
+2 -7
View File
@@ -1812,17 +1812,12 @@ E_TYPE_EXPAND_RANGE_FUNCTION_DEF(debug_info_table)
case RDI_SectionKind_Constants: case RDI_SectionKind_Constants:
{ {
RDI_Symbol *symbol = (RDI_Symbol *)rdi_section_raw_element_from_kind_idx(rdi, accel->section, element_idx); RDI_Symbol *symbol = (RDI_Symbol *)rdi_section_raw_element_from_kind_idx(rdi, accel->section, element_idx);
String8 symbol_name = {0}; item_string = fully_qualified_str8_from_rdi_symbol(scratch.arena, rdi, symbol);
symbol_name.str = rdi_string_from_idx(rdi, symbol->name_string_idx, &symbol_name.size);
item_string = symbol_name;
}break; }break;
case RDI_SectionKind_UDTs: case RDI_SectionKind_UDTs:
{ {
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, element_idx); 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); item_string = fully_qualified_str8_from_rdi_udt(scratch.arena, rdi, udt);
String8 name = {0};
name.str = rdi_string_from_idx(rdi, type_node->user_defined.name_string_idx, &name.size);
item_string = name;
}break; }break;
case RDI_SectionKind_SourceFiles: case RDI_SectionKind_SourceFiles:
{ {