mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 14:28:40 +00:00
oops - actually respect operating system file system match flags in dbgi layer
This commit is contained in:
+23
-16
@@ -157,7 +157,8 @@ dbgi_fuzzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, DBGI_FuzzySe
|
|||||||
internal void
|
internal void
|
||||||
dbgi_force_exe_path_dbg_path(String8 exe_path, String8 dbg_path)
|
dbgi_force_exe_path_dbg_path(String8 exe_path, String8 dbg_path)
|
||||||
{
|
{
|
||||||
U64 hash = dbgi_hash_from_string(exe_path, path_match_flags_from_os(operating_system_from_context()));
|
StringMatchFlags match_flags = path_match_flags_from_os(operating_system_from_context());
|
||||||
|
U64 hash = dbgi_hash_from_string(exe_path, match_flags);
|
||||||
U64 slot_idx = hash%dbgi_shared->force_slots_count;
|
U64 slot_idx = hash%dbgi_shared->force_slots_count;
|
||||||
U64 stripe_idx = slot_idx%dbgi_shared->force_stripes_count;
|
U64 stripe_idx = slot_idx%dbgi_shared->force_stripes_count;
|
||||||
DBGI_ForceSlot *slot = &dbgi_shared->force_slots[slot_idx];
|
DBGI_ForceSlot *slot = &dbgi_shared->force_slots[slot_idx];
|
||||||
@@ -167,7 +168,7 @@ dbgi_force_exe_path_dbg_path(String8 exe_path, String8 dbg_path)
|
|||||||
DBGI_ForceNode *node = 0;
|
DBGI_ForceNode *node = 0;
|
||||||
for(DBGI_ForceNode *n = slot->first; n != 0; n = n->next)
|
for(DBGI_ForceNode *n = slot->first; n != 0; n = n->next)
|
||||||
{
|
{
|
||||||
if(str8_match(n->exe_path, exe_path, 0))
|
if(str8_match(n->exe_path, exe_path, match_flags))
|
||||||
{
|
{
|
||||||
node = n;
|
node = n;
|
||||||
break;
|
break;
|
||||||
@@ -192,7 +193,8 @@ internal String8
|
|||||||
dbgi_forced_dbg_path_from_exe_path(Arena *arena, String8 exe_path)
|
dbgi_forced_dbg_path_from_exe_path(Arena *arena, String8 exe_path)
|
||||||
{
|
{
|
||||||
String8 result = {0};
|
String8 result = {0};
|
||||||
U64 hash = dbgi_hash_from_string(exe_path, path_match_flags_from_os(operating_system_from_context()));
|
StringMatchFlags match_flags = path_match_flags_from_os(operating_system_from_context());
|
||||||
|
U64 hash = dbgi_hash_from_string(exe_path, match_flags);
|
||||||
U64 slot_idx = hash%dbgi_shared->force_slots_count;
|
U64 slot_idx = hash%dbgi_shared->force_slots_count;
|
||||||
U64 stripe_idx = slot_idx%dbgi_shared->force_stripes_count;
|
U64 stripe_idx = slot_idx%dbgi_shared->force_stripes_count;
|
||||||
DBGI_ForceSlot *slot = &dbgi_shared->force_slots[slot_idx];
|
DBGI_ForceSlot *slot = &dbgi_shared->force_slots[slot_idx];
|
||||||
@@ -202,7 +204,7 @@ dbgi_forced_dbg_path_from_exe_path(Arena *arena, String8 exe_path)
|
|||||||
DBGI_ForceNode *node = 0;
|
DBGI_ForceNode *node = 0;
|
||||||
for(DBGI_ForceNode *n = slot->first; n != 0; n = n->next)
|
for(DBGI_ForceNode *n = slot->first; n != 0; n = n->next)
|
||||||
{
|
{
|
||||||
if(str8_match(exe_path, n->exe_path, 0))
|
if(str8_match(exe_path, n->exe_path, match_flags))
|
||||||
{
|
{
|
||||||
node = n;
|
node = n;
|
||||||
break;
|
break;
|
||||||
@@ -297,7 +299,8 @@ dbgi_binary_open(String8 exe_path)
|
|||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(0, 0);
|
Temp scratch = scratch_begin(0, 0);
|
||||||
exe_path = path_normalized_from_string(scratch.arena, exe_path);
|
exe_path = path_normalized_from_string(scratch.arena, exe_path);
|
||||||
U64 hash = dbgi_hash_from_string(exe_path, path_match_flags_from_os(operating_system_from_context()));
|
StringMatchFlags match_flags = path_match_flags_from_os(operating_system_from_context());
|
||||||
|
U64 hash = dbgi_hash_from_string(exe_path, match_flags);
|
||||||
U64 slot_idx = hash%dbgi_shared->binary_slots_count;
|
U64 slot_idx = hash%dbgi_shared->binary_slots_count;
|
||||||
U64 stripe_idx = slot_idx%dbgi_shared->binary_stripes_count;
|
U64 stripe_idx = slot_idx%dbgi_shared->binary_stripes_count;
|
||||||
DBGI_BinarySlot *slot = &dbgi_shared->binary_slots[slot_idx];
|
DBGI_BinarySlot *slot = &dbgi_shared->binary_slots[slot_idx];
|
||||||
@@ -308,7 +311,7 @@ dbgi_binary_open(String8 exe_path)
|
|||||||
DBGI_Binary *binary = 0;
|
DBGI_Binary *binary = 0;
|
||||||
for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
||||||
{
|
{
|
||||||
if(str8_match(bin->exe_path, exe_path, 0))
|
if(str8_match(bin->exe_path, exe_path, match_flags))
|
||||||
{
|
{
|
||||||
binary = bin;
|
binary = bin;
|
||||||
break;
|
break;
|
||||||
@@ -336,7 +339,8 @@ dbgi_binary_close(String8 exe_path)
|
|||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(0, 0);
|
Temp scratch = scratch_begin(0, 0);
|
||||||
exe_path = path_normalized_from_string(scratch.arena, exe_path);
|
exe_path = path_normalized_from_string(scratch.arena, exe_path);
|
||||||
U64 hash = dbgi_hash_from_string(exe_path, path_match_flags_from_os(operating_system_from_context()));
|
StringMatchFlags match_flags = path_match_flags_from_os(operating_system_from_context());
|
||||||
|
U64 hash = dbgi_hash_from_string(exe_path, match_flags);
|
||||||
U64 slot_idx = hash%dbgi_shared->binary_slots_count;
|
U64 slot_idx = hash%dbgi_shared->binary_slots_count;
|
||||||
U64 stripe_idx = slot_idx%dbgi_shared->binary_stripes_count;
|
U64 stripe_idx = slot_idx%dbgi_shared->binary_stripes_count;
|
||||||
DBGI_BinarySlot *slot = &dbgi_shared->binary_slots[slot_idx];
|
DBGI_BinarySlot *slot = &dbgi_shared->binary_slots[slot_idx];
|
||||||
@@ -346,7 +350,7 @@ dbgi_binary_close(String8 exe_path)
|
|||||||
DBGI_Binary *binary = 0;
|
DBGI_Binary *binary = 0;
|
||||||
for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
||||||
{
|
{
|
||||||
if(str8_match(bin->exe_path, exe_path, 0))
|
if(str8_match(bin->exe_path, exe_path, match_flags))
|
||||||
{
|
{
|
||||||
binary = bin;
|
binary = bin;
|
||||||
break;
|
break;
|
||||||
@@ -393,7 +397,8 @@ dbgi_parse_from_exe_path(DBGI_Scope *scope, String8 exe_path, U64 endt_us)
|
|||||||
DBGI_Parse *parse = &dbgi_parse_nil;
|
DBGI_Parse *parse = &dbgi_parse_nil;
|
||||||
if(exe_path.size != 0)
|
if(exe_path.size != 0)
|
||||||
{
|
{
|
||||||
U64 hash = dbgi_hash_from_string(exe_path, path_match_flags_from_os(operating_system_from_context()));
|
StringMatchFlags match_flags = path_match_flags_from_os(operating_system_from_context());
|
||||||
|
U64 hash = dbgi_hash_from_string(exe_path, match_flags);
|
||||||
U64 slot_idx = hash%dbgi_shared->binary_slots_count;
|
U64 slot_idx = hash%dbgi_shared->binary_slots_count;
|
||||||
U64 stripe_idx = slot_idx%dbgi_shared->binary_stripes_count;
|
U64 stripe_idx = slot_idx%dbgi_shared->binary_stripes_count;
|
||||||
DBGI_BinarySlot *slot = &dbgi_shared->binary_slots[slot_idx];
|
DBGI_BinarySlot *slot = &dbgi_shared->binary_slots[slot_idx];
|
||||||
@@ -404,7 +409,7 @@ dbgi_parse_from_exe_path(DBGI_Scope *scope, String8 exe_path, U64 endt_us)
|
|||||||
DBGI_Binary *binary = 0;
|
DBGI_Binary *binary = 0;
|
||||||
for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
||||||
{
|
{
|
||||||
if(str8_match(bin->exe_path, exe_path, 0))
|
if(str8_match(bin->exe_path, exe_path, match_flags))
|
||||||
{
|
{
|
||||||
binary = bin;
|
binary = bin;
|
||||||
break;
|
break;
|
||||||
@@ -446,6 +451,7 @@ dbgi_fuzzy_search_items_from_key_exe_query(DBGI_Scope *scope, U128 key, String8
|
|||||||
Temp scratch = scratch_begin(0, 0);
|
Temp scratch = scratch_begin(0, 0);
|
||||||
DBGI_FuzzySearchItemArray items = {0};
|
DBGI_FuzzySearchItemArray items = {0};
|
||||||
exe_path = path_normalized_from_string(scratch.arena, exe_path);
|
exe_path = path_normalized_from_string(scratch.arena, exe_path);
|
||||||
|
StringMatchFlags match_flags = path_match_flags_from_os(operating_system_from_context());
|
||||||
{
|
{
|
||||||
//- rjf: unpack key
|
//- rjf: unpack key
|
||||||
U64 slot_idx = key.u64[1]%dbgi_shared->fuzzy_search_slots_count;
|
U64 slot_idx = key.u64[1]%dbgi_shared->fuzzy_search_slots_count;
|
||||||
@@ -481,7 +487,7 @@ dbgi_fuzzy_search_items_from_key_exe_query(DBGI_Scope *scope, U128 key, String8
|
|||||||
|
|
||||||
// rjf: try to grab last valid results for this key/query; determine if stale
|
// rjf: try to grab last valid results for this key/query; determine if stale
|
||||||
B32 stale = 1;
|
B32 stale = 1;
|
||||||
if(str8_match(exe_path, node->buckets[node->gen%ArrayCount(node->buckets)].exe_path, 0) &&
|
if(str8_match(exe_path, node->buckets[node->gen%ArrayCount(node->buckets)].exe_path, match_flags) &&
|
||||||
target == node->buckets[node->gen%ArrayCount(node->buckets)].target &&
|
target == node->buckets[node->gen%ArrayCount(node->buckets)].target &&
|
||||||
node->gen != 0)
|
node->gen != 0)
|
||||||
{
|
{
|
||||||
@@ -639,6 +645,7 @@ dbgi_parse_thread_entry_point(void *p)
|
|||||||
|
|
||||||
//- rjf: grab next path & unpack
|
//- rjf: grab next path & unpack
|
||||||
String8 exe_path = dbgi_u2p_dequeue_exe_path(scratch.arena);
|
String8 exe_path = dbgi_u2p_dequeue_exe_path(scratch.arena);
|
||||||
|
StringMatchFlags match_flags = path_match_flags_from_os(operating_system_from_context());
|
||||||
ProfBegin("begin task for \"%.*s\"", str8_varg(exe_path));
|
ProfBegin("begin task for \"%.*s\"", str8_varg(exe_path));
|
||||||
U64 hash = dbgi_hash_from_string(exe_path, path_match_flags_from_os(operating_system_from_context()));
|
U64 hash = dbgi_hash_from_string(exe_path, path_match_flags_from_os(operating_system_from_context()));
|
||||||
U64 slot_idx = hash%dbgi_shared->binary_slots_count;
|
U64 slot_idx = hash%dbgi_shared->binary_slots_count;
|
||||||
@@ -654,7 +661,7 @@ dbgi_parse_thread_entry_point(void *p)
|
|||||||
DBGI_Binary *binary = 0;
|
DBGI_Binary *binary = 0;
|
||||||
for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
||||||
{
|
{
|
||||||
if(str8_match(bin->exe_path, exe_path, 0))
|
if(str8_match(bin->exe_path, exe_path, match_flags))
|
||||||
{
|
{
|
||||||
binary = bin;
|
binary = bin;
|
||||||
break;
|
break;
|
||||||
@@ -942,7 +949,7 @@ dbgi_parse_thread_entry_point(void *p)
|
|||||||
{
|
{
|
||||||
OS_MutexScopeR(stripe->rw_mutex) for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
OS_MutexScopeR(stripe->rw_mutex) for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
||||||
{
|
{
|
||||||
if(str8_match(bin->exe_path, exe_path, 0) &&
|
if(str8_match(bin->exe_path, exe_path, match_flags) &&
|
||||||
bin->scope_touch_count == 0)
|
bin->scope_touch_count == 0)
|
||||||
{
|
{
|
||||||
done = 1;
|
done = 1;
|
||||||
@@ -961,7 +968,7 @@ dbgi_parse_thread_entry_point(void *p)
|
|||||||
{
|
{
|
||||||
OS_MutexScopeW(stripe->rw_mutex) for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
OS_MutexScopeW(stripe->rw_mutex) for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
||||||
{
|
{
|
||||||
if(str8_match(bin->exe_path, exe_path, 0))
|
if(str8_match(bin->exe_path, exe_path, match_flags))
|
||||||
{
|
{
|
||||||
if(bin->refcount == 0)
|
if(bin->refcount == 0)
|
||||||
{
|
{
|
||||||
@@ -1032,7 +1039,7 @@ dbgi_parse_thread_entry_point(void *p)
|
|||||||
{
|
{
|
||||||
OS_MutexScopeW(stripe->rw_mutex) for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
OS_MutexScopeW(stripe->rw_mutex) for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
||||||
{
|
{
|
||||||
if(str8_match(bin->exe_path, exe_path, 0))
|
if(str8_match(bin->exe_path, exe_path, match_flags))
|
||||||
{
|
{
|
||||||
String8 dbg_path = og_dbg_path;
|
String8 dbg_path = og_dbg_path;
|
||||||
if(dbg_path.size == 0)
|
if(dbg_path.size == 0)
|
||||||
@@ -1069,7 +1076,7 @@ dbgi_parse_thread_entry_point(void *p)
|
|||||||
{
|
{
|
||||||
OS_MutexScopeW(stripe->rw_mutex) for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
OS_MutexScopeW(stripe->rw_mutex) for(DBGI_Binary *bin = slot->first; bin != 0; bin = bin->next)
|
||||||
{
|
{
|
||||||
if(str8_match(bin->exe_path, exe_path, 0))
|
if(str8_match(bin->exe_path, exe_path, match_flags))
|
||||||
{
|
{
|
||||||
bin->flags &= ~DBGI_BinaryFlag_ParseInFlight;
|
bin->flags &= ~DBGI_BinaryFlag_ParseInFlight;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user