mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-04 21:08:40 +00:00
eliminate path-tree-based keying of debug info on frontend; use dbgi-layer-defined debug info keys, which can be more robust to changes to the same debug info path across time (e.g. during hot reloads
This commit is contained in:
@@ -22,7 +22,7 @@ fzy_hash_from_params(FZY_Params *params)
|
||||
hash = fzy_hash_from_string(hash, str8_struct(¶ms->target));
|
||||
for(U64 idx = 0; idx < params->dbgi_keys.count; idx += 1)
|
||||
{
|
||||
hash = fzy_hash_from_string(hash, str8_struct(¶ms->dbgi_keys.v[idx].timestamp));
|
||||
hash = fzy_hash_from_string(hash, str8_struct(¶ms->dbgi_keys.v[idx].min_timestamp));
|
||||
hash = fzy_hash_from_string(hash, params->dbgi_keys.v[idx].path);
|
||||
}
|
||||
return hash;
|
||||
@@ -84,35 +84,13 @@ fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, FZY_Target target,
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void
|
||||
fzy_dbgi_key_list_push(Arena *arena, FZY_DbgiKeyList *list, FZY_DbgiKey key)
|
||||
{
|
||||
FZY_DbgiKeyNode *n = push_array(arena, FZY_DbgiKeyNode, 1);
|
||||
n->v = key;
|
||||
SLLQueuePush(list->first, list->last, n);
|
||||
list->count += 1;
|
||||
}
|
||||
|
||||
internal FZY_DbgiKeyArray
|
||||
fzy_dbgi_key_array_from_list(Arena *arena, FZY_DbgiKeyList *list)
|
||||
{
|
||||
FZY_DbgiKeyArray array = {0};
|
||||
array.v = push_array(arena, FZY_DbgiKey, list->count);
|
||||
U64 idx = 0;
|
||||
for(FZY_DbgiKeyNode *n = list->first; n != 0; n = n->next, idx += 1)
|
||||
{
|
||||
array.v[idx] = n->v;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
internal FZY_Params
|
||||
fzy_params_copy(Arena *arena, FZY_Params *src)
|
||||
{
|
||||
FZY_Params dst = zero_struct;
|
||||
MemoryCopyStruct(&dst, src);
|
||||
dst.dbgi_keys.v = push_array(arena, FZY_DbgiKey, dst.dbgi_keys.count);
|
||||
MemoryCopy(dst.dbgi_keys.v, src->dbgi_keys.v, sizeof(FZY_DbgiKey)*src->dbgi_keys.count);
|
||||
dst.dbgi_keys.v = push_array(arena, DI_Key, dst.dbgi_keys.count);
|
||||
MemoryCopy(dst.dbgi_keys.v, src->dbgi_keys.v, sizeof(DI_Key)*src->dbgi_keys.count);
|
||||
for(U64 idx = 0; idx < dst.dbgi_keys.count; idx += 1)
|
||||
{
|
||||
dst.dbgi_keys.v[idx].path = push_str8_copy(arena, dst.dbgi_keys.v[idx].path);
|
||||
@@ -422,7 +400,7 @@ fzy_search_thread__entry_point(void *p)
|
||||
{
|
||||
for(U64 idx = 0; idx < rdis_count; idx += 1)
|
||||
{
|
||||
rdis[idx] = di_rdi_from_path_min_timestamp(di_scope, params.dbgi_keys.v[idx].path, params.dbgi_keys.v[idx].timestamp, max_U64);
|
||||
rdis[idx] = di_rdi_from_key(di_scope, ¶ms.dbgi_keys.v[idx], max_U64);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,40 +53,11 @@ typedef enum FZY_Target
|
||||
}
|
||||
FZY_Target;
|
||||
|
||||
typedef struct FZY_DbgiKey FZY_DbgiKey;
|
||||
struct FZY_DbgiKey
|
||||
{
|
||||
String8 path;
|
||||
U64 timestamp;
|
||||
};
|
||||
|
||||
typedef struct FZY_DbgiKeyNode FZY_DbgiKeyNode;
|
||||
struct FZY_DbgiKeyNode
|
||||
{
|
||||
FZY_DbgiKeyNode *next;
|
||||
FZY_DbgiKey v;
|
||||
};
|
||||
|
||||
typedef struct FZY_DbgiKeyList FZY_DbgiKeyList;
|
||||
struct FZY_DbgiKeyList
|
||||
{
|
||||
FZY_DbgiKeyNode *first;
|
||||
FZY_DbgiKeyNode *last;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct FZY_DbgiKeyArray FZY_DbgiKeyArray;
|
||||
struct FZY_DbgiKeyArray
|
||||
{
|
||||
FZY_DbgiKey *v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct FZY_Params FZY_Params;
|
||||
struct FZY_Params
|
||||
{
|
||||
FZY_Target target;
|
||||
FZY_DbgiKeyArray dbgi_keys;
|
||||
DI_KeyArray dbgi_keys;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -199,8 +170,6 @@ internal U64 fzy_hash_from_string(U64 seed, String8 string);
|
||||
internal U64 fzy_hash_from_params(FZY_Params *params);
|
||||
internal U64 fzy_item_num_from_array_element_idx__linear_search(FZY_ItemArray *array, U64 element_idx);
|
||||
internal String8 fzy_item_string_from_rdi_target_element_idx(RDI_Parsed *rdi, FZY_Target target, U64 element_idx);
|
||||
internal void fzy_dbgi_key_list_push(Arena *arena, FZY_DbgiKeyList *list, FZY_DbgiKey key);
|
||||
internal FZY_DbgiKeyArray fzy_dbgi_key_array_from_list(Arena *arena, FZY_DbgiKeyList *list);
|
||||
internal FZY_Params fzy_params_copy(Arena *arena, FZY_Params *src);
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user