mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-25 07:12:20 -08:00
dbg_engine: shift thread register reads / process memory reads -> abstraction layer, rather than directly calling into demon; cache crash dump info, like thread info & memory ranges; implement thread reg reads & memory reads for dumps by using this acceleration structure when we have a dump handle, instead of regular demon reads.
This commit is contained in:
1 parent
463a4f8565
commit
4840b46b84
23 files changed
+1035
-401
No files matched your search
@@ -162,53 +162,6 @@ dmn_rsp_from_thread(DMN_Handle thread)
|
||||
////////////////////////////////
|
||||
//~ rjf: Process Reading Helper Functions (Helpers, Implemented Once)
|
||||
|
||||
internal String8
|
||||
dmn_process_read_cstring(Arena *arena, DMN_Handle process, U64 addr)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
String8List block_list = {0};
|
||||
for(U64 cursor = addr, stride = 256;; cursor += stride)
|
||||
{
|
||||
U8 *raw_block = push_array_no_zero(scratch.arena, U8, stride);
|
||||
U64 read_size = dmn_process_read(process, r1u64(cursor, cursor + stride), raw_block);
|
||||
String8 block = str8_cstring_capped(raw_block, raw_block + read_size);
|
||||
str8_list_push(scratch.arena, &block_list, block);
|
||||
if(read_size != stride || (block.size+1 <= read_size && block.str[block.size] == 0))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
String8 result = str8_list_join(arena, &block_list, 0);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal String8
|
||||
dmn_process_read_block(Arena *arena, DMN_Handle process, Rng1U64 vrange)
|
||||
{
|
||||
String8 block = {0};
|
||||
void *raw = dmn_process_read_raw(arena, process, vrange);
|
||||
if(raw)
|
||||
{
|
||||
block = str8(raw, dim_1u64(vrange));
|
||||
}
|
||||
return block;
|
||||
}
|
||||
|
||||
internal void *
|
||||
dmn_process_read_raw(Arena *arena, DMN_Handle process, Rng1U64 vrange)
|
||||
{
|
||||
Temp temp = temp_begin(arena);
|
||||
void *buffer = push_array(arena, U8, dim_1u64(vrange));
|
||||
U64 read_size = dmn_process_read(process, vrange, buffer);
|
||||
if(read_size != dim_1u64(vrange))
|
||||
{
|
||||
buffer = 0;
|
||||
temp_end(temp);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
internal String8
|
||||
dmn_get_trap_inst(void)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user