dedup multiple unwinder paths; just collapse down to using the ctrl one

This commit is contained in:
Ryan Fleury
2024-02-05 14:06:06 -08:00
parent ef317c1ffc
commit 95b8b71322
5 changed files with 32 additions and 151 deletions
+7 -4
View File
@@ -3498,9 +3498,9 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
if(df_icon_buttonf(DF_IconKind_Clipboard, "Copy Call Stack").clicked)
{
DF_Entity *process = df_entity_ancestor_from_kind(entity, DF_EntityKind_Process);
DF_Unwind unwind = df_query_cached_unwind_from_thread(entity);
CTRL_Unwind unwind = df_query_cached_unwind_from_thread(entity);
String8List lines = {0};
for(DF_UnwindFrame *frame = unwind.first; frame != 0; frame = frame->next)
for(CTRL_UnwindFrame *frame = unwind.first; frame != 0; frame = frame->next)
{
U64 rip_vaddr = frame->rip;
DF_Entity *module = df_module_from_process_vaddr(process, rip_vaddr);
@@ -8681,8 +8681,8 @@ df_entity_tooltips(DF_Entity *entity)
}
ui_spacer(ui_em(1.5f, 1.f));
DF_Entity *process = df_entity_ancestor_from_kind(entity, DF_EntityKind_Process);
DF_Unwind unwind = df_query_cached_unwind_from_thread(entity);
for(DF_UnwindFrame *frame = unwind.first; frame != 0; frame = frame->next)
CTRL_Unwind unwind = df_query_cached_unwind_from_thread(entity);
for(CTRL_UnwindFrame *frame = unwind.first; frame != 0; frame = frame->next)
{
U64 rip_vaddr = frame->rip;
DF_Entity *module = df_module_from_process_vaddr(process, rip_vaddr);
@@ -8869,6 +8869,9 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam
{
ui_label(str8_lit("(Disabled)"));
}
if(entity->kind == DF_EntityKind_Thread)
{
}
}
//- rjf: do interaction on main box
+4 -4
View File
@@ -4042,7 +4042,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
{
thread_color = df_rgba_from_entity(thread);
}
DF_Unwind unwind = df_query_cached_unwind_from_thread(thread);
CTRL_Unwind unwind = df_query_cached_unwind_from_thread(thread);
//- rjf: grab state
typedef struct DF_CallStackViewState DF_CallStackViewState;
@@ -4102,7 +4102,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
//- rjf: frame rows
U64 frame_idx = 0;
for(DF_UnwindFrame *frame = unwind.first; frame != 0; frame = frame->next, frame_idx += 1)
for(CTRL_UnwindFrame *frame = unwind.first; frame != 0; frame = frame->next, frame_idx += 1)
{
// rjf: out of range -> skip (TODO(rjf): this should be an array...)
if(frame_idx+1 < visible_row_range.min || visible_row_range.max < frame_idx+1)
@@ -7751,13 +7751,13 @@ DF_VIEW_UI_FUNCTION_DEF(Memory)
};
AnnotationList *visible_memory_annotations = push_array(scratch.arena, AnnotationList, visible_memory_size);
{
DF_Unwind unwind = df_query_cached_unwind_from_thread(thread);
CTRL_Unwind unwind = df_query_cached_unwind_from_thread(thread);
//- rjf: fill unwind frame annotations
if(unwind.first != 0)
{
U64 last_stack_top = regs_rsp_from_arch_block(thread->arch, unwind.first->regs);
for(DF_UnwindFrame *f = unwind.first->next; f != 0; f = f->next)
for(CTRL_UnwindFrame *f = unwind.first->next; f != 0; f = f->next)
{
U64 f_stack_top = regs_rsp_from_arch_block(thread->arch, f->regs);
Rng1U64 frame_vaddr_range = r1u64(last_stack_top, f_stack_top);