checkpoint in getting off of d_entities and onto ctrl_entities for frontend paths, including thread selection & df_regs

This commit is contained in:
Ryan Fleury
2024-09-12 16:30:26 -07:00
parent 3641c212b2
commit 71cb03f3be
16 changed files with 622 additions and 525 deletions
+13
View File
@@ -544,6 +544,18 @@ ctrl_entity_list_push(Arena *arena, CTRL_EntityList *list, CTRL_Entity *entity)
list->count += 1;
}
internal CTRL_EntityList
ctrl_entity_list_from_handle_list(Arena *arena, CTRL_EntityStore *store, CTRL_HandleList *list)
{
CTRL_EntityList result = {0};
for(CTRL_HandleNode *n = list->first; n != 0; n = n->next)
{
CTRL_Entity *entity = ctrl_entity_from_handle(store, n->v);
ctrl_entity_list_push(arena, &result, entity);
}
return result;
}
//- rjf: cache creation/destruction
internal CTRL_EntityStore *
@@ -1057,6 +1069,7 @@ ctrl_entity_store_apply_events(CTRL_EntityStore *store, CTRL_EventList *list)
{
CTRL_Entity *process = ctrl_entity_from_handle(store, event->parent);
CTRL_Entity *thread = ctrl_entity_alloc(store, process, CTRL_EntityKind_Thread, event->arch, event->entity, (U64)event->entity_id);
thread->stack_base = event->stack_base;
ctrl_query_cached_rip_from_thread(store, event->entity);
}break;
case CTRL_EventKind_EndThread:
+6 -1
View File
@@ -44,6 +44,7 @@ typedef enum CTRL_EntityKind
{
CTRL_EntityKind_Null,
CTRL_EntityKind_Root,
CTRL_EntityKind_Machine,
CTRL_EntityKind_Process,
CTRL_EntityKind_Thread,
@@ -65,9 +66,11 @@ struct CTRL_Entity
CTRL_EntityKind kind;
Arch arch;
B32 is_frozen;
U32 rgba;
CTRL_Handle handle;
U64 id;
Rng1U64 vaddr_range;
U64 stack_base;
U64 timestamp;
String8 string;
};
@@ -265,7 +268,7 @@ struct CTRL_UserBreakpointList
typedef U64 CTRL_EvalSpaceKind;
enum
{
CTRL_EvalSpaceKind_Entity,
CTRL_EvalSpaceKind_Entity = E_SpaceKind_FirstUserDefined,
};
////////////////////////////////
@@ -728,6 +731,8 @@ internal CTRL_Event ctrl_event_from_serialized_string(Arena *arena, String8 stri
//- rjf: entity list data structures
internal void ctrl_entity_list_push(Arena *arena, CTRL_EntityList *list, CTRL_Entity *entity);
internal CTRL_EntityList ctrl_entity_list_from_handle_list(Arena *arena, CTRL_EntityStore *store, CTRL_HandleList *list);
#define ctrl_entity_list_first(list) ((list)->first ? (list)->first->v : &ctrl_entity_nil)
//- rjf: cache creation/destruction
internal CTRL_EntityStore *ctrl_entity_store_alloc(void);