transmit user breakpoints hit from demon -> ctrl using ctrl-defined IDs, correllate those IDs to rd-defined IDs, use rd-defined IDs in stop events to count bp hits, rather than re-resolving breakpoints. further fixes & work on first pass of data breakpoints

This commit is contained in:
Ryan Fleury
2025-04-12 14:28:38 -07:00
parent d894f7112f
commit 0f380e9228
6 changed files with 181 additions and 71 deletions
+3
View File
@@ -1795,6 +1795,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
evt->cause = cause;
evt->thread = thread->kind == CTRL_EntityKind_Thread ? thread->handle : ctrl_handle_zero();
evt->vaddr = event->rip_vaddr;
evt->id = event->u64_code;
}
}break;
@@ -2417,6 +2418,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
{
CTRL_UserBreakpoint ctrl_user_bp = {CTRL_UserBreakpointKind_FileNameAndLineColNumber};
ctrl_user_bp.flags = ctrl_bp_flags;
ctrl_user_bp.id = bp->id;
ctrl_user_bp.string = n->string;
ctrl_user_bp.pt = bp->pt;
ctrl_user_bp.condition = bp->condition;
@@ -2430,6 +2432,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
{
CTRL_UserBreakpoint ctrl_user_bp = {CTRL_UserBreakpointKind_Expression};
ctrl_user_bp.flags = ctrl_bp_flags;
ctrl_user_bp.id = bp->id;
ctrl_user_bp.string = bp->vaddr_expr;
ctrl_user_bp.condition = bp->condition;
ctrl_user_bp.size = bp->size;
+2
View File
@@ -40,6 +40,7 @@ typedef struct D_Breakpoint D_Breakpoint;
struct D_Breakpoint
{
D_BreakpointFlags flags;
U64 id;
String8 file_path;
TxtPt pt;
String8 vaddr_expr;
@@ -98,6 +99,7 @@ struct D_Event
CTRL_Handle thread;
U64 vaddr;
U64 code;
U64 id;
};
typedef struct D_EventNode D_EventNode;