mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-13 21:11:25 -07:00
per-target option of automatically debugging subprocesses, or not
This commit is contained in:
@@ -195,6 +195,30 @@ read_only global Type B32__type = {TypeKind_B32, 0, sizeof(B32), &type_nil, st
|
||||
read_only global Type B64__type = {TypeKind_B64, 0, sizeof(B64), &type_nil, str8_lit_comp("B64")};
|
||||
read_only global Type F32__type = {TypeKind_F32, 0, sizeof(F32), &type_nil, str8_lit_comp("F32")};
|
||||
read_only global Type F64__type = {TypeKind_F64, 0, sizeof(F64), &type_nil, str8_lit_comp("F64")};
|
||||
read_only global Type *type_kind_type_table[] =
|
||||
{
|
||||
&type_nil,
|
||||
type(void),
|
||||
type(U8),
|
||||
type(U16),
|
||||
type(U32),
|
||||
type(U64),
|
||||
type(S8),
|
||||
type(S16),
|
||||
type(S32),
|
||||
type(S64),
|
||||
type(B8),
|
||||
type(B16),
|
||||
type(B32),
|
||||
type(B64),
|
||||
type(F32),
|
||||
type(F64),
|
||||
&type_nil,
|
||||
&type_nil,
|
||||
&type_nil,
|
||||
&type_nil,
|
||||
&type_nil,
|
||||
};
|
||||
|
||||
//- rjf: Rng1U64
|
||||
struct_members(Rng1U64)
|
||||
|
||||
+22
-6
@@ -15,6 +15,20 @@ typedef U64 CTRL_MachineID;
|
||||
////////////////////////////////
|
||||
//~ rjf: Meta Evaluation Types
|
||||
|
||||
//- rjf: auto-checkbox b32s
|
||||
|
||||
typedef struct CTRL_CheckB32 CTRL_CheckB32;
|
||||
struct CTRL_CheckB32
|
||||
{
|
||||
B32 b32;
|
||||
};
|
||||
|
||||
struct_members(CTRL_CheckB32)
|
||||
{
|
||||
member_lit_comp(CTRL_CheckB32, type(B32), b32),
|
||||
};
|
||||
struct_type(CTRL_CheckB32);
|
||||
|
||||
//- rjf: styled string types
|
||||
|
||||
ptr_type(CTRL_PlainString8__str_ptr_type, type(U8), .flags = TypeFlag_IsPlainText,.count_delimiter_name = str8_lit_comp("size"));
|
||||
@@ -74,12 +88,13 @@ typedef struct CTRL_MetaEval CTRL_MetaEval;
|
||||
struct CTRL_MetaEval
|
||||
{
|
||||
#define CTRL_MetaEval_MemberXList \
|
||||
X(B32, enabled, "Enabled")\
|
||||
X(B32, frozen, "Frozen")\
|
||||
X(U64, hit_count, "Hit Count")\
|
||||
X(U64, id, "ID")\
|
||||
X(Rng1U64, vaddr_range, "Address Range")\
|
||||
X(U32, color, "Color")\
|
||||
X(B32, enabled, "Enabled")\
|
||||
X(B32, frozen, "Frozen")\
|
||||
X(U64, hit_count, "Hit Count")\
|
||||
X(U64, id, "ID")\
|
||||
X(Rng1U64, vaddr_range, "Address Range")\
|
||||
X(U32, color, "Color")\
|
||||
X(CTRL_CheckB32, debug_subprocesses,"Debug Subprocesses")\
|
||||
Y(String8, type(CTRL_CodeString8), label, "Label")\
|
||||
Y(String8, type(CTRL_PathString8), exe, "Executable Path")\
|
||||
Y(String8, type(CTRL_PathString8), dbg, "Debug Info Path")\
|
||||
@@ -138,6 +153,7 @@ struct_members(CTRL_TargetMetaEval)
|
||||
member_lit_comp(CTRL_MetaEval, type(CTRL_PathString8), stdout_path, .pretty_name = str8_lit_comp("Standard Output Path")),
|
||||
member_lit_comp(CTRL_MetaEval, type(CTRL_PathString8), stderr_path, .pretty_name = str8_lit_comp("Standard Error Path")),
|
||||
member_lit_comp(CTRL_MetaEval, type(CTRL_PathString8), stdin_path, .pretty_name = str8_lit_comp("Standard Input Path")),
|
||||
member_lit_comp(CTRL_MetaEval, type(CTRL_CheckB32), debug_subprocesses, .pretty_name = str8_lit_comp("Debug Subprocesses")),
|
||||
};
|
||||
|
||||
struct_members(CTRL_PinMetaEval)
|
||||
|
||||
@@ -2068,6 +2068,7 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
|
||||
msg->stdout_path = stdout_path;
|
||||
msg->stderr_path = stderr_path;
|
||||
msg->stdin_path = stdin_path;
|
||||
msg->debug_subprocesses = target->debug_subprocesses;
|
||||
msg->env_inherit = 1;
|
||||
MemoryCopyArray(msg->exception_code_filters, exception_code_filters);
|
||||
MemoryCopyStruct(&msg->meta_evals, meta_evals);
|
||||
|
||||
@@ -17,6 +17,7 @@ struct D_Target
|
||||
String8 stdout_path;
|
||||
String8 stderr_path;
|
||||
String8 stdin_path;
|
||||
B32 debug_subprocesses;
|
||||
String8List env;
|
||||
};
|
||||
|
||||
|
||||
@@ -1911,6 +1911,7 @@ rd_d_target_from_entity(RD_Entity *entity)
|
||||
target.stdout_path = src_target_stdo->string;
|
||||
target.stderr_path = src_target_stde->string;
|
||||
target.stdin_path = src_target_stdi->string;
|
||||
target.debug_subprocesses = entity->debug_subprocesses;
|
||||
return target;
|
||||
}
|
||||
|
||||
@@ -2350,6 +2351,7 @@ rd_ctrl_meta_eval_from_entity(Arena *arena, RD_Entity *entity)
|
||||
meval->address_location = vaddr_loc_string;
|
||||
meval->function_location = function_loc_string;
|
||||
meval->condition = cnd_string;
|
||||
meval->debug_subprocesses.b32 = entity->debug_subprocesses;
|
||||
switch(entity->kind)
|
||||
{
|
||||
default:{}break;
|
||||
@@ -2611,6 +2613,7 @@ rd_eval_space_write(void *u, E_Space space, void *in, Rng1U64 range)
|
||||
#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)
|
||||
FlatMemberCase(enabled) {result = 1; rd_entity_equip_disabled(entity, !!((U8 *)in)[0]);}
|
||||
FlatMemberCase(debug_subprocesses) {result = 1; entity->debug_subprocesses = !!((U8 *)in)[0]; }
|
||||
StringMemberCase(label) {result = 1; rd_entity_equip_name(entity, str8_cstring_capped(in, (U8 *)in + 4096));}
|
||||
StringMemberCase(exe) {result = 1; rd_entity_equip_name(rd_entity_child_from_kind_or_alloc(entity, RD_EntityKind_Executable), str8_cstring_capped(in, (U8 *)in + 4096));}
|
||||
StringMemberCase(args) {result = 1; rd_entity_equip_name(rd_entity_child_from_kind_or_alloc(entity, RD_EntityKind_Arguments), str8_cstring_capped(in, (U8 *)in + 4096));}
|
||||
@@ -10593,6 +10596,7 @@ rd_cfg_strings_from_gfx(Arena *arena, String8 root_path, RD_CfgSrc source)
|
||||
EntityInfoFlag_HasVAddr = (1<<3),
|
||||
EntityInfoFlag_HasColor = (1<<4),
|
||||
EntityInfoFlag_HasChildren = (1<<5),
|
||||
EntityInfoFlag_HasDebugSubprocesses = (1<<6),
|
||||
};
|
||||
String8 entity_name_escaped = e->string;
|
||||
// TODO(rjf): @hack - hardcoding in the "EntityKind_Location" here - this is because
|
||||
@@ -10617,6 +10621,7 @@ rd_cfg_strings_from_gfx(Arena *arena, String8 root_path, RD_CfgSrc source)
|
||||
if(e->flags & RD_EntityFlag_HasVAddr) { info_flags |= EntityInfoFlag_HasVAddr; }
|
||||
if(e->flags & RD_EntityFlag_HasColor) { info_flags |= EntityInfoFlag_HasColor; }
|
||||
if(!rd_entity_is_nil(e->first)) { info_flags |= EntityInfoFlag_HasChildren; }
|
||||
if(e->debug_subprocesses) { info_flags |= EntityInfoFlag_HasDebugSubprocesses; }
|
||||
|
||||
//- rjf: write entity info
|
||||
B32 opened_brace = 0;
|
||||
@@ -10639,6 +10644,10 @@ rd_cfg_strings_from_gfx(Arena *arena, String8 root_path, RD_CfgSrc source)
|
||||
{
|
||||
str8_list_pushf(arena, &strs, "disabled: 1\n");
|
||||
}
|
||||
if(e->debug_subprocesses)
|
||||
{
|
||||
str8_list_pushf(arena, &strs, "debug_subprocesses: 1\n");
|
||||
}
|
||||
if(e->flags & RD_EntityFlag_HasColor)
|
||||
{
|
||||
Vec4F32 hsva = rd_hsva_from_entity(e);
|
||||
@@ -12258,6 +12267,7 @@ rd_frame(void)
|
||||
//
|
||||
EV_AutoViewRuleTable *auto_view_rule_table = push_array(scratch.arena, EV_AutoViewRuleTable, 1);
|
||||
{
|
||||
// ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, e_type_key_cons_base(type(CTRL_CheckB32)), str8_lit("checkbox"), 1);
|
||||
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, e_type_key_cons_base(type(CTRL_MetaEvalFrameArray)), str8_lit("slice"), 1);
|
||||
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, e_type_key_cons_base(type(CTRL_MachineMetaEval)), str8_lit("scheduler_machine"), 1);
|
||||
ev_auto_view_rule_table_push_new(scratch.arena, auto_view_rule_table, e_type_key_cons_base(type(CTRL_ProcessMetaEval)), str8_lit("scheduler_process"), 1);
|
||||
@@ -12838,6 +12848,10 @@ rd_frame(void)
|
||||
{
|
||||
rd_entity_equip_disabled(t->entity, str8_match(child->first->string, str8_lit("1"), 0));
|
||||
}
|
||||
if(str8_match(child->string, str8_lit("debug_subprocesses"), StringMatchFlag_CaseInsensitive) && child->first != &md_nil_node)
|
||||
{
|
||||
t->entity->debug_subprocesses = str8_match(child->first->string, str8_lit("1"), 0);
|
||||
}
|
||||
if(str8_match(child->string, str8_lit("hsva"), StringMatchFlag_CaseInsensitive) && child->first != &md_nil_node)
|
||||
{
|
||||
Vec4F32 hsva = {0};
|
||||
|
||||
@@ -414,7 +414,8 @@ struct RD_Entity
|
||||
// rjf: basic equipment
|
||||
TxtPt text_point;
|
||||
RD_Handle entity_handle;
|
||||
B32 disabled;
|
||||
B32 disabled;
|
||||
B32 debug_subprocesses;
|
||||
U64 u64;
|
||||
Vec4F32 color_hsva;
|
||||
RD_CfgSrc cfg_src;
|
||||
|
||||
@@ -2961,6 +2961,16 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
cell_ui_hook = ui_view_rule_info->ui;
|
||||
cell_ui_params = ui_view_rule_params_root;
|
||||
}
|
||||
for(EV_ViewRuleNode *n = row->view_rules->first; n != 0; n = n->next)
|
||||
{
|
||||
EV_ViewRule *vr = &n->v;
|
||||
RD_ViewRuleInfo *info = rd_view_rule_info_from_string(vr->root->string);
|
||||
if(info->flags & RD_ViewRuleInfoFlag_CanFillValueCell && info->ui != 0)
|
||||
{
|
||||
cell_ui_hook = info->ui;
|
||||
cell_ui_params = vr->root;
|
||||
}
|
||||
}
|
||||
cell_can_edit = ev_type_key_is_editable(cell_eval.type_key);
|
||||
}break;
|
||||
case RD_WatchViewColumnKind_Type:
|
||||
@@ -5382,7 +5392,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(targets)
|
||||
rd_watch_view_column_alloc(wv, RD_WatchViewColumnKind_Value, 0.75f, .dequote_string = 1, .is_non_code = 0);
|
||||
}
|
||||
rd_watch_view_build(wv, RD_WatchViewFlag_NoHeader|RD_WatchViewFlag_PrettyNameMembers|RD_WatchViewFlag_PrettyEntityRows|RD_WatchViewFlag_DisableCacheLines,
|
||||
str8_lit("collection:targets"), str8_lit("only: label exe args working_directory entry_point stdout_path stderr_path stdin_path str"), 1, 10, rect);
|
||||
str8_lit("collection:targets"), str8_lit("only: label exe args working_directory entry_point stdout_path stderr_path stdin_path debug_subprocesses b32 str"), 1, 10, rect);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user