entity from d -> df

This commit is contained in:
Ryan Fleury
2024-09-13 11:46:17 -07:00
parent 9b66a9c60e
commit 573bad8487
14 changed files with 2782 additions and 2918 deletions
-103
View File
@@ -24,109 +24,6 @@ D_CfgSrcTable:
@expand(D_CfgSrcTable a) `str8_lit_comp("$(a.string)")`,
}
////////////////////////////////
//~ rjf: Entity Kind Tables
@table(name name_lower name_lower_plural op_delete op_freeze op_edit op_rename op_enable op_cond op_dup name_is_code name_is_path user_lifetime is_serialized name_label icon_kind display_string)
// | |
// | _____________________________________________________________________________________________________________________________________/
// | /
// operations________ names lt sz
// /..................\ /...\ | |
// dl fz ed rn en cn dp nc np ul iz
DF_EntityKindTable:
{
{Nil nil nils 0 0 0 0 0 0 0 0 0 0 0 "Label" Null "Nil" }
{Root root roots 0 0 0 0 0 0 0 0 0 0 0 "Label" Null "Root" }
//- rjf: machines
{Machine machine machines 0 1 0 1 0 0 0 0 0 0 0 "Label" Machine "Machine" }
//- rjf: filesystem modeling
{File file files 0 0 0 0 0 0 0 0 0 0 0 "Label" FileOutline "File" }
//- rjf: auto view rules
{AutoViewRule auto_view_rule auto_view_rules 0 0 0 0 0 0 0 0 0 1 1 "Label" Binoculars "Auto View Rule" }
//- rjf: file path maps
{FilePathMap file_path_map file_path_maps 0 0 0 0 0 0 0 0 0 0 1 "Label" FileOutline "File Path Map" }
//- rjf: watch pins
{WatchPin watch_pin watch_pins 1 0 0 1 0 0 1 1 0 1 1 "Expression" Pin "Watch Pin" }
//- rjf: watches
{Watch watch watches 1 0 0 1 1 0 1 1 0 1 1 "Expression" Binoculars "Watch" }
{ViewRule view_rule view_rules 1 0 0 1 1 0 1 1 0 1 0 "Expression" Binoculars "View Rule" }
//- rjf: breakpoints
{Breakpoint breakpoint breakpoints 1 0 0 1 1 1 1 0 0 1 1 "Label" CircleFilled "Breakpoint" }
{Condition condition conditions 0 0 0 0 0 0 0 1 0 1 0 "Expression" CircleFilled "Condition" }
//- rjf: user-controlled locations (source, addresses, symbol names)
{Location location locations 0 0 0 0 0 0 0 1 1 1 0 "Location" Null "Location" }
//- rjf: targets
{Target target targets 1 0 1 1 1 0 1 0 0 1 1 "Label" Target "Target" }
{Executable executable executables 0 0 0 0 0 0 0 0 1 1 0 "Executable" Null "Executable" }
{Arguments arguments argumentses 0 0 0 0 0 0 0 0 0 1 0 "Arguments" Null "Arguments" }
{WorkingDirectory working_directory working_directories 0 0 0 0 0 0 0 0 1 1 0 "Execution Path" Null "Working Directory" }
{EntryPoint entry_point entry_points 0 0 0 0 0 0 0 0 0 1 0 "Symbol Name" Null "Entry Point" }
//- rjf: frontend containers (windows, panels, views)
{Window window windows 1 0 0 0 0 0 1 0 0 1 1 "Label" Window "Window" }
{Panel panel panels 1 0 0 0 0 0 1 0 0 1 1 "Label" XSplit "Panel" }
{View view views 1 0 0 0 0 0 1 0 0 1 1 "Label" Null "View" }
//- rjf: recent projects
{RecentProject recent_project recent_projects 0 0 0 0 0 0 0 0 1 0 1 "Path" Briefcase "Recent Project" }
//- rjf: src -> dst mapping
{Source source sources 0 0 0 0 0 0 0 0 0 0 0 "Path" Null "Source" }
{Dest dest dests 0 0 0 0 0 0 0 0 0 0 0 "Path" Null "Destination" }
//- rjf: control system entities
{Process process processes 0 1 0 1 0 0 0 0 0 0 0 "Label" Threads "Process" }
{Thread thread threads 0 1 0 1 0 0 0 0 0 0 0 "Label" Thread "Thread" }
{Module module modules 0 0 0 0 0 0 0 0 0 0 0 "Label" Module "Module" }
{PendingThreadName pending_thread_name pending_thread_names 0 0 0 0 0 0 0 0 0 0 0 "Label" Threads "Pending Thread Name" }
{DebugInfoPath debug_info_path debug_info_paths 0 0 0 0 0 0 0 0 0 0 0 "Label" Module "Debug Info Path" }
//- rjf: parser task entities
{ConversionTask conversion_task conversion_tasks 0 0 0 1 0 0 0 0 0 0 0 "Label" Null "Conversion Task" }
{ConversionFail conversion_fail conversion_fails 0 0 0 1 0 0 0 0 0 0 0 "Label" Null "Conversion Failure" }
}
@enum DF_EntityKind:
{
@expand(DF_EntityKindTable a) `$(a.name)`,
COUNT,
}
@data(String8) d_entity_kind_display_string_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.display_string)")`,
}
@data(String8) d_entity_kind_name_lower_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.name_lower)")`,
}
@data(String8) d_entity_kind_name_lower_plural_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.name_lower_plural)")`,
}
@data(String8) d_entity_kind_name_label_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.name_label)")`,
}
@data(DF_EntityKindFlags) d_entity_kind_flags_table:
{
@expand(DF_EntityKindTable a) `($(a.op_delete)*DF_EntityKindFlag_CanDelete) | ($(a.op_freeze)*DF_EntityKindFlag_CanFreeze) | ($(a.op_edit)*DF_EntityKindFlag_CanEdit) | ($(a.op_rename)*DF_EntityKindFlag_CanRename) | ($(a.op_enable)*DF_EntityKindFlag_CanEnable) | ($(a.op_cond)*DF_EntityKindFlag_CanCondition) | ($(a.op_dup)*DF_EntityKindFlag_CanDuplicate) | ($(a.name_is_code)*DF_EntityKindFlag_NameIsCode) | ($(a.name_is_path)*DF_EntityKindFlag_NameIsPath) | ($(a.user_lifetime)*DF_EntityKindFlag_UserDefinedLifetime) | ($(a.is_serialized)*DF_EntityKindFlag_IsSerializedToConfig)`,
}
////////////////////////////////
//~ rjf: Built-In Command Tables
File diff suppressed because it is too large Load Diff
+20 -466
View File
@@ -40,20 +40,20 @@ struct D_BreakpointArray
D_Breakpoint *v;
U64 count;
};
typedef struct D_PathMap D_PathMap;
struct D_PathMap
{
String8 src;
String8 dst;
};
typedef struct D_PathMapArray D_PathMapArray;
struct D_PathMapArray
{
D_PathMap *v;
U64 count;
};
typedef struct D_PathMap D_PathMap;
struct D_PathMap
{
String8 src;
String8 dst;
};
typedef struct D_PathMapArray D_PathMapArray;
struct D_PathMapArray
{
D_PathMap *v;
U64 count;
};
////////////////////////////////
//~ rjf: Tick Output Types
@@ -158,44 +158,6 @@ struct D_LineListArray
DI_KeyList dbgi_keys;
};
////////////////////////////////
//~ rjf: Entity Kind Flags
typedef U32 DF_EntityKindFlags;
enum
{
//- rjf: allowed operations
DF_EntityKindFlag_CanDelete = (1<<0),
DF_EntityKindFlag_CanFreeze = (1<<1),
DF_EntityKindFlag_CanEdit = (1<<2),
DF_EntityKindFlag_CanRename = (1<<3),
DF_EntityKindFlag_CanEnable = (1<<4),
DF_EntityKindFlag_CanCondition = (1<<5),
DF_EntityKindFlag_CanDuplicate = (1<<6),
//- rjf: name categorization
DF_EntityKindFlag_NameIsCode = (1<<7),
DF_EntityKindFlag_NameIsPath = (1<<8),
//- rjf: lifetime categorization
DF_EntityKindFlag_UserDefinedLifetime = (1<<9),
//- rjf: serialization
DF_EntityKindFlag_IsSerializedToConfig = (1<<10),
};
////////////////////////////////
//~ rjf: Entity Filesystem Lookup Flags
typedef U32 D_EntityFromPathFlags;
enum
{
D_EntityFromPathFlag_AllowOverrides = (1<<0),
D_EntityFromPathFlag_OpenAsNeeded = (1<<1),
D_EntityFromPathFlag_OpenMissing = (1<<2),
D_EntityFromPathFlag_All = 0xffffffff,
};
////////////////////////////////
//~ rjf: Debug Engine Control Communication Types
@@ -287,141 +249,6 @@ struct D_ViewRuleSpec
D_ViewRuleSpecInfo info;
};
////////////////////////////////
//~ rjf: Entity Types
typedef U32 D_EntityFlags;
enum
{
//- rjf: allocationless, simple equipment
D_EntityFlag_HasTextPoint = (1<<0),
D_EntityFlag_HasEntityHandle = (1<<2),
D_EntityFlag_HasU64 = (1<<4),
D_EntityFlag_HasColor = (1<<6),
D_EntityFlag_DiesOnRunStop = (1<<8),
//- rjf: ctrl entity equipment
D_EntityFlag_HasCtrlHandle = (1<<9),
D_EntityFlag_HasArch = (1<<10),
D_EntityFlag_HasCtrlID = (1<<11),
D_EntityFlag_HasStackBase = (1<<12),
D_EntityFlag_HasTLSRoot = (1<<13),
D_EntityFlag_HasVAddrRng = (1<<14),
D_EntityFlag_HasVAddr = (1<<15),
//- rjf: file properties
D_EntityFlag_IsFolder = (1<<16),
D_EntityFlag_IsMissing = (1<<17),
//- rjf: deletion
D_EntityFlag_MarkedForDeletion = (1<<31),
};
typedef U64 DF_EntityID;
typedef struct DF_Entity DF_Entity;
struct DF_Entity
{
// rjf: tree links
DF_Entity *first;
DF_Entity *last;
DF_Entity *next;
DF_Entity *prev;
DF_Entity *parent;
// rjf: metadata
DF_EntityKind kind;
D_EntityFlags flags;
DF_EntityID id;
U64 gen;
U64 alloc_time_us;
F32 alive_t;
// rjf: basic equipment
TxtPt text_point;
D_Handle entity_handle;
B32 disabled;
U64 u64;
Vec4F32 color_hsva;
D_CfgSrc cfg_src;
U64 timestamp;
// rjf: ctrl equipment
CTRL_Handle ctrl_handle;
Arch arch;
U32 ctrl_id;
U64 stack_base;
Rng1U64 vaddr_rng;
U64 vaddr;
// rjf: string equipment
String8 string;
// rjf: parameter tree
Arena *params_arena;
MD_Node *params_root;
};
typedef struct D_EntityNode D_EntityNode;
struct D_EntityNode
{
D_EntityNode *next;
DF_Entity *entity;
};
typedef struct D_EntityList D_EntityList;
struct D_EntityList
{
D_EntityNode *first;
D_EntityNode *last;
U64 count;
};
typedef struct D_EntityArray D_EntityArray;
struct D_EntityArray
{
DF_Entity **v;
U64 count;
};
typedef struct D_EntityRec D_EntityRec;
struct D_EntityRec
{
DF_Entity *next;
S32 push_count;
S32 pop_count;
};
////////////////////////////////
//~ rjf: Entity Evaluation Types
typedef struct D_EntityEval D_EntityEval;
struct D_EntityEval
{
B64 enabled;
U64 hit_count;
U64 label_off;
U64 location_off;
U64 condition_off;
};
////////////////////////////////
//~ rjf: Entity Fuzzy Listing Types
typedef struct D_EntityFuzzyItem D_EntityFuzzyItem;
struct D_EntityFuzzyItem
{
DF_Entity *entity;
FuzzyMatchRangeList matches;
};
typedef struct D_EntityFuzzyItemArray D_EntityFuzzyItemArray;
struct D_EntityFuzzyItemArray
{
D_EntityFuzzyItem *v;
U64 count;
};
////////////////////////////////
//~ rjf: Rich (Including Inline) Unwind Types
@@ -459,87 +286,6 @@ struct D_Unwind
D_UnwindFrameArray frames;
};
////////////////////////////////
//~ rjf: Command Specification Types
#if 0
typedef U32 D_CmdQueryFlags;
enum
{
D_CmdQueryFlag_AllowFiles = (1<<0),
D_CmdQueryFlag_AllowFolders = (1<<1),
D_CmdQueryFlag_CodeInput = (1<<2),
D_CmdQueryFlag_KeepOldInput = (1<<3),
D_CmdQueryFlag_SelectOldInput = (1<<4),
D_CmdQueryFlag_Required = (1<<5),
};
typedef struct D_CmdQuery D_CmdQuery;
struct D_CmdQuery
{
D_CmdParamSlot slot;
DF_EntityKind entity_kind;
D_CmdQueryFlags flags;
};
typedef U32 D_CmdSpecFlags;
enum
{
D_CmdSpecFlag_ListInUI = (1<<0),
D_CmdSpecFlag_ListInIPCDocs = (1<<1),
};
typedef struct D_CmdSpecInfo D_CmdSpecInfo;
struct D_CmdSpecInfo
{
String8 string;
String8 description;
String8 search_tags;
String8 display_name;
D_CmdSpecFlags flags;
D_CmdQuery query;
};
typedef struct D_CmdSpec D_CmdSpec;
struct D_CmdSpec
{
D_CmdSpec *hash_next;
D_CmdSpecInfo info;
U64 registrar_index;
U64 ordering_index;
U64 run_count;
};
typedef struct D_CmdSpecNode D_CmdSpecNode;
struct D_CmdSpecNode
{
D_CmdSpecNode *next;
D_CmdSpec *spec;
};
typedef struct D_CmdSpecList D_CmdSpecList;
struct D_CmdSpecList
{
D_CmdSpecNode *first;
D_CmdSpecNode *last;
U64 count;
};
typedef struct D_CmdSpecArray D_CmdSpecArray;
struct D_CmdSpecArray
{
D_CmdSpec **v;
U64 count;
};
typedef struct D_CmdSpecInfoArray D_CmdSpecInfoArray;
struct D_CmdSpecInfoArray
{
D_CmdSpecInfo *v;
U64 count;
};
#endif
////////////////////////////////
//~ rjf: Command Types
@@ -556,18 +302,6 @@ struct D_CmdParams
B32 prefer_disasm;
U32 pid;
D_TargetArray targets;
//String8 string;
//String8 file_path;
//MD_Node * params_tree;
//U64 vaddr;
//U64 voff;
//U64 index;
//U64 id;
//B32 prefer_dasm;
//B32 force_confirm;
//Dir2 dir2;
//U64 unwind_index;
//U64 inline_depth;
};
typedef struct D_Cmd D_Cmd;
@@ -596,16 +330,6 @@ struct D_CmdList
////////////////////////////////
//~ rjf: Main State Caches
//- rjf: per-entity-kind state cache
typedef struct D_EntityListCache D_EntityListCache;
struct D_EntityListCache
{
Arena *arena;
U64 alloc_gen;
D_EntityList list;
};
//- rjf: per-thread unwind cache
typedef struct D_UnwindCacheNode D_UnwindCacheNode;
@@ -723,20 +447,6 @@ struct D_State
// rjf: name allocator
D_NameChunkNode *free_name_chunks[8];
// rjf: entity state
Arena *entities_arena;
DF_Entity *entities_base;
U64 entities_count;
U64 entities_id_gen;
DF_Entity *entities_root;
DF_Entity *entities_free[2]; // [0] -> normal lifetime, not user defined; [1] -> user defined lifetime (& thus undoable)
U64 entities_free_count;
U64 entities_active_count;
// rjf: entity query caches
U64 kind_alloc_gens[DF_EntityKind_COUNT];
D_EntityListCache kind_caches[DF_EntityKind_COUNT];
// rjf: per-run caches
D_UnwindCache unwind_cache;
U64 tls_base_cache_reggen_idx;
@@ -760,8 +470,8 @@ struct D_State
U64 ctrl_last_run_frame_idx;
CTRL_Handle ctrl_last_run_thread_handle;
CTRL_RunFlags ctrl_last_run_flags;
CTRL_TrapList ctrl_last_run_traps;
D_BreakpointArray ctrl_last_run_extra_bps;
CTRL_TrapList ctrl_last_run_traps;
D_BreakpointArray ctrl_last_run_extra_bps;
U128 ctrl_last_run_param_state_hash;
B32 ctrl_is_running;
B32 ctrl_soft_halt_issued;
@@ -781,14 +491,6 @@ struct D_State
read_only global D_ViewRuleSpec d_nil_core_view_rule_spec = {0};
read_only global D_CfgTree d_nil_cfg_tree = {&d_nil_cfg_tree, D_CfgSrc_User, &md_nil_node};
read_only global D_CfgVal d_nil_cfg_val = {&d_nil_cfg_val, &d_nil_cfg_val, &d_nil_cfg_tree, &d_nil_cfg_tree};
read_only global DF_Entity d_nil_entity =
{
&d_nil_entity,
&d_nil_entity,
&d_nil_entity,
&d_nil_entity,
&d_nil_entity,
};
global D_State *d_state = 0;
@@ -810,14 +512,14 @@ internal void d_handle_list_push(Arena *arena, D_HandleList *list, D_Handle hand
internal D_HandleList d_handle_list_copy(Arena *arena, D_HandleList list);
////////////////////////////////
//~ rjf: Breakpoints
//~ rjf: Breakpoints
internal D_BreakpointArray d_breakpoint_array_copy(Arena *arena, D_BreakpointArray *src);
////////////////////////////////
//~ rjf: Path Map Application
internal String8List d_possible_path_overrides_from_maps_path(Arena *arena, D_PathMapArray *path_maps, String8 file_path);
internal String8List d_possible_path_overrides_from_maps_path(Arena *arena, D_PathMapArray *path_maps, String8 file_path);
////////////////////////////////
//~ rjf: Config Type Pure Functions
@@ -840,60 +542,6 @@ internal D_CmdParams d_cmd_params_copy(Arena *arena, D_CmdParams *src);
//- rjf: command lists
internal void d_cmd_list_push_new(Arena *arena, D_CmdList *cmds, D_CmdKind kind, D_CmdParams *params);
////////////////////////////////
//~ rjf: Entity Type Pure Functions
//- rjf: nil
internal B32 d_entity_is_nil(DF_Entity *entity);
#define d_require_entity_nonnil(entity, if_nil_stmts) do{if(d_entity_is_nil(entity)){if_nil_stmts;}}while(0)
//- rjf: handle <-> entity conversions
internal U64 d_index_from_entity(DF_Entity *entity);
internal D_Handle d_handle_from_entity(DF_Entity *entity);
internal DF_Entity *d_entity_from_handle(D_Handle handle);
internal D_EntityList d_entity_list_from_handle_list(Arena *arena, D_HandleList handles);
internal D_HandleList d_handle_list_from_entity_list(Arena *arena, D_EntityList entities);
//- rjf: entity recursion iterators
internal D_EntityRec d_entity_rec_depth_first(DF_Entity *entity, DF_Entity *subtree_root, U64 sib_off, U64 child_off);
#define d_entity_rec_depth_first_pre(entity, subtree_root) d_entity_rec_depth_first((entity), (subtree_root), OffsetOf(DF_Entity, next), OffsetOf(DF_Entity, first))
#define d_entity_rec_depth_first_post(entity, subtree_root) d_entity_rec_depth_first((entity), (subtree_root), OffsetOf(DF_Entity, prev), OffsetOf(DF_Entity, last))
//- rjf: ancestor/child introspection
internal DF_Entity *d_entity_child_from_kind(DF_Entity *entity, DF_EntityKind kind);
internal DF_Entity *d_entity_ancestor_from_kind(DF_Entity *entity, DF_EntityKind kind);
internal D_EntityList d_push_entity_child_list_with_kind(Arena *arena, DF_Entity *entity, DF_EntityKind kind);
internal DF_Entity *d_entity_child_from_string_and_kind(DF_Entity *parent, String8 string, DF_EntityKind kind);
//- rjf: entity list building
internal void d_entity_list_push(Arena *arena, D_EntityList *list, DF_Entity *entity);
internal D_EntityArray d_entity_array_from_list(Arena *arena, D_EntityList *list);
#define d_first_entity_from_list(list) ((list)->first != 0 ? (list)->first->entity : &d_nil_entity)
//- rjf: entity fuzzy list building
internal D_EntityFuzzyItemArray d_entity_fuzzy_item_array_from_entity_list_needle(Arena *arena, D_EntityList *list, String8 needle);
internal D_EntityFuzzyItemArray d_entity_fuzzy_item_array_from_entity_array_needle(Arena *arena, D_EntityArray *array, String8 needle);
//- rjf: full path building, from file/folder entities
internal String8 d_full_path_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: display string entities, for referencing entities in ui
internal String8 d_display_string_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: extra search tag strings for fuzzy filtering entities
internal String8 d_search_tags_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: entity -> color operations
internal Vec4F32 d_hsva_from_entity(DF_Entity *entity);
internal Vec4F32 d_rgba_from_entity(DF_Entity *entity);
//- rjf: entity -> expansion tree keys
internal EV_Key d_ev_key_from_entity(DF_Entity *entity);
internal EV_Key d_parent_ev_key_from_entity(DF_Entity *entity);
//- rjf: entity -> evaluation
internal D_EntityEval *d_eval_from_entity(Arena *arena, DF_Entity *entity);
////////////////////////////////
//~ rjf: Name Allocation
@@ -901,49 +549,6 @@ internal U64 d_name_bucket_idx_from_string_size(U64 size);
internal String8 d_name_alloc(String8 string);
internal void d_name_release(String8 string);
////////////////////////////////
//~ rjf: Entity Stateful Functions
//- rjf: entity allocation + tree forming
internal DF_Entity *d_entity_alloc(DF_Entity *parent, DF_EntityKind kind);
internal void d_entity_mark_for_deletion(DF_Entity *entity);
internal void d_entity_release(DF_Entity *entity);
internal void d_entity_change_parent(DF_Entity *entity, DF_Entity *old_parent, DF_Entity *new_parent, DF_Entity *prev_child);
//- rjf: entity simple equipment
internal void d_entity_equip_txt_pt(DF_Entity *entity, TxtPt point);
internal void d_entity_equip_entity_handle(DF_Entity *entity, D_Handle handle);
internal void d_entity_equip_disabled(DF_Entity *entity, B32 b32);
internal void d_entity_equip_u64(DF_Entity *entity, U64 u64);
internal void d_entity_equip_color_rgba(DF_Entity *entity, Vec4F32 rgba);
internal void d_entity_equip_color_hsva(DF_Entity *entity, Vec4F32 hsva);
internal void d_entity_equip_cfg_src(DF_Entity *entity, D_CfgSrc cfg_src);
internal void d_entity_equip_timestamp(DF_Entity *entity, U64 timestamp);
//- rjf: control layer correllation equipment
internal void d_entity_equip_ctrl_handle(DF_Entity *entity, CTRL_Handle handle);
internal void d_entity_equip_arch(DF_Entity *entity, Arch arch);
internal void d_entity_equip_ctrl_id(DF_Entity *entity, U32 id);
internal void d_entity_equip_stack_base(DF_Entity *entity, U64 stack_base);
internal void d_entity_equip_vaddr_rng(DF_Entity *entity, Rng1U64 range);
internal void d_entity_equip_vaddr(DF_Entity *entity, U64 vaddr);
//- rjf: name equipment
internal void d_entity_equip_name(DF_Entity *entity, String8 name);
internal void d_entity_equip_namef(DF_Entity *entity, char *fmt, ...);
//- rjf: file path map override lookups
internal String8List d_possible_overrides_from_file_path(Arena *arena, String8 file_path);
//- rjf: top-level state queries
internal DF_Entity *d_entity_root(void);
internal D_EntityList d_push_entity_list_with_kind(Arena *arena, DF_EntityKind kind);
internal DF_Entity *d_entity_from_id(DF_EntityID id);
internal DF_Entity *d_machine_entity_from_machine_id(CTRL_MachineID machine_id);
internal DF_Entity *d_entity_from_ctrl_handle(CTRL_Handle handle);
internal DF_Entity *d_entity_from_ctrl_id(CTRL_MachineID machine_id, U32 id);
internal DF_Entity *d_entity_from_name_and_kind(String8 string, DF_EntityKind kind);
////////////////////////////////
//~ rjf: View Rule Spec Stateful Functions
@@ -989,50 +594,6 @@ internal D_Unwind d_unwind_from_ctrl_unwind(Arena *arena, DI_Scope *di_scope, CT
//- rjf: stopped info from the control thread
internal CTRL_Event d_ctrl_last_stop_event(void);
////////////////////////////////
//~ rjf: Evaluation Spaces
//- rjf: ctrl entity <-> eval space
internal CTRL_Entity *d_ctrl_entity_from_eval_space(E_Space space);
internal E_Space d_eval_space_from_ctrl_entity(CTRL_Entity *entity);
//- rjf: entity <-> eval space
internal DF_Entity *d_entity_from_eval_space(E_Space space);
internal E_Space d_eval_space_from_entity(DF_Entity *entity);
//- rjf: eval space reads/writes
internal B32 d_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range);
internal B32 d_eval_space_write(void *u, E_Space space, void *in, Rng1U64 range);
//- rjf: asynchronous streamed reads -> hashes from spaces
internal U128 d_key_from_eval_space_range(E_Space space, Rng1U64 range, B32 zero_terminated);
//- rjf: space -> entire range
internal Rng1U64 d_whole_range_from_eval_space(E_Space space);
////////////////////////////////
//~ rjf: Evaluation Visualization
//- rjf: writing values back to child processes
internal B32 d_commit_eval_value_string(E_Eval dst_eval, String8 string);
//- rjf: eval / view rule params tree info extraction
internal U64 d_base_offset_from_eval(E_Eval eval);
internal E_Value d_value_from_params_key(MD_Node *params, String8 key);
internal Rng1U64 d_range_from_eval_params(E_Eval eval, MD_Node *params);
internal TXT_LangKind d_lang_kind_from_eval_params(E_Eval eval, MD_Node *params);
internal Arch d_arch_from_eval_params(E_Eval eval, MD_Node *params);
internal Vec2S32 d_dim2s32_from_eval_params(E_Eval eval, MD_Node *params);
internal R_Tex2DFormat d_tex2dformat_from_eval_params(E_Eval eval, MD_Node *params);
//- rjf: eval <-> entity
internal DF_Entity *d_entity_from_eval_string(String8 string);
internal String8 d_eval_string_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: eval <-> file path
internal String8 d_file_path_from_eval_string(Arena *arena, String8 string);
internal String8 d_eval_string_from_file_path(Arena *arena, String8 string);
////////////////////////////////
//~ rjf: Main State Accessors/Mutators
@@ -1050,15 +611,8 @@ internal String8 d_cfg_escaped_from_raw_string(Arena *arena, String8 string);
internal String8 d_cfg_raw_from_escaped_string(Arena *arena, String8 string);
internal String8List d_cfg_strings_from_core(Arena *arena, String8 root_path, D_CfgSrc source);
//- rjf: entity kind cache
internal D_EntityList d_query_cached_entity_list_with_kind(DF_EntityKind kind);
//- rjf: active entity based queries
internal DI_KeyList d_push_active_dbgi_key_list(Arena *arena);
internal D_EntityList d_push_active_target_list(Arena *arena);
//- rjf: expand key based entity queries
internal DF_Entity *d_entity_from_ev_key_and_kind(EV_Key key, DF_EntityKind kind);
//- rjf: per-run caches
internal CTRL_Unwind d_query_cached_unwind_from_thread(CTRL_Entity *thread);
-170
View File
@@ -12,176 +12,6 @@ str8_lit_comp("command_line"),
str8_lit_comp("transient"),
};
String8 d_entity_kind_display_string_table[30] =
{
str8_lit_comp("Nil"),
str8_lit_comp("Root"),
str8_lit_comp("Machine"),
str8_lit_comp("File"),
str8_lit_comp("Auto View Rule"),
str8_lit_comp("File Path Map"),
str8_lit_comp("Watch Pin"),
str8_lit_comp("Watch"),
str8_lit_comp("View Rule"),
str8_lit_comp("Breakpoint"),
str8_lit_comp("Condition"),
str8_lit_comp("Location"),
str8_lit_comp("Target"),
str8_lit_comp("Executable"),
str8_lit_comp("Arguments"),
str8_lit_comp("Working Directory"),
str8_lit_comp("Entry Point"),
str8_lit_comp("Window"),
str8_lit_comp("Panel"),
str8_lit_comp("View"),
str8_lit_comp("Recent Project"),
str8_lit_comp("Source"),
str8_lit_comp("Destination"),
str8_lit_comp("Process"),
str8_lit_comp("Thread"),
str8_lit_comp("Module"),
str8_lit_comp("Pending Thread Name"),
str8_lit_comp("Debug Info Path"),
str8_lit_comp("Conversion Task"),
str8_lit_comp("Conversion Failure"),
};
String8 d_entity_kind_name_lower_table[30] =
{
str8_lit_comp("nil"),
str8_lit_comp("root"),
str8_lit_comp("machine"),
str8_lit_comp("file"),
str8_lit_comp("auto_view_rule"),
str8_lit_comp("file_path_map"),
str8_lit_comp("watch_pin"),
str8_lit_comp("watch"),
str8_lit_comp("view_rule"),
str8_lit_comp("breakpoint"),
str8_lit_comp("condition"),
str8_lit_comp("location"),
str8_lit_comp("target"),
str8_lit_comp("executable"),
str8_lit_comp("arguments"),
str8_lit_comp("working_directory"),
str8_lit_comp("entry_point"),
str8_lit_comp("window"),
str8_lit_comp("panel"),
str8_lit_comp("view"),
str8_lit_comp("recent_project"),
str8_lit_comp("source"),
str8_lit_comp("dest"),
str8_lit_comp("process"),
str8_lit_comp("thread"),
str8_lit_comp("module"),
str8_lit_comp("pending_thread_name"),
str8_lit_comp("debug_info_path"),
str8_lit_comp("conversion_task"),
str8_lit_comp("conversion_fail"),
};
String8 d_entity_kind_name_lower_plural_table[30] =
{
str8_lit_comp("nils"),
str8_lit_comp("roots"),
str8_lit_comp("machines"),
str8_lit_comp("files"),
str8_lit_comp("auto_view_rules"),
str8_lit_comp("file_path_maps"),
str8_lit_comp("watch_pins"),
str8_lit_comp("watches"),
str8_lit_comp("view_rules"),
str8_lit_comp("breakpoints"),
str8_lit_comp("conditions"),
str8_lit_comp("locations"),
str8_lit_comp("targets"),
str8_lit_comp("executables"),
str8_lit_comp("argumentses"),
str8_lit_comp("working_directories"),
str8_lit_comp("entry_points"),
str8_lit_comp("windows"),
str8_lit_comp("panels"),
str8_lit_comp("views"),
str8_lit_comp("recent_projects"),
str8_lit_comp("sources"),
str8_lit_comp("dests"),
str8_lit_comp("processes"),
str8_lit_comp("threads"),
str8_lit_comp("modules"),
str8_lit_comp("pending_thread_names"),
str8_lit_comp("debug_info_paths"),
str8_lit_comp("conversion_tasks"),
str8_lit_comp("conversion_fails"),
};
String8 d_entity_kind_name_label_table[30] =
{
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
str8_lit_comp("Expression"),
str8_lit_comp("Expression"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
str8_lit_comp("Location"),
str8_lit_comp("Label"),
str8_lit_comp("Executable"),
str8_lit_comp("Arguments"),
str8_lit_comp("Execution Path"),
str8_lit_comp("Symbol Name"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Path"),
str8_lit_comp("Path"),
str8_lit_comp("Path"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
};
DF_EntityKindFlags d_entity_kind_flags_table[30] =
{
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (1*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (1*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (1*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (1*DF_EntityKindFlag_CanEnable) | (1*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (1*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (1*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (1*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (1*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (1*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (1*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (1*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (1*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
};
D_ViewRuleSpecInfo d_core_view_rule_spec_info_table[21] =
{
{str8_lit_comp("default"), str8_lit_comp("Default"), str8_lit_comp(""), str8_lit_comp(""), (D_ViewRuleSpecInfoFlag_Inherited*0)|(D_ViewRuleSpecInfoFlag_Expandable*0)|(D_ViewRuleSpecInfoFlag_ExprResolution*0)|(D_ViewRuleSpecInfoFlag_VizBlockProd*1), },
@@ -15,41 +15,6 @@ D_CfgSrc_Transient,
D_CfgSrc_COUNT,
} D_CfgSrc;
typedef enum DF_EntityKind
{
DF_EntityKind_Nil,
DF_EntityKind_Root,
DF_EntityKind_Machine,
DF_EntityKind_File,
DF_EntityKind_AutoViewRule,
DF_EntityKind_FilePathMap,
DF_EntityKind_WatchPin,
DF_EntityKind_Watch,
DF_EntityKind_ViewRule,
DF_EntityKind_Breakpoint,
DF_EntityKind_Condition,
DF_EntityKind_Location,
DF_EntityKind_Target,
DF_EntityKind_Executable,
DF_EntityKind_Arguments,
DF_EntityKind_WorkingDirectory,
DF_EntityKind_EntryPoint,
DF_EntityKind_Window,
DF_EntityKind_Panel,
DF_EntityKind_View,
DF_EntityKind_RecentProject,
DF_EntityKind_Source,
DF_EntityKind_Dest,
DF_EntityKind_Process,
DF_EntityKind_Thread,
DF_EntityKind_Module,
DF_EntityKind_PendingThreadName,
DF_EntityKind_DebugInfoPath,
DF_EntityKind_ConversionTask,
DF_EntityKind_ConversionFail,
DF_EntityKind_COUNT,
} DF_EntityKind;
typedef enum D_CmdKind
{
D_CmdKind_Null,
@@ -138,11 +103,6 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
};
C_LINKAGE_BEGIN
extern String8 d_cfg_src_string_table[4];
extern String8 d_entity_kind_display_string_table[30];
extern String8 d_entity_kind_name_lower_table[30];
extern String8 d_entity_kind_name_lower_plural_table[30];
extern String8 d_entity_kind_name_label_table[30];
extern DF_EntityKindFlags d_entity_kind_flags_table[30];
C_LINKAGE_END
+103
View File
@@ -28,6 +28,109 @@
@expand(D_CfgSrcTable a) `DF_CmdKind_$(a.apply_cmd)`;
}
////////////////////////////////
//~ rjf: Entity Kind Tables
@table(name name_lower name_lower_plural op_delete op_freeze op_edit op_rename op_enable op_cond op_dup name_is_code name_is_path user_lifetime is_serialized name_label icon_kind display_string)
// | |
// | _____________________________________________________________________________________________________________________________________/
// | /
// operations________ names lt sz
// /..................\ /...\ | |
// dl fz ed rn en cn dp nc np ul iz
DF_EntityKindTable:
{
{Nil nil nils 0 0 0 0 0 0 0 0 0 0 0 "Label" Null "Nil" }
{Root root roots 0 0 0 0 0 0 0 0 0 0 0 "Label" Null "Root" }
//- rjf: machines
{Machine machine machines 0 1 0 1 0 0 0 0 0 0 0 "Label" Machine "Machine" }
//- rjf: filesystem modeling
{File file files 0 0 0 0 0 0 0 0 0 0 0 "Label" FileOutline "File" }
//- rjf: auto view rules
{AutoViewRule auto_view_rule auto_view_rules 0 0 0 0 0 0 0 0 0 1 1 "Label" Binoculars "Auto View Rule" }
//- rjf: file path maps
{FilePathMap file_path_map file_path_maps 0 0 0 0 0 0 0 0 0 0 1 "Label" FileOutline "File Path Map" }
//- rjf: watch pins
{WatchPin watch_pin watch_pins 1 0 0 1 0 0 1 1 0 1 1 "Expression" Pin "Watch Pin" }
//- rjf: watches
{Watch watch watches 1 0 0 1 1 0 1 1 0 1 1 "Expression" Binoculars "Watch" }
{ViewRule view_rule view_rules 1 0 0 1 1 0 1 1 0 1 0 "Expression" Binoculars "View Rule" }
//- rjf: breakpoints
{Breakpoint breakpoint breakpoints 1 0 0 1 1 1 1 0 0 1 1 "Label" CircleFilled "Breakpoint" }
{Condition condition conditions 0 0 0 0 0 0 0 1 0 1 0 "Expression" CircleFilled "Condition" }
//- rjf: user-controlled locations (source, addresses, symbol names)
{Location location locations 0 0 0 0 0 0 0 1 1 1 0 "Location" Null "Location" }
//- rjf: targets
{Target target targets 1 0 1 1 1 0 1 0 0 1 1 "Label" Target "Target" }
{Executable executable executables 0 0 0 0 0 0 0 0 1 1 0 "Executable" Null "Executable" }
{Arguments arguments argumentses 0 0 0 0 0 0 0 0 0 1 0 "Arguments" Null "Arguments" }
{WorkingDirectory working_directory working_directories 0 0 0 0 0 0 0 0 1 1 0 "Execution Path" Null "Working Directory" }
{EntryPoint entry_point entry_points 0 0 0 0 0 0 0 0 0 1 0 "Symbol Name" Null "Entry Point" }
//- rjf: frontend containers (windows, panels, views)
{Window window windows 1 0 0 0 0 0 1 0 0 1 1 "Label" Window "Window" }
{Panel panel panels 1 0 0 0 0 0 1 0 0 1 1 "Label" XSplit "Panel" }
{View view views 1 0 0 0 0 0 1 0 0 1 1 "Label" Null "View" }
//- rjf: recent projects
{RecentProject recent_project recent_projects 0 0 0 0 0 0 0 0 1 0 1 "Path" Briefcase "Recent Project" }
//- rjf: src -> dst mapping
{Source source sources 0 0 0 0 0 0 0 0 0 0 0 "Path" Null "Source" }
{Dest dest dests 0 0 0 0 0 0 0 0 0 0 0 "Path" Null "Destination" }
//- rjf: control system entities
{Process process processes 0 1 0 1 0 0 0 0 0 0 0 "Label" Threads "Process" }
{Thread thread threads 0 1 0 1 0 0 0 0 0 0 0 "Label" Thread "Thread" }
{Module module modules 0 0 0 0 0 0 0 0 0 0 0 "Label" Module "Module" }
{PendingThreadName pending_thread_name pending_thread_names 0 0 0 0 0 0 0 0 0 0 0 "Label" Threads "Pending Thread Name" }
{DebugInfoPath debug_info_path debug_info_paths 0 0 0 0 0 0 0 0 0 0 0 "Label" Module "Debug Info Path" }
//- rjf: parser task entities
{ConversionTask conversion_task conversion_tasks 0 0 0 1 0 0 0 0 0 0 0 "Label" Null "Conversion Task" }
{ConversionFail conversion_fail conversion_fails 0 0 0 1 0 0 0 0 0 0 0 "Label" Null "Conversion Failure" }
}
@enum DF_EntityKind:
{
@expand(DF_EntityKindTable a) `$(a.name)`,
COUNT,
}
@data(String8) d_entity_kind_display_string_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.display_string)")`,
}
@data(String8) d_entity_kind_name_lower_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.name_lower)")`,
}
@data(String8) d_entity_kind_name_lower_plural_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.name_lower_plural)")`,
}
@data(String8) d_entity_kind_name_label_table:
{
@expand(DF_EntityKindTable a) `str8_lit_comp("$(a.name_label)")`,
}
@data(DF_EntityKindFlags) d_entity_kind_flags_table:
{
@expand(DF_EntityKindTable a) `($(a.op_delete)*DF_EntityKindFlag_CanDelete) | ($(a.op_freeze)*DF_EntityKindFlag_CanFreeze) | ($(a.op_edit)*DF_EntityKindFlag_CanEdit) | ($(a.op_rename)*DF_EntityKindFlag_CanRename) | ($(a.op_enable)*DF_EntityKindFlag_CanEnable) | ($(a.op_cond)*DF_EntityKindFlag_CanCondition) | ($(a.op_dup)*DF_EntityKindFlag_CanDuplicate) | ($(a.name_is_code)*DF_EntityKindFlag_NameIsCode) | ($(a.name_is_path)*DF_EntityKindFlag_NameIsPath) | ($(a.user_lifetime)*DF_EntityKindFlag_UserDefinedLifetime) | ($(a.is_serialized)*DF_EntityKindFlag_IsSerializedToConfig)`,
}
////////////////////////////////
//~ rjf: Registers Type Table
File diff suppressed because it is too large Load Diff
+339
View File
@@ -4,6 +4,62 @@
#ifndef DBG_FRONTEND_CORE_H
#define DBG_FRONTEND_CORE_H
////////////////////////////////
//~ rjf: Entity Kind Flags
typedef U32 DF_EntityKindFlags;
enum
{
//- rjf: allowed operations
DF_EntityKindFlag_CanDelete = (1<<0),
DF_EntityKindFlag_CanFreeze = (1<<1),
DF_EntityKindFlag_CanEdit = (1<<2),
DF_EntityKindFlag_CanRename = (1<<3),
DF_EntityKindFlag_CanEnable = (1<<4),
DF_EntityKindFlag_CanCondition = (1<<5),
DF_EntityKindFlag_CanDuplicate = (1<<6),
//- rjf: name categorization
DF_EntityKindFlag_NameIsCode = (1<<7),
DF_EntityKindFlag_NameIsPath = (1<<8),
//- rjf: lifetime categorization
DF_EntityKindFlag_UserDefinedLifetime = (1<<9),
//- rjf: serialization
DF_EntityKindFlag_IsSerializedToConfig = (1<<10),
};
////////////////////////////////
//~ rjf: Entity Kind Flags
typedef U32 DF_EntityFlags;
enum
{
//- rjf: allocationless, simple equipment
DF_EntityFlag_HasTextPoint = (1<<0),
DF_EntityFlag_HasEntityHandle = (1<<2),
DF_EntityFlag_HasU64 = (1<<4),
DF_EntityFlag_HasColor = (1<<6),
DF_EntityFlag_DiesOnRunStop = (1<<8),
//- rjf: ctrl entity equipment
DF_EntityFlag_HasCtrlHandle = (1<<9),
DF_EntityFlag_HasArch = (1<<10),
DF_EntityFlag_HasCtrlID = (1<<11),
DF_EntityFlag_HasStackBase = (1<<12),
DF_EntityFlag_HasTLSRoot = (1<<13),
DF_EntityFlag_HasVAddrRng = (1<<14),
DF_EntityFlag_HasVAddr = (1<<15),
//- rjf: file properties
DF_EntityFlag_IsFolder = (1<<16),
DF_EntityFlag_IsMissing = (1<<17),
//- rjf: deletion
DF_EntityFlag_MarkedForDeletion = (1<<31),
};
////////////////////////////////
//~ rjf: Evaluation Spaces
@@ -398,6 +454,114 @@ enum
#include "generated/dbg_frontend.meta.h"
////////////////////////////////
//~ rjf: Entity Types
typedef U64 DF_EntityID;
typedef struct DF_Entity DF_Entity;
struct DF_Entity
{
// rjf: tree links
DF_Entity *first;
DF_Entity *last;
DF_Entity *next;
DF_Entity *prev;
DF_Entity *parent;
// rjf: metadata
DF_EntityKind kind;
DF_EntityFlags flags;
DF_EntityID id;
U64 gen;
U64 alloc_time_us;
F32 alive_t;
// rjf: basic equipment
TxtPt text_point;
D_Handle entity_handle;
B32 disabled;
U64 u64;
Vec4F32 color_hsva;
D_CfgSrc cfg_src;
U64 timestamp;
// rjf: ctrl equipment
CTRL_Handle ctrl_handle;
Arch arch;
U32 ctrl_id;
U64 stack_base;
Rng1U64 vaddr_rng;
U64 vaddr;
// rjf: string equipment
String8 string;
// rjf: parameter tree
Arena *params_arena;
MD_Node *params_root;
};
typedef struct DF_EntityNode DF_EntityNode;
struct DF_EntityNode
{
DF_EntityNode *next;
DF_Entity *entity;
};
typedef struct DF_EntityList DF_EntityList;
struct DF_EntityList
{
DF_EntityNode *first;
DF_EntityNode *last;
U64 count;
};
typedef struct DF_EntityArray DF_EntityArray;
struct DF_EntityArray
{
DF_Entity **v;
U64 count;
};
typedef struct DF_EntityRec DF_EntityRec;
struct DF_EntityRec
{
DF_Entity *next;
S32 push_count;
S32 pop_count;
};
////////////////////////////////
//~ rjf: Entity Evaluation Types
typedef struct DF_EntityEval DF_EntityEval;
struct DF_EntityEval
{
B64 enabled;
U64 hit_count;
U64 label_off;
U64 location_off;
U64 condition_off;
};
////////////////////////////////
//~ rjf: Entity Fuzzy Listing Types
typedef struct DF_EntityFuzzyItem DF_EntityFuzzyItem;
struct DF_EntityFuzzyItem
{
DF_Entity *entity;
FuzzyMatchRangeList matches;
};
typedef struct DF_EntityFuzzyItemArray DF_EntityFuzzyItemArray;
struct DF_EntityFuzzyItemArray
{
DF_EntityFuzzyItem *v;
U64 count;
};
////////////////////////////////
//~ rjf: Command Types
@@ -668,6 +832,14 @@ struct DF_EvalVizViewCacheSlot
////////////////////////////////
//~ rjf: Main Per-Process Graphical State
typedef struct D_EntityListCache D_EntityListCache;
struct D_EntityListCache
{
Arena *arena;
U64 alloc_gen;
DF_EntityList list;
};
typedef struct DF_State DF_State;
struct DF_State
{
@@ -700,6 +872,20 @@ struct DF_State
// rjf: autosave timer
F32 seconds_until_autosave;
// rjf: entity state
Arena *entities_arena;
DF_Entity *entities_base;
U64 entities_count;
U64 entities_id_gen;
DF_Entity *entities_root;
DF_Entity *entities_free[2]; // [0] -> normal lifetime, not user defined; [1] -> user defined lifetime (& thus undoable)
U64 entities_free_count;
U64 entities_active_count;
// rjf: entity query caches
U64 kind_alloc_gens[DF_EntityKind_COUNT];
D_EntityListCache kind_caches[DF_EntityKind_COUNT];
// rjf: key map table
Arena *key_map_arena;
U64 key_map_table_size;
@@ -796,6 +982,15 @@ struct DF_State
////////////////////////////////
//~ rjf: Globals
read_only global DF_Entity d_nil_entity =
{
&d_nil_entity,
&d_nil_entity,
&d_nil_entity,
&d_nil_entity,
&d_nil_entity,
};
read_only global DF_CmdKindInfo df_nil_cmd_kind_info = {0};
read_only global DF_ViewSpec df_nil_view_spec =
@@ -853,6 +1048,59 @@ internal DF_Regs *df_regs_copy(Arena *arena, DF_Regs *src);
internal void df_cmd_list_push_new(Arena *arena, DF_CmdList *cmds, String8 name, DF_Regs *regs);
////////////////////////////////
//~ rjf: Entity Type Pure Functions
//- rjf: nil
internal B32 df_entity_is_nil(DF_Entity *entity);
#define df_require_entity_nonnil(entity, if_nil_stmts) do{if(df_entity_is_nil(entity)){if_nil_stmts;}}while(0)
//- rjf: handle <-> entity conversions
internal U64 df_index_from_entity(DF_Entity *entity);
internal D_Handle df_handle_from_entity(DF_Entity *entity);
internal DF_Entity *df_entity_from_handle(D_Handle handle);
internal D_HandleList df_handle_list_from_entity_list(Arena *arena, DF_EntityList entities);
//- rjf: entity recursion iterators
internal DF_EntityRec df_entity_rec_depth_first(DF_Entity *entity, DF_Entity *subtree_root, U64 sib_off, U64 child_off);
#define df_entity_rec_depth_first_pre(entity, subtree_root) df_entity_rec_depth_first((entity), (subtree_root), OffsetOf(DF_Entity, next), OffsetOf(DF_Entity, first))
#define df_entity_rec_depth_first_post(entity, subtree_root) df_entity_rec_depth_first((entity), (subtree_root), OffsetOf(DF_Entity, prev), OffsetOf(DF_Entity, last))
//- rjf: ancestor/child introspection
internal DF_Entity *df_entity_child_from_kind(DF_Entity *entity, DF_EntityKind kind);
internal DF_Entity *df_entity_ancestor_from_kind(DF_Entity *entity, DF_EntityKind kind);
internal DF_EntityList df_push_entity_child_list_with_kind(Arena *arena, DF_Entity *entity, DF_EntityKind kind);
internal DF_Entity *df_entity_child_from_string_and_kind(DF_Entity *parent, String8 string, DF_EntityKind kind);
//- rjf: entity list building
internal void df_entity_list_push(Arena *arena, DF_EntityList *list, DF_Entity *entity);
internal DF_EntityArray df_entity_array_from_list(Arena *arena, DF_EntityList *list);
#define df_first_entity_from_list(list) ((list)->first != 0 ? (list)->first->entity : &d_nil_entity)
//- rjf: entity fuzzy list building
internal DF_EntityFuzzyItemArray df_entity_fuzzy_item_array_from_entity_list_needle(Arena *arena, DF_EntityList *list, String8 needle);
internal DF_EntityFuzzyItemArray df_entity_fuzzy_item_array_from_entity_array_needle(Arena *arena, DF_EntityArray *array, String8 needle);
//- rjf: full path building, from file/folder entities
internal String8 df_full_path_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: display string entities, for referencing entities in ui
internal String8 df_display_string_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: extra search tag strings for fuzzy filtering entities
internal String8 df_search_tags_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: entity -> color operations
internal Vec4F32 df_hsva_from_entity(DF_Entity *entity);
internal Vec4F32 df_rgba_from_entity(DF_Entity *entity);
//- rjf: entity -> expansion tree keys
internal EV_Key df_ev_key_from_entity(DF_Entity *entity);
internal EV_Key df_parent_ev_key_from_entity(DF_Entity *entity);
//- rjf: entity -> evaluation
internal DF_EntityEval *df_eval_from_entity(Arena *arena, DF_Entity *entity);
////////////////////////////////
//~ rjf: View Type Functions
@@ -925,6 +1173,92 @@ internal void df_queue_drag_drop(void);
internal void df_set_hover_regs(void);
internal DF_Regs *df_get_hover_regs(void);
////////////////////////////////
//~ rjf: Entity Stateful Functions
//- rjf: entity allocation + tree forming
internal DF_Entity *df_entity_alloc(DF_Entity *parent, DF_EntityKind kind);
internal void df_entity_mark_for_deletion(DF_Entity *entity);
internal void df_entity_release(DF_Entity *entity);
internal void df_entity_change_parent(DF_Entity *entity, DF_Entity *old_parent, DF_Entity *new_parent, DF_Entity *prev_child);
//- rjf: entity simple equipment
internal void df_entity_equip_txt_pt(DF_Entity *entity, TxtPt point);
internal void df_entity_equip_entity_handle(DF_Entity *entity, D_Handle handle);
internal void df_entity_equip_disabled(DF_Entity *entity, B32 b32);
internal void df_entity_equip_u64(DF_Entity *entity, U64 u64);
internal void df_entity_equip_color_rgba(DF_Entity *entity, Vec4F32 rgba);
internal void df_entity_equip_color_hsva(DF_Entity *entity, Vec4F32 hsva);
internal void df_entity_equip_cfg_src(DF_Entity *entity, D_CfgSrc cfg_src);
internal void df_entity_equip_timestamp(DF_Entity *entity, U64 timestamp);
//- rjf: control layer correllation equipment
internal void df_entity_equip_ctrl_handle(DF_Entity *entity, CTRL_Handle handle);
internal void df_entity_equip_arch(DF_Entity *entity, Arch arch);
internal void df_entity_equip_ctrl_id(DF_Entity *entity, U32 id);
internal void df_entity_equip_stack_base(DF_Entity *entity, U64 stack_base);
internal void df_entity_equip_vaddr_rng(DF_Entity *entity, Rng1U64 range);
internal void df_entity_equip_vaddr(DF_Entity *entity, U64 vaddr);
//- rjf: name equipment
internal void df_entity_equip_name(DF_Entity *entity, String8 name);
//- rjf: file path map override lookups
internal String8List d_possible_overrides_from_file_path(Arena *arena, String8 file_path);
//- rjf: top-level state queries
internal DF_Entity *df_entity_root(void);
internal DF_EntityList df_push_entity_list_with_kind(Arena *arena, DF_EntityKind kind);
internal DF_Entity *df_entity_from_id(DF_EntityID id);
internal DF_Entity *df_machine_entity_from_machine_id(CTRL_MachineID machine_id);
internal DF_Entity *df_entity_from_ctrl_handle(CTRL_Handle handle);
internal DF_Entity *df_entity_from_ctrl_id(CTRL_MachineID machine_id, U32 id);
internal DF_Entity *df_entity_from_name_and_kind(String8 string, DF_EntityKind kind);
////////////////////////////////
//~ rjf: Evaluation Spaces
//- rjf: ctrl entity <-> eval space
internal CTRL_Entity *d_ctrl_entity_from_eval_space(E_Space space);
internal E_Space d_eval_space_from_ctrl_entity(CTRL_Entity *entity);
//- rjf: entity <-> eval space
internal DF_Entity *d_entity_from_eval_space(E_Space space);
internal E_Space d_eval_space_from_entity(DF_Entity *entity);
//- rjf: eval space reads/writes
internal B32 d_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range);
internal B32 d_eval_space_write(void *u, E_Space space, void *in, Rng1U64 range);
//- rjf: asynchronous streamed reads -> hashes from spaces
internal U128 d_key_from_eval_space_range(E_Space space, Rng1U64 range, B32 zero_terminated);
//- rjf: space -> entire range
internal Rng1U64 d_whole_range_from_eval_space(E_Space space);
////////////////////////////////
//~ rjf: Evaluation Visualization
//- rjf: writing values back to child processes
internal B32 d_commit_eval_value_string(E_Eval dst_eval, String8 string);
//- rjf: eval / view rule params tree info extraction
internal U64 d_base_offset_from_eval(E_Eval eval);
internal E_Value d_value_from_params_key(MD_Node *params, String8 key);
internal Rng1U64 d_range_from_eval_params(E_Eval eval, MD_Node *params);
internal TXT_LangKind d_lang_kind_from_eval_params(E_Eval eval, MD_Node *params);
internal Arch d_arch_from_eval_params(E_Eval eval, MD_Node *params);
internal Vec2S32 d_dim2s32_from_eval_params(E_Eval eval, MD_Node *params);
internal R_Tex2DFormat d_tex2dformat_from_eval_params(E_Eval eval, MD_Node *params);
//- rjf: eval <-> entity
internal DF_Entity *d_entity_from_eval_string(String8 string);
internal String8 d_eval_string_from_entity(Arena *arena, DF_Entity *entity);
//- rjf: eval <-> file path
internal String8 d_file_path_from_eval_string(Arena *arena, String8 string);
internal String8 d_eval_string_from_file_path(Arena *arena, String8 string);
////////////////////////////////
//~ rjf: View Spec State Functions
@@ -1063,6 +1397,11 @@ internal Arena *df_frame_arena(void);
//- rjf: config paths
internal String8 df_cfg_path_from_src(D_CfgSrc src);
//- rjf: entity cache queries
internal DF_EntityList d_query_cached_entity_list_with_kind(DF_EntityKind kind);
internal DF_EntityList d_push_active_target_list(Arena *arena);
internal DF_Entity *d_entity_from_ev_key_and_kind(EV_Key key, DF_EntityKind kind);
//- rjf: config state
internal D_CfgTable *df_cfg_table(void);
+147 -147
View File
@@ -168,9 +168,9 @@ df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeVie
code_slice_params.line_text = push_array(scratch.arena, String8, visible_line_count);
code_slice_params.line_ranges = push_array(scratch.arena, Rng1U64, visible_line_count);
code_slice_params.line_tokens = push_array(scratch.arena, TXT_TokenArray, visible_line_count);
code_slice_params.line_bps = push_array(scratch.arena, D_EntityList, visible_line_count);
code_slice_params.line_bps = push_array(scratch.arena, DF_EntityList, visible_line_count);
code_slice_params.line_ips = push_array(scratch.arena, CTRL_EntityList, visible_line_count);
code_slice_params.line_pins = push_array(scratch.arena, D_EntityList, visible_line_count);
code_slice_params.line_pins = push_array(scratch.arena, DF_EntityList, visible_line_count);
code_slice_params.line_vaddrs = push_array(scratch.arena, U64, visible_line_count);
code_slice_params.line_infos = push_array(scratch.arena, D_LineList, visible_line_count);
code_slice_params.font = code_font;
@@ -199,16 +199,16 @@ df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeVie
// rjf: find visible breakpoints for source code
ProfScope("find visible breakpoints")
{
D_EntityList bps = d_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint);
for(D_EntityNode *n = bps.first; n != 0; n = n->next)
DF_EntityList bps = d_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint);
for(DF_EntityNode *n = bps.first; n != 0; n = n->next)
{
DF_Entity *bp = n->entity;
DF_Entity *loc = d_entity_child_from_kind(bp, DF_EntityKind_Location);
DF_Entity *loc = df_entity_child_from_kind(bp, DF_EntityKind_Location);
if(path_match_normalized(loc->string, df_regs()->file_path) &&
visible_line_num_range.min <= loc->text_point.line && loc->text_point.line <= visible_line_num_range.max)
{
U64 slice_line_idx = (loc->text_point.line-visible_line_num_range.min);
d_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp);
df_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp);
}
}
}
@@ -245,16 +245,16 @@ df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeVie
// rjf: find visible watch pins for source code
ProfScope("find visible watch pins")
{
D_EntityList wps = d_query_cached_entity_list_with_kind(DF_EntityKind_WatchPin);
for(D_EntityNode *n = wps.first; n != 0; n = n->next)
DF_EntityList wps = d_query_cached_entity_list_with_kind(DF_EntityKind_WatchPin);
for(DF_EntityNode *n = wps.first; n != 0; n = n->next)
{
DF_Entity *wp = n->entity;
DF_Entity *loc = d_entity_child_from_kind(wp, DF_EntityKind_Location);
DF_Entity *loc = df_entity_child_from_kind(wp, DF_EntityKind_Location);
if(path_match_normalized(loc->string, df_regs()->file_path) &&
visible_line_num_range.min <= loc->text_point.line && loc->text_point.line <= visible_line_num_range.max)
{
U64 slice_line_idx = (loc->text_point.line-visible_line_num_range.min);
d_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], wp);
df_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], wp);
}
}
}
@@ -297,12 +297,12 @@ df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeVie
// rjf: find breakpoints mapping to this disasm
if(dasm_lines) ProfScope("find breakpoints mapping to this disassembly")
{
D_EntityList bps = d_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint);
for(D_EntityNode *n = bps.first; n != 0; n = n->next)
DF_EntityList bps = d_query_cached_entity_list_with_kind(DF_EntityKind_Breakpoint);
for(DF_EntityNode *n = bps.first; n != 0; n = n->next)
{
DF_Entity *bp = n->entity;
DF_Entity *loc = d_entity_child_from_kind(bp, DF_EntityKind_Location);
if(loc->flags & D_EntityFlag_HasVAddr && contains_1u64(dasm_vaddr_range, loc->vaddr))
DF_Entity *loc = df_entity_child_from_kind(bp, DF_EntityKind_Location);
if(loc->flags & DF_EntityFlag_HasVAddr && contains_1u64(dasm_vaddr_range, loc->vaddr))
{
U64 off = loc->vaddr-dasm_vaddr_range.min;
U64 idx = dasm_line_array_idx_from_code_off__linear_scan(dasm_lines, off);
@@ -310,7 +310,7 @@ df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeVie
if(contains_1s64(visible_line_num_range, line_num))
{
U64 slice_line_idx = (line_num-visible_line_num_range.min);
d_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp);
df_entity_list_push(scratch.arena, &code_slice_params.line_bps[slice_line_idx], bp);
}
}
}
@@ -319,12 +319,12 @@ df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeVie
// rjf: find watch pins mapping to this disasm
if(dasm_lines) ProfScope("find watch pins mapping to this disassembly")
{
D_EntityList pins = d_query_cached_entity_list_with_kind(DF_EntityKind_WatchPin);
for(D_EntityNode *n = pins.first; n != 0; n = n->next)
DF_EntityList pins = d_query_cached_entity_list_with_kind(DF_EntityKind_WatchPin);
for(DF_EntityNode *n = pins.first; n != 0; n = n->next)
{
DF_Entity *pin = n->entity;
DF_Entity *loc = d_entity_child_from_kind(pin, DF_EntityKind_Location);
if(loc->flags & D_EntityFlag_HasVAddr && contains_1u64(dasm_vaddr_range, loc->vaddr))
DF_Entity *loc = df_entity_child_from_kind(pin, DF_EntityKind_Location);
if(loc->flags & DF_EntityFlag_HasVAddr && contains_1u64(dasm_vaddr_range, loc->vaddr))
{
U64 off = loc->vaddr-dasm_vaddr_range.min;
U64 idx = dasm_line_array_idx_from_code_off__linear_scan(dasm_lines, off);
@@ -332,7 +332,7 @@ df_code_view_build(Arena *arena, DF_View *view, DF_CodeViewState *cv, DF_CodeVie
if(contains_1s64(visible_line_num_range, line_num))
{
U64 slice_line_idx = (line_num-visible_line_num_range.min);
d_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], pin);
df_entity_list_push(scratch.arena, &code_slice_params.line_pins[slice_line_idx], pin);
}
}
}
@@ -1007,17 +1007,17 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
case DF_WatchViewFillKind_Watch:
{
mutable_entity_kind = DF_EntityKind_Watch;
D_EntityList watches = d_query_cached_entity_list_with_kind(mutable_entity_kind);
for(D_EntityNode *n = watches.first; n != 0; n = n->next)
DF_EntityList watches = d_query_cached_entity_list_with_kind(mutable_entity_kind);
for(DF_EntityNode *n = watches.first; n != 0; n = n->next)
{
DF_Entity *watch = n->entity;
if(watch->flags & D_EntityFlag_MarkedForDeletion)
if(watch->flags & DF_EntityFlag_MarkedForDeletion)
{
continue;
}
EV_Key parent_key = d_parent_ev_key_from_entity(watch);
EV_Key key = d_ev_key_from_entity(watch);
DF_Entity *view_rule = d_entity_child_from_kind(watch, DF_EntityKind_ViewRule);
EV_Key parent_key = df_parent_ev_key_from_entity(watch);
EV_Key key = df_ev_key_from_entity(watch);
DF_Entity *view_rule = df_entity_child_from_kind(watch, DF_EntityKind_ViewRule);
ev_key_set_view_rule(eval_view, key, view_rule->string);
String8 expr_string = watch->string;
FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, expr_string);
@@ -1036,17 +1036,17 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
{
mutable_entity_kind = DF_EntityKind_Breakpoint;
ev_view_rule_list_push_string(scratch.arena, &top_level_view_rules, str8_lit("no_addr"));
D_EntityList bps = d_query_cached_entity_list_with_kind(mutable_entity_kind);
for(D_EntityNode *n = bps.first; n != 0; n = n->next)
DF_EntityList bps = d_query_cached_entity_list_with_kind(mutable_entity_kind);
for(DF_EntityNode *n = bps.first; n != 0; n = n->next)
{
DF_Entity *bp = n->entity;
if(bp->flags & D_EntityFlag_MarkedForDeletion)
if(bp->flags & DF_EntityFlag_MarkedForDeletion)
{
continue;
}
EV_Key parent_key = d_parent_ev_key_from_entity(bp);
EV_Key key = d_ev_key_from_entity(bp);
String8 title = d_display_string_from_entity(scratch.arena, bp);
EV_Key parent_key = df_parent_ev_key_from_entity(bp);
EV_Key key = df_ev_key_from_entity(bp);
String8 title = df_display_string_from_entity(scratch.arena, bp);
FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, title);
if(matches.count == matches.needle_part_count)
{
@@ -1075,16 +1075,16 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
case DF_WatchViewFillKind_WatchPins:
{
mutable_entity_kind = DF_EntityKind_WatchPin;
D_EntityList wps = d_query_cached_entity_list_with_kind(mutable_entity_kind);
for(D_EntityNode *n = wps.first; n != 0; n = n->next)
DF_EntityList wps = d_query_cached_entity_list_with_kind(mutable_entity_kind);
for(DF_EntityNode *n = wps.first; n != 0; n = n->next)
{
DF_Entity *wp = n->entity;
if(wp->flags & D_EntityFlag_MarkedForDeletion)
if(wp->flags & DF_EntityFlag_MarkedForDeletion)
{
continue;
}
EV_Key parent_key = d_parent_ev_key_from_entity(wp);
EV_Key key = d_ev_key_from_entity(wp);
EV_Key parent_key = df_parent_ev_key_from_entity(wp);
EV_Key key = df_ev_key_from_entity(wp);
String8 title = wp->string;
FuzzyMatchRangeList matches = fuzzy_match_find(scratch.arena, filter, title);
if(matches.count == matches.needle_part_count)
@@ -1728,18 +1728,18 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
{
DF_WatchViewPoint pt = df_watch_view_point_from_tbl(&blocks, tbl);
DF_Entity *watch = d_entity_from_ev_key_and_kind(pt.key, mutable_entity_kind);
if(!d_entity_is_nil(watch))
if(!df_entity_is_nil(watch))
{
d_entity_equip_name(watch, new_string);
df_entity_equip_name(watch, new_string);
state_dirty = 1;
snap_to_cursor = 1;
}
else if(editing_complete && new_string.size != 0 && ev_key_match(pt.key, empty_row_key))
{
watch = d_entity_alloc(d_entity_root(), mutable_entity_kind);
d_entity_equip_cfg_src(watch, D_CfgSrc_Project);
d_entity_equip_name(watch, new_string);
EV_Key key = d_ev_key_from_entity(watch);
watch = df_entity_alloc(df_entity_root(), mutable_entity_kind);
df_entity_equip_cfg_src(watch, D_CfgSrc_Project);
df_entity_equip_name(watch, new_string);
EV_Key key = df_ev_key_from_entity(watch);
ev_key_set_view_rule(eval_view, key, str8_zero());
state_dirty = 1;
snap_to_cursor = 1;
@@ -1774,18 +1774,18 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
DF_WatchViewPoint pt = df_watch_view_point_from_tbl(&blocks, tbl);
ev_key_set_view_rule(eval_view, pt.key, new_string);
DF_Entity *watch = d_entity_from_ev_key_and_kind(pt.key, mutable_entity_kind);
DF_Entity *view_rule = d_entity_child_from_kind(watch, DF_EntityKind_ViewRule);
if(new_string.size != 0 && d_entity_is_nil(view_rule))
DF_Entity *view_rule = df_entity_child_from_kind(watch, DF_EntityKind_ViewRule);
if(new_string.size != 0 && df_entity_is_nil(view_rule))
{
view_rule = d_entity_alloc(watch, DF_EntityKind_ViewRule);
view_rule = df_entity_alloc(watch, DF_EntityKind_ViewRule);
}
else if(new_string.size == 0 && !d_entity_is_nil(view_rule))
else if(new_string.size == 0 && !df_entity_is_nil(view_rule))
{
d_entity_mark_for_deletion(view_rule);
df_entity_mark_for_deletion(view_rule);
}
if(new_string.size != 0)
{
d_entity_equip_name(view_rule, new_string);
df_entity_equip_name(view_rule, new_string);
}
state_dirty = 1;
snap_to_cursor = 1;
@@ -1858,30 +1858,30 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
DF_WatchViewPoint fallback_pt_prev = df_watch_view_point_from_tbl(&blocks, v2s64(0, y - 1));
DF_WatchViewPoint fallback_pt_next = df_watch_view_point_from_tbl(&blocks, v2s64(0, y + 1));
DF_Entity *watch = d_entity_from_ev_key_and_kind(pt.key, mutable_entity_kind);
if(!d_entity_is_nil(watch))
if(!df_entity_is_nil(watch))
{
EV_Key new_cursor_key = empty_row_key;
EV_Key new_cursor_parent_key = empty_row_parent_key;
if((evt->delta_2s32.x < 0 || evt->delta_2s32.y < 0) && !ev_key_match(ev_key_zero(), fallback_pt_prev.key))
{
DF_Entity *fallback_watch = d_entity_from_ev_key_and_kind(fallback_pt_prev.key, mutable_entity_kind);
if(!d_entity_is_nil(fallback_watch))
if(!df_entity_is_nil(fallback_watch))
{
new_cursor_key = fallback_pt_prev.key;
new_cursor_parent_key = d_parent_ev_key_from_entity(fallback_watch);
new_cursor_parent_key = df_parent_ev_key_from_entity(fallback_watch);
}
}
else if(!ev_key_match(ev_key_zero(), fallback_pt_next.key))
{
DF_Entity *fallback_watch = d_entity_from_ev_key_and_kind(fallback_pt_next.key, mutable_entity_kind);
if(!d_entity_is_nil(fallback_watch))
if(!df_entity_is_nil(fallback_watch))
{
new_cursor_key = fallback_pt_next.key;
new_cursor_parent_key = d_parent_ev_key_from_entity(fallback_watch);
new_cursor_parent_key = df_parent_ev_key_from_entity(fallback_watch);
}
}
DF_WatchViewPoint new_cursor_pt = {0, new_cursor_parent_key, new_cursor_key};
d_entity_mark_for_deletion(watch);
df_entity_mark_for_deletion(watch);
ewv->cursor = ewv->mark = ewv->next_cursor = ewv->next_mark = new_cursor_pt;
}
}
@@ -1890,8 +1890,8 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
else if(selection_tbl.min.x <= DF_WatchViewColumnKind_ViewRule && DF_WatchViewColumnKind_ViewRule <= selection_tbl.max.x)
{
DF_Entity *watch = d_entity_from_ev_key_and_kind(pt.key, mutable_entity_kind);
DF_Entity *view_rule = d_entity_child_from_kind(watch, DF_EntityKind_ViewRule);
d_entity_mark_for_deletion(view_rule);
DF_Entity *view_rule = df_entity_child_from_kind(watch, DF_EntityKind_ViewRule);
df_entity_mark_for_deletion(view_rule);
ev_key_set_view_rule(eval_view, pt.key, str8_zero());
}
}
@@ -1996,29 +1996,29 @@ df_watch_view_build(DF_View *view, DF_WatchViewState *ewv, B32 modifiable, U32 d
DF_Entity *reorder_group_next = d_entity_from_ev_key_and_kind(reorder_group_next_watch_key, mutable_entity_kind);
DF_Entity *first_watch = d_entity_from_ev_key_and_kind(first_watch_key, mutable_entity_kind);
DF_Entity *last_watch = first_watch;
if(!d_entity_is_nil(first_watch))
if(!df_entity_is_nil(first_watch))
{
for(S64 y = selection_tbl.min.y+1; y <= selection_tbl.max.y; y += 1)
{
EV_Key key = ev_key_from_block_list_row_num(&blocks, y);
DF_Entity *new_last = d_entity_from_ev_key_and_kind(key, mutable_entity_kind);
if(!d_entity_is_nil(new_last))
if(!df_entity_is_nil(new_last))
{
last_watch = new_last;
}
}
}
if(evt->delta_2s32.y < 0 && !d_entity_is_nil(first_watch) && !d_entity_is_nil(reorder_group_prev))
if(evt->delta_2s32.y < 0 && !df_entity_is_nil(first_watch) && !df_entity_is_nil(reorder_group_prev))
{
state_dirty = 1;
snap_to_cursor = 1;
d_entity_change_parent(reorder_group_prev, reorder_group_prev->parent, reorder_group_prev->parent, last_watch);
df_entity_change_parent(reorder_group_prev, reorder_group_prev->parent, reorder_group_prev->parent, last_watch);
}
if(evt->delta_2s32.y > 0 && !d_entity_is_nil(last_watch) && !d_entity_is_nil(reorder_group_next))
if(evt->delta_2s32.y > 0 && !df_entity_is_nil(last_watch) && !df_entity_is_nil(reorder_group_next))
{
state_dirty = 1;
snap_to_cursor = 1;
d_entity_change_parent(reorder_group_next, reorder_group_next->parent, reorder_group_next->parent, reorder_group_prev);
df_entity_change_parent(reorder_group_next, reorder_group_next->parent, reorder_group_next->parent, reorder_group_prev);
}
}
@@ -2911,8 +2911,8 @@ DF_VIEW_UI_FUNCTION_DEF(getting_started)
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
UI_Padding(ui_pct(1, 0)) UI_Focus(UI_FocusKind_Null)
{
D_EntityList targets = d_push_active_target_list(scratch.arena);
D_EntityList processes = d_query_cached_entity_list_with_kind(DF_EntityKind_Process);
DF_EntityList targets = d_push_active_target_list(scratch.arena);
DF_EntityList processes = d_query_cached_entity_list_with_kind(DF_EntityKind_Process);
//- rjf: icon & info
UI_Padding(ui_em(2.f, 1.f))
@@ -2969,7 +2969,7 @@ DF_VIEW_UI_FUNCTION_DEF(getting_started)
//- rjf: user has 1 target. build helper for launching it
case 1:
{
DF_Entity *target = d_first_entity_from_list(&targets);
DF_Entity *target = df_first_entity_from_list(&targets);
String8 target_full_path = target->string;
String8 target_name = str8_skip_last_slash(target_full_path);
UI_PrefHeight(ui_em(3.75f, 1.f))
@@ -2982,12 +2982,12 @@ DF_VIEW_UI_FUNCTION_DEF(getting_started)
{
if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch %S", target_name)))
{
df_cmd(DF_CmdKind_LaunchAndRun, .entity = d_handle_from_entity(target));
df_cmd(DF_CmdKind_LaunchAndRun, .entity = df_handle_from_entity(target));
}
ui_spacer(ui_em(1.5f, 1));
if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Step Into %S", target_name)))
{
df_cmd(DF_CmdKind_LaunchAndInit, .entity = d_handle_from_entity(target));
df_cmd(DF_CmdKind_LaunchAndInit, .entity = df_handle_from_entity(target));
}
}
}break;
@@ -3952,11 +3952,11 @@ df_process_info_list_from_query(Arena *arena, String8 query)
U64 attached_process_count = 0;
U32 *attached_process_pids = 0;
{
D_EntityList processes = d_query_cached_entity_list_with_kind(DF_EntityKind_Process);
DF_EntityList processes = d_query_cached_entity_list_with_kind(DF_EntityKind_Process);
attached_process_count = processes.count;
attached_process_pids = push_array(scratch.arena, U32, attached_process_count);
U64 idx = 0;
for(D_EntityNode *n = processes.first; n != 0; n = n->next, idx += 1)
for(DF_EntityNode *n = processes.first; n != 0; n = n->next, idx += 1)
{
DF_Entity *process = n->entity;
attached_process_pids[idx] = process->ctrl_id;
@@ -4262,17 +4262,17 @@ struct DF_EntityListerItemArray
};
internal DF_EntityListerItemList
df_entity_lister_item_list_from_needle(Arena *arena, DF_EntityKind kind, D_EntityFlags omit_flags, String8 needle)
df_entity_lister_item_list_from_needle(Arena *arena, DF_EntityKind kind, DF_EntityFlags omit_flags, String8 needle)
{
Temp scratch = scratch_begin(&arena, 1);
DF_EntityListerItemList result = {0};
D_EntityList ent_list = d_query_cached_entity_list_with_kind(kind);
for(D_EntityNode *n = ent_list.first; n != 0; n = n->next)
DF_EntityList ent_list = d_query_cached_entity_list_with_kind(kind);
for(DF_EntityNode *n = ent_list.first; n != 0; n = n->next)
{
DF_Entity *entity = n->entity;
if(!(entity->flags & omit_flags))
{
String8 display_string = d_display_string_from_entity(scratch.arena, entity);
String8 display_string = df_display_string_from_entity(scratch.arena, entity);
FuzzyMatchRangeList match_rngs = fuzzy_match_find(arena, needle, display_string);
if(match_rngs.count != 0 || needle.size == 0)
{
@@ -4334,7 +4334,7 @@ DF_VIEW_UI_FUNCTION_DEF(entity_lister)
DF_Window *window = df_window_from_handle(df_regs()->window);
DF_CmdKindInfo *cmd_kind_info = df_cmd_kind_info_from_string(window->query_cmd_name);
DF_EntityKind entity_kind = cmd_kind_info->query.entity_kind;
D_EntityFlags entity_flags_omit = D_EntityFlag_IsFolder;
DF_EntityFlags entity_flags_omit = DF_EntityFlag_IsFolder;
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
F32 scroll_bar_dim = floor_f32(ui_top_font_size()*1.5f);
@@ -4346,7 +4346,7 @@ DF_VIEW_UI_FUNCTION_DEF(entity_lister)
};
DF_EntityListerViewState *fev = df_view_user_state(view, DF_EntityListerViewState);
D_Handle selected_entity_handle = fev->selected_entity_handle;
DF_Entity *selected_entity = d_entity_from_handle(selected_entity_handle);
DF_Entity *selected_entity = df_entity_from_handle(selected_entity_handle);
//- rjf: build filtered array of entities
DF_EntityListerItemList ent_list = df_entity_lister_item_list_from_needle(scratch.arena, entity_kind, entity_flags_omit, string);
@@ -4354,10 +4354,10 @@ DF_VIEW_UI_FUNCTION_DEF(entity_lister)
df_entity_lister_item_array_sort_by_strength__in_place(ent_arr);
//- rjf: submit best match when hitting enter w/ no selection
if(d_entity_is_nil(d_entity_from_handle(fev->selected_entity_handle)) && ent_arr.count != 0 && ui_slot_press(UI_EventActionSlot_Accept))
if(df_entity_is_nil(df_entity_from_handle(fev->selected_entity_handle)) && ent_arr.count != 0 && ui_slot_press(UI_EventActionSlot_Accept))
{
DF_Entity *ent = ent_arr.v[0].entity;
df_cmd(DF_CmdKind_CompleteQuery, .entity = d_handle_from_entity(ent));
df_cmd(DF_CmdKind_CompleteQuery, .entity = df_handle_from_entity(ent));
}
//- rjf: selected entity -> cursor
@@ -4425,8 +4425,8 @@ DF_VIEW_UI_FUNCTION_DEF(entity_lister)
UI_PrefWidth(ui_text_dim(10, 1))
ui_label(df_g_icon_kind_text_table[icon_kind]);
}
String8 display_string = d_display_string_from_entity(scratch.arena, ent);
Vec4F32 color = d_rgba_from_entity(ent);
String8 display_string = df_display_string_from_entity(scratch.arena, ent);
Vec4F32 color = df_rgba_from_entity(ent);
if(color.w != 0)
{
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = color));
@@ -4436,14 +4436,14 @@ DF_VIEW_UI_FUNCTION_DEF(entity_lister)
}
if(ui_clicked(ui_signal_from_box(box)))
{
df_cmd(DF_CmdKind_CompleteQuery, .entity = d_handle_from_entity(ent));
df_cmd(DF_CmdKind_CompleteQuery, .entity = df_handle_from_entity(ent));
}
}
}
//- rjf: selected entity num -> handle
{
fev->selected_entity_handle = (1 <= cursor.y && cursor.y <= ent_arr.count) ? d_handle_from_entity(ent_arr.v[cursor.y-1].entity) : d_handle_zero();
fev->selected_entity_handle = (1 <= cursor.y && cursor.y <= ent_arr.count) ? df_handle_from_entity(ent_arr.v[cursor.y-1].entity) : d_handle_zero();
}
scratch_end(scratch);
@@ -4693,14 +4693,14 @@ DF_VIEW_CMD_FUNCTION_DEF(target)
DF_Entity *storage_entity = entity;
if(tv->pick_dst_kind != DF_EntityKind_Nil)
{
DF_Entity *child = d_entity_child_from_kind(entity, tv->pick_dst_kind);
if(d_entity_is_nil(child))
DF_Entity *child = df_entity_child_from_kind(entity, tv->pick_dst_kind);
if(df_entity_is_nil(child))
{
child = d_entity_alloc(entity, tv->pick_dst_kind);
child = df_entity_alloc(entity, tv->pick_dst_kind);
}
storage_entity = child;
}
d_entity_equip_name(storage_entity, pick_string);
df_entity_equip_name(storage_entity, pick_string);
}break;
}
}
@@ -4712,7 +4712,7 @@ DF_VIEW_UI_FUNCTION_DEF(target)
ProfBeginFunction();
Temp scratch = scratch_begin(0, 0);
DF_Entity *entity = d_entity_from_eval_string(string);
D_EntityList custom_entry_points = d_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_EntryPoint);
DF_EntityList custom_entry_points = df_push_entity_child_list_with_kind(scratch.arena, entity, DF_EntityKind_EntryPoint);
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
//- rjf: grab state
@@ -4737,10 +4737,10 @@ DF_VIEW_UI_FUNCTION_DEF(target)
kv_info[] =
{
{ 0, 0, 0, str8_lit("Label"), DF_EntityKind_Nil, entity->string },
{ 1, 0, 0, str8_lit("Executable"), DF_EntityKind_Executable, d_entity_child_from_kind(entity, DF_EntityKind_Executable)->string },
{ 0, 0, 0, str8_lit("Arguments"), DF_EntityKind_Arguments, d_entity_child_from_kind(entity, DF_EntityKind_Arguments)->string },
{ 0, 1, 0, str8_lit("Working Directory"), DF_EntityKind_WorkingDirectory, d_entity_child_from_kind(entity, DF_EntityKind_WorkingDirectory)->string },
{ 0, 0, 1, str8_lit("Entry Point Override"), DF_EntityKind_EntryPoint, d_entity_child_from_kind(entity, DF_EntityKind_EntryPoint)->string },
{ 1, 0, 0, str8_lit("Executable"), DF_EntityKind_Executable, df_entity_child_from_kind(entity, DF_EntityKind_Executable)->string },
{ 0, 0, 0, str8_lit("Arguments"), DF_EntityKind_Arguments, df_entity_child_from_kind(entity, DF_EntityKind_Arguments)->string },
{ 0, 1, 0, str8_lit("Working Directory"), DF_EntityKind_WorkingDirectory, df_entity_child_from_kind(entity, DF_EntityKind_WorkingDirectory)->string },
{ 0, 0, 1, str8_lit("Entry Point Override"), DF_EntityKind_EntryPoint, df_entity_child_from_kind(entity, DF_EntityKind_EntryPoint)->string },
};
//- rjf: take controls to start/end editing
@@ -4941,16 +4941,16 @@ DF_VIEW_UI_FUNCTION_DEF(target)
{
default:
{
DF_Entity *child = d_entity_child_from_kind(entity, commit_storage_child_kind);
if(d_entity_is_nil(child))
DF_Entity *child = df_entity_child_from_kind(entity, commit_storage_child_kind);
if(df_entity_is_nil(child))
{
child = d_entity_alloc(entity, commit_storage_child_kind);
child = df_entity_alloc(entity, commit_storage_child_kind);
}
d_entity_equip_name(child, new_string);
df_entity_equip_name(child, new_string);
}break;
case DF_EntityKind_Nil:
{
d_entity_equip_name(entity, new_string);
df_entity_equip_name(entity, new_string);
}break;
}
}
@@ -4981,8 +4981,8 @@ DF_VIEW_UI_FUNCTION_DEF(targets)
{
ProfBeginFunction();
Temp scratch = scratch_begin(0, 0);
D_EntityList targets_list = d_query_cached_entity_list_with_kind(DF_EntityKind_Target);
D_EntityFuzzyItemArray targets = d_entity_fuzzy_item_array_from_entity_list_needle(scratch.arena, &targets_list, string);
DF_EntityList targets_list = d_query_cached_entity_list_with_kind(DF_EntityKind_Target);
DF_EntityFuzzyItemArray targets = df_entity_fuzzy_item_array_from_entity_list_needle(scratch.arena, &targets_list, string);
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
//- rjf: grab state
@@ -5002,7 +5002,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets)
// NOTE(rjf): 0 => nothing, 1 => add new, 2 => first target
Vec2S64 cursor = {0};
{
DF_Entity *selected_target = d_entity_from_handle(tv->selected_target_handle);
DF_Entity *selected_target = df_entity_from_handle(tv->selected_target_handle);
for(U64 idx = 0; idx < targets.count; idx += 1)
{
if(selected_target == targets.v[idx].entity)
@@ -5067,7 +5067,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets)
UI_Signal sig = df_icon_buttonf(!target->disabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", target);
if(ui_clicked(sig))
{
df_cmd(!target->disabled ? DF_CmdKind_DisableTarget : DF_CmdKind_EnableTarget, .entity = d_handle_from_entity(target));
df_cmd(!target->disabled ? DF_CmdKind_DisableTarget : DF_CmdKind_EnableTarget, .entity = df_handle_from_entity(target));
}
}
@@ -5106,7 +5106,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets)
}
if(ui_clicked(sig))
{
df_cmd(ctrls[ctrl_idx].cmd, .entity = d_handle_from_entity(target));
df_cmd(ctrls[ctrl_idx].cmd, .entity = df_handle_from_entity(target));
}
}
}
@@ -5116,7 +5116,7 @@ DF_VIEW_UI_FUNCTION_DEF(targets)
//- rjf: commit cursor to selection state
{
tv->selected_column = cursor.x;
tv->selected_target_handle = (1 < cursor.y && cursor.y < targets.count+2) ? d_handle_from_entity(targets.v[cursor.y-2].entity) : d_handle_zero();
tv->selected_target_handle = (1 < cursor.y && cursor.y < targets.count+2) ? df_handle_from_entity(targets.v[cursor.y-2].entity) : d_handle_zero();
tv->selected_add = (cursor.y == 1);
}
@@ -5179,11 +5179,11 @@ DF_VIEW_CMD_FUNCTION_DEF(file_path_map)
{
String8 pick_string = cmd->regs->file_path;
Side pick_side = fpms->pick_file_dst_side;
DF_Entity *storage_entity = d_entity_from_handle(fpms->pick_file_dst_map);
DF_Entity *storage_entity = df_entity_from_handle(fpms->pick_file_dst_map);
df_cmd(pick_side == Side_Min ?
DF_CmdKind_SetFileOverrideLinkSrc :
DF_CmdKind_SetFileOverrideLinkDst,
.entity = d_handle_from_entity(storage_entity),
.entity = df_handle_from_entity(storage_entity),
.file_path = pick_string);
}break;
}
@@ -5194,8 +5194,8 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map)
{
ProfBeginFunction();
Temp scratch = scratch_begin(0, 0);
D_EntityList maps_list = d_query_cached_entity_list_with_kind(DF_EntityKind_FilePathMap);
D_EntityArray maps = d_entity_array_from_list(scratch.arena, &maps_list);
DF_EntityList maps_list = d_query_cached_entity_list_with_kind(DF_EntityKind_FilePathMap);
DF_EntityArray maps = df_entity_array_from_list(scratch.arena, &maps_list);
F32 row_height_px = floor_f32(ui_top_font_size()*2.5f);
//- rjf: grab state
@@ -5284,8 +5284,8 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map)
{
U64 map_idx = row_idx-1;
DF_Entity *map = (map_idx < maps.count ? maps.v[map_idx] : &d_nil_entity);
DF_Entity *map_src = d_entity_child_from_kind(map, DF_EntityKind_Source);
DF_Entity *map_dst = d_entity_child_from_kind(map, DF_EntityKind_Dest);
DF_Entity *map_src = df_entity_child_from_kind(map, DF_EntityKind_Source);
DF_Entity *map_dst = df_entity_child_from_kind(map, DF_EntityKind_Dest);
String8 map_src_path = map_src->string;
String8 map_dst_path = map_dst->string;
B32 row_selected = (fpms->cursor.y == row_idx);
@@ -5345,7 +5345,7 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map)
if(value_selected)
{
commit_side = Side_Min;
commit_map = d_handle_from_entity(map);
commit_map = df_handle_from_entity(map);
}
}
@@ -5355,7 +5355,7 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map)
if(ui_clicked(ui_buttonf("Browse...")))
{
df_cmd(DF_CmdKind_RunCommand, .string = df_cmd_kind_info_table[DF_CmdKind_PickFileOrFolder].string);
fpms->pick_file_dst_map = d_handle_from_entity(map);
fpms->pick_file_dst_map = df_handle_from_entity(map);
fpms->pick_file_dst_side = Side_Min;
}
}
@@ -5415,7 +5415,7 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map)
if(value_selected)
{
commit_side = Side_Max;
commit_map = d_handle_from_entity(map);
commit_map = df_handle_from_entity(map);
}
}
@@ -5426,7 +5426,7 @@ DF_VIEW_UI_FUNCTION_DEF(file_path_map)
if(ui_clicked(ui_buttonf("Browse...")))
{
df_cmd(DF_CmdKind_RunCommand, .string = df_cmd_kind_info_table[DF_CmdKind_PickFileOrFolder].string);
fpms->pick_file_dst_map = d_handle_from_entity(map);
fpms->pick_file_dst_map = df_handle_from_entity(map);
fpms->pick_file_dst_side = Side_Max;
}
}
@@ -5533,40 +5533,40 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler)
DF_SchedulerViewState *sv = df_view_user_state(view, DF_SchedulerViewState);
//- rjf: get entities
D_EntityList machines = d_query_cached_entity_list_with_kind(DF_EntityKind_Machine);
D_EntityList processes = d_query_cached_entity_list_with_kind(DF_EntityKind_Process);
D_EntityList threads = d_query_cached_entity_list_with_kind(DF_EntityKind_Thread);
DF_EntityList machines = d_query_cached_entity_list_with_kind(DF_EntityKind_Machine);
DF_EntityList processes = d_query_cached_entity_list_with_kind(DF_EntityKind_Process);
DF_EntityList threads = d_query_cached_entity_list_with_kind(DF_EntityKind_Thread);
//- rjf: produce list of items; no query -> all entities, in tree; query -> only show threads
D_EntityFuzzyItemArray items = {0};
DF_EntityFuzzyItemArray items = {0};
ProfScope("query -> entities")
{
if(query.size == 0)
{
//- rjf: build flat array of entities, arranged into row order
D_EntityArray entities = {0};
DF_EntityArray entities = {0};
{
entities.count = machines.count+processes.count+threads.count;
entities.v = push_array_no_zero(scratch.arena, DF_Entity *, entities.count);
U64 idx = 0;
for(D_EntityNode *machine_n = machines.first; machine_n != 0; machine_n = machine_n->next)
for(DF_EntityNode *machine_n = machines.first; machine_n != 0; machine_n = machine_n->next)
{
DF_Entity *machine = machine_n->entity;
entities.v[idx] = machine;
idx += 1;
for(D_EntityNode *process_n = processes.first; process_n != 0; process_n = process_n->next)
for(DF_EntityNode *process_n = processes.first; process_n != 0; process_n = process_n->next)
{
DF_Entity *process = process_n->entity;
if(d_entity_ancestor_from_kind(process, DF_EntityKind_Machine) != machine)
if(df_entity_ancestor_from_kind(process, DF_EntityKind_Machine) != machine)
{
continue;
}
entities.v[idx] = process;
idx += 1;
for(D_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next)
for(DF_EntityNode *thread_n = threads.first; thread_n != 0; thread_n = thread_n->next)
{
DF_Entity *thread = thread_n->entity;
if(d_entity_ancestor_from_kind(thread, DF_EntityKind_Process) != process)
if(df_entity_ancestor_from_kind(thread, DF_EntityKind_Process) != process)
{
continue;
}
@@ -5578,11 +5578,11 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler)
}
//- rjf: entities -> fuzzy-filtered entities
items = d_entity_fuzzy_item_array_from_entity_array_needle(scratch.arena, &entities, query);
items = df_entity_fuzzy_item_array_from_entity_array_needle(scratch.arena, &entities, query);
}
else
{
items = d_entity_fuzzy_item_array_from_entity_list_needle(scratch.arena, &threads, query);
items = df_entity_fuzzy_item_array_from_entity_list_needle(scratch.arena, &threads, query);
}
}
@@ -5590,7 +5590,7 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler)
Vec2S64 cursor = {sv->selected_column};
for(U64 idx = 0; idx < items.count; idx += 1)
{
if(items.v[idx].entity == d_entity_from_handle(sv->selected_entity))
if(items.v[idx].entity == df_entity_from_handle(sv->selected_entity))
{
cursor.y = (S64)(idx+1);
break;
@@ -5663,7 +5663,7 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler)
if(ui_clicked(sig))
{
D_CmdKind cmd_kind = frozen ? D_CmdKind_ThawEntity : D_CmdKind_FreezeEntity;
df_cmd(cmd_kind, .entity = d_handle_from_entity(entity));
df_cmd(cmd_kind, .entity = df_handle_from_entity(entity));
}
}
UI_TableCellSized(ui_pct(1, 0))
@@ -5686,14 +5686,14 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler)
UI_TextAlignment(UI_TextAlign_Center)
if(ui_clicked(ui_buttonf("Detach")))
{
df_cmd(D_CmdKind_Detach, .entity = d_handle_from_entity(entity));
df_cmd(D_CmdKind_Detach, .entity = df_handle_from_entity(entity));
}
}
UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 3) ? UI_FocusKind_On : UI_FocusKind_Off)
{
if(ui_clicked(df_icon_buttonf(DF_IconKind_Redo, 0, "###retry")))
{
df_cmd(D_CmdKind_Restart, .entity = d_handle_from_entity(entity));
df_cmd(D_CmdKind_Restart, .entity = df_handle_from_entity(entity));
}
}
UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off)
@@ -5701,7 +5701,7 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler)
DF_Palette(DF_PaletteCode_NegativePopButton)
if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "###kill")))
{
df_cmd(D_CmdKind_Kill, .entity = d_handle_from_entity(entity));
df_cmd(D_CmdKind_Kill, .entity = df_handle_from_entity(entity));
}
}
}break;
@@ -5730,7 +5730,7 @@ DF_VIEW_UI_FUNCTION_DEF(scheduler)
//- rjf: selected num -> selected entity
sv->selected_column = cursor.x;
sv->selected_entity = (1 <= cursor.y && cursor.y <= items.count) ? d_handle_from_entity(items.v[cursor.y-1].entity) : d_handle_zero();
sv->selected_entity = (1 <= cursor.y && cursor.y <= items.count) ? df_handle_from_entity(items.v[cursor.y-1].entity) : d_handle_zero();
scratch_end(scratch);
ProfEnd();
@@ -5816,7 +5816,7 @@ DF_VIEW_CMD_FUNCTION_DEF(modules)
{
Temp scratch = scratch_begin(0, 0);
String8 pick_string = cmd->regs->file_path;
DF_Entity *module = d_entity_from_handle(mv->pick_file_dst_entity);
DF_Entity *module = df_entity_from_handle(mv->pick_file_dst_entity);
if(module->kind == DF_EntityKind_Module)
{
String8 exe_path = module->string;
@@ -5843,27 +5843,27 @@ DF_VIEW_UI_FUNCTION_DEF(modules)
F32 *col_pcts[] = {&mv->idx_col_pct, &mv->desc_col_pct, &mv->range_col_pct, &mv->dbg_col_pct};
//- rjf: get entities
D_EntityList processes = d_query_cached_entity_list_with_kind(DF_EntityKind_Process);
D_EntityList modules = d_query_cached_entity_list_with_kind(DF_EntityKind_Module);
DF_EntityList processes = d_query_cached_entity_list_with_kind(DF_EntityKind_Process);
DF_EntityList modules = d_query_cached_entity_list_with_kind(DF_EntityKind_Module);
//- rjf: make filtered item array
D_EntityFuzzyItemArray items = {0};
DF_EntityFuzzyItemArray items = {0};
if(query.size == 0)
{
D_EntityArray entities = {0};
DF_EntityArray entities = {0};
{
entities.count = processes.count+modules.count;
entities.v = push_array_no_zero(scratch.arena, DF_Entity *, entities.count);
U64 idx = 0;
for(D_EntityNode *process_n = processes.first; process_n != 0; process_n = process_n->next)
for(DF_EntityNode *process_n = processes.first; process_n != 0; process_n = process_n->next)
{
DF_Entity *process = process_n->entity;
entities.v[idx] = process;
idx += 1;
for(D_EntityNode *module_n = modules.first; module_n != 0; module_n = module_n->next)
for(DF_EntityNode *module_n = modules.first; module_n != 0; module_n = module_n->next)
{
DF_Entity *module = module_n->entity;
if(d_entity_ancestor_from_kind(module, DF_EntityKind_Process) != process)
if(df_entity_ancestor_from_kind(module, DF_EntityKind_Process) != process)
{
continue;
}
@@ -5872,18 +5872,18 @@ DF_VIEW_UI_FUNCTION_DEF(modules)
}
}
}
items = d_entity_fuzzy_item_array_from_entity_array_needle(scratch.arena, &entities, query);
items = df_entity_fuzzy_item_array_from_entity_array_needle(scratch.arena, &entities, query);
}
else
{
items = d_entity_fuzzy_item_array_from_entity_list_needle(scratch.arena, &modules, query);
items = df_entity_fuzzy_item_array_from_entity_list_needle(scratch.arena, &modules, query);
}
//- rjf: selected column/entity -> selected cursor
Vec2S64 cursor = {mv->selected_column};
for(U64 idx = 0; idx < items.count; idx += 1)
{
if(items.v[idx].entity == d_entity_from_handle(mv->selected_entity))
if(items.v[idx].entity == df_entity_from_handle(mv->selected_entity))
{
cursor.y = (S64)(idx+1);
break;
@@ -6057,7 +6057,7 @@ DF_VIEW_UI_FUNCTION_DEF(modules)
if(ui_clicked(ui_buttonf("Browse...")) || (brw_is_selected && edit_begin))
{
df_cmd(DF_CmdKind_RunCommand, .string = df_cmd_kind_info_table[DF_CmdKind_PickFile].string);
mv->pick_file_dst_entity = d_handle_from_entity(entity);
mv->pick_file_dst_entity = df_handle_from_entity(entity);
}
}
}
@@ -6072,7 +6072,7 @@ DF_VIEW_UI_FUNCTION_DEF(modules)
if(edit_commit)
{
mv->txt_editing = 0;
if(!d_entity_is_nil(commit_module))
if(!df_entity_is_nil(commit_module))
{
String8 exe_path = commit_module->string;
String8 dbg_path = str8(mv->txt_buffer, mv->txt_size);
@@ -6092,7 +6092,7 @@ DF_VIEW_UI_FUNCTION_DEF(modules)
//- rjf: selected num -> selected entity
mv->selected_column = cursor.x;
mv->selected_entity = (1 <= cursor.y && cursor.y <= items.count) ? d_handle_from_entity(items.v[cursor.y-1].entity) : d_handle_zero();
mv->selected_entity = (1 <= cursor.y && cursor.y <= items.count) ? df_handle_from_entity(items.v[cursor.y-1].entity) : d_handle_zero();
di_scope_close(scope);
scratch_end(scratch);
@@ -6748,8 +6748,8 @@ DF_VIEW_CMD_FUNCTION_DEF(disasm)
{
DF_Entity *process = &d_nil_entity;
{
DF_Entity *entity = d_entity_from_handle(cmd->regs->entity);
if(!d_entity_is_nil(entity) &&
DF_Entity *entity = df_entity_from_handle(cmd->regs->entity);
if(!df_entity_is_nil(entity) &&
(entity->kind == DF_EntityKind_Process ||
entity->kind == DF_EntityKind_Thread ||
entity->kind == DF_EntityKind_Module))
@@ -6758,7 +6758,7 @@ DF_VIEW_CMD_FUNCTION_DEF(disasm)
if(entity->kind == DF_EntityKind_Thread ||
entity->kind == DF_EntityKind_Module)
{
process = d_entity_ancestor_from_kind(process, DF_EntityKind_Process);
process = df_entity_ancestor_from_kind(process, DF_EntityKind_Process);
}
}
}
+49 -49
View File
@@ -424,13 +424,13 @@ df_entity_tooltips(DF_Entity *entity)
case DF_EntityKind_File:
UI_Tooltip UI_PrefWidth(ui_text_dim(10, 1))
{
String8 full_path = d_full_path_from_entity(scratch.arena, entity);
String8 full_path = df_full_path_from_entity(scratch.arena, entity);
ui_label(full_path);
}break;
case DF_EntityKind_Thread: UI_Flags(0)
UI_Tooltip UI_PrefWidth(ui_text_dim(10, 1))
{
String8 display_string = d_display_string_from_entity(scratch.arena, entity);
String8 display_string = df_display_string_from_entity(scratch.arena, entity);
CTRL_Entity *entity_ctrl = ctrl_entity_from_handle(d_state->ctrl_entity_store, entity->ctrl_handle);
U64 rip_vaddr = d_query_cached_rip_from_thread(entity_ctrl);
Arch arch = entity_ctrl->arch;
@@ -438,15 +438,15 @@ df_entity_tooltips(DF_Entity *entity)
U32 pid_or_tid = entity->ctrl_id;
if(display_string.size != 0) UI_PrefWidth(ui_children_sum(1)) UI_Row
{
if(entity->flags & D_EntityFlag_HasColor)
if(entity->flags & DF_EntityFlag_HasColor)
{
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = d_rgba_from_entity(entity)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity)));
}
UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_string);
}
{
CTRL_Event stop_event = d_ctrl_last_stop_event();
DF_Entity *stopper_thread = d_entity_from_ctrl_handle(stop_event.entity);
DF_Entity *stopper_thread = df_entity_from_ctrl_handle(stop_event.entity);
if(stopper_thread == entity)
{
ui_spacer(ui_em(1.5f, 1.f));
@@ -542,15 +542,15 @@ df_entity_tooltips(DF_Entity *entity)
case DF_EntityKind_Breakpoint: UI_Flags(0)
UI_Tooltip UI_PrefWidth(ui_text_dim(10, 1))
{
if(entity->flags & D_EntityFlag_HasColor)
if(entity->flags & DF_EntityFlag_HasColor)
{
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = d_rgba_from_entity(entity)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity)));
}
String8 display_string = d_display_string_from_entity(scratch.arena, entity);
String8 display_string = df_display_string_from_entity(scratch.arena, entity);
UI_PrefWidth(ui_text_dim(10, 1)) ui_label(display_string);
UI_PrefWidth(ui_children_sum(1)) UI_Row
{
String8 stop_condition = d_entity_child_from_kind(entity, DF_EntityKind_Condition)->string;
String8 stop_condition = df_entity_child_from_kind(entity, DF_EntityKind_Condition)->string;
if(stop_condition.size == 0)
{
stop_condition = str8_lit("true");
@@ -570,11 +570,11 @@ df_entity_tooltips(DF_Entity *entity)
DF_Font(DF_FontSlot_Code)
UI_Tooltip UI_PrefWidth(ui_text_dim(10, 1))
{
if(entity->flags & D_EntityFlag_HasColor)
if(entity->flags & DF_EntityFlag_HasColor)
{
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = d_rgba_from_entity(entity)));
ui_set_next_palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_entity(entity)));
}
String8 display_string = d_display_string_from_entity(scratch.arena, entity);
String8 display_string = df_display_string_from_entity(scratch.arena, entity);
UI_PrefWidth(ui_text_dim(10, 1)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), display_string);
}break;
}
@@ -630,9 +630,9 @@ df_entity_desc_button(DF_Entity *entity, FuzzyMatchRangeList *name_matches, Stri
DF_IconKind icon = df_entity_kind_icon_kind_table[entity->kind];
Vec4F32 entity_color = palette->colors[UI_ColorCode_Text];
Vec4F32 entity_color_weak = palette->colors[UI_ColorCode_TextWeak];
if(entity->flags & D_EntityFlag_HasColor)
if(entity->flags & DF_EntityFlag_HasColor)
{
entity_color = d_rgba_from_entity(entity);
entity_color = df_rgba_from_entity(entity);
entity_color_weak = entity_color;
entity_color_weak.w *= 0.5f;
}
@@ -660,7 +660,7 @@ df_entity_desc_button(DF_Entity *entity, FuzzyMatchRangeList *name_matches, Stri
}
}
}
String8 label = d_display_string_from_entity(scratch.arena, entity);
String8 label = df_display_string_from_entity(scratch.arena, entity);
UI_Palette(ui_build_palette(ui_top_palette(), .text = entity_color))
DF_Font(kind_flags&DF_EntityKindFlag_NameIsCode ? DF_FontSlot_Code : DF_FontSlot_Main)
UI_Flags((entity->kind == DF_EntityKind_Thread ||
@@ -677,7 +677,7 @@ df_entity_desc_button(DF_Entity *entity, FuzzyMatchRangeList *name_matches, Stri
}
if(entity->kind == DF_EntityKind_Target) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FontSize(ui_top_font_size()*0.95f)
{
DF_Entity *args = d_entity_child_from_kind(entity, DF_EntityKind_Arguments);
DF_Entity *args = df_entity_child_from_kind(entity, DF_EntityKind_Arguments);
ui_label(args->string);
}
if(kind_flags & DF_EntityKindFlag_CanEnable && entity->disabled) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FontSize(ui_top_font_size()*0.95f) UI_HeightFill
@@ -741,13 +741,13 @@ df_entity_desc_button(DF_Entity *entity, FuzzyMatchRangeList *name_matches, Stri
// rjf: click => fastpath for this entity
if(ui_clicked(sig))
{
df_cmd(DF_CmdKind_EntityRefFastPath, .entity = d_handle_from_entity(entity));
df_cmd(DF_CmdKind_EntityRefFastPath, .entity = df_handle_from_entity(entity));
}
// rjf: right-click => context menu for this entity
else if(ui_right_clicked(sig))
{
D_Handle handle = d_handle_from_entity(entity);
D_Handle handle = df_handle_from_entity(entity);
DF_Window *window = df_window_from_handle(df_regs()->window);
ui_ctx_menu_open(df_state->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1 - sig.box->rect.y0));
window->entity_ctx_menu_entity = handle;
@@ -758,7 +758,7 @@ df_entity_desc_button(DF_Entity *entity, FuzzyMatchRangeList *name_matches, Stri
{
DF_DragDropPayload payload = {0};
payload.key = box->key;
payload.entity = d_handle_from_entity(entity);
payload.entity = df_handle_from_entity(entity);
df_drag_begin(&payload);
}
}
@@ -1152,7 +1152,7 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
if(ui_right_clicked(thread_sig))
{
// TODO(rjf): @msgs top-level regs-based ctx menu here!!!!
// D_Handle handle = d_handle_from_entity(thread);
// D_Handle handle = df_handle_from_entity(thread);
// ui_ctx_menu_open(df_state->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0));
// DF_Window *window = df_window_from_handle(df_regs()->window);
// window->entity_ctx_menu_entity = handle;
@@ -1164,7 +1164,7 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// TODO(rjf): @msgs top-level regs-based drag/drop here!!!
// DF_DragDropPayload payload = {0};
// payload.key = thread_box->key;
// payload.entity = d_handle_from_entity(thread);
// payload.entity = df_handle_from_entity(thread);
// df_drag_begin(&payload);
}
}
@@ -1198,8 +1198,8 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
line_num += 1, line_idx += 1)
{
CTRL_EntityList line_ips = params->line_ips[line_idx];
D_EntityList line_bps = params->line_bps[line_idx];
D_EntityList line_pins = params->line_pins[line_idx];
DF_EntityList line_bps = params->line_bps[line_idx];
DF_EntityList line_pins = params->line_pins[line_idx];
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
UI_Box *line_margin_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable*!!(params->flags & DF_CodeSliceFlag_Clickable)|UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawActiveEffects, "line_margin_%I64x", line_num);
UI_Parent(line_margin_box)
@@ -1310,7 +1310,7 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
if(ui_right_clicked(thread_sig))
{
// TODO(rjf): @msgs top-level regs-based ctx menu here!!!!
// D_Handle handle = d_handle_from_entity(thread);
// D_Handle handle = df_handle_from_entity(thread);
// ui_ctx_menu_open(df_state->entity_ctx_menu_key, thread_box->key, v2f32(0, thread_box->rect.y1-thread_box->rect.y0));
// DF_Window *window = df_window_from_handle(df_regs()->window);
// window->entity_ctx_menu_entity = handle;
@@ -1329,19 +1329,19 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// TODO(rjf): @msgs top-level regs-based drag/drop here!!!
// DF_DragDropPayload payload = {0};
// payload.key = thread_box->key;
// payload.entity = d_handle_from_entity(thread);
// payload.entity = df_handle_from_entity(thread);
// df_drag_begin(&payload);
}
}
//- rjf: build margin breakpoint ui
for(D_EntityNode *n = line_bps.first; n != 0; n = n->next)
for(DF_EntityNode *n = line_bps.first; n != 0; n = n->next)
{
DF_Entity *bp = n->entity;
Vec4F32 bp_color = df_rgba_from_theme_color(DF_ThemeColor_Breakpoint);
if(bp->flags & D_EntityFlag_HasColor)
if(bp->flags & DF_EntityFlag_HasColor)
{
bp_color = d_rgba_from_entity(bp);
bp_color = df_rgba_from_entity(bp);
}
if(bp->disabled)
{
@@ -1398,21 +1398,21 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: click => remove breakpoint
if(ui_clicked(bp_sig))
{
df_cmd(DF_CmdKind_RemoveBreakpoint, .entity = d_handle_from_entity(bp));
df_cmd(DF_CmdKind_RemoveBreakpoint, .entity = df_handle_from_entity(bp));
}
// rjf: drag start
if(ui_dragging(bp_sig) && !contains_2f32(bp_box->rect, ui_mouse()))
{
DF_DragDropPayload payload = {0};
payload.entity = d_handle_from_entity(bp);
payload.entity = df_handle_from_entity(bp);
df_drag_begin(&payload);
}
// rjf: bp right-click menu
if(ui_right_clicked(bp_sig))
{
D_Handle handle = d_handle_from_entity(bp);
D_Handle handle = df_handle_from_entity(bp);
ui_ctx_menu_open(df_state->entity_ctx_menu_key, bp_box->key, v2f32(0, bp_box->rect.y1-bp_box->rect.y0));
DF_Window *window = df_window_from_handle(df_regs()->window);
window->entity_ctx_menu_entity = handle;
@@ -1420,13 +1420,13 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
}
//- rjf: build margin watch pin ui
for(D_EntityNode *n = line_pins.first; n != 0; n = n->next)
for(DF_EntityNode *n = line_pins.first; n != 0; n = n->next)
{
DF_Entity *pin = n->entity;
Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_Text);
if(pin->flags & D_EntityFlag_HasColor)
if(pin->flags & DF_EntityFlag_HasColor)
{
color = d_rgba_from_entity(pin);
color = df_rgba_from_entity(pin);
}
// rjf: build box for watch
@@ -1456,21 +1456,21 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: click => remove pin
if(ui_clicked(pin_sig))
{
df_cmd(DF_CmdKind_RemoveEntity, .entity = d_handle_from_entity(pin));
df_cmd(DF_CmdKind_RemoveEntity, .entity = df_handle_from_entity(pin));
}
// rjf: drag start
if(ui_dragging(pin_sig) && !contains_2f32(pin_box->rect, ui_mouse()))
{
DF_DragDropPayload payload = {0};
payload.entity = d_handle_from_entity(pin);
payload.entity = df_handle_from_entity(pin);
df_drag_begin(&payload);
}
// rjf: watch right-click menu
if(ui_right_clicked(pin_sig))
{
D_Handle handle = d_handle_from_entity(pin);
D_Handle handle = df_handle_from_entity(pin);
ui_ctx_menu_open(df_state->entity_ctx_menu_key, pin_box->key, v2f32(0, pin_box->rect.y1-pin_box->rect.y0));
DF_Window *window = df_window_from_handle(df_regs()->window);
window->entity_ctx_menu_entity = handle;
@@ -1651,13 +1651,13 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
line_num < params->line_num_range.max;
line_num += 1, line_idx += 1)
{
D_EntityList pins = params->line_pins[line_idx];
DF_EntityList pins = params->line_pins[line_idx];
if(pins.count != 0) UI_Parent(line_extras_boxes[line_idx])
DF_Font(DF_FontSlot_Code)
UI_FontSize(params->font_size)
UI_PrefHeight(ui_px(params->line_height_px, 1.f))
{
for(D_EntityNode *n = pins.first; n != 0; n = n->next)
for(DF_EntityNode *n = pins.first; n != 0; n = n->next)
{
DF_Entity *pin = n->entity;
String8 pin_expr = pin->string;
@@ -1678,9 +1678,9 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
UI_Parent(pin_box) UI_PrefWidth(ui_text_dim(10, 1))
{
Vec4F32 pin_color = df_rgba_from_theme_color(DF_ThemeColor_CodeDefault);
if(pin->flags & D_EntityFlag_HasColor)
if(pin->flags & DF_EntityFlag_HasColor)
{
pin_color = d_rgba_from_entity(pin);
pin_color = df_rgba_from_entity(pin);
}
UI_PrefWidth(ui_em(1.5f, 1.f))
DF_Font(DF_FontSlot_Icons)
@@ -1692,14 +1692,14 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
if(ui_dragging(sig) && !contains_2f32(sig.box->rect, ui_mouse()))
{
DF_DragDropPayload payload = {0};
payload.entity = d_handle_from_entity(pin);
payload.entity = df_handle_from_entity(pin);
df_drag_begin(&payload);
}
if(ui_right_clicked(sig))
{
ui_ctx_menu_open(df_state->entity_ctx_menu_key, sig.box->key, v2f32(0, sig.box->rect.y1-sig.box->rect.y0));
DF_Window *window = df_window_from_handle(df_regs()->window);
window->entity_ctx_menu_entity = d_handle_from_entity(pin);
window->entity_ctx_menu_entity = df_handle_from_entity(pin);
}
}
df_code_label(0.8f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), pin_expr);
@@ -1860,7 +1860,7 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
if(df_drag_is_active() && contains_2f32(clipped_top_container_rect, ui_mouse()))
{
DF_DragDropPayload *payload = &df_drag_drop_payload;
DF_Entity *entity = d_entity_from_handle(payload->entity);
DF_Entity *entity = df_entity_from_handle(payload->entity);
if(entity->kind == DF_EntityKind_Thread ||
entity->kind == DF_EntityKind_WatchPin ||
entity->kind == DF_EntityKind_Breakpoint)
@@ -1872,7 +1872,7 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
//- rjf: drop target is dropped -> process
{
DF_DragDropPayload payload = {0};
if(!d_entity_is_nil(line_drag_entity) && df_drag_drop(&payload) && contains_1s64(params->line_num_range, mouse_pt.line))
if(!df_entity_is_nil(line_drag_entity) && df_drag_drop(&payload) && contains_1s64(params->line_num_range, mouse_pt.line))
{
DF_Entity *dropped_entity = line_drag_entity;
S64 line_num = mouse_pt.line;
@@ -1885,7 +1885,7 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
case DF_EntityKind_WatchPin:
{
df_cmd(DF_CmdKind_RelocateEntity,
.entity = d_handle_from_entity(dropped_entity),
.entity = df_handle_from_entity(dropped_entity),
.file_path = df_regs()->file_path,
.cursor = txt_pt(line_num, 1),
.vaddr = line_vaddr);
@@ -2001,12 +2001,12 @@ df_code_slice(DF_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
//////////////////////////////
//- rjf: dragging entity which applies to lines over this slice -> visualize
//
if(!d_entity_is_nil(line_drag_entity) && contains_2f32(clipped_top_container_rect, ui_mouse()))
if(!df_entity_is_nil(line_drag_entity) && contains_2f32(clipped_top_container_rect, ui_mouse()))
{
Vec4F32 color = df_rgba_from_theme_color(DF_ThemeColor_DropSiteOverlay);
if(line_drag_entity->flags & D_EntityFlag_HasColor)
if(line_drag_entity->flags & DF_EntityFlag_HasColor)
{
color = d_rgba_from_entity(line_drag_entity);
color = df_rgba_from_entity(line_drag_entity);
color.w /= 2;
}
DR_Bucket *bucket = dr_bucket_make();
+2 -2
View File
@@ -42,9 +42,9 @@ struct DF_CodeSliceParams
String8 *line_text;
Rng1U64 *line_ranges;
TXT_TokenArray *line_tokens;
D_EntityList *line_bps;
DF_EntityList *line_bps;
CTRL_EntityList *line_ips;
D_EntityList *line_pins;
DF_EntityList *line_pins;
U64 *line_vaddrs;
D_LineList *line_infos;
DI_KeyList relevant_dbgi_keys;
@@ -28,6 +28,176 @@ DF_CmdKind_Null,
DF_CmdKind_Null,
};
String8 d_entity_kind_display_string_table[30] =
{
str8_lit_comp("Nil"),
str8_lit_comp("Root"),
str8_lit_comp("Machine"),
str8_lit_comp("File"),
str8_lit_comp("Auto View Rule"),
str8_lit_comp("File Path Map"),
str8_lit_comp("Watch Pin"),
str8_lit_comp("Watch"),
str8_lit_comp("View Rule"),
str8_lit_comp("Breakpoint"),
str8_lit_comp("Condition"),
str8_lit_comp("Location"),
str8_lit_comp("Target"),
str8_lit_comp("Executable"),
str8_lit_comp("Arguments"),
str8_lit_comp("Working Directory"),
str8_lit_comp("Entry Point"),
str8_lit_comp("Window"),
str8_lit_comp("Panel"),
str8_lit_comp("View"),
str8_lit_comp("Recent Project"),
str8_lit_comp("Source"),
str8_lit_comp("Destination"),
str8_lit_comp("Process"),
str8_lit_comp("Thread"),
str8_lit_comp("Module"),
str8_lit_comp("Pending Thread Name"),
str8_lit_comp("Debug Info Path"),
str8_lit_comp("Conversion Task"),
str8_lit_comp("Conversion Failure"),
};
String8 d_entity_kind_name_lower_table[30] =
{
str8_lit_comp("nil"),
str8_lit_comp("root"),
str8_lit_comp("machine"),
str8_lit_comp("file"),
str8_lit_comp("auto_view_rule"),
str8_lit_comp("file_path_map"),
str8_lit_comp("watch_pin"),
str8_lit_comp("watch"),
str8_lit_comp("view_rule"),
str8_lit_comp("breakpoint"),
str8_lit_comp("condition"),
str8_lit_comp("location"),
str8_lit_comp("target"),
str8_lit_comp("executable"),
str8_lit_comp("arguments"),
str8_lit_comp("working_directory"),
str8_lit_comp("entry_point"),
str8_lit_comp("window"),
str8_lit_comp("panel"),
str8_lit_comp("view"),
str8_lit_comp("recent_project"),
str8_lit_comp("source"),
str8_lit_comp("dest"),
str8_lit_comp("process"),
str8_lit_comp("thread"),
str8_lit_comp("module"),
str8_lit_comp("pending_thread_name"),
str8_lit_comp("debug_info_path"),
str8_lit_comp("conversion_task"),
str8_lit_comp("conversion_fail"),
};
String8 d_entity_kind_name_lower_plural_table[30] =
{
str8_lit_comp("nils"),
str8_lit_comp("roots"),
str8_lit_comp("machines"),
str8_lit_comp("files"),
str8_lit_comp("auto_view_rules"),
str8_lit_comp("file_path_maps"),
str8_lit_comp("watch_pins"),
str8_lit_comp("watches"),
str8_lit_comp("view_rules"),
str8_lit_comp("breakpoints"),
str8_lit_comp("conditions"),
str8_lit_comp("locations"),
str8_lit_comp("targets"),
str8_lit_comp("executables"),
str8_lit_comp("argumentses"),
str8_lit_comp("working_directories"),
str8_lit_comp("entry_points"),
str8_lit_comp("windows"),
str8_lit_comp("panels"),
str8_lit_comp("views"),
str8_lit_comp("recent_projects"),
str8_lit_comp("sources"),
str8_lit_comp("dests"),
str8_lit_comp("processes"),
str8_lit_comp("threads"),
str8_lit_comp("modules"),
str8_lit_comp("pending_thread_names"),
str8_lit_comp("debug_info_paths"),
str8_lit_comp("conversion_tasks"),
str8_lit_comp("conversion_fails"),
};
String8 d_entity_kind_name_label_table[30] =
{
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
str8_lit_comp("Expression"),
str8_lit_comp("Expression"),
str8_lit_comp("Label"),
str8_lit_comp("Expression"),
str8_lit_comp("Location"),
str8_lit_comp("Label"),
str8_lit_comp("Executable"),
str8_lit_comp("Arguments"),
str8_lit_comp("Execution Path"),
str8_lit_comp("Symbol Name"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Path"),
str8_lit_comp("Path"),
str8_lit_comp("Path"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
str8_lit_comp("Label"),
};
DF_EntityKindFlags d_entity_kind_flags_table[30] =
{
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (1*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (1*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (1*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (1*DF_EntityKindFlag_CanEnable) | (1*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (1*DF_EntityKindFlag_NameIsCode) | (1*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (1*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (1*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (1*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (1*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(1*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (1*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (1*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (1*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (1*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (1*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (1*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (0*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
(0*DF_EntityKindFlag_CanDelete) | (0*DF_EntityKindFlag_CanFreeze) | (0*DF_EntityKindFlag_CanEdit) | (1*DF_EntityKindFlag_CanRename) | (0*DF_EntityKindFlag_CanEnable) | (0*DF_EntityKindFlag_CanCondition) | (0*DF_EntityKindFlag_CanDuplicate) | (0*DF_EntityKindFlag_NameIsCode) | (0*DF_EntityKindFlag_NameIsPath) | (0*DF_EntityKindFlag_UserDefinedLifetime) | (0*DF_EntityKindFlag_IsSerializedToConfig),
};
Rng1U64 df_reg_slot_range_table[32] =
{
{0},
@@ -6,6 +6,41 @@
#ifndef DBG_FRONTEND_META_H
#define DBG_FRONTEND_META_H
typedef enum DF_EntityKind
{
DF_EntityKind_Nil,
DF_EntityKind_Root,
DF_EntityKind_Machine,
DF_EntityKind_File,
DF_EntityKind_AutoViewRule,
DF_EntityKind_FilePathMap,
DF_EntityKind_WatchPin,
DF_EntityKind_Watch,
DF_EntityKind_ViewRule,
DF_EntityKind_Breakpoint,
DF_EntityKind_Condition,
DF_EntityKind_Location,
DF_EntityKind_Target,
DF_EntityKind_Executable,
DF_EntityKind_Arguments,
DF_EntityKind_WorkingDirectory,
DF_EntityKind_EntryPoint,
DF_EntityKind_Window,
DF_EntityKind_Panel,
DF_EntityKind_View,
DF_EntityKind_RecentProject,
DF_EntityKind_Source,
DF_EntityKind_Dest,
DF_EntityKind_Process,
DF_EntityKind_Thread,
DF_EntityKind_Module,
DF_EntityKind_PendingThreadName,
DF_EntityKind_DebugInfoPath,
DF_EntityKind_ConversionTask,
DF_EntityKind_ConversionFail,
DF_EntityKind_COUNT,
} DF_EntityKind;
typedef enum DF_RegSlot
{
DF_RegSlot_Null,
@@ -707,6 +742,11 @@ C_LINKAGE_BEGIN
extern DF_CmdKind d_cfg_src_load_cmd_kind_table[4];
extern DF_CmdKind d_cfg_src_write_cmd_kind_table[4];
extern DF_CmdKind d_cfg_src_apply_cmd_kind_table[4];
extern String8 d_entity_kind_display_string_table[30];
extern String8 d_entity_kind_name_lower_table[30];
extern String8 d_entity_kind_name_lower_plural_table[30];
extern String8 d_entity_kind_name_label_table[30];
extern DF_EntityKindFlags d_entity_kind_flags_table[30];
extern Rng1U64 df_reg_slot_range_table[32];
extern DF_StringBindingPair df_g_default_binding_table[110];
extern String8 df_g_binding_version_remap_old_name_table[7];
+8 -8
View File
@@ -775,8 +775,8 @@ entry_point(CmdLine *cmd_line)
if(args.node_count > 0 && args.first->string.size != 0)
{
Temp scratch = scratch_begin(0, 0);
DF_Entity *target = d_entity_alloc(d_entity_root(), DF_EntityKind_Target);
d_entity_equip_cfg_src(target, D_CfgSrc_CommandLine);
DF_Entity *target = df_entity_alloc(df_entity_root(), DF_EntityKind_Target);
df_entity_equip_cfg_src(target, D_CfgSrc_CommandLine);
String8List passthrough_args_list = {0};
for(String8Node *n = args.first->next; n != 0; n = n->next)
{
@@ -790,14 +790,14 @@ entry_point(CmdLine *cmd_line)
if(args.first->string.size != 0)
{
String8 exe_name = args.first->string;
DF_Entity *exe = d_entity_alloc(target, DF_EntityKind_Executable);
DF_Entity *exe = df_entity_alloc(target, DF_EntityKind_Executable);
PathStyle style = path_style_from_str8(exe_name);
if(style == PathStyle_Relative)
{
exe_name = push_str8f(scratch.arena, "%S/%S", current_path, exe_name);
exe_name = path_normalized_from_string(scratch.arena, exe_name);
}
d_entity_equip_name(exe, exe_name);
df_entity_equip_name(exe, exe_name);
}
// rjf: equip working directory
@@ -805,8 +805,8 @@ entry_point(CmdLine *cmd_line)
if(path_part_of_arg.size != 0)
{
String8 path = push_str8f(scratch.arena, "%S/", path_part_of_arg);
DF_Entity *wdir = d_entity_alloc(target, DF_EntityKind_WorkingDirectory);
d_entity_equip_name(wdir, path);
DF_Entity *wdir = df_entity_alloc(target, DF_EntityKind_WorkingDirectory);
df_entity_equip_name(wdir, path);
}
// rjf: equip args
@@ -814,8 +814,8 @@ entry_point(CmdLine *cmd_line)
String8 args_str = str8_list_join(scratch.arena, &passthrough_args_list, &join);
if(args_str.size != 0)
{
DF_Entity *args_entity = d_entity_alloc(target, DF_EntityKind_Arguments);
d_entity_equip_name(args_entity, args_str);
DF_Entity *args_entity = df_entity_alloc(target, DF_EntityKind_Arguments);
df_entity_equip_name(args_entity, args_str);
}
scratch_end(scratch);
}