From 848b26bbd9050ea806093eec22d583670f353bf8 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 10 Oct 2024 07:13:47 -0700 Subject: [PATCH] fixes / jank pass --- src/dbg_engine/dbg_engine_core.c | 4 ++-- src/raddbg/raddbg_core.c | 7 ++++--- src/raddbg/raddbg_views.c | 2 +- src/raddbg/raddbg_widgets.c | 13 ++----------- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/dbg_engine/dbg_engine_core.c b/src/dbg_engine/dbg_engine_core.c index 4f2c6842..c8d50c52 100644 --- a/src/dbg_engine/dbg_engine_core.c +++ b/src/dbg_engine/dbg_engine_core.c @@ -2515,7 +2515,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P } // rjf: virtual address location -> add breakpoint for address - if(bp->vaddr != 0) + else if(bp->vaddr != 0) { CTRL_UserBreakpoint ctrl_user_bp = {CTRL_UserBreakpointKind_VirtualAddress}; ctrl_user_bp.u64 = bp->vaddr; @@ -2524,7 +2524,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P } // rjf: symbol name location -> add breakpoint for symbol name - if(bp->symbol_name.size != 0) + else if(bp->symbol_name.size != 0) { CTRL_UserBreakpoint ctrl_user_bp = {CTRL_UserBreakpointKind_SymbolNameAndOffset}; ctrl_user_bp.string = bp->symbol_name; diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index 6b094519..807c3afb 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -14590,6 +14590,7 @@ rd_frame(void) if(rd_regs()->vaddr != 0) { rd_entity_equip_vaddr(location, rd_regs()->vaddr); + rd_entity_equip_name(location, str8_zero()); } if(rd_regs()->file_path.size != 0) { @@ -14671,9 +14672,9 @@ rd_frame(void) { RD_Entity *wp = n->entity; RD_Entity *loc = rd_entity_child_from_kind(wp, RD_EntityKind_Location); - if((loc->flags & RD_EntityFlag_HasTextPoint && path_match_normalized(loc->string, file_path) && loc->text_point.line == pt.line) || - (loc->flags & RD_EntityFlag_HasVAddr && loc->vaddr == vaddr) || - (!(loc->flags & RD_EntityFlag_HasTextPoint) && str8_match(loc->string, string, 0))) + if(str8_match(wp->string, string, 0) && + ((loc->flags & RD_EntityFlag_HasTextPoint && path_match_normalized(loc->string, file_path) && loc->text_point.line == pt.line) || + (loc->flags & RD_EntityFlag_HasVAddr && loc->vaddr == vaddr))) { rd_entity_mark_for_deletion(wp); removed_already_existing = 1; diff --git a/src/raddbg/raddbg_views.c b/src/raddbg/raddbg_views.c index 9bd725f0..56d8c565 100644 --- a/src/raddbg/raddbg_views.c +++ b/src/raddbg/raddbg_views.c @@ -5402,7 +5402,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(watch_pins) rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1); } rd_watch_view_build(wv, RD_WatchViewFlag_NoHeader|RD_WatchViewFlag_PrettyNameMembers|RD_WatchViewFlag_PrettyEntityRows|RD_WatchViewFlag_DisableCacheLines, - str8_lit("watch_pins"), str8_lit("only: label location str"), 0, 10, rect); + str8_lit("watch_pins"), str8_lit("only: label source_location address_location str"), 0, 10, rect); ProfEnd(); } diff --git a/src/raddbg/raddbg_widgets.c b/src/raddbg/raddbg_widgets.c index 1d429b38..fa7d0a38 100644 --- a/src/raddbg/raddbg_widgets.c +++ b/src/raddbg/raddbg_widgets.c @@ -1127,8 +1127,6 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe ui_set_next_text_alignment(UI_TextAlign_Center); UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%I64x_%p", line_num, thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| - UI_BoxFlag_DrawHotEffects| - UI_BoxFlag_DrawBorder| UI_BoxFlag_Clickable*!!(params->flags & RD_CodeSliceFlag_Clickable)| UI_BoxFlag_DrawText, thread_box_key); @@ -1277,8 +1275,6 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe ui_set_next_text_alignment(UI_TextAlign_Center); UI_Key thread_box_key = ui_key_from_stringf(top_container_box->key, "###ip_%I64x_catchall_%p", line_num, thread); UI_Box *thread_box = ui_build_box_from_key(UI_BoxFlag_DisableTextTrunc| - UI_BoxFlag_DrawHotEffects| - UI_BoxFlag_DrawBorder| UI_BoxFlag_Clickable*!!(params->flags & RD_CodeSliceFlag_Clickable)| UI_BoxFlag_DrawText, thread_box_key); @@ -1391,8 +1387,6 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = bp_color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Box *bp_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| - UI_BoxFlag_DrawHotEffects| - UI_BoxFlag_DrawBorder| UI_BoxFlag_Clickable*!!(params->flags & RD_CodeSliceFlag_Clickable)| UI_BoxFlag_DisableTextTrunc, "%S##bp_%p", @@ -1450,9 +1444,6 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color)); ui_set_next_text_alignment(UI_TextAlign_Center); UI_Box *pin_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| - UI_BoxFlag_DrawActiveEffects| - UI_BoxFlag_DrawHotEffects| - UI_BoxFlag_DrawBorder| UI_BoxFlag_Clickable*!!(params->flags & RD_CodeSliceFlag_Clickable)| UI_BoxFlag_DisableTextTrunc, "%S##watch_%p", @@ -1899,8 +1890,8 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe U64 line_vaddr = params->line_vaddrs[line_idx]; rd_cmd(RD_CmdKind_RelocateEntity, .entity = rd_handle_from_entity(dropped_entity), - .file_path = rd_regs()->file_path, - .cursor = txt_pt(line_num, 1), + .file_path = line_vaddr == 0 ? rd_regs()->file_path : str8_zero(), + .cursor = line_vaddr == 0 ? txt_pt(line_num, 1) : txt_pt(0, 0), .vaddr = line_vaddr); } if(line_drag_ctrl_entity != &ctrl_entity_nil && rd_drag_drop() && contains_1s64(params->line_num_range, mouse_pt.line))