mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-04 12:58:41 +00:00
extend dbgi matching system with preferred dbgi key, to disambiguate results - fill with primary module dbgi in eval, to always prefer selected thread context when applicable
This commit is contained in:
+13
-7
@@ -1431,11 +1431,13 @@ di_match_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out)
|
||||
|
||||
//- rjf: unpack key
|
||||
U64 index = 0;
|
||||
String8 name = {0};
|
||||
String8 name = {0};
|
||||
DI_Key preferred_key = {0};
|
||||
{
|
||||
U64 key_read_off = 0;
|
||||
key_read_off += str8_deserial_read_struct(key, key_read_off, &index);
|
||||
key_read_off += str8_deserial_read_struct(key, key_read_off, &name.size);
|
||||
key_read_off += str8_deserial_read_struct(key, key_read_off, &index);
|
||||
key_read_off += str8_deserial_read_struct(key, key_read_off, &preferred_key);
|
||||
key_read_off += str8_deserial_read_struct(key, key_read_off, &name.size);
|
||||
name.str = push_array_no_zero(scratch.arena, U8, name.size);
|
||||
key_read_off += str8_deserial_read(key, key_read_off, name.str, name.size, 1);
|
||||
}
|
||||
@@ -1501,8 +1503,11 @@ di_match_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out)
|
||||
{
|
||||
if(lane_matches[idx].idx != 0)
|
||||
{
|
||||
match = lane_matches[idx];
|
||||
break;
|
||||
match = lane_matches[idx];
|
||||
if(di_key_match(di_key_zero(), preferred_key) || di_key_match(match.key, preferred_key))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1523,7 +1528,7 @@ di_match_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out)
|
||||
}
|
||||
|
||||
internal DI_Match
|
||||
di_match_from_string(String8 string, U64 index, U64 endt_us)
|
||||
di_match_from_string(String8 string, U64 index, DI_Key preferred_dbgi_key, U64 endt_us)
|
||||
{
|
||||
DI_Match result = {0};
|
||||
Access *access = access_open();
|
||||
@@ -1531,7 +1536,8 @@ di_match_from_string(String8 string, U64 index, U64 endt_us)
|
||||
{
|
||||
String8List key_parts = {0};
|
||||
str8_list_push(scratch.arena, &key_parts, str8_struct(&index));
|
||||
str8_list_push(scratch.arena, &key_parts, str8_struct(&string.size));
|
||||
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());
|
||||
|
||||
@@ -358,6 +358,6 @@ internal DI_SearchItemArray di_search_item_array_from_target_query(Access *acces
|
||||
//~ rjf: Match Artifact Cache Hooks / Lookups
|
||||
|
||||
internal AC_Artifact di_match_artifact_create(String8 key, B32 *cancel_signal, B32 *retry_out);
|
||||
internal DI_Match di_match_from_string(String8 string, U64 index, U64 endt_us);
|
||||
internal DI_Match di_match_from_string(String8 string, U64 index, DI_Key preferred_dbgi_key, U64 endt_us);
|
||||
|
||||
#endif // DBG_INFO_H
|
||||
|
||||
Reference in New Issue
Block a user