mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
fix duplicate nil local, equip locals with their scopes as symbol containers
This commit is contained in:
+12
-9
@@ -1134,10 +1134,16 @@ lane_sync(); if(flags & (1ull<<(kind))) ProfScope(rdi_name_title_from_dump_subse
|
||||
RDI_Symbol *symbol = &v[idx];
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
dumpf("\n '%S': // %S[%I64u]\n {\n", str8_from_rdi_string_idx(rdi, symbol->name_string_idx), table_name, idx);
|
||||
dumpf(" link_name: '%S'\n", str8_from_rdi_string_idx(rdi, symbol->link_name_string_idx));
|
||||
dumpf(" type_idx: %u\n", symbol->type_idx);
|
||||
dumpf(" root_scope_idx: %u\n", symbol->root_scope_idx);
|
||||
dumpf(" container_idx: %u\n", symbol->container_idx);
|
||||
dumpf(" type_idx: %u\n", symbol->type_idx);
|
||||
if(symbol->link_name_string_idx != 0)
|
||||
{
|
||||
dumpf(" link_name: '%S'\n", str8_from_rdi_string_idx(rdi, symbol->link_name_string_idx));
|
||||
}
|
||||
if(symbol->root_scope_idx != 0)
|
||||
{
|
||||
dumpf(" root_scope_idx: %u\n", symbol->root_scope_idx);
|
||||
}
|
||||
dumpf(" container_idx: %u\n", symbol->container_idx);
|
||||
// TODO(rjf): location info
|
||||
dumpf(" }\n");
|
||||
scratch_end(scratch);
|
||||
@@ -1185,7 +1191,7 @@ lane_sync(); if(flags & (1ull<<(kind))) ProfScope(rdi_name_title_from_dump_subse
|
||||
}
|
||||
|
||||
// rjf: scope procedure -> name
|
||||
String8 procedure_name = str8_from_rdi_string_idx(rdi, rdi_element_from_name_idx(rdi, Procedures, scope->proc_idx)->name_string_idx);
|
||||
String8 procedure_name = str8_from_rdi_string_idx(rdi, rdi_element_from_name_idx(rdi, ProcedureSymbols, scope->proc_idx)->name_string_idx);
|
||||
if(procedure_name.size == 0)
|
||||
{
|
||||
procedure_name = str8_lit("???");
|
||||
@@ -1220,10 +1226,7 @@ lane_sync(); if(flags & (1ull<<(kind))) ProfScope(rdi_name_title_from_dump_subse
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
RDI_Symbol *local_ptr = &locals[local_idx];
|
||||
dumpf("%.*s '%S': // local[%u]\n", depth*2, indent.str, str8_from_rdi_string_idx(rdi, local_ptr->name_string_idx), local_idx);
|
||||
dumpf("%.*s {\n", depth*2, indent.str);
|
||||
dumpf("%.*s type_idx: %u\n", depth*2, indent.str, local_ptr->type_idx);
|
||||
dumpf("%.*s }\n", depth*2, indent.str);
|
||||
dumpf("%.*s '%S': {type_idx: %u} // local_variable #%u\n", depth*2, indent.str, str8_from_rdi_string_idx(rdi, local_ptr->name_string_idx), local_ptr->type_idx, local_idx);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3819,8 +3819,8 @@ p2r_convert(Arena *arena, P2R_ConvertParams *params)
|
||||
RDIM_Symbol *local = rdim_symbol_chunk_list_push(arena, &scope->locals, 8);
|
||||
{
|
||||
local->is_param = !!(slocal->flags & CV_LocalFlag_Param);
|
||||
local->name = name;
|
||||
local->type = type;
|
||||
local->name = name;
|
||||
local->type = type;
|
||||
}
|
||||
|
||||
#if 0 // TODO(rjf): @locpass
|
||||
|
||||
@@ -3066,7 +3066,7 @@ rdim_bake(Arena *arena, RDIM_BakeParams *params)
|
||||
}
|
||||
if(lane_idx() == lane_from_task_idx(2))
|
||||
{
|
||||
baked_scopes->arranged_locals_chunk.count = scope_layout->total_local_count;
|
||||
baked_scopes->arranged_locals_chunk.count = scope_layout->total_local_count - 1;
|
||||
baked_scopes->arranged_locals_chunk.cap = baked_scopes->arranged_locals_chunk.count;
|
||||
baked_scopes->arranged_locals_chunk.base_idx = 0;
|
||||
baked_scopes->arranged_locals_chunk.v = push_array(scratch.arena, RDIM_Symbol, baked_scopes->arranged_locals_chunk.count);
|
||||
@@ -3105,16 +3105,14 @@ rdim_bake(Arena *arena, RDIM_BakeParams *params)
|
||||
for EachIndex(src_local_idx, src_local_n->count)
|
||||
{
|
||||
RDIM_Symbol *src_local = &src_local_n->v[src_local_idx];
|
||||
RDIM_Symbol *dst_local = &baked_scopes->arranged_locals_chunk.v[chunk_local_off];
|
||||
RDIM_Symbol *dst_local = &baked_scopes->arranged_locals_chunk.v[chunk_local_off - 1];
|
||||
dst_local->chunk = &baked_scopes->arranged_locals_chunk;
|
||||
dst_local->is_extern = src_local->is_extern;
|
||||
dst_local->is_param = src_local->is_param;
|
||||
dst_local->name = src_local->name;
|
||||
dst_local->link_name = src_local->link_name;
|
||||
dst_local->type = src_local->type;
|
||||
dst_local->container_scope = src_local->container_scope;
|
||||
dst_local->container_type = src_local->container_type;
|
||||
dst_local->container_namespace = src_local->container_namespace;
|
||||
dst_local->container_scope = src_scope;
|
||||
dst_local->root_scope = src_local->root_scope;
|
||||
dst_local->location_cases = src_local->location_cases;
|
||||
chunk_local_off += 1;
|
||||
|
||||
Reference in New Issue
Block a user