mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-10-14 04:49:41 -07:00
eliminate backend-specific module parsing from debug engine ctrl thread; just pass that info back via the demon event
This commit is contained in:
1 parent
d98d6b56d9
commit
9cc2afc659
20 files changed
+825
-544
No files matched your search
@@ -119,5 +119,6 @@ dmn_event_list_push(Arena *arena, DMN_EventList *list)
|
||||
SLLQueuePush(list->first, list->last, n);
|
||||
list->count += 1;
|
||||
DMN_Event *result = &n->v;
|
||||
result->module_info = &dmn_module_info_nil;
|
||||
return result;
|
||||
}
|
||||
+51
-8
@@ -69,33 +69,72 @@ struct DMN_HandleArray
|
||||
////////////////////////////////
|
||||
//~ rjf: Event Types
|
||||
|
||||
typedef struct DMN_ModuleInfo DMN_ModuleInfo;
|
||||
struct DMN_ModuleInfo
|
||||
{
|
||||
// rjf: image architecture
|
||||
Arch arch;
|
||||
|
||||
// rjf: image virtual size
|
||||
U64 vsize;
|
||||
|
||||
// rjf: entry point
|
||||
U64 entry_point_voff;
|
||||
|
||||
// rjf: module path
|
||||
String8 module_path;
|
||||
|
||||
// rjf: debug info key
|
||||
String8 debug_info_path;
|
||||
Guid debug_info_guid;
|
||||
U64 debug_info_timestamp;
|
||||
U64 debug_info_age;
|
||||
|
||||
// rjf: thread-local storage info
|
||||
U64 tls_index;
|
||||
U64 tls_offset;
|
||||
|
||||
// rjf: unwinding info
|
||||
Rng1U64 pe_intel_pdatas_vaddr_range;
|
||||
Rng1U64 eh_frame_header_vaddr_range;
|
||||
U64 cfi_rebase;
|
||||
|
||||
// rjf: special raddbg data
|
||||
Rng1U64 raddbg_info_voff_range;
|
||||
U64 raddbg_is_attached_marker_voff;
|
||||
};
|
||||
|
||||
typedef struct DMN_Event DMN_Event;
|
||||
struct DMN_Event
|
||||
{
|
||||
// rjf: categories
|
||||
DMN_EventKind kind;
|
||||
DMN_ErrorKind error_kind;
|
||||
DMN_MemoryEventKind memory_kind;
|
||||
DMN_ExceptionKind exception_kind;
|
||||
|
||||
// rjf: entities
|
||||
DMN_Handle process;
|
||||
DMN_Handle thread;
|
||||
DMN_Handle module;
|
||||
|
||||
// rjf: general event properties
|
||||
Arch arch;
|
||||
U64 address;
|
||||
U64 size;
|
||||
String8 string;
|
||||
U32 code; // code gives pid & tid on CreateProcess and CreateThread (respectfully)
|
||||
U32 code; // code -> exception code (signo on Linux), pid/tid
|
||||
U32 flags; // DMN_TrapFlags, if `DMN_EventKind_SetBreakpoint`
|
||||
S32 signo;
|
||||
S32 sigcode;
|
||||
Rng1U64 elf_phdr_vrange;
|
||||
U64 elf_phdr_entsize;
|
||||
U64 instruction_pointer;
|
||||
U64 stack_pointer;
|
||||
U64 user_data;
|
||||
B32 exception_repeated;
|
||||
U64 tls_index;
|
||||
U64 tls_offset;
|
||||
|
||||
// rjf: process info
|
||||
DMN_TlsModel tls_model;
|
||||
|
||||
// rjf: module info
|
||||
DMN_ModuleInfo *module_info;
|
||||
};
|
||||
|
||||
typedef struct DMN_EventNode DMN_EventNode;
|
||||
@@ -181,6 +220,11 @@ struct DMN_ProcessInfo
|
||||
U32 pid;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
read_only global DMN_ModuleInfo dmn_module_info_nil = {0};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Type Functions (Helpers, Implemented Once)
|
||||
|
||||
@@ -247,7 +291,6 @@ internal U64 dmn_process_read(DMN_Handle process, Rng1U64 range, void *dst);
|
||||
internal B32 dmn_process_write(DMN_Handle process, Rng1U64 range, void *src);
|
||||
|
||||
//- rjf: threads
|
||||
internal Arch dmn_arch_from_thread(DMN_Handle handle);
|
||||
internal U64 dmn_stack_base_vaddr_from_thread(DMN_Handle handle);
|
||||
internal U64 dmn_tls_root_vaddr_from_thread(DMN_Handle handle);
|
||||
internal B32 dmn_thread_read_reg_block(DMN_Handle handle, void *reg_block);
|
||||
|
||||
@@ -13,6 +13,7 @@ DMN_EventKindTable:
|
||||
{ExitThread}
|
||||
{LoadModule}
|
||||
{UnloadModule}
|
||||
{ModuleDebugInfo}
|
||||
{Breakpoint}
|
||||
{Trap}
|
||||
{SingleStep}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//- GENERATED CODE
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
String8 dmn_event_kind_string_table[21] =
|
||||
String8 dmn_event_kind_string_table[22] =
|
||||
{
|
||||
str8_lit_comp("Null"),
|
||||
str8_lit_comp("Error"),
|
||||
@@ -15,6 +15,7 @@ str8_lit_comp("CreateThread"),
|
||||
str8_lit_comp("ExitThread"),
|
||||
str8_lit_comp("LoadModule"),
|
||||
str8_lit_comp("UnloadModule"),
|
||||
str8_lit_comp("ModuleDebugInfo"),
|
||||
str8_lit_comp("Breakpoint"),
|
||||
str8_lit_comp("Trap"),
|
||||
str8_lit_comp("SingleStep"),
|
||||
|
||||
@@ -17,6 +17,7 @@ DMN_EventKind_CreateThread,
|
||||
DMN_EventKind_ExitThread,
|
||||
DMN_EventKind_LoadModule,
|
||||
DMN_EventKind_UnloadModule,
|
||||
DMN_EventKind_ModuleDebugInfo,
|
||||
DMN_EventKind_Breakpoint,
|
||||
DMN_EventKind_Trap,
|
||||
DMN_EventKind_SingleStep,
|
||||
@@ -62,7 +63,7 @@ DMN_ExceptionKind_COUNT,
|
||||
} DMN_ExceptionKind;
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 dmn_event_kind_string_table[21];
|
||||
extern String8 dmn_event_kind_string_table[22];
|
||||
extern String8 dmn_exception_kind_string_table[5];
|
||||
|
||||
C_LINKAGE_END
|
||||
|
||||
Reference in new issue
Block a user