diff --git a/src/dbg_info/dbg_info2.c b/src/dbg_info/dbg_info2.c index 2324dd39..1e357805 100644 --- a/src/dbg_info/dbg_info2.c +++ b/src/dbg_info/dbg_info2.c @@ -1347,6 +1347,7 @@ di2_match_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out) } scratch_end(scratch); + return artifact; } internal DI2_Match diff --git a/src/scratch/ryan_scratch.c b/src/scratch/ryan_scratch.c index 692a9e04..7729b4e1 100644 --- a/src/scratch/ryan_scratch.c +++ b/src/scratch/ryan_scratch.c @@ -34,16 +34,53 @@ internal void entry_point(CmdLine *cmdline) { - DI2_Key key = di2_key_from_path_timestamp(str8_lit("C:/devel/raddebugger/build/raddbg.pdb"), 0); - di2_open(key); + local_persist char *pdb_paths[] = + { + "C:/devel/raddebugger/build/raddbg.pdb", + // #include "fn_debug_infos.inc" + }; + + DI2_Key keys[ArrayCount(pdb_paths)] = {0}; + for EachElement(idx, pdb_paths) + { + String8 path = str8_cstring(pdb_paths[idx]); + keys[idx] = di2_key_from_path_timestamp(path, 0); + di2_open(keys[idx]); + } + for(;;) { Access *access = access_open(); - RDI_Parsed *rdi = di2_rdi_from_key(access, key, 1, 0); - if(rdi != &rdi_parsed_nil) + B32 got_all_rdis = 1; + U64 num_rdis_loaded = 0; + for EachElement(idx, pdb_paths) { - int x = 0; + RDI_Parsed *rdi = di2_rdi_from_key(access, keys[idx], 1, 0); + if(rdi == &rdi_parsed_nil) + { + got_all_rdis = 0; + } + else + { + num_rdis_loaded += 1; + } } + printf("\rloaded [%I64u/%I64u], %I64u active threads, %I64u active processes", num_rdis_loaded, ArrayCount(pdb_paths), di2_shared->conversion_thread_count, di2_shared->conversion_process_count); access_close(access); + if(got_all_rdis) + { + Access *access = access_open(); + String8 search_query = str8_lit("rd_"); + DI2_SearchItemArray items = di2_search_item_array_from_target_query(access, RDI_SectionKind_Procedures, search_query, max_U64); + printf("\n"); + printf("fuzzy searched for %.*s, found %I64u items\n", str8_varg(search_query), items.count); + access_close(access); + + String8 match_query = str8_lit("rd_frame"); + DI2_Match match = di2_match_from_string(match_query, 0, max_U64); + printf("searched for %.*s, found at %i in [%I64x:%I64x]\n", str8_varg(match_query), match.idx, match.key.u64[0], match.key.u64[1]); + + break; + } } }