mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-02 20:18:12 +00:00
collapse user clock indices into base-layer-provided clock counter; fuzzy_search -> dbgi_search
This commit is contained in:
+29
-29
@@ -4880,7 +4880,7 @@ rd_window_frame(RD_Window *ws)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
FZY_Scope *fzy_scope = fzy_scope_open();
|
||||
DIS_Scope *dis_scope = dis_scope_open();
|
||||
DI_KeyList dbgi_keys_list = d_push_active_dbgi_key_list(scratch.arena);
|
||||
DI_KeyArray dbgi_keys = di_key_array_from_list(scratch.arena, &dbgi_keys_list);
|
||||
|
||||
@@ -5012,14 +5012,14 @@ rd_window_frame(RD_Window *ws)
|
||||
//- rjf: gather globals
|
||||
if(ws->autocomp_lister_params.flags & RD_AutoCompListerFlag_Globals && query_word.size != 0)
|
||||
{
|
||||
U128 fzy_key = {d_hash_from_string(str8_lit("autocomp_globals_fzy_key"))};
|
||||
FZY_Params fzy_params =
|
||||
U128 dis_key = {d_hash_from_string(str8_lit("autocomp_globals_dis_key"))};
|
||||
DIS_Params dis_params =
|
||||
{
|
||||
RDI_SectionKind_GlobalVariables,
|
||||
dbgi_keys,
|
||||
};
|
||||
B32 is_stale = 0;
|
||||
FZY_ItemArray items = fzy_items_from_key_params_query(fzy_scope, fzy_key, &fzy_params, query_word, 0, &is_stale);
|
||||
DIS_ItemArray items = dis_items_from_key_params_query(dis_scope, dis_key, &dis_params, query_word, 0, &is_stale);
|
||||
for(U64 idx = 0; idx < 20 && idx < items.count; idx += 1)
|
||||
{
|
||||
// rjf: determine dbgi/rdi to which this item belongs
|
||||
@@ -5030,7 +5030,7 @@ rd_window_frame(RD_Window *ws)
|
||||
for(U64 rdi_idx = 0; rdi_idx < rdis_count; rdi_idx += 1)
|
||||
{
|
||||
U64 table_count = 0;
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], fzy_params.target, &table_count);
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], dis_params.target, &table_count);
|
||||
if(base_idx <= items.v[idx].idx && items.v[idx].idx < base_idx + table_count)
|
||||
{
|
||||
dbgi_key = dbgi_keys.v[rdi_idx];
|
||||
@@ -5042,7 +5042,7 @@ rd_window_frame(RD_Window *ws)
|
||||
}
|
||||
|
||||
// rjf: unpack info
|
||||
String8 name = fzy_item_string_from_rdi_target_element_idx(rdi, fzy_params.target, items.v[idx].idx-base_idx);
|
||||
String8 name = dis_item_string_from_rdi_target_element_idx(rdi, dis_params.target, items.v[idx].idx-base_idx);
|
||||
|
||||
// rjf: push item
|
||||
RD_AutoCompListerItem item = {0};
|
||||
@@ -5059,14 +5059,14 @@ rd_window_frame(RD_Window *ws)
|
||||
//- rjf: gather thread locals
|
||||
if(ws->autocomp_lister_params.flags & RD_AutoCompListerFlag_ThreadLocals && query_word.size != 0)
|
||||
{
|
||||
U128 fzy_key = {d_hash_from_string(str8_lit("autocomp_tvars_fzy_key"))};
|
||||
FZY_Params fzy_params =
|
||||
U128 dis_key = {d_hash_from_string(str8_lit("autocomp_tvars_dis_key"))};
|
||||
DIS_Params dis_params =
|
||||
{
|
||||
RDI_SectionKind_ThreadVariables,
|
||||
dbgi_keys,
|
||||
};
|
||||
B32 is_stale = 0;
|
||||
FZY_ItemArray items = fzy_items_from_key_params_query(fzy_scope, fzy_key, &fzy_params, query_word, 0, &is_stale);
|
||||
DIS_ItemArray items = dis_items_from_key_params_query(dis_scope, dis_key, &dis_params, query_word, 0, &is_stale);
|
||||
for(U64 idx = 0; idx < 20 && idx < items.count; idx += 1)
|
||||
{
|
||||
// rjf: determine dbgi/rdi to which this item belongs
|
||||
@@ -5077,7 +5077,7 @@ rd_window_frame(RD_Window *ws)
|
||||
for(U64 rdi_idx = 0; rdi_idx < rdis_count; rdi_idx += 1)
|
||||
{
|
||||
U64 table_count = 0;
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], fzy_params.target, &table_count);
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], dis_params.target, &table_count);
|
||||
if(base_idx <= items.v[idx].idx && items.v[idx].idx < base_idx + table_count)
|
||||
{
|
||||
dbgi_key = dbgi_keys.v[rdi_idx];
|
||||
@@ -5089,7 +5089,7 @@ rd_window_frame(RD_Window *ws)
|
||||
}
|
||||
|
||||
// rjf: unpack info
|
||||
String8 name = fzy_item_string_from_rdi_target_element_idx(rdi, fzy_params.target, items.v[idx].idx-base_idx);
|
||||
String8 name = dis_item_string_from_rdi_target_element_idx(rdi, dis_params.target, items.v[idx].idx-base_idx);
|
||||
|
||||
// rjf: push item
|
||||
RD_AutoCompListerItem item = {0};
|
||||
@@ -5106,14 +5106,14 @@ rd_window_frame(RD_Window *ws)
|
||||
//- rjf: gather procedures
|
||||
if(ws->autocomp_lister_params.flags & RD_AutoCompListerFlag_Procedures && query_word.size != 0)
|
||||
{
|
||||
U128 fzy_key = {d_hash_from_string(str8_lit("autocomp_procedures_fzy_key"))};
|
||||
FZY_Params fzy_params =
|
||||
U128 dis_key = {d_hash_from_string(str8_lit("autocomp_procedures_dis_key"))};
|
||||
DIS_Params dis_params =
|
||||
{
|
||||
RDI_SectionKind_Procedures,
|
||||
dbgi_keys,
|
||||
};
|
||||
B32 is_stale = 0;
|
||||
FZY_ItemArray items = fzy_items_from_key_params_query(fzy_scope, fzy_key, &fzy_params, query_word, 0, &is_stale);
|
||||
DIS_ItemArray items = dis_items_from_key_params_query(dis_scope, dis_key, &dis_params, query_word, 0, &is_stale);
|
||||
for(U64 idx = 0; idx < 20 && idx < items.count; idx += 1)
|
||||
{
|
||||
// rjf: determine dbgi/rdi to which this item belongs
|
||||
@@ -5124,7 +5124,7 @@ rd_window_frame(RD_Window *ws)
|
||||
for(U64 rdi_idx = 0; rdi_idx < rdis_count; rdi_idx += 1)
|
||||
{
|
||||
U64 table_count = 0;
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], fzy_params.target, &table_count);
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], dis_params.target, &table_count);
|
||||
if(base_idx <= items.v[idx].idx && items.v[idx].idx < base_idx + table_count)
|
||||
{
|
||||
dbgi_key = dbgi_keys.v[rdi_idx];
|
||||
@@ -5136,7 +5136,7 @@ rd_window_frame(RD_Window *ws)
|
||||
}
|
||||
|
||||
// rjf: unpack info
|
||||
String8 name = fzy_item_string_from_rdi_target_element_idx(rdi, fzy_params.target, items.v[idx].idx-base_idx);
|
||||
String8 name = dis_item_string_from_rdi_target_element_idx(rdi, dis_params.target, items.v[idx].idx-base_idx);
|
||||
|
||||
// rjf: push item
|
||||
RD_AutoCompListerItem item = {0};
|
||||
@@ -5153,14 +5153,14 @@ rd_window_frame(RD_Window *ws)
|
||||
//- rjf: gather types
|
||||
if(ws->autocomp_lister_params.flags & RD_AutoCompListerFlag_Types && query_word.size != 0)
|
||||
{
|
||||
U128 fzy_key = {d_hash_from_string(str8_lit("autocomp_types_fzy_key"))};
|
||||
FZY_Params fzy_params =
|
||||
U128 dis_key = {d_hash_from_string(str8_lit("autocomp_types_dis_key"))};
|
||||
DIS_Params dis_params =
|
||||
{
|
||||
RDI_SectionKind_UDTs,
|
||||
dbgi_keys,
|
||||
};
|
||||
B32 is_stale = 0;
|
||||
FZY_ItemArray items = fzy_items_from_key_params_query(fzy_scope, fzy_key, &fzy_params, query_word, 0, &is_stale);
|
||||
DIS_ItemArray items = dis_items_from_key_params_query(dis_scope, dis_key, &dis_params, query_word, 0, &is_stale);
|
||||
for(U64 idx = 0; idx < 20 && idx < items.count; idx += 1)
|
||||
{
|
||||
// rjf: determine dbgi/rdi to which this item belongs
|
||||
@@ -5171,7 +5171,7 @@ rd_window_frame(RD_Window *ws)
|
||||
for(U64 rdi_idx = 0; rdi_idx < rdis_count; rdi_idx += 1)
|
||||
{
|
||||
U64 table_count = 0;
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], fzy_params.target, &table_count);
|
||||
rdi_section_raw_table_from_kind(rdis[rdi_idx], dis_params.target, &table_count);
|
||||
if(base_idx <= items.v[idx].idx && items.v[idx].idx < base_idx + table_count)
|
||||
{
|
||||
dbgi_key = dbgi_keys.v[rdi_idx];
|
||||
@@ -5183,7 +5183,7 @@ rd_window_frame(RD_Window *ws)
|
||||
}
|
||||
|
||||
// rjf: unpack info
|
||||
String8 name = fzy_item_string_from_rdi_target_element_idx(rdi, fzy_params.target, items.v[idx].idx-base_idx);
|
||||
String8 name = dis_item_string_from_rdi_target_element_idx(rdi, dis_params.target, items.v[idx].idx-base_idx);
|
||||
|
||||
// rjf: push item
|
||||
RD_AutoCompListerItem item = {0};
|
||||
@@ -5467,7 +5467,7 @@ rd_window_frame(RD_Window *ws)
|
||||
}
|
||||
}
|
||||
|
||||
fzy_scope_close(fzy_scope);
|
||||
dis_scope_close(dis_scope);
|
||||
di_scope_close(di_scope);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
@@ -9323,7 +9323,7 @@ rd_ev_view_rule_expr_num_from_id__meta_ctrl_entities(U64 id, void *user_data, CT
|
||||
typedef struct RD_DebugInfoTableExpandAccel RD_DebugInfoTableExpandAccel;
|
||||
struct RD_DebugInfoTableExpandAccel
|
||||
{
|
||||
FZY_ItemArray items;
|
||||
DIS_ItemArray items;
|
||||
};
|
||||
|
||||
internal EV_ExpandInfo
|
||||
@@ -9348,8 +9348,8 @@ rd_ev_view_rule_expr_expand_info__debug_info_tables(Arena *arena, EV_View *view,
|
||||
//- rjf: query all filtered items from dbgi searching system
|
||||
U128 fuzzy_search_key = {(U64)view, (U64)section};
|
||||
B32 items_stale = 0;
|
||||
FZY_Params params = {section, dbgi_keys};
|
||||
accel->items = fzy_items_from_key_params_query(rd_state->frame_fzy_scope, fuzzy_search_key, ¶ms, filter, endt_us, &items_stale);
|
||||
DIS_Params params = {section, dbgi_keys};
|
||||
accel->items = dis_items_from_key_params_query(rd_state->frame_dis_scope, fuzzy_search_key, ¶ms, filter, endt_us, &items_stale);
|
||||
if(items_stale)
|
||||
{
|
||||
rd_request_frame();
|
||||
@@ -9376,7 +9376,7 @@ rd_ev_view_rule_expr_expand_range_info__debug_info_tables(Arena *arena, EV_View
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
// rjf: unpack row info
|
||||
FZY_Item *item = &accel->items.v[idx_range.min + row_expr_idx];
|
||||
DIS_Item *item = &accel->items.v[idx_range.min + row_expr_idx];
|
||||
|
||||
// rjf: determine module to which this item belongs
|
||||
E_Module *module = e_parse_ctx->primary_module;
|
||||
@@ -9488,7 +9488,7 @@ internal U64
|
||||
rd_ev_view_rule_expr_num_from_id__debug_info_tables(U64 id, void *user_data, RDI_SectionKind section)
|
||||
{
|
||||
RD_DebugInfoTableExpandAccel *accel = (RD_DebugInfoTableExpandAccel *)user_data;
|
||||
U64 num = fzy_item_num_from_array_element_idx__linear_search(&accel->items, id-1);
|
||||
U64 num = dis_item_num_from_array_element_idx__linear_search(&accel->items, id-1);
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -11704,7 +11704,7 @@ rd_frame(void)
|
||||
if(depth == 0)
|
||||
{
|
||||
rd_state->frame_di_scope = di_scope_open();
|
||||
rd_state->frame_fzy_scope = fzy_scope_open();
|
||||
rd_state->frame_dis_scope = dis_scope_open();
|
||||
}
|
||||
B32 allow_text_hotkeys = !rd_state->text_edit_mode;
|
||||
rd_state->text_edit_mode = 0;
|
||||
@@ -16739,7 +16739,7 @@ rd_frame(void)
|
||||
if(depth == 0)
|
||||
{
|
||||
di_scope_close(rd_state->frame_di_scope);
|
||||
fzy_scope_close(rd_state->frame_fzy_scope);
|
||||
dis_scope_close(rd_state->frame_dis_scope);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
|
||||
@@ -822,7 +822,7 @@ struct RD_State
|
||||
// rjf: frame parameters
|
||||
F32 frame_dt;
|
||||
DI_Scope *frame_di_scope;
|
||||
FZY_Scope *frame_fzy_scope;
|
||||
DIS_Scope *frame_dis_scope;
|
||||
|
||||
// rjf: ambiguous path table
|
||||
U64 ambiguous_path_slots_count;
|
||||
|
||||
@@ -595,8 +595,8 @@
|
||||
#include "regs/regs.h"
|
||||
#include "regs/rdi/regs_rdi.h"
|
||||
#include "dbgi/dbgi.h"
|
||||
#include "dbgi_search/dbgi_search.h"
|
||||
#include "dasm_cache/dasm_cache.h"
|
||||
#include "fuzzy_search/fuzzy_search.h"
|
||||
#include "demon/demon_inc.h"
|
||||
#include "eval/eval_inc.h"
|
||||
#include "eval_visualization/eval_visualization_inc.h"
|
||||
@@ -637,8 +637,8 @@
|
||||
#include "regs/regs.c"
|
||||
#include "regs/rdi/regs_rdi.c"
|
||||
#include "dbgi/dbgi.c"
|
||||
#include "dbgi_search/dbgi_search.c"
|
||||
#include "dasm_cache/dasm_cache.c"
|
||||
#include "fuzzy_search/fuzzy_search.c"
|
||||
#include "demon/demon_inc.c"
|
||||
#include "eval/eval_inc.c"
|
||||
#include "eval_visualization/eval_visualization_inc.c"
|
||||
@@ -693,6 +693,7 @@ global OS_Handle ipc_s2m_ring_cv = {0};
|
||||
internal void
|
||||
ipc_signaler_thread__entry_point(void *p)
|
||||
{
|
||||
ThreadNameF("[rd] ipc signaler thread");
|
||||
for(;;)
|
||||
{
|
||||
if(os_semaphore_take(ipc_signal_semaphore, max_U64))
|
||||
|
||||
@@ -1264,7 +1264,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
{
|
||||
ProfBeginFunction();
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
FZY_Scope *fzy_scope = fzy_scope_open();
|
||||
DIS_Scope *dis_scope = dis_scope_open();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
UI_ScrollPt2 scroll_pos = rd_view_scroll_pos();
|
||||
F32 entity_hover_t_rate = rd_setting_val_from_code(RD_SettingCode_HoverAnimations).s32 ? (1 - pow_f32(2, (-20.f * rd_state->frame_dt))) : 1.f;
|
||||
@@ -3407,7 +3407,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
|
||||
if(!is_top_level_hook) { rd_store_view_scroll_pos(scroll_pos); }
|
||||
scratch_end(scratch);
|
||||
fzy_scope_close(fzy_scope);
|
||||
dis_scope_close(dis_scope);
|
||||
di_scope_close(di_scope);
|
||||
ProfEnd();
|
||||
}
|
||||
@@ -5214,11 +5214,11 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(symbol_lister)
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
FZY_Scope *fzy_scope = fzy_scope_open();
|
||||
DIS_Scope *dis_scope = dis_scope_open();
|
||||
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
|
||||
DI_KeyList dbgi_keys_list = d_push_active_dbgi_key_list(scratch.arena);
|
||||
DI_KeyArray dbgi_keys = di_key_array_from_list(scratch.arena, &dbgi_keys_list);
|
||||
FZY_Params fuzzy_search_params = {RDI_SectionKind_Procedures, dbgi_keys};
|
||||
DIS_Params fuzzy_search_params = {RDI_SectionKind_Procedures, dbgi_keys};
|
||||
U64 endt_us = os_now_microseconds()+200;
|
||||
|
||||
//- rjf: grab rdis
|
||||
@@ -5245,7 +5245,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(symbol_lister)
|
||||
//- rjf: query -> raddbg, filtered items
|
||||
U128 fuzzy_search_key = {rd_regs()->view.u64[0], rd_regs()->view.u64[1]};
|
||||
B32 items_stale = 0;
|
||||
FZY_ItemArray items = fzy_items_from_key_params_query(fzy_scope, fuzzy_search_key, &fuzzy_search_params, string, endt_us, &items_stale);
|
||||
DIS_ItemArray items = dis_items_from_key_params_query(dis_scope, fuzzy_search_key, &fuzzy_search_params, string, endt_us, &items_stale);
|
||||
if(items_stale)
|
||||
{
|
||||
rd_request_frame();
|
||||
@@ -5254,7 +5254,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(symbol_lister)
|
||||
//- rjf: submit best match when hitting enter w/ no selection
|
||||
if(slv->cursor.y == 0 && items.count != 0 && ui_slot_press(UI_EventActionSlot_Accept))
|
||||
{
|
||||
FZY_Item *item = &items.v[0];
|
||||
DIS_Item *item = &items.v[0];
|
||||
U64 base_idx = 0;
|
||||
for(U64 rdi_idx = 0; rdi_idx < rdis_count; rdi_idx += 1)
|
||||
{
|
||||
@@ -5306,7 +5306,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(symbol_lister)
|
||||
idx += 1)
|
||||
UI_Focus((slv->cursor.y == idx+1) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
FZY_Item *item = &items.v[idx];
|
||||
DIS_Item *item = &items.v[idx];
|
||||
|
||||
//- rjf: determine dbgi/rdi to which this item belongs
|
||||
DI_Key dbgi_key = {0};
|
||||
@@ -5385,7 +5385,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(symbol_lister)
|
||||
}
|
||||
|
||||
rd_store_view_scroll_pos(scroll_pos);
|
||||
fzy_scope_close(fzy_scope);
|
||||
dis_scope_close(dis_scope);
|
||||
di_scope_close(di_scope);
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
|
||||
Reference in New Issue
Block a user