mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-18 20:20:12 -08:00
draw run-to-line info
This commit is contained in:
1 parent
af2932f0ff
commit
58948fab3d
6 files changed
+56
-6
No files matched your search
@@ -18,7 +18,6 @@ target:
|
||||
{
|
||||
executable: "build/mule_main.exe"
|
||||
working_directory: build
|
||||
enabled: 0
|
||||
}
|
||||
target:
|
||||
{
|
||||
|
||||
@@ -13568,6 +13568,23 @@ rd_frame(void)
|
||||
d_push_cmd((D_CmdKind)kind, ¶ms);
|
||||
}
|
||||
|
||||
// rjf: run-to-line? -> remember where we're running to, so we can render
|
||||
if((D_CmdKind)kind == D_CmdKind_RunToLine)
|
||||
{
|
||||
CFG_Node *transient = cfg_node_child_from_string(cfg_node_root(), s("transient"));
|
||||
CFG_Node *run_to_line = cfg_node_child_from_string_or_alloc(rd_state->cfg, transient, s("run_to_line"));
|
||||
if(rd_regs()->file_path.size != 0)
|
||||
{
|
||||
CFG_Node *src_loc = cfg_node_child_from_string_or_alloc(rd_state->cfg, run_to_line, s("source_location"));
|
||||
cfg_node_new_replacef(rd_state->cfg, src_loc, "%S:%I64u:%I64u", rd_regs()->file_path, rd_regs()->line_num, rd_regs()->column_num);
|
||||
}
|
||||
else
|
||||
{
|
||||
CFG_Node *addr_loc = cfg_node_child_from_string_or_alloc(rd_state->cfg, run_to_line, s("address_location"));
|
||||
cfg_node_new_replacef(rd_state->cfg, addr_loc, "0x%I64x", rd_regs()->vaddr);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: try to open tabs, if this is a tab-fastpath-opener
|
||||
if(kind >= RD_CmdKind_FirstTabFastPathCmd)
|
||||
{
|
||||
@@ -18263,6 +18280,15 @@ rd_frame(void)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: remove run-to-line info
|
||||
//
|
||||
if(!d_ctrl_targets_running())
|
||||
{
|
||||
CFG_Node *transient = cfg_node_child_from_string(cfg_node_root(), s("transient"));
|
||||
cfg_node_release(rd_state->cfg, cfg_node_child_from_string(transient, s("run_to_line")));
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: retry find-thread
|
||||
//
|
||||
|
||||
@@ -319,10 +319,6 @@ struct RD_WindowState
|
||||
RD_DropCompletionTask *top_drop_completion_task;
|
||||
|
||||
// rjf: query stack state
|
||||
#if 0
|
||||
B32 query_is_active;
|
||||
RD_Regs *query_regs;
|
||||
#endif
|
||||
Arena *query_arena;
|
||||
CFG_ID query_last_bottom_view_id;
|
||||
RD_QueryView *query_top;
|
||||
|
||||
@@ -644,6 +644,18 @@ rd_code_view_build(Arena *arena, RD_CodeViewState *cv, RD_CodeViewBuildFlags fla
|
||||
code_slice_params.relevant_dbgi_keys = lines_array.dbgi_keys;
|
||||
}
|
||||
|
||||
// rjf: find visible run-to-line info for source code
|
||||
if(!dasm_lines)
|
||||
{
|
||||
CFG_Node *transient = cfg_node_child_from_string(cfg_node_root(), s("transient"));
|
||||
CFG_Node *run_to_line = cfg_node_child_from_string(transient, s("run_to_line"));
|
||||
RD_Location loc = rd_location_from_cfg(run_to_line);
|
||||
if(path_match_normalized(loc.file_path, rd_regs()->file_path))
|
||||
{
|
||||
code_slice_params.run_to_line_num = loc.pt.line;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: find live threads mapping to disasm
|
||||
if(dasm_lines) ProfScope("find live threads mapping to this disassembly")
|
||||
{
|
||||
@@ -731,6 +743,22 @@ rd_code_view_build(Arena *arena, RD_CodeViewState *cv, RD_CodeViewBuildFlags fla
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: find visible run-to-line info for disassembly
|
||||
if(dasm_lines)
|
||||
{
|
||||
CFG_Node *transient = cfg_node_child_from_string(cfg_node_root(), s("transient"));
|
||||
CFG_Node *run_to_line = cfg_node_child_from_string(transient, s("run_to_line"));
|
||||
RD_Location loc = rd_location_from_cfg(run_to_line);
|
||||
E_Value loc_value = e_value_from_string(loc.expr);
|
||||
if(contains_1u64(dasm_vaddr_range, loc_value.u64))
|
||||
{
|
||||
U64 off = loc_value.u64 - dasm_vaddr_range.min;
|
||||
U64 idx = dasm_line_array_idx_from_code_off__linear_scan(dasm_lines, off);
|
||||
S64 line_num = (S64)idx+1;
|
||||
code_slice_params.run_to_line_num = line_num;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: add dasm dbgi key to relevant dbgis
|
||||
if(dasm_lines != 0)
|
||||
{
|
||||
|
||||
@@ -1577,7 +1577,7 @@ rd_code_slice(RD_CodeSliceParams *params, U64 *cursor, U64 *mark, S64 *preferred
|
||||
|
||||
// rjf: empty priority margin interaction
|
||||
UI_Signal line_margin_sig = ui_signal_from_box(line_margin_box);
|
||||
if(ui_hovering(line_margin_sig))
|
||||
if(ui_hovering(line_margin_sig) || line_num == params->run_to_line_num)
|
||||
{
|
||||
DR_FStrList fstrs = {0};
|
||||
Vec4F32 color = ui_color_from_name(s("thread_0"));
|
||||
|
||||
@@ -113,6 +113,7 @@ struct RD_CodeSliceParams
|
||||
D_EntityList *line_ips;
|
||||
CFG_NodePtrList *line_pins;
|
||||
U64 *line_vaddrs;
|
||||
S64 run_to_line_num;
|
||||
D_LineList *line_infos;
|
||||
DI_KeyList relevant_dbgi_keys;
|
||||
TXT_TextInfo *text_info;
|
||||
|
||||
Reference in new issue
Block a user