mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 13:58:40 +00:00
bps view work
This commit is contained in:
@@ -130,7 +130,7 @@ struct_members(CTRL_PinMetaEval)
|
|||||||
{
|
{
|
||||||
member_lit_comp(CTRL_MetaEval, type(CTRL_CodeString8), label, .pretty_name = str8_lit_comp("Expression")),
|
member_lit_comp(CTRL_MetaEval, type(CTRL_CodeString8), label, .pretty_name = str8_lit_comp("Expression")),
|
||||||
member_lit_comp(CTRL_MetaEval, type(U32), color, .pretty_name = str8_lit_comp("Color")),
|
member_lit_comp(CTRL_MetaEval, type(U32), color, .pretty_name = str8_lit_comp("Color")),
|
||||||
member_lit_comp(CTRL_MetaEval, type(String8), location, .pretty_name = str8_lit_comp("Location")),
|
member_lit_comp(CTRL_MetaEval, type(CTRL_PathString8), location, .pretty_name = str8_lit_comp("Location")),
|
||||||
};
|
};
|
||||||
|
|
||||||
struct_members(CTRL_MachineMetaEval)
|
struct_members(CTRL_MachineMetaEval)
|
||||||
|
|||||||
+41
-78
@@ -1749,6 +1749,7 @@ rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_co
|
|||||||
RD_Entity *exe = rd_entity_child_from_kind(entity, RD_EntityKind_Executable);
|
RD_Entity *exe = rd_entity_child_from_kind(entity, RD_EntityKind_Executable);
|
||||||
RD_Entity *args = rd_entity_child_from_kind(entity, RD_EntityKind_Arguments);
|
RD_Entity *args = rd_entity_child_from_kind(entity, RD_EntityKind_Arguments);
|
||||||
RD_Entity *loc = rd_entity_child_from_kind(entity, RD_EntityKind_Location);
|
RD_Entity *loc = rd_entity_child_from_kind(entity, RD_EntityKind_Location);
|
||||||
|
RD_Entity *cnd = rd_entity_child_from_kind(entity, RD_EntityKind_Condition);
|
||||||
RD_IconKind icon_kind = rd_entity_kind_icon_kind_table[entity->kind];
|
RD_IconKind icon_kind = rd_entity_kind_icon_kind_table[entity->kind];
|
||||||
Vec4F32 color = rd_rgba_from_theme_color(RD_ThemeColor_Text);
|
Vec4F32 color = rd_rgba_from_theme_color(RD_ThemeColor_Text);
|
||||||
if(icon_kind != RD_IconKind_Null)
|
if(icon_kind != RD_IconKind_Null)
|
||||||
@@ -1760,16 +1761,9 @@ rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_co
|
|||||||
B32 name_is_code = 1;
|
B32 name_is_code = 1;
|
||||||
String8 location = {0};
|
String8 location = {0};
|
||||||
B32 location_is_code = 0;
|
B32 location_is_code = 0;
|
||||||
String8 exe_name = {0};
|
String8 exe_name = str8_skip_last_slash(exe->string);
|
||||||
String8 args_string = {0};
|
String8 args_string = args->string;
|
||||||
if(!rd_entity_is_nil(exe))
|
String8 cnd_string = cnd->string;
|
||||||
{
|
|
||||||
exe_name = str8_skip_last_slash(exe->string);
|
|
||||||
}
|
|
||||||
if(!rd_entity_is_nil(args))
|
|
||||||
{
|
|
||||||
args_string = args->string;
|
|
||||||
}
|
|
||||||
if(!rd_entity_is_nil(loc))
|
if(!rd_entity_is_nil(loc))
|
||||||
{
|
{
|
||||||
if(loc->string.size != 0 && loc->flags & RD_EntityFlag_HasTextPoint)
|
if(loc->string.size != 0 && loc->flags & RD_EntityFlag_HasTextPoint)
|
||||||
@@ -1825,11 +1819,26 @@ rd_title_fstrs_from_entity(Arena *arena, RD_Entity *entity, Vec4F32 secondary_co
|
|||||||
size_extrafied = size*0.95f;
|
size_extrafied = size*0.95f;
|
||||||
color_extrafied = secondary_color;
|
color_extrafied = secondary_color;
|
||||||
}
|
}
|
||||||
|
if(cnd_string.size != 0)
|
||||||
|
{
|
||||||
|
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Code), size, color_extrafied, str8_lit(" if "));
|
||||||
|
RD_Font(RD_FontSlot_Code) UI_FontSize(size_extrafied)
|
||||||
|
{
|
||||||
|
DR_FancyStringList cnd_fstrs = rd_fancy_string_list_from_code_string(arena, 1.f, 0.f, color_extrafied, cnd_string);
|
||||||
|
dr_fancy_string_list_concat_in_place(&result, &cnd_fstrs);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(entity->kind == RD_EntityKind_Target && entity->disabled)
|
if(entity->kind == RD_EntityKind_Target && entity->disabled)
|
||||||
{
|
{
|
||||||
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Code), size, v4f32(0, 0, 0, 0), str8_lit(" "));
|
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Code), size, v4f32(0, 0, 0, 0), str8_lit(" "));
|
||||||
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Main), size*0.95f, secondary_color, str8_lit("(Disabled)"));
|
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Main), size*0.95f, secondary_color, str8_lit("(Disabled)"));
|
||||||
}
|
}
|
||||||
|
if(entity->kind == RD_EntityKind_Breakpoint)
|
||||||
|
{
|
||||||
|
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Code), size, v4f32(0, 0, 0, 0), str8_lit(" "));
|
||||||
|
String8 string = push_str8f(arena, "(%I64u hit%s)", entity->u64, entity->u64 == 1 ? "" : "s");
|
||||||
|
dr_fancy_string_list_push_new(arena, &result, rd_font_from_slot(RD_FontSlot_Main), size_extrafied, secondary_color, string);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2285,80 +2294,34 @@ rd_eval_space_write(void *u, E_Space space, void *in, Rng1U64 range)
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}break;
|
}break;
|
||||||
case RD_EvalSpaceKind_MetaCtrlEntity:
|
case RD_EvalSpaceKind_MetaCtrlEntity:
|
||||||
{
|
|
||||||
|
|
||||||
}break;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
#if 0 // TODO(rjf): @msgs
|
|
||||||
B32 result = 0;
|
|
||||||
RD_Entity *entity = rd_entity_from_eval_space(space);
|
|
||||||
switch(entity->kind)
|
|
||||||
{
|
|
||||||
//- rjf: default -> making commits to entity evaluation
|
|
||||||
default:
|
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(0, 0);
|
Temp scratch = scratch_begin(0, 0);
|
||||||
RD_EntityEval *eval = rd_eval_from_entity(scratch.arena, entity);
|
|
||||||
U64 range_dim = dim_1u64(range);
|
// rjf: get entity, produce meta-eval
|
||||||
if(range.min == OffsetOf(RD_EntityEval, enabled) &&
|
CTRL_Entity *entity = rd_ctrl_entity_from_eval_space(space);
|
||||||
range_dim >= 1)
|
CTRL_MetaEval *meval = rd_ctrl_meta_eval_from_ctrl_entity(scratch.arena, entity);
|
||||||
{
|
|
||||||
result = 1;
|
// rjf: copy meta evaluation to scratch arena, to form range of legal reads
|
||||||
B32 new_enabled = !!((U8 *)in)[0];
|
arena_push(scratch.arena, 0, 64);
|
||||||
rd_entity_equip_disabled(entity, !new_enabled);
|
String8 meval_srlzed = serialized_from_struct(scratch.arena, CTRL_MetaEval, meval);
|
||||||
}
|
U64 pos_min = arena_pos(scratch.arena);
|
||||||
else if(range.min == eval->label_off &&
|
CTRL_MetaEval *meval_read = struct_from_serialized(scratch.arena, CTRL_MetaEval, meval_srlzed);
|
||||||
range_dim >= 1)
|
U64 pos_opl = arena_pos(scratch.arena);
|
||||||
{
|
|
||||||
result = 1;
|
// rjf: rebase all pointer values in meta evaluation to be relative to base pointer
|
||||||
String8 new_name = str8_cstring_capped((U8 *)in, (U8 *)in+range_dim);
|
struct_rebase_ptrs(CTRL_MetaEval, meval_read, meval_read);
|
||||||
rd_entity_equip_name(entity, new_name);
|
|
||||||
}
|
// rjf: perform write to entity
|
||||||
else if(range.min == eval->condition_off &&
|
if(0){}
|
||||||
range_dim >= 1)
|
#define FlatMemberCase(name) else if(range.min == OffsetOf(CTRL_MetaEval, name) && dim_1u64(range) <= sizeof(meval_read->name))
|
||||||
{
|
#define StringMemberCase(name) else if(range.min == (U64)meval_read->name.str)
|
||||||
result = 1;
|
StringMemberCase(label) {result = 1; ctrl_entity_equip_string(d_state->ctrl_entity_store, entity, str8_cstring_capped(in, (U8 *)in + 4096));}
|
||||||
RD_Entity *condition = rd_entity_child_from_kind(entity, RD_EntityKind_Condition);
|
#undef FlatMemberCase
|
||||||
if(rd_entity_is_nil(condition))
|
#undef StringMemberCase
|
||||||
{
|
|
||||||
condition = rd_entity_alloc(entity, RD_EntityKind_Condition);
|
|
||||||
}
|
|
||||||
String8 new_name = str8_cstring_capped((U8 *)in, (U8 *)in+range_dim);
|
|
||||||
rd_entity_equip_name(condition, new_name);
|
|
||||||
}
|
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
//- rjf: process -> commit to process memory
|
|
||||||
case RD_EntityKind_Process:
|
|
||||||
{
|
|
||||||
result = ctrl_process_write(entity->ctrl_handle, range, in);
|
|
||||||
}break;
|
|
||||||
|
|
||||||
//- rjf: thread -> commit to thread's register block
|
|
||||||
case RD_EntityKind_Thread:
|
|
||||||
{
|
|
||||||
CTRL_Unwind unwind = d_query_cached_unwind_from_thread(entity);
|
|
||||||
U64 frame_idx = 0;
|
|
||||||
if(frame_idx < unwind.frames.count)
|
|
||||||
{
|
|
||||||
Temp scratch = scratch_begin(0, 0);
|
|
||||||
U64 regs_size = regs_block_size_from_arch(d_arch_from_entity(entity));
|
|
||||||
Rng1U64 legal_range = r1u64(0, regs_size);
|
|
||||||
Rng1U64 write_range = intersect_1u64(legal_range, range);
|
|
||||||
U64 write_size = dim_1u64(write_range);
|
|
||||||
CTRL_UnwindFrame *f = &unwind.frames.v[frame_idx];
|
|
||||||
void *new_regs = push_array(scratch.arena, U8, regs_size);
|
|
||||||
MemoryCopy(new_regs, f->regs, regs_size);
|
|
||||||
MemoryCopy((U8 *)new_regs + write_range.min, in, write_size);
|
|
||||||
result = ctrl_thread_write_reg_block(entity->ctrl_handle, new_regs);
|
|
||||||
scratch_end(scratch);
|
|
||||||
}
|
|
||||||
}break;
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//- rjf: asynchronous streamed reads -> hashes from spaces
|
//- rjf: asynchronous streamed reads -> hashes from spaces
|
||||||
|
|||||||
@@ -8,20 +8,14 @@
|
|||||||
// [ ] new universal ctx menu, hover, tooltips systems
|
// [ ] new universal ctx menu, hover, tooltips systems
|
||||||
// [ ] fix memory view
|
// [ ] fix memory view
|
||||||
// [ ] meta eval system
|
// [ ] meta eval system
|
||||||
// [ ] target editor
|
|
||||||
// [ ] file path map editor
|
// [ ] file path map editor
|
||||||
// [ ] modules view
|
|
||||||
// [ ] eval writing/committing
|
|
||||||
// [ ] file path map building
|
// [ ] file path map building
|
||||||
// [ ] `switch` replacement (recent files history)
|
// [ ] `switch` replacement (recent files history)
|
||||||
// [ ] resolving name as file or #include
|
// [ ] resolving name as file or #include
|
||||||
// [ ] new `restart processes` path
|
// [ ] new `restart processes` path
|
||||||
// [ ] breakpoint hit count resetting
|
|
||||||
// [ ] remainder of @msgs
|
// [ ] remainder of @msgs
|
||||||
//
|
//
|
||||||
// [ ] post-@msgs TODOs:
|
// [ ] post-@msgs TODOs:
|
||||||
// [ ] output: add option for scroll-to-bottom - ensure this shows up in universal ctx menu
|
|
||||||
// [ ] universal ctx menu address/watch options; e.g. watch -> memory; watch -> add watch
|
|
||||||
// [ ] ensure "prefer_disasm" is calculated correctly - disassembly-focused
|
// [ ] ensure "prefer_disasm" is calculated correctly - disassembly-focused
|
||||||
// stepping
|
// stepping
|
||||||
//
|
//
|
||||||
@@ -41,11 +35,18 @@
|
|||||||
// because you're like "wait why did it stop" and then you later remember
|
// because you're like "wait why did it stop" and then you later remember
|
||||||
// that's because there was a function breakpoint there.
|
// that's because there was a function breakpoint there.
|
||||||
// [ ] debugger readme pass
|
// [ ] debugger readme pass
|
||||||
|
//
|
||||||
// [x] codebase readme pass
|
// [x] codebase readme pass
|
||||||
|
// [x] target editor
|
||||||
|
// [x] modules view
|
||||||
|
// [x] eval writing/committing
|
||||||
|
// [x] breakpoint hit count resetting
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: post-0.9.12 TODO notes
|
//~ rjf: post-0.9.12 TODO notes
|
||||||
//
|
//
|
||||||
|
// [ ] output: add option for scroll-to-bottom - ensure this shows up in universal ctx menu
|
||||||
|
// [ ] universal ctx menu address/watch options; e.g. watch -> memory; watch -> add watch
|
||||||
// [ ] EVAL LOOKUP RULES -> currently going 0 -> rdis_count, but we need
|
// [ ] EVAL LOOKUP RULES -> currently going 0 -> rdis_count, but we need
|
||||||
// to prioritize the primary rdi
|
// to prioritize the primary rdi
|
||||||
// [ ] (reported by forrest) 'set-next-statement' -> prioritize current
|
// [ ] (reported by forrest) 'set-next-statement' -> prioritize current
|
||||||
|
|||||||
Reference in New Issue
Block a user