start sketching out basic unreal type views

This commit is contained in:
Ryan Fleury
2025-05-28 18:00:16 -07:00
parent 7350c2d576
commit 14cfd87f68
6 changed files with 13 additions and 13 deletions
+1 -7
View File
@@ -158,31 +158,25 @@ dmn_rsp_from_thread(DMN_Handle thread)
}
////////////////////////////////
//~ Memory Helpers
//~ 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;
}
+5 -1
View File
@@ -190,6 +190,11 @@ internal DMN_Event *dmn_event_list_push(Arena *arena, DMN_EventList *list);
internal U64 dmn_rip_from_thread(DMN_Handle thread);
internal U64 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);
////////////////////////////////
//~ rjf: @dmn_os_hooks Main Layer Initialization (Implemented Per-OS)
@@ -236,7 +241,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);
#define dmn_process_read_struct(process, vaddr, ptr) dmn_process_read((process), r1u64((vaddr), (vaddr)+(sizeof(*ptr))), ptr)
#define dmn_process_write_struct(process, vaddr, ptr) dmn_process_write((process), r1u64((vaddr), (vaddr)+(sizeof(*ptr))), ptr)
internal String8 dmn_process_read_cstring(Arena *arena, DMN_Handle process, U64 addr);
//- rjf: threads
internal Arch dmn_arch_from_thread(DMN_Handle handle);
+1 -1
View File
@@ -2380,7 +2380,7 @@ e_push_irtree_and_type_from_expr(Arena *arena, E_IRTreeAndType *root_parent, E_I
}
//- rjf: equip previous task's irtree
if(parent != 0)
if(parent != 0 && (result.prev == 0 || result.prev->root == &e_irnode_nil))
{
result.prev = push_array(arena, E_IRTreeAndType, 1);
result.prev[0] = *parent;
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -300,8 +300,8 @@ RD_VocabTable:
//- rjf: visualizers
@display_name('Use Default C++ STL Type Visualizers') @description("Enables the built-in type views for C++ STL types.")
@default(1) use_default_stl_type_views: bool,
// @display_name('Use Default Unreal Engine Type Visualizers') @description("Enables the built-in type views for Unreal Engine types.")
// @default(1) use_default_ue_type_views: bool,
@display_name('Use Default Unreal Engine Type Visualizers') @description("Enables the built-in type views for Unreal Engine types.")
@default(1) use_default_ue_type_views: bool,
//- rjf: theme
@default("None") @display_name('Project Theme') @description("The project's theme, which describes all colors used throughout the UI, and can override the user's theme.")
+3 -1
View File
@@ -12368,6 +12368,8 @@ rd_frame(void)
{ 1, 0, str8_lit_comp("std::unique_ptr<?>"), str8_lit_comp("_Mypair._Myval2") },
{ 1, 0, str8_lit_comp("std::basic_string<?>"), str8_lit_comp("_Mypair._Myval2._Myres <= 15 ? _Mypair._Myval2._Bx._Buf : array(_Mypair._Myval2._Bx._Ptr, _Mypair._Myval2._Mysize)") },
{ 1, 0, str8_lit_comp("std::basic_string_view<?>"), str8_lit_comp("array(_Mydata, _Mysize)") },
{ 0, 1, str8_lit_comp("FString"), str8_lit_comp("(TCHAR *)Data.AllocatorInstance.Data, Data.ArrayNum") },
{ 0, 1, str8_lit_comp("TArray<?{element_type}>"), str8_lit_comp("array(cast(element_type *)AllocatorInstance.Data, ArrayNum)") },
};
if(rd_state->use_default_stl_type_views)
{
@@ -12376,7 +12378,7 @@ rd_frame(void)
if((type_views[idx].stl && rd_state->use_default_stl_type_views) ||
(type_views[idx].ue && rd_state->use_default_ue_type_views))
{
RD_Cfg *immediate_root = rd_immediate_cfg_from_keyf("default_stl_type_vis_%I64x", idx);
RD_Cfg *immediate_root = rd_immediate_cfg_from_keyf("default_type_vis_%I64x", idx);
RD_Cfg *type_view = rd_cfg_child_from_string_or_alloc(immediate_root, str8_lit("type_view"));
RD_Cfg *type = rd_cfg_child_from_string_or_alloc(type_view, str8_lit("type"));
RD_Cfg *expr = rd_cfg_child_from_string_or_alloc(type_view, str8_lit("expr"));