mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 23:52:22 -07:00
double clicking cfgs with location info -> snap
This commit is contained in:
@@ -307,7 +307,7 @@ RD_NameSchemaInfo rd_name_schema_info_table[12] =
|
||||
{
|
||||
{str8_lit_comp("settings"), str8_lit_comp("x:\n{\n @default(1) 'hover_animations': bool,\n @default(1) 'press_animations': bool,\n @default(0) 'focus_animations': bool,\n @default(1) 'tooltip_animations': bool,\n @default(1) 'menu_animations': bool,\n @default(1) 'scrolling_animations': bool,\n @default(1) 'background_blur': bool,\n @default(1) 'thread_lines': bool,\n @default(1) 'breakpoint_lines': bool,\n @default(1) 'thread_glow': bool,\n @default(1) 'breakpoint_glow': bool,\n @default(0) 'opaque_backgrounds': bool,\n @default(1) 'smooth_main_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_main_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(2) 'tab_width': @range[1, 32] u64,\n @can_be_per_window 'main_font_size': @range[6, 72] u64,\n @can_be_per_window 'code_font_size': @range[1, 32] u64,\n}\n")},
|
||||
{str8_lit_comp("target"), str8_lit_comp("@commands(launch_and_run, launch_and_init, select_cfg, remove_cfg)\n@collection_commands(add_target)\nx:\n{\n 'label': code_string,\n 'executable': path,\n 'arguments': string,\n 'working_directory': path,\n 'entry_point': code_string,\n 'stdout_path': path,\n 'stderr_path': path,\n 'stdin_path': path,\n 'debug_subprocesses': bool,\n 'environment': query,\n}\n")},
|
||||
{str8_lit_comp("breakpoint"), str8_lit_comp("@commands(enable_cfg, remove_cfg)\n@collection_commands(add_breakpoint, add_address_breakpoint, add_function_breakpoint)\nx:\n{\n 'label': code_string,\n 'condition': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n 'hit_count': u64,\n 'disabled': bool,\n}\n")},
|
||||
{str8_lit_comp("breakpoint"), str8_lit_comp("@commands(enable_cfg, remove_cfg)\n@collection_commands(toggle_breakpoint, add_breakpoint, add_address_breakpoint, add_function_breakpoint)\nx:\n{\n 'label': code_string,\n 'condition': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n 'hit_count': u64,\n 'disabled': bool,\n}\n")},
|
||||
{str8_lit_comp("watch_pin"), str8_lit_comp("@commands(remove_cfg)\n@collection_commands(add_watch_pin)\nx:\n{\n 'expression': code_string,\n 'view_rule': code_string,\n 'source_location': path_pt,\n 'address_location': code_string,\n}\n")},
|
||||
{str8_lit_comp("file_path_map"), str8_lit_comp("@collection_commands(add_file_path_map) @commands(remove_cfg) x:{'source':path, 'dest':path}")},
|
||||
{str8_lit_comp("auto_view_rule"), str8_lit_comp("@collection_commands(add_auto_view_rule) @commands(remove_cfg) x:{'type':code_string, 'view_rule':code_string}")},
|
||||
|
||||
@@ -179,7 +179,7 @@ RD_VocabTable:
|
||||
breakpoint,
|
||||
```
|
||||
@commands(enable_cfg, remove_cfg)
|
||||
@collection_commands(add_breakpoint, add_address_breakpoint, add_function_breakpoint)
|
||||
@collection_commands(toggle_breakpoint, add_breakpoint, add_address_breakpoint, add_function_breakpoint)
|
||||
x:
|
||||
{
|
||||
'label': code_string,
|
||||
|
||||
@@ -5247,7 +5247,10 @@ rd_view_ui(Rng2F32 rect)
|
||||
case CTRL_EntityKind_Thread:{RD_RegsScope(.thread = cell_info.entity->handle) rd_drag_begin(RD_RegSlot_Thread);}break;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(row_info->eval.space.kind == RD_EvalSpaceKind_CtrlEntity ||
|
||||
row_info->eval.space.kind == E_SpaceKind_FileSystem ||
|
||||
row_info->eval.space.kind == E_SpaceKind_File ||
|
||||
row_info->eval.space.kind == E_SpaceKind_Null)
|
||||
{
|
||||
RD_RegsScope(.expr = e_string_from_expr(scratch.arena, row_info->eval.exprs.last),
|
||||
.view_rule = ev_view_rule_from_key(rd_view_eval_view(), row->key))
|
||||
@@ -5328,6 +5331,22 @@ rd_view_ui(Rng2F32 rect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: can't edit, but has cfg location info? -> find
|
||||
else if(cell_info.eval.space.kind == RD_EvalSpaceKind_MetaCfg)
|
||||
{
|
||||
RD_Cfg *cfg = rd_cfg_from_eval_space(cell_info.eval.space);
|
||||
RD_Location loc = rd_location_from_cfg(cfg);
|
||||
if(loc.file_path.size != 0)
|
||||
{
|
||||
rd_cmd(RD_CmdKind_FindCodeLocation, .vaddr = 0, .file_path = loc.file_path, .cursor = loc.pt);
|
||||
}
|
||||
else if(loc.expr.size != 0)
|
||||
{
|
||||
U64 value = e_value_from_string(loc.expr).u64;
|
||||
rd_cmd(RD_CmdKind_FindCodeLocation, .vaddr = value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: hovering with inheritance string -> show tooltip
|
||||
@@ -8972,7 +8991,14 @@ rd_window_frame(void)
|
||||
{
|
||||
String8 view_expr = rd_expr_from_cfg(selected_tab);
|
||||
String8 view_file_path = rd_file_path_from_eval_string(rd_frame_arena(), view_expr);
|
||||
rd_regs()->file_path = view_file_path;
|
||||
// NOTE(rjf): we want to only fill out this view's file path slot if it
|
||||
// evaluates one - this way, a view can use the slot to know the selected
|
||||
// file path (if there is one). this is useful when pushing commandas which
|
||||
// apply to a cursor, for example.
|
||||
if(view_file_path.size != 0)
|
||||
{
|
||||
rd_regs()->file_path = view_file_path;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: build view container
|
||||
@@ -14647,10 +14673,16 @@ rd_frame(void)
|
||||
}break;
|
||||
case RD_CmdKind_OpenTab:
|
||||
{
|
||||
String8 expr_file_path = rd_file_path_from_eval_string(scratch.arena, rd_regs()->expr);
|
||||
RD_Cfg *panel = rd_cfg_from_id(rd_regs()->panel);
|
||||
RD_Cfg *tab = rd_cfg_new(panel, rd_regs()->string);
|
||||
RD_Cfg *expr = rd_cfg_new(tab, str8_lit("expression"));
|
||||
rd_cfg_new(expr, rd_regs()->expr);
|
||||
if(expr_file_path.size != 0)
|
||||
{
|
||||
RD_Cfg *project = rd_cfg_new(tab, str8_lit("project"));
|
||||
rd_cfg_new(project, rd_state->project_path);
|
||||
}
|
||||
rd_cmd(RD_CmdKind_FocusTab, .view = tab->id);
|
||||
#if 0 // TODO(rjf): @cfg (tab opening)
|
||||
RD_Panel *panel = rd_panel_from_handle(rd_regs()->panel);
|
||||
|
||||
@@ -1607,6 +1607,7 @@ RD_VIEW_UI_FUNCTION_DEF(text)
|
||||
//- rjf: unpack parameterization info
|
||||
//
|
||||
ProfBegin("unpack parameterization info");
|
||||
rd_regs()->file_path = rd_file_path_from_eval(rd_frame_arena(), eval);
|
||||
rd_regs()->vaddr = 0;
|
||||
rd_regs()->prefer_disasm = 0;
|
||||
rd_regs()->cursor.line = rd_view_cfg_value_from_string(str8_lit("cursor_line")).s64;
|
||||
|
||||
Reference in New Issue
Block a user