Skip to content

Commit

Permalink
adjust failure cases in conversion; adjust waiting time period in pre…
Browse files Browse the repository at this point in the history
…-emptive heuristic conversion rule; avoid bp resolution path & waiting on debug info when unnecessary
  • Loading branch information
ryanfleury committed Dec 3, 2024
1 parent aee2d51 commit 94c4000
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/ctrl/ctrl_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3314,6 +3314,7 @@ ctrl_thread__entry_point(void *p)
internal void
ctrl_thread__append_resolved_module_user_bp_traps(Arena *arena, CTRL_Handle process, CTRL_Handle module, CTRL_UserBreakpointList *user_bps, DMN_TrapChunkList *traps_out)
{
if(user_bps->first == 0) { return; }
Temp scratch = scratch_begin(&arena, 1);
DI_Scope *di_scope = di_scope_open();
CTRL_Entity *module_entity = ctrl_entity_from_handle(ctrl_state->ctrl_thread_entity_store, module);
Expand Down Expand Up @@ -4136,6 +4137,8 @@ ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg,
(ctrl_state->ctrl_thread_entity_store->entity_kind_counts[CTRL_EntityKind_Module] > 256 ||
ctrl_state->ctrl_thread_entity_store->entity_kind_counts[CTRL_EntityKind_Module] == 1))
{
U64 endt_us = os_now_microseconds() + 1000000;

//- rjf: unpack event
CTRL_Handle process_handle = ctrl_handle_make(CTRL_MachineID_Local, event->process);
CTRL_Handle loaded_module_handle = ctrl_handle_make(CTRL_MachineID_Local, event->module);
Expand Down Expand Up @@ -4292,7 +4295,7 @@ ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg,
for(DI_KeyNode *n = preemptively_loaded_keys.first; n != 0; n = n->next)
{
DI_Scope *di_scope = di_scope_open();
RDI_Parsed *rdi = di_rdi_from_key(di_scope, &n->v, max_U64);
RDI_Parsed *rdi = di_rdi_from_key(di_scope, &n->v, endt_us);
di_scope_close(di_scope);
di_close(&n->v);
}
Expand Down
14 changes: 9 additions & 5 deletions src/raddbg/raddbg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,36 +1079,40 @@ entry_point(CmdLine *cmd_line)

//- rjf: convert
P2R_Convert2Bake *convert2bake = 0;
if(out_file_is_good)
if(out_file_is_good) ProfScope("convert")
{
convert2bake = p2r_convert(scratch.arena, user2convert);
}

//- rjf: bake
P2R_Bake2Serialize *bake2srlz = 0;
ProfScope("bake")
if(out_file_is_good) ProfScope("bake")
{
bake2srlz = p2r_bake(scratch.arena, convert2bake);
}

//- rjf: serialize
P2R_Serialize2File *srlz2file = 0;
ProfScope("serialize")
if(out_file_is_good) ProfScope("serialize")
{
srlz2file = push_array(scratch.arena, P2R_Serialize2File, 1);
srlz2file->bundle = rdim_serialized_section_bundle_from_bake_results(&bake2srlz->bake_results);
}

//- rjf: compress
P2R_Serialize2File *srlz2file_compressed = srlz2file;
if(cmd_line_has_flag(cmd_line, str8_lit("compress"))) ProfScope("compress")
if(out_file_is_good) if(cmd_line_has_flag(cmd_line, str8_lit("compress"))) ProfScope("compress")
{
srlz2file_compressed = push_array(scratch.arena, P2R_Serialize2File, 1);
srlz2file_compressed = p2r_compress(scratch.arena, srlz2file);
}

//- rjf: serialize
String8List blobs = rdim_file_blobs_from_section_bundle(scratch.arena, &srlz2file_compressed->bundle);
String8List blobs = {0};
if(out_file_is_good)
{
blobs = rdim_file_blobs_from_section_bundle(scratch.arena, &srlz2file_compressed->bundle);
}

//- rjf: write
if(out_file_is_good)
Expand Down
5 changes: 2 additions & 3 deletions src/scratch/convertperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ entry_point(CmdLine *cmdline)
String8List lines = str8_split(arena, list_data, splits, ArrayCount(splits), 0);
OS_HandleList processes = {0};
String8Node *processes_first_path_n = 0;

U64 limit = 32;
U64 limit = 64;
U64 idx = 0;
for(String8Node *n = lines.first; n != 0; n = n->next)
{
Expand All @@ -54,7 +53,7 @@ entry_point(CmdLine *cmdline)
String8 dll_name = str8_skip_last_slash(dll_path_no_ext);
String8 pdb_path = push_str8f(arena, "%S.pdb", dll_path_no_ext);
String8 rdi_path = push_str8f(arena, "dump/%S.rdi", dll_name);
OS_Handle handle = os_cmd_line_launchf("raddbg --convert --work_threads_count:1 --pdb:%S --out:%S", pdb_path, rdi_path);
OS_Handle handle = os_cmd_line_launchf("raddbg --convert --pdb:%S --out:%S", pdb_path, rdi_path);
os_handle_list_push(arena, &processes, handle);
if(processes_first_path_n == 0)
{
Expand Down

0 comments on commit 94c4000

Please sign in to comment.