mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 07:32:23 -07:00
fix impossible disasm loading condition; do not go wide on dbgi matching unless we have significant-enough dbgis
This commit is contained in:
+2
-2
@@ -46,8 +46,8 @@ load_paths =
|
||||
commands =
|
||||
{
|
||||
//- rjf: [raddbg]
|
||||
// .f1 = { .win = "raddbg_stable --ipc kill_all && build raddbg telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.f1 = { .win = "raddbg_stable --ipc kill_all && build radbin debug telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
.f1 = { .win = "raddbg_stable --ipc kill_all && build raddbg telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
// .f1 = { .win = "raddbg_stable --ipc kill_all && build radbin debug telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
|
||||
//- rjf: [raddbg wsl]
|
||||
// .f1 = { .win = "wsl ./build.sh raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||
|
||||
@@ -459,10 +459,18 @@ ac_async_tick(void)
|
||||
if(req_idx >= task->thin_count) { break; }
|
||||
AC_Request *r = &task->thin[req_idx];
|
||||
|
||||
// rjf: push thin lane ctx
|
||||
U64 thin_lane_ctx_broadcast_memory = 0;
|
||||
LaneCtx thin_lane_ctx = {0, 1, {0}, &thin_lane_ctx_broadcast_memory};
|
||||
LaneCtx lane_ctx_restore = lane_ctx(thin_lane_ctx);
|
||||
|
||||
// rjf: compute val
|
||||
B32 retry = 0;
|
||||
AC_Artifact val = r->create(r->key, r->cancel_signal, &retry);
|
||||
|
||||
// rjf: restore wide lane ctx
|
||||
lane_ctx(lane_ctx_restore);
|
||||
|
||||
// rjf: retry? -> resubmit request
|
||||
if(retry)
|
||||
{
|
||||
|
||||
@@ -202,7 +202,7 @@ c_submit_data(C_Key key, Arena **data_arena, String8 data)
|
||||
}
|
||||
|
||||
// rjf: release duplicate data if node already exists
|
||||
if(node != 0)
|
||||
if(node != 0 && data_arena != 0 && *data_arena != 0)
|
||||
{
|
||||
arena_release(*data_arena);
|
||||
}
|
||||
|
||||
@@ -6046,14 +6046,13 @@ ctrl_memory_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out)
|
||||
{
|
||||
arena_release(range_arena);
|
||||
range_base = 0;
|
||||
range_size = 0;
|
||||
range_arena = 0;
|
||||
}
|
||||
else if(bytes_read < range_size)
|
||||
{
|
||||
MemoryZero((U8 *)range_base + bytes_read, range_size-bytes_read);
|
||||
}
|
||||
zero_terminated_size = range_size;
|
||||
zero_terminated_size = bytes_read;
|
||||
if(zero_terminated && range_base != 0)
|
||||
{
|
||||
for(U64 idx = 0; idx < bytes_read; idx += 1)
|
||||
@@ -6080,7 +6079,7 @@ ctrl_memory_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out)
|
||||
|
||||
//- rjf: read successful -> submit to hash store
|
||||
U128 hash = {0};
|
||||
if(range_base != 0 && pre_read_mem_gen == post_read_mem_gen)
|
||||
if(range_size != 0 && pre_read_mem_gen == post_read_mem_gen)
|
||||
{
|
||||
hash = c_submit_data(content_key, &range_arena, str8((U8*)range_base, zero_terminated_size));
|
||||
}
|
||||
|
||||
+15
-4
@@ -367,7 +367,8 @@ di_close(DI_Key key)
|
||||
|
||||
//- rjf: release node's resources if needed
|
||||
if(node_released)
|
||||
{
|
||||
{
|
||||
ins_atomic_u64_dec_eval(&di_shared->load_count);
|
||||
os_file_map_view_close(file_map, file_base, r1u64(0, file_props.size));
|
||||
os_file_map_close(file_map);
|
||||
os_file_close(file);
|
||||
@@ -387,6 +388,13 @@ di_load_gen(void)
|
||||
U64 result = ins_atomic_u64_eval(&di_shared->load_gen);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
di_load_count(void)
|
||||
{
|
||||
U64 result = ins_atomic_u64_eval(&di_shared->load_count);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal DI_KeyArray
|
||||
di_push_all_loaded_keys(Arena *arena)
|
||||
@@ -942,7 +950,8 @@ di_async_tick(void)
|
||||
MemoryCopyStruct(&node->rdi, &rdi_parsed);
|
||||
node->completion_count += 1;
|
||||
node->working_count -= 1;
|
||||
ins_atomic_u64_inc_eval(&di_shared->load_gen);
|
||||
ins_atomic_u64_inc_eval(&di_shared->load_gen);
|
||||
ins_atomic_u64_inc_eval(&di_shared->load_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1539,8 +1548,10 @@ di_match_from_string(String8 string, U64 index, DI_Key preferred_dbgi_key, U64 e
|
||||
str8_list_push(scratch.arena, &key_parts, str8_struct(&preferred_dbgi_key));
|
||||
str8_list_push(scratch.arena, &key_parts, str8_struct(&string.size));
|
||||
str8_list_push(scratch.arena, &key_parts, string);
|
||||
String8 key = str8_list_join(scratch.arena, &key_parts, 0);
|
||||
AC_Artifact artifact = ac_artifact_from_key(access, key, di_match_artifact_create, 0, endt_us, .flags = AC_Flag_Wide, .gen = di_load_gen());
|
||||
String8 key = str8_list_join(scratch.arena, &key_parts, 0);
|
||||
U64 dbgi_count = di_load_count();
|
||||
B32 wide = (dbgi_count > 256);
|
||||
AC_Artifact artifact = ac_artifact_from_key(access, key, di_match_artifact_create, 0, endt_us, .flags = wide ? AC_Flag_Wide : 0, .gen = di_load_gen());
|
||||
result.key.u64[0] = artifact.u64[0];
|
||||
result.key.u64[1] = artifact.u64[1];
|
||||
result.section_kind = artifact.u64[2];
|
||||
|
||||
@@ -246,6 +246,7 @@ struct DI_Shared
|
||||
{
|
||||
Arena *arena;
|
||||
U64 load_gen;
|
||||
U64 load_count;
|
||||
|
||||
// rjf: key -> path cache
|
||||
U64 key2path_slots_count;
|
||||
@@ -328,6 +329,7 @@ internal void di_close(DI_Key key);
|
||||
//~ rjf: Debug Info Lookups
|
||||
|
||||
internal U64 di_load_gen(void);
|
||||
internal U64 di_load_count(void);
|
||||
internal DI_KeyArray di_push_all_loaded_keys(Arena *arena);
|
||||
internal RDI_Parsed *di_rdi_from_key(Access *access, DI_Key key, B32 high_priority, U64 endt_us);
|
||||
|
||||
|
||||
@@ -1142,7 +1142,10 @@ internal Barrier
|
||||
os_barrier_alloc(U64 count)
|
||||
{
|
||||
OS_LNX_Entity *entity = os_lnx_entity_alloc(OS_LNX_EntityKind_Barrier);
|
||||
pthread_barrier_init(&entity->barrier, 0, count);
|
||||
if(entity != 0)
|
||||
{
|
||||
pthread_barrier_init(&entity->barrier, 0, count);
|
||||
}
|
||||
Barrier result = {IntFromPtr(entity)};
|
||||
return result;
|
||||
}
|
||||
@@ -1151,15 +1154,21 @@ internal void
|
||||
os_barrier_release(Barrier barrier)
|
||||
{
|
||||
OS_LNX_Entity *entity = (OS_LNX_Entity*)PtrFromInt(barrier.u64[0]);
|
||||
pthread_barrier_destroy(&entity->barrier);
|
||||
os_lnx_entity_release(entity);
|
||||
if(entity != 0)
|
||||
{
|
||||
pthread_barrier_destroy(&entity->barrier);
|
||||
os_lnx_entity_release(entity);
|
||||
}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_barrier_wait(Barrier barrier)
|
||||
{
|
||||
OS_LNX_Entity *entity = (OS_LNX_Entity*)PtrFromInt(barrier.u64[0]);
|
||||
pthread_barrier_wait(&entity->barrier);
|
||||
if(entity != 0)
|
||||
{
|
||||
pthread_barrier_wait(&entity->barrier);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -1342,7 +1342,11 @@ internal Barrier
|
||||
os_barrier_alloc(U64 count)
|
||||
{
|
||||
OS_W32_Entity *entity = os_w32_entity_alloc(OS_W32_EntityKind_Barrier);
|
||||
BOOL init_good = InitializeSynchronizationBarrier(&entity->sb, count, -1);
|
||||
if(entity != 0)
|
||||
{
|
||||
BOOL init_good = InitializeSynchronizationBarrier(&entity->sb, count, -1);
|
||||
(void)init_good;
|
||||
}
|
||||
Barrier result = {IntFromPtr(entity)};
|
||||
return result;
|
||||
}
|
||||
@@ -1351,15 +1355,21 @@ internal void
|
||||
os_barrier_release(Barrier barrier)
|
||||
{
|
||||
OS_W32_Entity *entity = (OS_W32_Entity*)PtrFromInt(barrier.u64[0]);
|
||||
DeleteSynchronizationBarrier(&entity->sb);
|
||||
os_w32_entity_release(entity);
|
||||
if(entity != 0)
|
||||
{
|
||||
DeleteSynchronizationBarrier(&entity->sb);
|
||||
os_w32_entity_release(entity);
|
||||
}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_barrier_wait(Barrier barrier)
|
||||
{
|
||||
OS_W32_Entity *entity = (OS_W32_Entity*)PtrFromInt(barrier.u64[0]);
|
||||
EnterSynchronizationBarrier(&entity->sb, 0);
|
||||
if(entity != 0)
|
||||
{
|
||||
EnterSynchronizationBarrier(&entity->sb, 0);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -2482,8 +2482,8 @@ RD_VIEW_UI_FUNCTION_DEF(disasm)
|
||||
U128 dasm_text_hash = {0};
|
||||
TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(access, rd_regs()->text_key, rd_regs()->lang_kind, &dasm_text_hash);
|
||||
String8 dasm_text_data = c_data_from_hash(access, dasm_text_hash);
|
||||
B32 has_disasm = (dasm_info.lines.count != 0 && dasm_text_info.lines_count != 0);
|
||||
B32 is_loading = (!has_disasm && dim_1u64(range) != 0 && eval.msgs.max_kind == E_MsgKind_Null && (space.kind != RD_EvalSpaceKind_CtrlEntity || space_entity != &ctrl_entity_nil));
|
||||
B32 is_loading = (dasm_text_info.lines_count == 0 && dim_1u64(range) != 0 && eval.msgs.max_kind == E_MsgKind_Null && (space.kind != RD_EvalSpaceKind_CtrlEntity || space_entity != &ctrl_entity_nil));
|
||||
B32 has_disasm = (dasm_text_info.lines_count != 0 && dasm_info.lines.count != 0);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: is loading -> equip view with loading information
|
||||
|
||||
Reference in New Issue
Block a user