fix run-to-line and run-to-address for new breakpoint entity setup

This commit is contained in:
Ryan Fleury
2024-08-14 12:39:34 -07:00
parent afdb0e5b2e
commit a9f4a11c0a
3 changed files with 15 additions and 14 deletions
+12 -12
View File
@@ -7239,24 +7239,24 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
//- rjf: high-level composite target control operations
case DF_CoreCmdKind_RunToLine:
{
DF_Entity *file = df_entity_from_handle(params.entity);
String8 file_path = params.file_path;
TxtPt point = params.text_point;
if(file->kind == DF_EntityKind_File)
{
DF_Entity *bp = df_entity_alloc(file, DF_EntityKind_Breakpoint);
bp->flags |= DF_EntityFlag_DiesOnRunStop;
df_entity_equip_txt_pt(bp, point);
df_entity_equip_cfg_src(bp, DF_CfgSrc_Transient);
DF_CmdParams p = df_cmd_params_zero();
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Run));
}
DF_Entity *bp = df_entity_alloc(df_entity_root(), DF_EntityKind_Breakpoint);
df_entity_equip_cfg_src(bp, DF_CfgSrc_Transient);
bp->flags |= DF_EntityFlag_DiesOnRunStop;
DF_Entity *loc = df_entity_alloc(bp, DF_EntityKind_Location);
df_entity_equip_name(loc, file_path);
df_entity_equip_txt_pt(loc, point);
DF_CmdParams p = df_cmd_params_zero();
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Run));
}break;
case DF_CoreCmdKind_RunToAddress:
{
DF_Entity *bp = df_entity_alloc(df_entity_root(), DF_EntityKind_Breakpoint);
bp->flags |= DF_EntityFlag_DiesOnRunStop;
df_entity_equip_vaddr(bp, params.vaddr);
df_entity_equip_cfg_src(bp, DF_CfgSrc_Transient);
bp->flags |= DF_EntityFlag_DiesOnRunStop;
DF_Entity *loc = df_entity_alloc(bp, DF_EntityKind_Location);
df_entity_equip_vaddr(loc, params.vaddr);
DF_CmdParams p = df_cmd_params_zero();
df_cmd_list_push(arena, cmds, &p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Run));
}break;
+3 -1
View File
@@ -11968,6 +11968,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m
TxtRng mouse_expr_rng = {0};
Vec2F32 mouse_expr_baseline_pos = {0};
String8 mouse_expr = {0};
B32 mouse_expr_is_explicit = 0;
if(ui_hovering(text_container_sig) && contains_1s64(params->line_num_range, mouse_pt.line)) ProfScope("mouse -> expression range")
{
TxtRng selected_rng = txt_rng(*cursor, *mark);
@@ -11982,6 +11983,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m
result.mouse_expr_baseline_pos = mouse_expr_baseline_pos = v2f32(text_container_box->rect.x0+expr_hoff_px,
text_container_box->rect.y0+line_slice_idx*params->line_height_px + params->line_height_px*0.85f);
mouse_expr = str8_substr(line_text, r1u64(selected_rng.min.column-1, selected_rng.max.column-1));
mouse_expr_is_explicit = 1;
}
else
{
@@ -12027,7 +12029,7 @@ df_code_slice(DF_Window *ws, DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *m
if(!ui_dragging(text_container_sig) && text_container_sig.event_flags == 0 && mouse_expr.size != 0)
{
E_Eval eval = e_eval_from_string(scratch.arena, mouse_expr);
if(eval.mode != E_Mode_Null)
if(eval.msgs.max_kind == E_MsgKind_Null && (eval.mode != E_Mode_Null || mouse_expr_is_explicit))
{
U64 line_vaddr = 0;
if(contains_1s64(params->line_num_range, mouse_pt.line))
-1
View File
@@ -1873,7 +1873,6 @@ txt_expr_off_range_from_line_off_range_string_tokens(U64 off, Rng1U64 line_range
}break;
case TXT_TokenKind_Identifier:
case TXT_TokenKind_Keyword:
case TXT_TokenKind_String:
case TXT_TokenKind_Meta:
{
token_ender = 1;