fix incorrect ordering of inline sites & concrete frames in call stack view

This commit is contained in:
Ryan Fleury
2024-10-18 16:07:25 -07:00
parent 3aa4b2ea03
commit 669574df5a
+23 -10
View File
@@ -1088,23 +1088,36 @@ rd_string_from_eval_viz_row_column(Arena *arena, EV_View *ev, EV_Row *row, RD_Wa
RDI_Parsed *rdi = di_rdi_from_key(di_scope, &dbgi, 0); RDI_Parsed *rdi = di_rdi_from_key(di_scope, &dbgi, 0);
if(rdi != &di_rdi_parsed_nil) if(rdi != &di_rdi_parsed_nil)
{ {
typedef struct ScopeTask ScopeTask;
struct ScopeTask
{
ScopeTask *next;
RDI_Scope *scope;
};
U64 voff = ctrl_voff_from_vaddr(module, vaddr); U64 voff = ctrl_voff_from_vaddr(module, vaddr);
RDI_Scope *scope = rdi_scope_from_voff(rdi, voff); RDI_Scope *root_scope = rdi_scope_from_voff(rdi, voff);
RDI_Procedure *procedure = rdi_procedure_from_scope(rdi, scope); ScopeTask start_task = {0, root_scope};
RDI_InlineSite *inline_site = rdi_inline_site_from_scope(rdi, scope); ScopeTask *first_task = &start_task;
for(U64 d = 0; d < depth;) ScopeTask *last_task = &start_task;
for(;root_scope->parent_scope_idx != 0;)
{ {
scope = rdi_parent_from_scope(rdi, scope); root_scope = rdi_parent_from_scope(rdi, root_scope);
inline_site = rdi_inline_site_from_scope(rdi, scope); ScopeTask *t = push_array(scratch.arena, ScopeTask, 1);
if(scope->inline_site_idx != 0) SLLQueuePushFront(first_task, last_task, t);
{ t->scope = root_scope;
d += 1;
} }
if(scope->parent_scope_idx == 0) RDI_Scope *scope = root_scope;
U64 idx = 0;
for(ScopeTask *t = first_task; t != 0; t = t->next, idx += 1)
{ {
if(idx == depth)
{
scope = t->scope;
break; break;
} }
} }
RDI_Procedure *procedure = rdi_procedure_from_scope(rdi, scope);
RDI_InlineSite *inline_site = rdi_inline_site_from_scope(rdi, scope);
if(inline_site->name_string_idx != 0 || inline_site->type_idx != 0) if(inline_site->name_string_idx != 0 || inline_site->type_idx != 0)
{ {
String8List parts = {0}; String8List parts = {0};