mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-23 07:57:50 +00:00
proper inline frame unwind selection & storage & command parameterization
This commit is contained in:
+64
-54
@@ -522,13 +522,15 @@ df_cmd_params_from_window(DF_Window *window)
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_View);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_PreferDisassembly);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Index);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_BaseUnwindIndex);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_InlineUnwindIndex);
|
||||
p.window = df_handle_from_window(window);
|
||||
p.panel = df_handle_from_panel(window->focused_panel);
|
||||
p.view = df_handle_from_view(df_selected_tab_from_panel(window->focused_panel));
|
||||
p.prefer_dasm = df_prefer_dasm_from_window(window);
|
||||
p.entity = ctrl_ctx.thread;
|
||||
p.index = ctrl_ctx.unwind_count;
|
||||
p.base_unwind_index = ctrl_ctx.unwind_count;
|
||||
p.inline_unwind_index = ctrl_ctx.inline_unwind_count;
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -542,13 +544,15 @@ df_cmd_params_from_panel(DF_Window *window, DF_Panel *panel)
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_View);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_PreferDisassembly);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Index);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_BaseUnwindIndex);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_InlineUnwindIndex);
|
||||
p.window = df_handle_from_window(window);
|
||||
p.panel = df_handle_from_panel(panel);
|
||||
p.view = df_handle_from_view(df_selected_tab_from_panel(panel));
|
||||
p.prefer_dasm = df_prefer_dasm_from_window(window);
|
||||
p.entity = ctrl_ctx.thread;
|
||||
p.index = ctrl_ctx.unwind_count;
|
||||
p.base_unwind_index = ctrl_ctx.unwind_count;
|
||||
p.inline_unwind_index = ctrl_ctx.inline_unwind_count;
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -562,13 +566,15 @@ df_cmd_params_from_view(DF_Window *window, DF_Panel *panel, DF_View *view)
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_View);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_PreferDisassembly);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Index);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_BaseUnwindIndex);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_InlineUnwindIndex);
|
||||
p.window = df_handle_from_window(window);
|
||||
p.panel = df_handle_from_panel(panel);
|
||||
p.view = df_handle_from_view(view);
|
||||
p.prefer_dasm = df_prefer_dasm_from_window(window);
|
||||
p.entity = ctrl_ctx.thread;
|
||||
p.index = ctrl_ctx.unwind_count;
|
||||
p.base_unwind_index = ctrl_ctx.unwind_count;
|
||||
p.inline_unwind_index = ctrl_ctx.inline_unwind_count;
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -635,24 +641,18 @@ df_queue_drag_drop(void)
|
||||
}
|
||||
|
||||
internal void
|
||||
df_set_hovered_line_info(DI_Key *dbgi_key, U64 voff)
|
||||
df_set_rich_hover_info(DF_RichHoverInfo *info)
|
||||
{
|
||||
arena_clear(df_gfx_state->hover_line_arena);
|
||||
df_gfx_state->hover_line_dbgi_key = di_key_copy(df_gfx_state->hover_line_arena, dbgi_key);
|
||||
df_gfx_state->hover_line_voff = voff;
|
||||
df_gfx_state->hover_line_set_this_frame = 1;
|
||||
arena_clear(df_gfx_state->rich_hover_info_next_arena);
|
||||
MemoryCopyStruct(&df_gfx_state->rich_hover_info_next, info);
|
||||
df_gfx_state->rich_hover_info_next.dbgi_key = di_key_copy(df_gfx_state->rich_hover_info_next_arena, &info->dbgi_key);
|
||||
}
|
||||
|
||||
internal DI_Key
|
||||
df_get_hovered_line_info_dbgi_key(void)
|
||||
internal DF_RichHoverInfo
|
||||
df_get_rich_hover_info(void)
|
||||
{
|
||||
return df_gfx_state->hover_line_dbgi_key;
|
||||
}
|
||||
|
||||
internal U64
|
||||
df_get_hovered_line_info_voff(void)
|
||||
{
|
||||
return df_gfx_state->hover_line_voff;
|
||||
DF_RichHoverInfo info = df_gfx_state->rich_hover_info_current;
|
||||
return info;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -1264,8 +1264,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
case DF_CoreCmdKind_SelectThread:goto thread_locator;
|
||||
case DF_CoreCmdKind_SelectThreadWindow:
|
||||
{
|
||||
MemoryZeroStruct(&ws->ctrl_ctx_overrides);
|
||||
ws->ctrl_ctx_overrides.thread = params.entity;
|
||||
ws->ctrl_ctx_overrides.unwind_count = 0;
|
||||
}goto thread_locator;
|
||||
case DF_CoreCmdKind_SelectThreadView:
|
||||
{
|
||||
@@ -1277,8 +1277,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
}
|
||||
if(!df_view_is_nil(view))
|
||||
{
|
||||
MemoryZeroStruct(&view->ctrl_ctx_overrides);
|
||||
view->ctrl_ctx_overrides.thread = params.entity;
|
||||
view->ctrl_ctx_overrides.unwind_count = 0;
|
||||
}
|
||||
}goto thread_locator;
|
||||
case DF_CoreCmdKind_SelectUnwind:
|
||||
@@ -2598,11 +2598,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
{
|
||||
DI_Scope *scope = di_scope_open();
|
||||
DF_Entity *thread = df_entity_from_handle(params.entity);
|
||||
U64 unwind_count = params.index;
|
||||
U64 base_unwind_index = params.base_unwind_index;
|
||||
U64 inline_unwind_index = params.inline_unwind_index;
|
||||
if(thread->kind == DF_EntityKind_Thread)
|
||||
{
|
||||
// rjf: grab rip
|
||||
U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count);
|
||||
U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, base_unwind_index);
|
||||
|
||||
// rjf: extract thread/rip info
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
@@ -2610,7 +2611,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
DI_Key dbgi_key = df_dbgi_key_from_module(module);
|
||||
RDI_Parsed *rdi = di_rdi_from_key(scope, &dbgi_key, 0);
|
||||
U64 rip_voff = df_voff_from_vaddr(module, rip_vaddr);
|
||||
DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff);
|
||||
DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff, inline_unwind_index);
|
||||
|
||||
// rjf: snap to resolved line
|
||||
B32 missing_rip = (rip_vaddr == 0);
|
||||
@@ -2632,11 +2633,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
params.entity = df_handle_from_entity(thread);
|
||||
params.voff = rip_voff;
|
||||
params.vaddr = rip_vaddr;
|
||||
params.index = unwind_count;
|
||||
params.base_unwind_index = base_unwind_index;
|
||||
params.inline_unwind_index = inline_unwind_index;
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualOff);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Index);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_BaseUnwindIndex);
|
||||
df_cmd_list_push(arena, cmds, ¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindCodeLocation));
|
||||
}
|
||||
|
||||
@@ -2647,7 +2649,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
params.entity = df_handle_from_entity(thread);
|
||||
params.voff = rip_voff;
|
||||
params.vaddr = rip_vaddr;
|
||||
params.index = unwind_count;
|
||||
params.base_unwind_index = base_unwind_index;
|
||||
params.inline_unwind_index = inline_unwind_index;
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualOff);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_VirtualAddr);
|
||||
@@ -2669,9 +2672,11 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
DF_Entity *selected_thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_CmdParams params = df_cmd_params_from_window(ws);
|
||||
params.entity = df_handle_from_entity(selected_thread);
|
||||
params.index = ctrl_ctx.unwind_count;
|
||||
params.base_unwind_index = ctrl_ctx.unwind_count;
|
||||
params.inline_unwind_index = ctrl_ctx.inline_unwind_count;
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Index);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_BaseUnwindIndex);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_InlineUnwindIndex);
|
||||
df_cmd_list_push(arena, cmds, ¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FindThread));
|
||||
}break;
|
||||
|
||||
@@ -2804,7 +2809,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
|
||||
// rjf: name resolved to voff * dbg info
|
||||
if(name_resolved != 0 && voff != 0)
|
||||
{
|
||||
DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&voff_dbgi_key, voff);
|
||||
DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&voff_dbgi_key, voff, 0);
|
||||
DF_CmdParams p = params;
|
||||
{
|
||||
p.file_path = df_full_path_from_entity(scratch.arena, dasm2src_info.file);
|
||||
@@ -11566,11 +11571,23 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
if(params->line_src2dasm[line_slice_idx].first != 0 &&
|
||||
params->line_src2dasm[line_slice_idx].first->v.remap_line == mouse_pt.line)
|
||||
{
|
||||
df_set_hovered_line_info(¶ms->line_src2dasm[line_slice_idx].first->v.dbgi_key, params->line_src2dasm[line_slice_idx].first->v.voff_range.min);
|
||||
DF_RichHoverInfo info = {0};
|
||||
info.process = df_handle_from_entity(selected_thread_process);
|
||||
info.vaddr_range = df_vaddr_range_from_voff_range(selected_thread_module, params->line_src2dasm[line_slice_idx].first->v.voff_range);
|
||||
info.module = df_handle_from_entity(selected_thread_module);
|
||||
info.dbgi_key = params->line_src2dasm[line_slice_idx].first->v.dbgi_key;
|
||||
info.voff_range = params->line_src2dasm[line_slice_idx].first->v.voff_range;
|
||||
df_set_rich_hover_info(&info);
|
||||
}
|
||||
if(params->line_dasm2src[line_slice_idx].first != 0)
|
||||
{
|
||||
df_set_hovered_line_info(¶ms->line_dasm2src[line_slice_idx].first->v.dbgi_key, params->line_dasm2src[line_slice_idx].first->v.voff_range.min);
|
||||
DF_RichHoverInfo info = {0};
|
||||
info.process = df_handle_from_entity(selected_thread_process);
|
||||
info.vaddr_range = df_vaddr_range_from_voff_range(selected_thread_module, params->line_dasm2src[line_slice_idx].first->v.voff_range);
|
||||
info.module = df_handle_from_entity(selected_thread_module);
|
||||
info.dbgi_key = params->line_dasm2src[line_slice_idx].first->v.dbgi_key;
|
||||
info.voff_range = params->line_dasm2src[line_slice_idx].first->v.voff_range;
|
||||
df_set_rich_hover_info(&info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11734,8 +11751,9 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
//
|
||||
UI_Parent(text_container_box) ProfScope("build line text") UI_Focus(UI_FocusKind_Off)
|
||||
{
|
||||
DI_Key hovered_line_dbgi_key = df_get_hovered_line_info_dbgi_key();
|
||||
U64 hovered_line_voff = df_get_hovered_line_info_voff();
|
||||
DF_RichHoverInfo rich_hover_info = df_get_rich_hover_info();
|
||||
DI_Key hovered_line_dbgi_key = rich_hover_info.dbgi_key;
|
||||
U64 hovered_line_voff = rich_hover_info.voff_range.min;
|
||||
ui_set_next_pref_height(ui_px(params->line_height_px*(dim_1s64(params->line_num_range)+1), 1.f));
|
||||
UI_WidthFill
|
||||
UI_Column
|
||||
@@ -12029,18 +12047,14 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_
|
||||
// rjf: check dasm2src
|
||||
if(dasm2src_list->first != 0)
|
||||
{
|
||||
DI_Key dbgi_key = dasm2src_list->first->v.dbgi_key;
|
||||
if(di_key_match(&dbgi_key, &dasm2src_list->first->v.dbgi_key))
|
||||
for(DF_TextLineDasm2SrcInfoNode *n = dasm2src_list->first; n != 0; n = n->next)
|
||||
{
|
||||
for(DF_TextLineDasm2SrcInfoNode *n = dasm2src_list->first; n != 0; n = n->next)
|
||||
if(n->v.voff_range.min <= hovered_line_voff &&
|
||||
hovered_line_voff < n->v.voff_range.max)
|
||||
{
|
||||
if(n->v.voff_range.min <= hovered_line_voff &&
|
||||
hovered_line_voff < n->v.voff_range.max)
|
||||
{
|
||||
line_info_line_num = n->v.pt.line;
|
||||
matches = 1;
|
||||
break;
|
||||
}
|
||||
line_info_line_num = n->v.pt.line;
|
||||
matches = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13129,7 +13143,8 @@ df_gfx_init(OS_WindowRepaintFunctionType *window_repaint_entry_point, DF_StateDe
|
||||
df_gfx_state->repaint_hook = window_repaint_entry_point;
|
||||
df_gfx_state->cfg_main_font_path_arena = arena_alloc();
|
||||
df_gfx_state->cfg_code_font_path_arena = arena_alloc();
|
||||
df_gfx_state->hover_line_arena = arena_alloc();
|
||||
df_gfx_state->rich_hover_info_next_arena = arena_alloc();
|
||||
df_gfx_state->rich_hover_info_current_arena = arena_alloc();
|
||||
df_clear_bindings();
|
||||
|
||||
// rjf: register gfx layer views
|
||||
@@ -13236,7 +13251,9 @@ internal void
|
||||
df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
df_gfx_state->hover_line_set_this_frame = 0;
|
||||
arena_clear(df_gfx_state->rich_hover_info_current_arena);
|
||||
MemoryCopyStruct(&df_gfx_state->rich_hover_info_current, &df_gfx_state->rich_hover_info_next);
|
||||
df_gfx_state->rich_hover_info_current.dbgi_key = di_key_copy(df_gfx_state->rich_hover_info_current_arena, &df_gfx_state->rich_hover_info_current.dbgi_key);
|
||||
|
||||
//- rjf: animate confirmation
|
||||
{
|
||||
@@ -14152,13 +14169,6 @@ df_gfx_end_frame(void)
|
||||
MemoryZeroStruct(&df_g_drag_drop_payload);
|
||||
}
|
||||
|
||||
//- rjf: clear hover line info
|
||||
if(df_gfx_state->hover_line_set_this_frame == 0)
|
||||
{
|
||||
MemoryZeroStruct(&df_gfx_state->hover_line_dbgi_key);
|
||||
df_gfx_state->hover_line_voff = 0;
|
||||
}
|
||||
|
||||
//- rjf: clear frame request state
|
||||
if(df_gfx_state->num_frames_requested > 0)
|
||||
{
|
||||
|
||||
+20
-8
@@ -282,6 +282,19 @@ struct DF_DragDropPayload
|
||||
TxtPt text_point;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Rich Hover Types
|
||||
|
||||
typedef struct DF_RichHoverInfo DF_RichHoverInfo;
|
||||
struct DF_RichHoverInfo
|
||||
{
|
||||
DF_Handle process;
|
||||
Rng1U64 vaddr_range;
|
||||
DF_Handle module;
|
||||
Rng1U64 voff_range;
|
||||
DI_Key dbgi_key;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Rule Spec Types
|
||||
|
||||
@@ -719,11 +732,11 @@ struct DF_GfxState
|
||||
// rjf: drag/drop state machine
|
||||
DF_DragDropState drag_drop_state;
|
||||
|
||||
// rjf: hover line info correllation state
|
||||
Arena *hover_line_arena;
|
||||
DI_Key hover_line_dbgi_key;
|
||||
U64 hover_line_voff;
|
||||
B32 hover_line_set_this_frame;
|
||||
// rjf: rich hover info
|
||||
Arena *rich_hover_info_next_arena;
|
||||
Arena *rich_hover_info_current_arena;
|
||||
DF_RichHoverInfo rich_hover_info_next;
|
||||
DF_RichHoverInfo rich_hover_info_current;
|
||||
|
||||
// rjf: running theme state
|
||||
DF_Theme cfg_theme_target;
|
||||
@@ -880,9 +893,8 @@ internal B32 df_drag_drop(DF_DragDropPayload *out_payload);
|
||||
internal void df_drag_kill(void);
|
||||
internal void df_queue_drag_drop(void);
|
||||
|
||||
internal void df_set_hovered_line_info(DI_Key *dbgi_key, U64 voff);
|
||||
internal DI_Key df_get_hovered_line_info_dbgi_key(void);
|
||||
internal U64 df_get_hovered_line_info_voff(void);
|
||||
internal void df_set_rich_hover_info(DF_RichHoverInfo *info);
|
||||
internal DF_RichHoverInfo df_get_rich_hover_info(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View Spec State Functions
|
||||
|
||||
+23
-13
@@ -3417,7 +3417,7 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister)
|
||||
if(ui_hovering(sig)) UI_Tooltip
|
||||
{
|
||||
U64 binary_voff = df_voff_from_dbgi_key_symbol_name(&dbgi_key, name);
|
||||
DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, binary_voff);
|
||||
DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, binary_voff, 0);
|
||||
String8 file_path = df_full_path_from_entity(scratch.arena, dasm2src_info.file);
|
||||
S64 line_num = dasm2src_info.pt.line;
|
||||
df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeFunction), name);
|
||||
@@ -4808,7 +4808,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler)
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, rip_vaddr);
|
||||
U64 rip_voff = df_voff_from_vaddr(module, rip_vaddr);
|
||||
DI_Key dbgi_key = df_dbgi_key_from_module(module);
|
||||
DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff);
|
||||
DF_TextLineDasm2SrcInfo line_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff, 0);
|
||||
if(!df_entity_is_nil(line_info.file))
|
||||
{
|
||||
UI_PrefWidth(ui_children_sum(0)) df_entity_src_loc_button(ws, line_info.file, line_info.pt);
|
||||
@@ -4843,7 +4843,6 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
Architecture arch = df_architecture_from_entity(thread);
|
||||
U64 selected_unwind_count = ctrl_ctx.unwind_count;
|
||||
DF_Entity *process = thread->parent;
|
||||
Vec4F32 thread_color = df_rgba_from_theme_color(DF_ThemeColor_PlainText);
|
||||
if(thread->flags & DF_EntityFlag_HasColor)
|
||||
@@ -4960,7 +4959,12 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
|
||||
UI_TextAlignment(UI_TextAlign_Center)
|
||||
UI_FocusHot((row_selected && cs->cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
String8 selected_string = selected_unwind_count == frame_idx ? df_g_icon_kind_text_table[DF_IconKind_RightArrow] : str8_lit("");
|
||||
String8 selected_string = {0};
|
||||
if(ctrl_ctx.unwind_count == frame->base_unwind_idx &&
|
||||
ctrl_ctx.inline_unwind_count == frame->inline_unwind_idx)
|
||||
{
|
||||
selected_string = df_g_icon_kind_text_table[DF_IconKind_RightArrow];
|
||||
}
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_DrawText, "%S###selection_%i", selected_string,
|
||||
(int)frame_idx);
|
||||
UI_Signal sig = ui_signal_from_box(box);
|
||||
@@ -4973,8 +4977,10 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
|
||||
if(ui_double_clicked(sig) || sig.f&UI_SignalFlag_KeyboardPressed)
|
||||
{
|
||||
DF_CmdParams params = df_cmd_params_from_view(ws, panel, view);
|
||||
params.index = frame_idx;
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Index);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_BaseUnwindIndex);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_InlineUnwindIndex);
|
||||
params.base_unwind_index = frame->base_unwind_idx;
|
||||
params.inline_unwind_index = frame->inline_unwind_idx;
|
||||
df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SelectUnwind));
|
||||
}
|
||||
}
|
||||
@@ -5043,8 +5049,10 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
|
||||
if(ui_double_clicked(sig) || sig.f&UI_SignalFlag_KeyboardPressed)
|
||||
{
|
||||
DF_CmdParams params = df_cmd_params_from_view(ws, panel, view);
|
||||
params.index = frame_idx;
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Index);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_BaseUnwindIndex);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_InlineUnwindIndex);
|
||||
params.base_unwind_index = frame->base_unwind_idx;
|
||||
params.inline_unwind_index = frame->inline_unwind_idx;
|
||||
df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SelectUnwind));
|
||||
}
|
||||
}
|
||||
@@ -5064,8 +5072,10 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack)
|
||||
if(ui_double_clicked(sig) || sig.f&UI_SignalFlag_KeyboardPressed)
|
||||
{
|
||||
DF_CmdParams params = df_cmd_params_from_view(ws, panel, view);
|
||||
params.index = frame_idx;
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Index);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_BaseUnwindIndex);
|
||||
df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_InlineUnwindIndex);
|
||||
params.base_unwind_index = frame->base_unwind_idx;
|
||||
params.inline_unwind_index = frame->inline_unwind_idx;
|
||||
df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SelectUnwind));
|
||||
}
|
||||
}
|
||||
@@ -5953,7 +5963,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, last_inst_on_unwound_rip_vaddr);
|
||||
U64 rip_voff = df_voff_from_vaddr(module, last_inst_on_unwound_rip_vaddr);
|
||||
DI_Key dbgi_key = df_dbgi_key_from_module(module);
|
||||
DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff);
|
||||
DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff, 0);
|
||||
if(dasm2src_info.file == entity && visible_line_num_range.min <= dasm2src_info.pt.line && dasm2src_info.pt.line <= visible_line_num_range.max)
|
||||
{
|
||||
U64 slice_line_idx = dasm2src_info.pt.line-visible_line_num_range.min;
|
||||
@@ -7093,7 +7103,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly)
|
||||
DF_TextLineDasm2SrcInfoNode *dasm2src_n = push_array(scratch.arena, DF_TextLineDasm2SrcInfoNode, 1);
|
||||
SLLQueuePush(code_slice_params.line_dasm2src[slice_idx].first, code_slice_params.line_dasm2src[slice_idx].last, dasm2src_n);
|
||||
code_slice_params.line_dasm2src[slice_idx].count += 1;
|
||||
dasm2src_n->v = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, voff);
|
||||
dasm2src_n->v = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, voff, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7265,7 +7275,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly)
|
||||
DF_Entity *module = df_module_from_process_vaddr(process, vaddr);
|
||||
DI_Key dbgi_key = df_dbgi_key_from_module(module);
|
||||
U64 voff = df_voff_from_vaddr(module, vaddr);
|
||||
DF_TextLineDasm2SrcInfo dasm2src = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, voff);
|
||||
DF_TextLineDasm2SrcInfo dasm2src = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, voff, 0);
|
||||
String8 file_path = df_full_path_from_entity(scratch.arena, dasm2src.file);
|
||||
DF_CmdParams params = df_cmd_params_from_view(ws, panel, view);
|
||||
params.text_point = dasm2src.pt;
|
||||
|
||||
Reference in New Issue
Block a user