mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 23:52:22 -07:00
Merge branch 'master' into odin
# Conflicts: # src/df/core/generated/df_core.meta.c # src/df/gfx/df_gfx.mdesk # src/df/gfx/df_view_rules.c # src/df/gfx/generated/df_gfx.meta.c # src/df/gfx/generated/df_gfx.meta.h
This commit is contained in:
@@ -168,6 +168,7 @@
|
||||
# define ins_atomic_u64_dec_eval(x) InterlockedDecrement64((volatile __int64 *)(x))
|
||||
# define ins_atomic_u64_eval_assign(x,c) InterlockedExchange64((volatile __int64 *)(x),(c))
|
||||
# define ins_atomic_u64_add_eval(x,c) InterlockedAdd64((volatile __int64 *)(x), c)
|
||||
# define ins_atomic_u64_eval_cond_assign(x,k,c) InterlockedCompareExchange64((volatile __int64 *)(x),(k),(c))
|
||||
# define ins_atomic_u32_eval(x,c) InterlockedAdd((volatile LONG *)(x), 0)
|
||||
# define ins_atomic_u32_eval_assign(x,c) InterlockedExchange((volatile LONG *)(x),(c))
|
||||
# define ins_atomic_u32_eval_cond_assign(x,k,c) InterlockedCompareExchange((volatile LONG *)(x),(k),(c))
|
||||
@@ -390,6 +391,19 @@ typedef enum Corner
|
||||
}
|
||||
Corner;
|
||||
|
||||
typedef enum Dir2
|
||||
{
|
||||
Dir2_Invalid = -1,
|
||||
Dir2_Left,
|
||||
Dir2_Up,
|
||||
Dir2_Right,
|
||||
Dir2_Down,
|
||||
Dir2_COUNT
|
||||
}
|
||||
Dir2;
|
||||
#define axis2_from_dir2(d) (((d) & 1) ? Axis2_Y : Axis2_X)
|
||||
#define side_from_dir2(d) (((d) < Dir2_Right) ? Side_Min : Side_Max)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Toolchain/Environment Enums
|
||||
|
||||
|
||||
@@ -48,9 +48,6 @@ main_thread_base_entry_point(void (*entry_point)(CmdLine *cmdline), char **argum
|
||||
#if defined(CTRL_CORE_H)
|
||||
ctrl_init();
|
||||
#endif
|
||||
#if defined(DASM_H)
|
||||
dasmi_init();
|
||||
#endif
|
||||
#if defined(OS_GRAPHICAL_H)
|
||||
os_graphical_init();
|
||||
#endif
|
||||
|
||||
@@ -15,4 +15,5 @@
|
||||
#include "base_thread_context.c"
|
||||
#include "base_command_line.c"
|
||||
#include "base_markup.c"
|
||||
#include "base_log.c"
|
||||
#include "base_entry_point.c"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "base_thread_context.h"
|
||||
#include "base_command_line.h"
|
||||
#include "base_markup.h"
|
||||
#include "base_log.h"
|
||||
#include "base_entry_point.h"
|
||||
|
||||
#endif // BASE_INC_H
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals/Thread-Locals
|
||||
|
||||
C_LINKAGE thread_static Log *log_active;
|
||||
#if !BUILD_SUPPLEMENTARY_UNIT
|
||||
C_LINKAGE thread_static Log *log_active = 0;
|
||||
#endif
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Creation/Selection
|
||||
|
||||
internal Log *
|
||||
log_alloc(void)
|
||||
{
|
||||
Arena *arena = arena_alloc();
|
||||
Log *log = push_array(arena, Log, 1);
|
||||
log->arena = arena;
|
||||
return log;
|
||||
}
|
||||
|
||||
internal void
|
||||
log_release(Log *log)
|
||||
{
|
||||
arena_release(log->arena);
|
||||
}
|
||||
|
||||
internal void
|
||||
log_select(Log *log)
|
||||
{
|
||||
log_active = log;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Building/Clearing
|
||||
|
||||
internal void
|
||||
log_msg(String8 string)
|
||||
{
|
||||
if(log_active != 0 && log_active->top_scope != 0)
|
||||
{
|
||||
String8 string_copy = push_str8_copy(log_active->arena, string);
|
||||
str8_list_push(log_active->arena, &log_active->top_scope->strings, string_copy);
|
||||
}
|
||||
}
|
||||
|
||||
internal void
|
||||
log_msgf(char *fmt, ...)
|
||||
{
|
||||
if(log_active != 0)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
log_msg(string);
|
||||
va_end(args);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Scopes
|
||||
|
||||
internal void
|
||||
log_scope_begin(void)
|
||||
{
|
||||
if(log_active != 0)
|
||||
{
|
||||
U64 pos = arena_pos(log_active->arena);
|
||||
LogScope *scope = push_array(log_active->arena, LogScope, 1);
|
||||
scope->pos = pos;
|
||||
SLLStackPush(log_active->top_scope, scope);
|
||||
}
|
||||
}
|
||||
|
||||
internal String8
|
||||
log_scope_end(Arena *arena)
|
||||
{
|
||||
String8 result = {0};
|
||||
if(log_active != 0)
|
||||
{
|
||||
LogScope *scope = log_active->top_scope;
|
||||
if(scope != 0)
|
||||
{
|
||||
SLLStackPop(log_active->top_scope);
|
||||
if(arena != 0)
|
||||
{
|
||||
result = str8_list_join(arena, &scope->strings, 0);
|
||||
}
|
||||
arena_pop_to(log_active->arena, scope->pos);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef BASE_LOG_H
|
||||
#define BASE_LOG_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Types
|
||||
|
||||
typedef struct LogScope LogScope;
|
||||
struct LogScope
|
||||
{
|
||||
LogScope *next;
|
||||
U64 pos;
|
||||
String8List strings;
|
||||
};
|
||||
|
||||
typedef struct Log Log;
|
||||
struct Log
|
||||
{
|
||||
Arena *arena;
|
||||
LogScope *top_scope;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Creation/Selection
|
||||
|
||||
internal Log *log_alloc(void);
|
||||
internal void log_release(Log *log);
|
||||
internal void log_select(Log *log);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Building
|
||||
|
||||
internal void log_msg(String8 string);
|
||||
internal void log_msgf(char *fmt, ...);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Scopes
|
||||
|
||||
internal void log_scope_begin(void);
|
||||
internal String8 log_scope_end(Arena *arena);
|
||||
|
||||
#endif // BASE_LOG_H
|
||||
@@ -4,9 +4,9 @@
|
||||
#ifndef BASE_MARKUP_H
|
||||
#define BASE_MARKUP_H
|
||||
|
||||
internal void thread_namef(char *fmt, ...);
|
||||
internal void thread_name(String8 string);
|
||||
internal void thread_namef(char *fmt, ...);
|
||||
#define ThreadNameF(...) (ProfThreadName(__VA_ARGS__), thread_namef(__VA_ARGS__))
|
||||
#define ThreadName(str) (ProfThreadName("%s", str8_varg(str)), thread_name(str))
|
||||
#define ThreadName(str) (ProfThreadName("%.*s", str8_varg(str)), thread_name(str))
|
||||
|
||||
#endif // BASE_MARKUP_H
|
||||
|
||||
+71
-3
@@ -851,6 +851,15 @@ ctrl_init(void)
|
||||
ctrl_state->c2u_ring_base = push_array_no_zero(arena, U8, ctrl_state->c2u_ring_size);
|
||||
ctrl_state->c2u_ring_mutex = os_mutex_alloc();
|
||||
ctrl_state->c2u_ring_cv = os_condition_variable_alloc();
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 user_program_data_path = os_string_from_system_path(scratch.arena, OS_SystemPath_UserProgramData);
|
||||
String8 user_data_folder = push_str8f(scratch.arena, "%S/raddbg/logs", user_program_data_path);
|
||||
os_make_directory(user_data_folder);
|
||||
ctrl_state->ctrl_thread_log_path = push_str8f(ctrl_state->arena, "%S/ctrl_thread.raddbg_log", user_data_folder);
|
||||
os_write_data_to_file_path(ctrl_state->ctrl_thread_log_path, str8_zero());
|
||||
scratch_end(scratch);
|
||||
}
|
||||
ctrl_state->ctrl_thread_entity_store = ctrl_entity_store_alloc();
|
||||
ctrl_state->dmn_event_arena = arena_alloc();
|
||||
ctrl_state->user_entry_point_arena = arena_alloc();
|
||||
@@ -865,6 +874,7 @@ ctrl_init(void)
|
||||
ctrl_state->u2ms_ring_base = push_array(arena, U8, ctrl_state->u2ms_ring_size);
|
||||
ctrl_state->u2ms_ring_mutex = os_mutex_alloc();
|
||||
ctrl_state->u2ms_ring_cv = os_condition_variable_alloc();
|
||||
ctrl_state->ctrl_thread_log = log_alloc();
|
||||
ctrl_state->ctrl_thread = os_launch_thread(ctrl_thread__entry_point, 0, 0);
|
||||
ctrl_state->ms_thread_count = Clamp(1, os_logical_core_count()-1, 4);
|
||||
ctrl_state->ms_threads = push_array(arena, OS_Handle, ctrl_state->ms_thread_count);
|
||||
@@ -1737,12 +1747,14 @@ ctrl_thread__entry_point(void *p)
|
||||
ThreadNameF("[ctrl] thread");
|
||||
ProfBeginFunction();
|
||||
DMN_CtrlCtx *ctrl_ctx = dmn_ctrl_begin();
|
||||
log_select(ctrl_state->ctrl_thread_log);
|
||||
|
||||
//- rjf: loop
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
for(;;)
|
||||
{
|
||||
temp_end(scratch);
|
||||
log_scope_begin();
|
||||
|
||||
//- rjf: get next messages
|
||||
CTRL_MsgList msgs = ctrl_u2c_pop_msgs(scratch.arena);
|
||||
@@ -1781,6 +1793,9 @@ ctrl_thread__entry_point(void *p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String8 log = log_scope_end(scratch.arena);
|
||||
ctrl_thread__flush_log(log);
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
@@ -1923,6 +1938,22 @@ ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg,
|
||||
// rjf: grab first event
|
||||
DMN_EventNode *next_event_node = ctrl_state->first_dmn_event_node;
|
||||
|
||||
// rjf: log event
|
||||
if(next_event_node != 0) CTRL_CtrlThreadLogScope
|
||||
{
|
||||
DMN_Event *ev = &next_event_node->v;
|
||||
log_msgf("--- event ---\n");
|
||||
log_msgf("kind: %S\n", dmn_event_kind_string_table[ev->kind]);
|
||||
log_msgf("exception_kind: %S\n", dmn_exception_kind_string_table[ev->exception_kind]);
|
||||
log_msgf("process: [%I64u]\n", ev->process.u64[0]);
|
||||
log_msgf("thread: [%I64u]\n", ev->thread.u64[0]);
|
||||
log_msgf("module: [%I64u]\n", ev->module.u64[0]);
|
||||
log_msgf("arch: %S\n", string_from_architecture(ev->arch));
|
||||
log_msgf("address: 0x%I64x\n", ev->address);
|
||||
log_msgf("string: \"%S\"\n", ev->string);
|
||||
log_msgf("ip_vaddr: 0x%I64x\n", ev->instruction_pointer);
|
||||
}
|
||||
|
||||
// rjf: determine if we should filter
|
||||
B32 should_filter_event = 0;
|
||||
if(next_event_node != 0)
|
||||
@@ -2073,7 +2104,9 @@ ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg,
|
||||
// rjf: run for new events
|
||||
ProfScope("run for new events")
|
||||
{
|
||||
CTRL_CtrlThreadLogScope log_msgf("{dmn_ctrl_run ...");
|
||||
DMN_EventList events = dmn_ctrl_run(scratch.arena, ctrl_ctx, run_ctrls);
|
||||
CTRL_CtrlThreadLogScope log_msgf("}\n");
|
||||
for(DMN_EventNode *src_n = events.first; src_n != 0; src_n = src_n->next)
|
||||
{
|
||||
DMN_EventNode *dst_n = ctrl_state->free_dmn_event_node;
|
||||
@@ -2260,6 +2293,23 @@ ctrl_eval_memory_read(void *u, void *out, U64 addr, U64 size)
|
||||
return result;
|
||||
}
|
||||
|
||||
//- rjf: log flusher
|
||||
|
||||
internal void
|
||||
ctrl_thread__flush_log(String8 string)
|
||||
{
|
||||
os_append_data_to_file_path(ctrl_state->ctrl_thread_log_path, string);
|
||||
}
|
||||
|
||||
internal void
|
||||
ctrl_thread__end_and_flush_log(void)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 log = log_scope_end(scratch.arena);
|
||||
ctrl_thread__flush_log(log);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
//- rjf: msg kind implementations
|
||||
|
||||
internal void
|
||||
@@ -2693,7 +2743,7 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
B32 hard_stop = 0;
|
||||
CTRL_EventCause hard_stop_cause = ctrl_event_cause_from_dmn_event_kind(event->kind);
|
||||
B32 use_stepping_logic = 0;
|
||||
switch(event->kind)
|
||||
CTRL_CtrlThreadLogScope switch(event->kind)
|
||||
{
|
||||
default:{}break;
|
||||
case DMN_EventKind_Error:
|
||||
@@ -2702,17 +2752,29 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
case DMN_EventKind_Trap:
|
||||
{
|
||||
hard_stop = 1;
|
||||
log_msgf(">>> stepping >>> hard stop\n");
|
||||
}break;
|
||||
case DMN_EventKind_Exception:
|
||||
case DMN_EventKind_Breakpoint:
|
||||
{
|
||||
use_stepping_logic = 1;
|
||||
log_msgf(">>> stepping >>> exception or breakpoint - begin stepping logic\n");
|
||||
}break;
|
||||
case DMN_EventKind_CreateProcess:
|
||||
{
|
||||
DMN_TrapChunkList new_traps = {0};
|
||||
ctrl_thread__append_resolved_process_user_bp_traps(scratch.arena, CTRL_MachineID_Local, event->process, &msg->user_bps, &new_traps);
|
||||
log_msgf(">>> stepping >>> create process -> resolve new BPs\n");
|
||||
for(DMN_TrapChunkNode *n = new_traps.first; n != 0; n = n->next)
|
||||
{
|
||||
for(U64 idx = 0; idx < n->count; idx += 1)
|
||||
{
|
||||
DMN_Trap *trap = &n->v[idx];
|
||||
log_msgf(" trap: {process:%I64d, vaddr:0x%I64x}\n", trap->process.u64[0], trap->vaddr);
|
||||
}
|
||||
}
|
||||
dmn_trap_chunk_list_concat_shallow_copy(scratch.arena, &joined_traps, &new_traps);
|
||||
dmn_trap_chunk_list_concat_shallow_copy(scratch.arena, &user_traps, &new_traps);
|
||||
}break;
|
||||
case DMN_EventKind_LoadModule:
|
||||
{
|
||||
@@ -2720,6 +2782,7 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
ctrl_thread__append_resolved_module_user_bp_traps(scratch.arena, CTRL_MachineID_Local, event->process, event->module, &msg->user_bps, &new_traps);
|
||||
dmn_trap_chunk_list_concat_shallow_copy(scratch.arena, &joined_traps, &new_traps);
|
||||
dmn_trap_chunk_list_concat_shallow_copy(scratch.arena, &user_traps, &new_traps);
|
||||
log_msgf(">>> stepping >>> load module -> resolve new BPs\n");
|
||||
}break;
|
||||
}
|
||||
|
||||
@@ -2923,7 +2986,7 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
//
|
||||
CTRL_Entity *thread = ctrl_entity_from_machine_id_handle(ctrl_state->ctrl_thread_entity_store, CTRL_MachineID_Local, event->thread);
|
||||
Architecture arch = thread->arch;
|
||||
U64 thread_rip_vaddr = dmn_rsp_from_thread(event->thread);
|
||||
U64 thread_rip_vaddr = dmn_rip_from_thread(event->thread);
|
||||
DMN_Handle module = {0};
|
||||
String8 module_name = {0};
|
||||
U64 module_base_vaddr = 0;
|
||||
@@ -2991,7 +3054,7 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
B32 hit_trap_net_bp = 0;
|
||||
B32 hit_conditional_bp_but_filtered = 0;
|
||||
CTRL_TrapFlags hit_trap_flags = 0;
|
||||
if(!hard_stop && use_stepping_logic)
|
||||
if(!hard_stop && use_stepping_logic) CTRL_CtrlThreadLogScope
|
||||
{
|
||||
if(event->kind == DMN_EventKind_Breakpoint)
|
||||
{
|
||||
@@ -3093,11 +3156,13 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
{
|
||||
hit_user_bp = 0;
|
||||
hit_conditional_bp_but_filtered = 1;
|
||||
log_msgf(">>> stepping >>> conditional breakpoint hit, but condition eval'd to 0, and so filtered\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
hit_user_bp = 1;
|
||||
hit_conditional_bp_but_filtered = 0;
|
||||
log_msgf(">>> stepping >>> conditional breakpoint hit\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3118,6 +3183,8 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
}
|
||||
}
|
||||
|
||||
log_msgf(">>> stepping >>> stepping logic - BP event -> hit_user_bp: %i\n", hit_user_bp);
|
||||
log_msgf(">>> stepping >>> stepping logic - BP event -> hit_entry: %i\n", hit_entry);
|
||||
temp_end(temp);
|
||||
}
|
||||
}
|
||||
@@ -3351,6 +3418,7 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
|
||||
{
|
||||
stage_stop_cause = CTRL_EventCause_Finished;
|
||||
}
|
||||
log_msgf(">>> stepping >>> stage stop cause -> %i\n", stage_stop_cause);
|
||||
if(stage_stop_cause != CTRL_EventCause_Null)
|
||||
{
|
||||
stop_event = event;
|
||||
|
||||
@@ -514,7 +514,9 @@ struct CTRL_State
|
||||
OS_Handle c2u_ring_cv;
|
||||
|
||||
// rjf: ctrl thread state
|
||||
String8 ctrl_thread_log_path;
|
||||
OS_Handle ctrl_thread;
|
||||
Log *ctrl_thread_log;
|
||||
CTRL_EntityStore *ctrl_thread_entity_store;
|
||||
Arena *dmn_event_arena;
|
||||
DMN_EventNode *first_dmn_event_node;
|
||||
@@ -551,6 +553,11 @@ read_only global CTRL_Entity ctrl_entity_nil =
|
||||
&ctrl_entity_nil,
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Logging Markup
|
||||
|
||||
#define CTRL_CtrlThreadLogScope DeferLoop(log_scope_begin(), ctrl_thread__end_and_flush_log())
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Type Functions
|
||||
|
||||
@@ -708,6 +715,10 @@ internal DMN_Event *ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_
|
||||
//- rjf: eval helpers
|
||||
internal B32 ctrl_eval_memory_read(void *u, void *out, U64 addr, U64 size);
|
||||
|
||||
//- rjf: log flusher
|
||||
internal void ctrl_thread__flush_log(String8 string);
|
||||
internal void ctrl_thread__end_and_flush_log(void);
|
||||
|
||||
//- rjf: msg kind implementations
|
||||
internal void ctrl_thread__launch(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg);
|
||||
internal void ctrl_thread__attach(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg);
|
||||
|
||||
+213
-96
@@ -13,6 +13,21 @@
|
||||
#include "third_party/udis86/libudis86/syn.c"
|
||||
#include "third_party/udis86/libudis86/udis86.c"
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Parameter Type Functions
|
||||
|
||||
internal B32
|
||||
dasm_params_match(DASM_Params *a, DASM_Params *b)
|
||||
{
|
||||
B32 result = (a->vaddr == b->vaddr &&
|
||||
a->arch == b->arch &&
|
||||
a->style_flags == b->style_flags &&
|
||||
a->syntax == b->syntax &&
|
||||
a->base_vaddr == b->base_vaddr &&
|
||||
str8_match(a->exe_path, b->exe_path, 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Instruction Type Functions
|
||||
|
||||
@@ -103,7 +118,7 @@ dasm_init(void)
|
||||
{
|
||||
dasm_shared->parse_threads[idx] = os_launch_thread(dasm_parse_thread__entry_point, (void *)idx, 0);
|
||||
}
|
||||
dasm_shared->evictor_thread = os_launch_thread(dasm_evictor_thread__entry_point, 0, 0);
|
||||
dasm_shared->evictor_detector_thread = os_launch_thread(dasm_evictor_detector_thread__entry_point, 0, 0);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -134,16 +149,9 @@ dasm_scope_open(void)
|
||||
dasm_tctx = push_array(arena, DASM_TCTX, 1);
|
||||
dasm_tctx->arena = arena;
|
||||
}
|
||||
DASM_Scope *scope = dasm_tctx->free_scope;
|
||||
if(scope != 0)
|
||||
{
|
||||
SLLStackPop(dasm_tctx->free_scope);
|
||||
}
|
||||
else
|
||||
{
|
||||
scope = push_array_no_zero(dasm_tctx->arena, DASM_Scope, 1);
|
||||
}
|
||||
MemoryZeroStruct(scope);
|
||||
U64 base_pos = arena_pos(dasm_tctx->arena);
|
||||
DASM_Scope *scope = push_array(dasm_tctx->arena, DASM_Scope, 1);
|
||||
scope->base_pos = base_pos;
|
||||
return scope;
|
||||
}
|
||||
|
||||
@@ -161,43 +169,27 @@ dasm_scope_close(DASM_Scope *scope)
|
||||
{
|
||||
for(DASM_Node *n = slot->first; n != 0; n = n->next)
|
||||
{
|
||||
if(u128_match(t->hash, n->hash) &&
|
||||
t->addr == n->addr &&
|
||||
t->arch == n->arch &&
|
||||
t->style_flags == n->style_flags &&
|
||||
t->syntax == n->syntax)
|
||||
if(u128_match(t->hash, n->hash) && dasm_params_match(&t->params, &n->params))
|
||||
{
|
||||
ins_atomic_u64_dec_eval(&n->scope_ref_count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
SLLStackPush(dasm_tctx->free_touch, t);
|
||||
}
|
||||
SLLStackPush(dasm_tctx->free_scope, scope);
|
||||
arena_pop_to(dasm_tctx->arena, scope->base_pos);
|
||||
}
|
||||
|
||||
internal void
|
||||
dasm_scope_touch_node__stripe_r_guarded(DASM_Scope *scope, DASM_Node *node)
|
||||
{
|
||||
DASM_Touch *touch = dasm_tctx->free_touch;
|
||||
DASM_Touch *touch = push_array(dasm_tctx->arena, DASM_Touch, 1);
|
||||
ins_atomic_u64_inc_eval(&node->scope_ref_count);
|
||||
ins_atomic_u64_eval_assign(&node->last_time_touched_us, os_now_microseconds());
|
||||
ins_atomic_u64_eval_assign(&node->last_user_clock_idx_touched, dasm_user_clock_idx());
|
||||
if(touch != 0)
|
||||
{
|
||||
SLLStackPop(dasm_tctx->free_touch);
|
||||
}
|
||||
else
|
||||
{
|
||||
touch = push_array_no_zero(dasm_tctx->arena, DASM_Touch, 1);
|
||||
}
|
||||
MemoryZeroStruct(touch);
|
||||
touch->hash = node->hash;
|
||||
touch->addr = node->addr;
|
||||
touch->arch = node->arch;
|
||||
touch->style_flags = node->style_flags;
|
||||
touch->syntax = node->syntax;
|
||||
MemoryCopyStruct(&touch->params, &node->params);
|
||||
touch->params.exe_path = push_str8_copy(dasm_tctx->arena, touch->params.exe_path);
|
||||
SLLStackPush(scope->top_touch, touch);
|
||||
}
|
||||
|
||||
@@ -205,7 +197,7 @@ dasm_scope_touch_node__stripe_r_guarded(DASM_Scope *scope, DASM_Node *node)
|
||||
//~ rjf: Cache Lookups
|
||||
|
||||
internal DASM_Info
|
||||
dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax)
|
||||
dasm_info_from_hash_params(DASM_Scope *scope, U128 hash, DASM_Params *params)
|
||||
{
|
||||
DASM_Info info = {0};
|
||||
if(!u128_match(hash, u128_zero()))
|
||||
@@ -219,11 +211,7 @@ dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Arch
|
||||
{
|
||||
for(DASM_Node *n = slot->first; n != 0; n = n->next)
|
||||
{
|
||||
if(u128_match(hash, n->hash) &&
|
||||
addr == n->addr &&
|
||||
arch == n->arch &&
|
||||
style_flags == n->style_flags &&
|
||||
syntax == n->syntax)
|
||||
if(u128_match(hash, n->hash) && dasm_params_match(params, &n->params))
|
||||
{
|
||||
MemoryCopyStruct(&info, &n->info);
|
||||
found = 1;
|
||||
@@ -240,11 +228,7 @@ dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Arch
|
||||
DASM_Node *node = 0;
|
||||
for(DASM_Node *n = slot->first; n != 0; n = n->next)
|
||||
{
|
||||
if(u128_match(hash, n->hash) &&
|
||||
addr == n->addr &&
|
||||
arch == n->arch &&
|
||||
style_flags == n->style_flags &&
|
||||
syntax == n->syntax)
|
||||
if(u128_match(hash, n->hash) && dasm_params_match(params, &n->params))
|
||||
{
|
||||
node = n;
|
||||
break;
|
||||
@@ -264,30 +248,29 @@ dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Arch
|
||||
MemoryZeroStruct(node);
|
||||
DLLPushBack(slot->first, slot->last, node);
|
||||
node->hash = hash;
|
||||
node->addr = addr;
|
||||
node->arch = arch;
|
||||
node->style_flags = style_flags;
|
||||
node->syntax = syntax;
|
||||
MemoryCopyStruct(&node->params, params);
|
||||
// TODO(rjf): need to make this releasable - currently all exe_paths just leak
|
||||
node->params.exe_path = push_str8_copy(stripe->arena, node->params.exe_path);
|
||||
node_is_new = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(node_is_new)
|
||||
{
|
||||
dasm_u2p_enqueue_req(hash, addr, arch, style_flags, syntax, max_U64);
|
||||
dasm_u2p_enqueue_req(hash, params, max_U64);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
internal DASM_Info
|
||||
dasm_info_from_key_addr_arch_style(DASM_Scope *scope, U128 key, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax, U128 *hash_out)
|
||||
dasm_info_from_key_params(DASM_Scope *scope, U128 key, DASM_Params *params, U128 *hash_out)
|
||||
{
|
||||
DASM_Info result = {0};
|
||||
for(U64 rewind_idx = 0; rewind_idx < 2; rewind_idx += 1)
|
||||
{
|
||||
U128 hash = hs_hash_from_key(key, rewind_idx);
|
||||
result = dasm_info_from_hash_addr_arch_style(scope, hash, addr, arch, style_flags, syntax);
|
||||
result = dasm_info_from_hash_params(scope, hash, params);
|
||||
if(result.insts.count != 0)
|
||||
{
|
||||
if(hash_out)
|
||||
@@ -304,21 +287,26 @@ dasm_info_from_key_addr_arch_style(DASM_Scope *scope, U128 key, U64 addr, Archit
|
||||
//~ rjf: Parse Threads
|
||||
|
||||
internal B32
|
||||
dasm_u2p_enqueue_req(U128 hash, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax, U64 endt_us)
|
||||
dasm_u2p_enqueue_req(U128 hash, DASM_Params *params, U64 endt_us)
|
||||
{
|
||||
B32 good = 0;
|
||||
OS_MutexScope(dasm_shared->u2p_ring_mutex) for(;;)
|
||||
{
|
||||
U64 unconsumed_size = dasm_shared->u2p_ring_write_pos - dasm_shared->u2p_ring_read_pos;
|
||||
U64 available_size = dasm_shared->u2p_ring_size - unconsumed_size;
|
||||
if(available_size >= sizeof(hash)+sizeof(addr)+sizeof(arch))
|
||||
if(available_size >= sizeof(hash)+sizeof(U64)+sizeof(Architecture)+sizeof(DASM_StyleFlags)+sizeof(DASM_Syntax)+sizeof(U64)+sizeof(U64)+params->exe_path.size)
|
||||
{
|
||||
good = 1;
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &hash);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &addr);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &arch);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &style_flags);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, &syntax);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, ¶ms->vaddr);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, ¶ms->arch);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, ¶ms->style_flags);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, ¶ms->syntax);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, ¶ms->base_vaddr);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, ¶ms->exe_path.size);
|
||||
dasm_shared->u2p_ring_write_pos += ring_write(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_write_pos, params->exe_path.str, params->exe_path.size);
|
||||
dasm_shared->u2p_ring_write_pos += 7;
|
||||
dasm_shared->u2p_ring_write_pos -= dasm_shared->u2p_ring_write_pos%8;
|
||||
break;
|
||||
}
|
||||
if(os_now_microseconds() >= endt_us)
|
||||
@@ -335,18 +323,24 @@ dasm_u2p_enqueue_req(U128 hash, U64 addr, Architecture arch, DASM_StyleFlags sty
|
||||
}
|
||||
|
||||
internal void
|
||||
dasm_u2p_dequeue_req(U128 *hash_out, U64 *addr_out, Architecture *arch_out, DASM_StyleFlags *style_flags_out, DASM_Syntax *syntax_out)
|
||||
dasm_u2p_dequeue_req(Arena *arena, U128 *hash_out, DASM_Params *params_out)
|
||||
{
|
||||
OS_MutexScope(dasm_shared->u2p_ring_mutex) for(;;)
|
||||
{
|
||||
U64 unconsumed_size = dasm_shared->u2p_ring_write_pos - dasm_shared->u2p_ring_read_pos;
|
||||
if(unconsumed_size >= sizeof(*hash_out)+sizeof(*addr_out)+sizeof(*arch_out))
|
||||
if(unconsumed_size >= sizeof(*hash_out)+sizeof(U64)+sizeof(Architecture)+sizeof(DASM_StyleFlags)+sizeof(DASM_Syntax)+sizeof(U64)+sizeof(U64))
|
||||
{
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, hash_out);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, addr_out);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, arch_out);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, style_flags_out);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, syntax_out);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, ¶ms_out->vaddr);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, ¶ms_out->arch);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, ¶ms_out->style_flags);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, ¶ms_out->syntax);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, ¶ms_out->base_vaddr);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read_struct(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, ¶ms_out->exe_path.size);
|
||||
params_out->exe_path.str = push_array(arena, U8, params_out->exe_path.size);
|
||||
dasm_shared->u2p_ring_read_pos += ring_read(dasm_shared->u2p_ring_base, dasm_shared->u2p_ring_size, dasm_shared->u2p_ring_read_pos, params_out->exe_path.str, params_out->exe_path.size);
|
||||
dasm_shared->u2p_ring_read_pos += 7;
|
||||
dasm_shared->u2p_ring_read_pos -= dasm_shared->u2p_ring_read_pos%8;
|
||||
break;
|
||||
}
|
||||
os_condition_variable_wait(dasm_shared->u2p_ring_cv, dasm_shared->u2p_ring_mutex, max_U64);
|
||||
@@ -364,12 +358,12 @@ dasm_parse_thread__entry_point(void *p)
|
||||
|
||||
//- rjf: get next request
|
||||
U128 hash = {0};
|
||||
U64 addr = 0;
|
||||
Architecture arch = Architecture_Null;
|
||||
DASM_StyleFlags style_flags = 0;
|
||||
DASM_Syntax syntax = DASM_Syntax_Intel;
|
||||
dasm_u2p_dequeue_req(&hash, &addr, &arch, &style_flags, &syntax);
|
||||
DASM_Params params = {0};
|
||||
dasm_u2p_dequeue_req(scratch.arena, &hash, ¶ms);
|
||||
U64 change_gen = fs_change_gen();
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
DBGI_Scope *dbgi_scope = dbgi_scope_open();
|
||||
TXT_Scope *txt_scope = txt_scope_open();
|
||||
|
||||
//- rjf: unpack hash
|
||||
U64 slot_idx = hash.u64[1]%dasm_shared->slots_count;
|
||||
@@ -383,11 +377,7 @@ dasm_parse_thread__entry_point(void *p)
|
||||
{
|
||||
for(DASM_Node *n = slot->first; n != 0; n = n->next)
|
||||
{
|
||||
if(u128_match(n->hash, hash) &&
|
||||
n->addr == addr &&
|
||||
n->arch == arch &&
|
||||
n->style_flags == style_flags &&
|
||||
n->syntax == syntax)
|
||||
if(u128_match(n->hash, hash) && dasm_params_match(&n->params, ¶ms))
|
||||
{
|
||||
got_task = !ins_atomic_u32_eval_cond_assign(&n->is_working, 1, 0);
|
||||
break;
|
||||
@@ -395,6 +385,14 @@ dasm_parse_thread__entry_point(void *p)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: get dbg info
|
||||
DBGI_Parse *dbgi = &dbgi_parse_nil;
|
||||
if(got_task && params.exe_path.size != 0)
|
||||
{
|
||||
dbgi = dbgi_parse_from_exe_path(dbgi_scope, params.exe_path, max_U64);
|
||||
}
|
||||
RDI_Parsed *rdi = &dbgi->rdi;
|
||||
|
||||
//- rjf: hash -> data
|
||||
String8 data = {0};
|
||||
if(got_task)
|
||||
@@ -402,12 +400,12 @@ dasm_parse_thread__entry_point(void *p)
|
||||
data = hs_data_from_hash(hs_scope, hash);
|
||||
}
|
||||
|
||||
//- rjf: data * arch * addr -> decode artifacts
|
||||
//- rjf: data * arch * addr * dbg -> decode artifacts
|
||||
DASM_InstChunkList inst_list = {0};
|
||||
String8List inst_strings = {0};
|
||||
if(got_task)
|
||||
{
|
||||
switch(arch)
|
||||
switch(params.arch)
|
||||
{
|
||||
default:{}break;
|
||||
|
||||
@@ -418,14 +416,15 @@ dasm_parse_thread__entry_point(void *p)
|
||||
// rjf: grab context
|
||||
struct ud udc;
|
||||
ud_init(&udc);
|
||||
ud_set_mode(&udc, bit_size_from_arch(arch));
|
||||
ud_set_pc(&udc, addr);
|
||||
ud_set_mode(&udc, bit_size_from_arch(params.arch));
|
||||
ud_set_pc(&udc, params.vaddr);
|
||||
ud_set_input_buffer(&udc, data.str, data.size);
|
||||
ud_set_vendor(&udc, UD_VENDOR_ANY);
|
||||
ud_set_syntax(&udc, syntax == DASM_Syntax_Intel ? UD_SYN_INTEL : UD_SYN_ATT);
|
||||
ud_set_syntax(&udc, params.syntax == DASM_Syntax_Intel ? UD_SYN_INTEL : UD_SYN_ATT);
|
||||
|
||||
// rjf: disassemble
|
||||
U64 byte_process_start_off = 0;
|
||||
RDI_SourceFile *last_file = &rdi_source_file_nil;
|
||||
RDI_Line *last_line = 0;
|
||||
for(U64 off = 0; off < data.size;)
|
||||
{
|
||||
// rjf: disassemble one instruction
|
||||
@@ -438,15 +437,90 @@ dasm_parse_thread__entry_point(void *p)
|
||||
// rjf: analyze
|
||||
struct ud_operand *first_op = (struct ud_operand *)ud_insn_opr(&udc, 0);
|
||||
U64 rel_voff = (first_op != 0 && first_op->type == UD_OP_JIMM) ? ud_syn_rel_target(&udc, first_op) : 0;
|
||||
U64 jump_dst_vaddr = rel_voff;
|
||||
|
||||
// rjf: push strings derived from voff -> line info
|
||||
if(params.style_flags & DASM_StyleFlag_SourceFilesNames|DASM_StyleFlag_SourceLines)
|
||||
{
|
||||
if(dbgi != &dbgi_parse_nil)
|
||||
{
|
||||
U64 voff = (params.vaddr+off) - params.base_vaddr;
|
||||
U32 unit_idx = rdi_vmap_idx_from_voff(rdi->unit_vmap, rdi->unit_vmap_count, voff);
|
||||
RDI_Unit *unit = rdi_element_from_idx(rdi, units, unit_idx);
|
||||
RDI_ParsedLineInfo unit_line_info = {0};
|
||||
rdi_line_info_from_unit(rdi, unit, &unit_line_info);
|
||||
U64 line_info_idx = rdi_line_info_idx_from_voff(&unit_line_info, voff);
|
||||
if(line_info_idx < unit_line_info.count)
|
||||
{
|
||||
RDI_Line *line = &unit_line_info.lines[line_info_idx];
|
||||
RDI_SourceFile *file = rdi_element_from_idx(rdi, source_files, line->file_idx);
|
||||
String8 file_normalized_full_path = {0};
|
||||
file_normalized_full_path.str = rdi_string_from_idx(rdi, file->normal_full_path_string_idx, &file_normalized_full_path.size);
|
||||
if(file != last_file)
|
||||
{
|
||||
if(params.style_flags & DASM_StyleFlag_SourceFilesNames &&
|
||||
file->normal_full_path_string_idx != 0 && file_normalized_full_path.size != 0)
|
||||
{
|
||||
DASM_Inst inst = {0};
|
||||
dasm_inst_chunk_list_push(scratch.arena, &inst_list, 1024, &inst);
|
||||
str8_list_pushf(scratch.arena, &inst_strings, "> %S", file_normalized_full_path);
|
||||
}
|
||||
if(params.style_flags & DASM_StyleFlag_SourceFilesNames && file->normal_full_path_string_idx == 0)
|
||||
{
|
||||
DASM_Inst inst = {0};
|
||||
dasm_inst_chunk_list_push(scratch.arena, &inst_list, 1024, &inst);
|
||||
str8_list_pushf(scratch.arena, &inst_strings, ">");
|
||||
}
|
||||
last_file = file;
|
||||
}
|
||||
if(line && line != last_line && file->normal_full_path_string_idx != 0 &&
|
||||
params.style_flags & DASM_StyleFlag_SourceLines &&
|
||||
file_normalized_full_path.size != 0)
|
||||
{
|
||||
FileProperties props = os_properties_from_file_path(file_normalized_full_path);
|
||||
if(props.modified != 0)
|
||||
{
|
||||
// TODO(rjf): need redirection path - this may map to a different path on the local machine,
|
||||
// need frontend to communicate path remapping info to this layer
|
||||
U128 key = fs_key_from_path(file_normalized_full_path);
|
||||
TXT_LangKind lang_kind = txt_lang_kind_from_extension(file_normalized_full_path);
|
||||
U64 endt_us = max_U64;
|
||||
U128 hash = {0};
|
||||
TXT_TextInfo text_info = {0};
|
||||
for(;os_now_microseconds() <= endt_us;)
|
||||
{
|
||||
text_info = txt_text_info_from_key_lang(txt_scope, key, lang_kind, &hash);
|
||||
if(!u128_match(hash, u128_zero()))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(0 < line->line_num && line->line_num < text_info.lines_count)
|
||||
{
|
||||
String8 data = hs_data_from_hash(hs_scope, hash);
|
||||
String8 line_text = str8_skip_chop_whitespace(str8_substr(data, text_info.lines_ranges[line->line_num-1]));
|
||||
if(line_text.size != 0)
|
||||
{
|
||||
DASM_Inst inst = {0};
|
||||
dasm_inst_chunk_list_push(scratch.arena, &inst_list, 1024, &inst);
|
||||
str8_list_pushf(scratch.arena, &inst_strings, "> %S", line_text);
|
||||
}
|
||||
}
|
||||
}
|
||||
last_line = line;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: push
|
||||
String8 addr_part = {0};
|
||||
if(style_flags & DASM_StyleFlag_Addresses)
|
||||
if(params.style_flags & DASM_StyleFlag_Addresses)
|
||||
{
|
||||
addr_part = push_str8f(scratch.arena, "%016I64X ", addr+off);
|
||||
addr_part = push_str8f(scratch.arena, "%s%016I64X ", dbgi != &dbgi_parse_nil ? " " : "", params.vaddr+off);
|
||||
}
|
||||
String8 code_bytes_part = {0};
|
||||
if(style_flags & DASM_StyleFlag_CodeBytes)
|
||||
if(params.style_flags & DASM_StyleFlag_CodeBytes)
|
||||
{
|
||||
String8List code_bytes_strings = {0};
|
||||
str8_list_push(scratch.arena, &code_bytes_strings, str8_lit("{"));
|
||||
@@ -464,7 +538,24 @@ dasm_parse_thread__entry_point(void *p)
|
||||
str8_list_push(scratch.arena, &code_bytes_strings, str8_lit(" "));
|
||||
code_bytes_part = str8_list_join(scratch.arena, &code_bytes_strings, 0);
|
||||
}
|
||||
String8 inst_string = push_str8f(scratch.arena, "%S%S%s", addr_part, code_bytes_part, udc.asm_buf);
|
||||
String8 symbol_part = {0};
|
||||
if(jump_dst_vaddr != 0 && dbgi != &dbgi_parse_nil && params.style_flags & DASM_StyleFlag_SymbolNames)
|
||||
{
|
||||
RDI_U32 scope_idx = rdi_vmap_idx_from_voff(rdi->scope_vmap, rdi->scope_vmap_count, jump_dst_vaddr-params.base_vaddr);
|
||||
if(scope_idx != 0)
|
||||
{
|
||||
RDI_Scope *scope = rdi_element_from_idx(rdi, scopes, scope_idx);
|
||||
RDI_U32 procedure_idx = scope->proc_idx;
|
||||
RDI_Procedure *procedure = rdi_element_from_idx(rdi, procedures, procedure_idx);
|
||||
String8 procedure_name = {0};
|
||||
procedure_name.str = rdi_string_from_idx(rdi, procedure->name_string_idx, &procedure_name.size);
|
||||
if(procedure_name.size != 0)
|
||||
{
|
||||
symbol_part = push_str8f(scratch.arena, " (%S)", procedure_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
String8 inst_string = push_str8f(scratch.arena, "%S%S%s%S", addr_part, code_bytes_part, udc.asm_buf, symbol_part);
|
||||
DASM_Inst inst = {off, rel_voff, r1u64(inst_strings.total_size + inst_strings.node_count,
|
||||
inst_strings.total_size + inst_strings.node_count + inst_string.size)};
|
||||
dasm_inst_chunk_list_push(scratch.arena, &inst_list, 1024, &inst);
|
||||
@@ -495,10 +586,11 @@ dasm_parse_thread__entry_point(void *p)
|
||||
{
|
||||
hash.u64[0],
|
||||
hash.u64[1],
|
||||
addr,
|
||||
(U64)arch,
|
||||
(U64)style_flags,
|
||||
(U64)syntax,
|
||||
params.vaddr,
|
||||
(U64)params.arch,
|
||||
(U64)params.style_flags,
|
||||
(U64)params.syntax,
|
||||
(U64)dbgi,
|
||||
0x4d534144,
|
||||
};
|
||||
text_key = hs_hash_from_data(str8((U8 *)hash_data, sizeof(hash_data)));
|
||||
@@ -518,14 +610,18 @@ dasm_parse_thread__entry_point(void *p)
|
||||
{
|
||||
for(DASM_Node *n = slot->first; n != 0; n = n->next)
|
||||
{
|
||||
if(u128_match(n->hash, hash) &&
|
||||
addr == n->addr &&
|
||||
arch == n->arch &&
|
||||
style_flags == n->style_flags &&
|
||||
syntax == n->syntax)
|
||||
if(u128_match(n->hash, hash) && dasm_params_match(&n->params, ¶ms))
|
||||
{
|
||||
n->info_arena = info_arena;
|
||||
MemoryCopyStruct(&n->info, &info);
|
||||
if(dbgi != &dbgi_parse_nil && params.style_flags & (DASM_StyleFlag_SourceLines|DASM_StyleFlag_SourceFilesNames))
|
||||
{
|
||||
n->change_gen = change_gen;
|
||||
}
|
||||
else
|
||||
{
|
||||
n->change_gen = 0;
|
||||
}
|
||||
ins_atomic_u32_eval_assign(&n->is_working, 0);
|
||||
ins_atomic_u64_inc_eval(&n->load_count);
|
||||
break;
|
||||
@@ -533,24 +629,29 @@ dasm_parse_thread__entry_point(void *p)
|
||||
}
|
||||
}
|
||||
|
||||
txt_scope_close(txt_scope);
|
||||
dbgi_scope_close(dbgi_scope);
|
||||
hs_scope_close(hs_scope);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evictor Threads
|
||||
//~ rjf: Evictor/Detector Thread
|
||||
|
||||
internal void
|
||||
dasm_evictor_thread__entry_point(void *p)
|
||||
dasm_evictor_detector_thread__entry_point(void *p)
|
||||
{
|
||||
ThreadNameF("[dasm] evictor thread");
|
||||
ThreadNameF("[dasm] evictor/detector thread");
|
||||
for(;;)
|
||||
{
|
||||
U64 change_gen = fs_change_gen();
|
||||
U64 check_time_us = os_now_microseconds();
|
||||
U64 check_time_user_clocks = dasm_user_clock_idx();
|
||||
U64 evict_threshold_us = 10*1000000;
|
||||
U64 retry_threshold_us = 1*1000000;
|
||||
U64 evict_threshold_user_clocks = 10;
|
||||
U64 retry_threshold_user_clocks = 10;
|
||||
for(U64 slot_idx = 0; slot_idx < dasm_shared->slots_count; slot_idx += 1)
|
||||
{
|
||||
U64 stripe_idx = slot_idx%dasm_shared->stripes_count;
|
||||
@@ -570,6 +671,13 @@ dasm_evictor_thread__entry_point(void *p)
|
||||
slot_has_work = 1;
|
||||
break;
|
||||
}
|
||||
if(n->change_gen != 0 && n->change_gen != change_gen &&
|
||||
n->last_time_requested_us+retry_threshold_us <= check_time_us &&
|
||||
n->last_user_clock_idx_requested+retry_threshold_user_clocks <= check_time_user_clocks)
|
||||
{
|
||||
slot_has_work = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(slot_has_work) OS_MutexScopeW(stripe->rw_mutex)
|
||||
@@ -590,10 +698,19 @@ dasm_evictor_thread__entry_point(void *p)
|
||||
}
|
||||
SLLStackPush(stripe->free_node, n);
|
||||
}
|
||||
if(n->change_gen != 0 && n->change_gen != change_gen &&
|
||||
n->last_time_requested_us+retry_threshold_us <= check_time_us &&
|
||||
n->last_user_clock_idx_requested+retry_threshold_user_clocks <= check_time_user_clocks)
|
||||
{
|
||||
if(dasm_u2p_enqueue_req(n->hash, &n->params, max_U64))
|
||||
{
|
||||
n->last_time_requested_us = os_now_microseconds();
|
||||
n->last_user_clock_idx_requested = check_time_user_clocks;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
os_sleep_milliseconds(5);
|
||||
}
|
||||
os_sleep_milliseconds(1000);
|
||||
os_sleep_milliseconds(100);
|
||||
}
|
||||
}
|
||||
|
||||
+40
-20
@@ -10,8 +10,11 @@
|
||||
typedef U32 DASM_StyleFlags;
|
||||
enum
|
||||
{
|
||||
DASM_StyleFlag_Addresses = (1<<0),
|
||||
DASM_StyleFlag_CodeBytes = (1<<1),
|
||||
DASM_StyleFlag_Addresses = (1<<0),
|
||||
DASM_StyleFlag_CodeBytes = (1<<1),
|
||||
DASM_StyleFlag_SourceFilesNames = (1<<2),
|
||||
DASM_StyleFlag_SourceLines = (1<<3),
|
||||
DASM_StyleFlag_SymbolNames = (1<<4),
|
||||
};
|
||||
|
||||
typedef enum DASM_Syntax
|
||||
@@ -22,6 +25,20 @@ typedef enum DASM_Syntax
|
||||
}
|
||||
DASM_Syntax;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Disassembling Parameters Bundle
|
||||
|
||||
typedef struct DASM_Params DASM_Params;
|
||||
struct DASM_Params
|
||||
{
|
||||
U64 vaddr;
|
||||
Architecture arch;
|
||||
DASM_StyleFlags style_flags;
|
||||
DASM_Syntax syntax;
|
||||
U64 base_vaddr;
|
||||
String8 exe_path;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Instruction Types
|
||||
|
||||
@@ -80,10 +97,10 @@ struct DASM_Node
|
||||
|
||||
// rjf: key
|
||||
U128 hash;
|
||||
U64 addr;
|
||||
Architecture arch;
|
||||
DASM_StyleFlags style_flags;
|
||||
DASM_Syntax syntax;
|
||||
DASM_Params params;
|
||||
|
||||
// rjf: generations
|
||||
U64 change_gen;
|
||||
|
||||
// rjf: value
|
||||
Arena *info_arena;
|
||||
@@ -95,6 +112,8 @@ struct DASM_Node
|
||||
U64 last_time_touched_us;
|
||||
U64 last_user_clock_idx_touched;
|
||||
U64 load_count;
|
||||
U64 last_time_requested_us;
|
||||
U64 last_user_clock_idx_requested;
|
||||
};
|
||||
|
||||
typedef struct DASM_Slot DASM_Slot;
|
||||
@@ -121,10 +140,7 @@ struct DASM_Touch
|
||||
{
|
||||
DASM_Touch *next;
|
||||
U128 hash;
|
||||
U64 addr;
|
||||
Architecture arch;
|
||||
DASM_StyleFlags style_flags;
|
||||
DASM_Syntax syntax;
|
||||
DASM_Params params;
|
||||
};
|
||||
|
||||
typedef struct DASM_Scope DASM_Scope;
|
||||
@@ -132,6 +148,7 @@ struct DASM_Scope
|
||||
{
|
||||
DASM_Scope *next;
|
||||
DASM_Touch *top_touch;
|
||||
U64 base_pos;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -141,8 +158,6 @@ typedef struct DASM_TCTX DASM_TCTX;
|
||||
struct DASM_TCTX
|
||||
{
|
||||
Arena *arena;
|
||||
DASM_Scope *free_scope;
|
||||
DASM_Touch *free_touch;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -174,8 +189,8 @@ struct DASM_Shared
|
||||
U64 parse_thread_count;
|
||||
OS_Handle *parse_threads;
|
||||
|
||||
// rjf: evictor thread
|
||||
OS_Handle evictor_thread;
|
||||
// rjf: evictor/detector thread
|
||||
OS_Handle evictor_detector_thread;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -184,6 +199,11 @@ struct DASM_Shared
|
||||
thread_static DASM_TCTX *dasm_tctx = 0;
|
||||
global DASM_Shared *dasm_shared = 0;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Parameter Type Functions
|
||||
|
||||
internal B32 dasm_params_match(DASM_Params *a, DASM_Params *b);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Instruction Type Functions
|
||||
|
||||
@@ -213,19 +233,19 @@ internal void dasm_scope_touch_node__stripe_r_guarded(DASM_Scope *scope, DASM_No
|
||||
////////////////////////////////
|
||||
//~ rjf: Cache Lookups
|
||||
|
||||
internal DASM_Info dasm_info_from_hash_addr_arch_style(DASM_Scope *scope, U128 hash, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax);
|
||||
internal DASM_Info dasm_info_from_key_addr_arch_style(DASM_Scope *scope, U128 key, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax, U128 *hash_out);
|
||||
internal DASM_Info dasm_info_from_hash_params(DASM_Scope *scope, U128 hash, DASM_Params *params);
|
||||
internal DASM_Info dasm_info_from_key_params(DASM_Scope *scope, U128 key, DASM_Params *params, U128 *hash_out);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Parse Threads
|
||||
|
||||
internal B32 dasm_u2p_enqueue_req(U128 hash, U64 addr, Architecture arch, DASM_StyleFlags style_flags, DASM_Syntax syntax, U64 endt_us);
|
||||
internal void dasm_u2p_dequeue_req(U128 *hash_out, U64 *addr_out, Architecture *arch_out, DASM_StyleFlags *style_flags_out, DASM_Syntax *syntax_out);
|
||||
internal B32 dasm_u2p_enqueue_req(U128 hash, DASM_Params *params, U64 endt_us);
|
||||
internal void dasm_u2p_dequeue_req(Arena *arena, U128 *hash_out, DASM_Params *params_out);
|
||||
internal void dasm_parse_thread__entry_point(void *p);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evictor Threads
|
||||
//~ rjf: Evictor/Detector Thread
|
||||
|
||||
internal void dasm_evictor_thread__entry_point(void *p);
|
||||
internal void dasm_evictor_detector_thread__entry_point(void *p);
|
||||
|
||||
#endif // DASM_CACHE_H
|
||||
|
||||
+74
-6
@@ -859,6 +859,13 @@ dbgi_parse_thread_entry_point(void *p)
|
||||
os_file_close(file);
|
||||
}
|
||||
|
||||
//- rjf: heuristically choose compression settings
|
||||
B32 should_compress = 0;
|
||||
if(og_dbg_props.size > MB(64))
|
||||
{
|
||||
should_compress = 1;
|
||||
}
|
||||
|
||||
//- rjf: raddbg file not up-to-date? we need to generate it
|
||||
if(do_task)
|
||||
{
|
||||
@@ -883,6 +890,10 @@ dbgi_parse_thread_entry_point(void *p)
|
||||
str8_list_pushf(scratch.arena, &opts.cmd_line, "raddbg");
|
||||
str8_list_pushf(scratch.arena, &opts.cmd_line, "--convert");
|
||||
str8_list_pushf(scratch.arena, &opts.cmd_line, "--quiet");
|
||||
if(should_compress)
|
||||
{
|
||||
str8_list_pushf(scratch.arena, &opts.cmd_line, "--compress");
|
||||
}
|
||||
//str8_list_pushf(scratch.arena, &opts.cmd_line, "--capture");
|
||||
str8_list_pushf(scratch.arena, &opts.cmd_line, "--exe:%S", exe_path);
|
||||
str8_list_pushf(scratch.arena, &opts.cmd_line, "--pdb:%S", og_dbg_path);
|
||||
@@ -1020,15 +1031,72 @@ dbgi_parse_thread_entry_point(void *p)
|
||||
do_task = 0;
|
||||
}
|
||||
|
||||
//- rjf: parse raddbg info
|
||||
RDI_Parsed rdi_parsed = dbgi_parse_nil.rdi;
|
||||
U64 arch_addr_size = 8;
|
||||
//- rjf: initial parse of raddbg info
|
||||
RDI_Parsed rdi_parsed_maybe_compressed = dbgi_parse_nil.rdi;
|
||||
if(do_task)
|
||||
{
|
||||
RDI_ParseStatus parse_status = rdi_parse((U8 *)raddbgi_file_base, raddbgi_file_props.size, &rdi_parsed);
|
||||
if(rdi_parsed.top_level_info != 0)
|
||||
RDI_ParseStatus parse_status = rdi_parse((U8 *)raddbgi_file_base, raddbgi_file_props.size, &rdi_parsed_maybe_compressed);
|
||||
(void)parse_status;
|
||||
}
|
||||
|
||||
//- rjf: decompress, if necessary
|
||||
RDI_Parsed rdi_parsed = rdi_parsed_maybe_compressed;
|
||||
if(do_task)
|
||||
{
|
||||
U64 decompressed_size = raddbgi_file_props.size;
|
||||
for(U64 dsec_idx = 0; dsec_idx < rdi_parsed_maybe_compressed.dsec_count; dsec_idx += 1)
|
||||
{
|
||||
arch_addr_size = rdi_addr_size_from_arch(rdi_parsed.top_level_info->architecture);
|
||||
decompressed_size += (rdi_parsed_maybe_compressed.dsecs[dsec_idx].unpacked_size - rdi_parsed_maybe_compressed.dsecs[dsec_idx].encoded_size);
|
||||
}
|
||||
if(decompressed_size > raddbgi_file_props.size)
|
||||
{
|
||||
U8 *decompressed_data = push_array_no_zero(parse_arena, U8, decompressed_size);
|
||||
|
||||
// rjf: copy header
|
||||
RDI_Header *src_header = (RDI_Header *)raddbgi_file_base;
|
||||
RDI_Header *dst_header = (RDI_Header *)decompressed_data;
|
||||
{
|
||||
MemoryCopy(dst_header, src_header, sizeof(RDI_Header));
|
||||
}
|
||||
|
||||
// rjf: copy & adjust sections for decompressed version
|
||||
if(rdi_parsed_maybe_compressed.dsec_count != 0)
|
||||
{
|
||||
RDI_DataSection *dsec_base = (RDI_DataSection *)(decompressed_data + dst_header->data_section_off);
|
||||
MemoryCopy(dsec_base, (U8 *)raddbgi_file_base + src_header->data_section_off, sizeof(RDI_DataSection) * rdi_parsed_maybe_compressed.dsec_count);
|
||||
U64 off = dst_header->data_section_off + sizeof(RDI_DataSection) * rdi_parsed_maybe_compressed.dsec_count;
|
||||
off += 7;
|
||||
off -= off%8;
|
||||
for(U64 idx = 0; idx < rdi_parsed_maybe_compressed.dsec_count; idx += 1)
|
||||
{
|
||||
dsec_base[idx].encoding = RDI_DataSectionEncoding_Unpacked;
|
||||
dsec_base[idx].off = off;
|
||||
dsec_base[idx].encoded_size = dsec_base[idx].unpacked_size;
|
||||
off += dsec_base[idx].unpacked_size;
|
||||
off += 7;
|
||||
off -= off%8;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: decompress sections into new decompressed file buffer
|
||||
if(rdi_parsed_maybe_compressed.dsec_count != 0)
|
||||
{
|
||||
RDI_DataSection *src_first = rdi_parsed_maybe_compressed.dsecs;
|
||||
RDI_DataSection *dst_first = (RDI_DataSection *)(decompressed_data + dst_header->data_section_off);
|
||||
RDI_DataSection *src_opl = src_first + rdi_parsed_maybe_compressed.dsec_count;
|
||||
RDI_DataSection *dst_opl = dst_first + rdi_parsed_maybe_compressed.dsec_count;
|
||||
for(RDI_DataSection *src = src_first, *dst = dst_first;
|
||||
src < src_opl && dst < dst_opl;
|
||||
src += 1, dst += 1)
|
||||
{
|
||||
rr_lzb_simple_decode((U8*)raddbgi_file_base + src->off, src->encoded_size,
|
||||
decompressed_data + dst->off, dst->unpacked_size);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: re-parse
|
||||
RDI_ParseStatus parse_status = rdi_parse(decompressed_data, decompressed_size, &rdi_parsed);
|
||||
(void)parse_status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Generated Code
|
||||
|
||||
#include "generated/demon.meta.c"
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Type Functions (Helpers, Implemented Once)
|
||||
|
||||
|
||||
@@ -61,6 +61,11 @@ DMN_ExceptionKindTable:
|
||||
COUNT
|
||||
}
|
||||
|
||||
@data(String8) dmn_event_kind_string_table:
|
||||
{
|
||||
@expand(DMN_EventKindTable a) `str8_lit_comp("$(a.name)")`
|
||||
}
|
||||
|
||||
@enum DMN_ErrorKind:
|
||||
{
|
||||
@expand(DMN_ErrorKindTable a) `$(a.name)`,
|
||||
@@ -78,3 +83,8 @@ DMN_ExceptionKindTable:
|
||||
@expand(DMN_ExceptionKindTable a) `$(a.name)`,
|
||||
COUNT
|
||||
}
|
||||
|
||||
@data(String8) dmn_exception_kind_string_table:
|
||||
{
|
||||
@expand(DMN_ExceptionKindTable a) `str8_lit_comp("$(a.name)")`
|
||||
}
|
||||
|
||||
@@ -4,5 +4,35 @@
|
||||
//- GENERATED CODE
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
String8 dmn_event_kind_string_table[17] =
|
||||
{
|
||||
str8_lit_comp("Null"),
|
||||
str8_lit_comp("Error"),
|
||||
str8_lit_comp("HandshakeComplete"),
|
||||
str8_lit_comp("CreateProcess"),
|
||||
str8_lit_comp("ExitProcess"),
|
||||
str8_lit_comp("CreateThread"),
|
||||
str8_lit_comp("ExitThread"),
|
||||
str8_lit_comp("LoadModule"),
|
||||
str8_lit_comp("UnloadModule"),
|
||||
str8_lit_comp("Breakpoint"),
|
||||
str8_lit_comp("Trap"),
|
||||
str8_lit_comp("SingleStep"),
|
||||
str8_lit_comp("Exception"),
|
||||
str8_lit_comp("Halt"),
|
||||
str8_lit_comp("Memory"),
|
||||
str8_lit_comp("DebugString"),
|
||||
str8_lit_comp("SetThreadName"),
|
||||
};
|
||||
|
||||
String8 dmn_exception_kind_string_table[5] =
|
||||
{
|
||||
str8_lit_comp("Null"),
|
||||
str8_lit_comp("MemoryRead"),
|
||||
str8_lit_comp("MemoryWrite"),
|
||||
str8_lit_comp("MemoryExecute"),
|
||||
str8_lit_comp("CppThrow"),
|
||||
};
|
||||
|
||||
C_LINKAGE_END
|
||||
|
||||
|
||||
@@ -58,6 +58,8 @@ DMN_ExceptionKind_COUNT,
|
||||
} DMN_ExceptionKind;
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 dmn_event_kind_string_table[17];
|
||||
extern String8 dmn_exception_kind_string_table[5];
|
||||
C_LINKAGE_END
|
||||
|
||||
#endif // DEMON_META_H
|
||||
|
||||
@@ -2114,7 +2114,7 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
|
||||
U64 total_string_size = 0;
|
||||
for(;total_string_size < KB(4);)
|
||||
{
|
||||
U8 *buffer = push_array_no_zero(scratch.arena, U8, 256);
|
||||
U8 *buffer = push_array(scratch.arena, U8, 256);
|
||||
B32 good_read = dmn_w32_process_read(process->handle, r1u64(read_addr, read_addr+256), buffer);
|
||||
if(good_read)
|
||||
{
|
||||
@@ -2136,6 +2136,10 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
e->kind = DMN_EventKind_SetThreadName;
|
||||
|
||||
+183
-9
@@ -1798,6 +1798,9 @@ df_entity_alloc(DF_StateDeltaHistory *hist, DF_Entity *parent, DF_EntityKind kin
|
||||
df_state->kind_alloc_gens[kind] += 1;
|
||||
df_entity_notify_mutation(entity);
|
||||
|
||||
// rjf: log
|
||||
log_msgf("new entity: %S $%I64d\n", df_g_entity_kind_display_string_table[kind], entity->id);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -1841,6 +1844,7 @@ df_entity_release(DF_StateDeltaHistory *hist, DF_Entity *entity)
|
||||
t->e = child;
|
||||
SLLQueuePush(first_task, last_task, t);
|
||||
}
|
||||
log_msgf("end entity: %S $%I64d\n", df_g_entity_kind_display_string_table[task->e->kind], task->e->id);
|
||||
df_state_delta_history_push_struct_delta(hist, &task->e->first);
|
||||
df_state_delta_history_push_struct_delta(hist, &task->e->last);
|
||||
df_state_delta_history_push_struct_delta(hist, &task->e->next);
|
||||
@@ -5025,6 +5029,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
//
|
||||
TG_Key eval_type_key = tg_unwrapped_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, eval.type_key);
|
||||
TG_Kind eval_type_kind = tg_kind_from_key(eval_type_key);
|
||||
String8 eval_string = push_str8_copy(arena, string);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: make and push block for root
|
||||
@@ -5033,7 +5038,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *block = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Root, parent_key, key, depth);
|
||||
block->eval = eval;
|
||||
block->cfg_table = *cfg_table;
|
||||
block->string = push_str8_copy(arena, string);
|
||||
block->string = eval_string;
|
||||
block->visual_idx_range = r1u64(key.child_num-1, key.child_num+0);
|
||||
block->semantic_idx_range = r1u64(key.child_num-1, key.child_num+0);
|
||||
if(opt_member != 0)
|
||||
@@ -5156,7 +5161,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
expand_view_rule_cfg != &df_g_nil_cfg_val)
|
||||
ProfScope("build viz blocks for lens")
|
||||
{
|
||||
expand_view_rule_spec->info.viz_block_prod(arena, scope, ctrl_ctx, parse_ctx, macro_map, eval_view, eval, cfg_table, parent_key, key, depth+1, expand_view_rule_cfg->last, list_out);
|
||||
expand_view_rule_spec->info.viz_block_prod(arena, scope, ctrl_ctx, parse_ctx, macro_map, eval_view, eval, string, cfg_table, parent_key, key, depth+1, expand_view_rule_cfg->last, list_out);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
@@ -5176,6 +5181,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Members, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
{
|
||||
last_vb->eval = udt_eval;
|
||||
last_vb->string = eval_string;
|
||||
last_vb->cfg_table = *cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, filtered_data_members.count);
|
||||
}
|
||||
@@ -5231,6 +5237,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_EnumMembers, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
{
|
||||
last_vb->eval = udt_eval;
|
||||
last_vb->string = eval_string;
|
||||
last_vb->cfg_table = *cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, type->count);
|
||||
}
|
||||
@@ -5287,6 +5294,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Links, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
{
|
||||
last_vb->eval = udt_eval;
|
||||
last_vb->string = eval_string;
|
||||
last_vb->cfg_table = *cfg_table;
|
||||
last_vb->link_member_type_key = link_member->type_key;
|
||||
last_vb->link_member_off = link_member->off;
|
||||
@@ -5350,6 +5358,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Elements, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
{
|
||||
last_vb->eval = arr_eval;
|
||||
last_vb->string = eval_string;
|
||||
last_vb->cfg_table = *cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, array_count);
|
||||
}
|
||||
@@ -5411,10 +5420,11 @@ df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DBGI_Scope *scope,
|
||||
{
|
||||
DF_Eval eval = df_eval_from_string(arena, scope, ctrl_ctx, parse_ctx, macro_map, expr);
|
||||
U64 expr_comma_pos = str8_find_needle(expr, 0, str8_lit(","), 0);
|
||||
U64 passthrough_pos = str8_find_needle(expr, 0, str8_lit("--"), 0);
|
||||
String8List default_view_rules = {0};
|
||||
if(expr_comma_pos < expr.size)
|
||||
if(expr_comma_pos < expr.size && expr_comma_pos < passthrough_pos)
|
||||
{
|
||||
String8 expr_extension = str8_skip(expr, expr_comma_pos+1);
|
||||
String8 expr_extension = str8_substr(expr, r1u64(expr_comma_pos+1, passthrough_pos));
|
||||
expr_extension = str8_skip_chop_whitespace(expr_extension);
|
||||
if(str8_match(expr_extension, str8_lit("x"), StringMatchFlag_CaseInsensitive))
|
||||
{
|
||||
@@ -5428,11 +5438,19 @@ df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DBGI_Scope *scope,
|
||||
{
|
||||
str8_list_pushf(arena, &default_view_rules, "oct");
|
||||
}
|
||||
else
|
||||
else if(expr_extension.size != 0)
|
||||
{
|
||||
str8_list_pushf(arena, &default_view_rules, "array:{%S}", expr_extension);
|
||||
}
|
||||
}
|
||||
if(passthrough_pos < expr.size)
|
||||
{
|
||||
String8 passthrough_view_rule = str8_skip_chop_whitespace(str8_skip(expr, passthrough_pos+2));
|
||||
if(passthrough_view_rule.size != 0)
|
||||
{
|
||||
str8_list_push(arena, &default_view_rules, passthrough_view_rule);
|
||||
}
|
||||
}
|
||||
String8 view_rule_string = df_eval_view_rule_from_key(eval_view, key);
|
||||
DF_CfgTable view_rule_table = {0};
|
||||
for(String8Node *n = default_view_rules.first; n != 0; n = n->next)
|
||||
@@ -5724,7 +5742,7 @@ df_cfg_escaped_from_raw_string(Arena *arena, String8 string)
|
||||
for(U64 idx = 0; idx <= string.size; idx += 1)
|
||||
{
|
||||
U8 byte = (idx < string.size ? string.str[idx] : 0);
|
||||
if(byte == 0 || byte == '\"')
|
||||
if(byte == 0 || byte == '\"' || byte == '\\')
|
||||
{
|
||||
String8 part = str8_substr(string, r1u64(split_start_idx, idx));
|
||||
str8_list_push(scratch.arena, &parts, part);
|
||||
@@ -5732,6 +5750,7 @@ df_cfg_escaped_from_raw_string(Arena *arena, String8 string)
|
||||
{
|
||||
default:{}break;
|
||||
case '\"':{str8_list_push(scratch.arena, &parts, str8_lit("\\\""));}break;
|
||||
case '\\':{str8_list_push(scratch.arena, &parts, str8_lit("\\\\"));}break;
|
||||
}
|
||||
split_start_idx = idx+1;
|
||||
}
|
||||
@@ -5761,7 +5780,8 @@ df_cfg_raw_from_escaped_string(Arena *arena, String8 string)
|
||||
switch(string.str[idx+1])
|
||||
{
|
||||
default:{}break;
|
||||
case '"':{extra_advance = 1; str8_list_push(scratch.arena, &parts, str8_lit("\""));}break;
|
||||
case '"': {extra_advance = 1; str8_list_push(scratch.arena, &parts, str8_lit("\""));}break;
|
||||
case '\\':{extra_advance = 1; str8_list_push(scratch.arena, &parts, str8_lit("\\"));}break;
|
||||
}
|
||||
}
|
||||
split_start_idx = idx+1+extra_advance;
|
||||
@@ -5863,6 +5883,35 @@ df_cfg_strings_from_core(Arena *arena, String8 root_path, DF_CfgSrc source)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: write auto view rules
|
||||
{
|
||||
B32 first = 1;
|
||||
DF_EntityList avrs = df_query_cached_entity_list_with_kind(DF_EntityKind_AutoViewRule);
|
||||
for(DF_EntityNode *n = avrs.first; n != 0; n = n->next)
|
||||
{
|
||||
DF_Entity *map = n->entity;
|
||||
if(map->cfg_src == source)
|
||||
{
|
||||
if(first)
|
||||
{
|
||||
first = 0;
|
||||
str8_list_push(arena, &strs, str8_lit("/// auto view rules ///////////////////////////////////////////////////////////\n"));
|
||||
str8_list_push(arena, &strs, str8_lit("\n"));
|
||||
}
|
||||
String8 type = df_entity_child_from_kind(map, DF_EntityKind_Source)->name;
|
||||
String8 view_rule = df_entity_child_from_kind(map, DF_EntityKind_Dest)->name;
|
||||
type = df_cfg_escaped_from_raw_string(arena, type);
|
||||
view_rule= df_cfg_escaped_from_raw_string(arena, view_rule);
|
||||
str8_list_push (arena, &strs, str8_lit("auto_view_rule:\n"));
|
||||
str8_list_push (arena, &strs, str8_lit("{\n"));
|
||||
str8_list_pushf(arena, &strs, " type: \"%S\"\n", type);
|
||||
str8_list_pushf(arena, &strs, " view_rule: \"%S\"\n", view_rule);
|
||||
str8_list_push (arena, &strs, str8_lit("}\n"));
|
||||
str8_list_push (arena, &strs, str8_lit("\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: write breakpoints
|
||||
{
|
||||
B32 first = 1;
|
||||
@@ -6404,6 +6453,47 @@ df_query_cached_member_map_from_binary_voff(DF_Entity *binary, U64 voff)
|
||||
internal void
|
||||
df_push_cmd__root(DF_CmdParams *params, DF_CmdSpec *spec)
|
||||
{
|
||||
// rjf: log
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_Entity *entity = df_entity_from_handle(params->entity);
|
||||
log_msgf("debug frontend command pushed: \"%S\"\n", spec->info.string);
|
||||
#define HandleParamPrint(mem_name) if(!df_handle_match(df_handle_zero(), params->mem_name)) { log_msgf("| %s: [0x%I64x, 0x%I64x]\n", #mem_name, params->mem_name.u64[0], params->mem_name.u64[1]); }
|
||||
HandleParamPrint(window);
|
||||
HandleParamPrint(panel);
|
||||
HandleParamPrint(dest_panel);
|
||||
HandleParamPrint(prev_view);
|
||||
HandleParamPrint(view);
|
||||
if(!df_entity_is_nil(entity))
|
||||
{
|
||||
String8 entity_name = df_display_string_from_entity(scratch.arena, entity);
|
||||
log_msgf("| entity: \"%S\"\n", entity_name);
|
||||
}
|
||||
U64 idx = 0;
|
||||
for(DF_HandleNode *n = params->entity_list.first; n != 0; n = n->next, idx += 1)
|
||||
{
|
||||
DF_Entity *entity = df_entity_from_handle(n->handle);
|
||||
if(!df_entity_is_nil(entity))
|
||||
{
|
||||
String8 entity_name = df_display_string_from_entity(scratch.arena, entity);
|
||||
log_msgf("| entity_list[%I64u]: \"%S\"\n", idx, entity_name);
|
||||
}
|
||||
}
|
||||
if(!df_cmd_spec_is_nil(params->cmd_spec))
|
||||
{
|
||||
log_msgf("| cmd_spec: \"%S\"\n", params->cmd_spec->info.string);
|
||||
}
|
||||
if(params->string.size != 0) { log_msgf("| string: \"%S\"\n", params->string); }
|
||||
if(params->file_path.size != 0) { log_msgf("| file_path: \"%S\"\n", params->file_path); }
|
||||
if(params->text_point.line != 0){ log_msgf("| text_point: [line:%I64d, col:%I64d]\n", params->text_point.line, params->text_point.column); }
|
||||
if(params->vaddr != 0) { log_msgf("| vaddr: 0x%I64x\n", params->vaddr); }
|
||||
if(params->voff != 0) { log_msgf("| voff: 0x%I64x\n", params->voff); }
|
||||
if(params->index != 0) { log_msgf("| index: 0x%I64x\n", params->index); }
|
||||
if(params->id != 0) { log_msgf("| id: 0x%I64x\n", params->id); }
|
||||
#undef HandleParamPrint
|
||||
log_msgf("--------------------------------\n");
|
||||
scratch_end(scratch);
|
||||
}
|
||||
df_cmd_list_push(df_state->root_cmd_arena, &df_state->root_cmds, params, spec);
|
||||
}
|
||||
|
||||
@@ -6577,6 +6667,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
|
||||
df_state->time_in_seconds += dt;
|
||||
|
||||
//- rjf: sync with ctrl thread
|
||||
ProfScope("sync with ctrl thread")
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
@@ -6987,6 +7078,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
|
||||
}
|
||||
|
||||
//- rjf: sync with dbgi parsers
|
||||
ProfScope("sync with dbgi parsers")
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
DBGI_EventList events = dbgi_p2u_pop_events(scratch.arena, 0);
|
||||
@@ -7021,6 +7113,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
|
||||
}
|
||||
|
||||
//- rjf: start/stop telemetry captures
|
||||
ProfScope("start/stop telemetry captures")
|
||||
{
|
||||
if(!ProfIsCapturing() && DEV_telemetry_capture)
|
||||
{
|
||||
@@ -7051,6 +7144,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
|
||||
}
|
||||
|
||||
//- rjf: process top-level commands
|
||||
ProfScope("process top-level commands")
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
for(DF_CmdNode *cmd_node = cmds->first;
|
||||
@@ -7874,6 +7968,29 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: apply auto view rules
|
||||
DF_CfgVal *avrs = df_cfg_val_from_string(table, str8_lit("auto_view_rule"));
|
||||
for(DF_CfgNode *map = avrs->first;
|
||||
map != &df_g_nil_cfg_node;
|
||||
map = map->next)
|
||||
{
|
||||
if(map->source == src)
|
||||
{
|
||||
DF_CfgNode *src_cfg = df_cfg_node_child_from_string(map, str8_lit("type"), StringMatchFlag_CaseInsensitive);
|
||||
DF_CfgNode *dst_cfg = df_cfg_node_child_from_string(map, str8_lit("view_rule"), StringMatchFlag_CaseInsensitive);
|
||||
String8 type = src_cfg->first->string;
|
||||
String8 view_rule = dst_cfg->first->string;
|
||||
type = df_cfg_raw_from_escaped_string(scratch.arena, type);
|
||||
view_rule = df_cfg_raw_from_escaped_string(scratch.arena, view_rule);
|
||||
DF_Entity *map_entity = df_entity_alloc(0, df_entity_root(), DF_EntityKind_AutoViewRule);
|
||||
DF_Entity *src_entity = df_entity_alloc(0, map_entity, DF_EntityKind_Source);
|
||||
DF_Entity *dst_entity = df_entity_alloc(0, map_entity, DF_EntityKind_Dest);
|
||||
df_entity_equip_name(0, src_entity, type);
|
||||
df_entity_equip_name(0, dst_entity, view_rule);
|
||||
df_entity_equip_cfg_src(map_entity, src);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: apply breakpoints
|
||||
DF_CfgVal *bps = df_cfg_val_from_string(table, str8_lit("breakpoint"));
|
||||
for(DF_CfgNode *bp = bps->first;
|
||||
@@ -7970,9 +8087,9 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
|
||||
{
|
||||
df_entity_equip_color_hsva(bp_ent, hsva);
|
||||
}
|
||||
if(cond_cfg->string.size != 0)
|
||||
if(cond_cfg->first->string.size != 0)
|
||||
{
|
||||
String8 cond_raw = df_cfg_raw_from_escaped_string(scratch.arena, cond_cfg->string);
|
||||
String8 cond_raw = df_cfg_raw_from_escaped_string(scratch.arena, cond_cfg->first->string);
|
||||
DF_Entity *cond = df_entity_alloc(0, bp_ent, DF_EntityKind_Condition);
|
||||
df_entity_equip_name(0, cond, cond_raw);
|
||||
}
|
||||
@@ -8210,6 +8327,63 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: auto view rules
|
||||
case DF_CoreCmdKind_SetAutoViewRuleType:
|
||||
case DF_CoreCmdKind_SetAutoViewRuleViewRule:
|
||||
{
|
||||
DF_Entity *map = df_entity_from_handle(params.entity);
|
||||
if(df_entity_is_nil(map))
|
||||
{
|
||||
map = df_entity_alloc(df_state_delta_history(), df_entity_root(), DF_EntityKind_AutoViewRule);
|
||||
df_entity_equip_cfg_src(map, DF_CfgSrc_Profile);
|
||||
}
|
||||
DF_Entity *src = df_entity_child_from_kind(map, DF_EntityKind_Source);
|
||||
if(df_entity_is_nil(src))
|
||||
{
|
||||
src = df_entity_alloc(df_state_delta_history(), map, DF_EntityKind_Source);
|
||||
}
|
||||
DF_Entity *dst = df_entity_child_from_kind(map, DF_EntityKind_Dest);
|
||||
if(df_entity_is_nil(dst))
|
||||
{
|
||||
dst = df_entity_alloc(df_state_delta_history(), map, DF_EntityKind_Dest);
|
||||
}
|
||||
if(map->kind == DF_EntityKind_AutoViewRule)
|
||||
{
|
||||
DF_Entity *edit_child = (core_cmd_kind == DF_CoreCmdKind_SetAutoViewRuleType ? src : dst);
|
||||
df_entity_equip_name(df_state_delta_history(), edit_child, params.string);
|
||||
}
|
||||
if(src->name.size == 0 && dst->name.size == 0)
|
||||
{
|
||||
df_entity_mark_for_deletion(map);
|
||||
}
|
||||
{
|
||||
DF_AutoViewRuleMapCache *cache = &df_state->auto_view_rule_cache;
|
||||
if(cache->arena == 0)
|
||||
{
|
||||
cache->arena = arena_alloc();
|
||||
}
|
||||
arena_clear(cache->arena);
|
||||
cache->slots_count = 1024;
|
||||
cache->slots = push_array(cache->arena, DF_AutoViewRuleSlot, cache->slots_count);
|
||||
DF_EntityList maps = df_query_cached_entity_list_with_kind(DF_EntityKind_AutoViewRule);
|
||||
for(DF_EntityNode *n = maps.first; n != 0; n = n->next)
|
||||
{
|
||||
DF_Entity *map = n->entity;
|
||||
DF_Entity *src = df_entity_child_from_kind(map, DF_EntityKind_Source);
|
||||
DF_Entity *dst = df_entity_child_from_kind(map, DF_EntityKind_Dest);
|
||||
String8 type = src->name;
|
||||
String8 view_rule = dst->name;
|
||||
U64 hash = df_hash_from_string(type);
|
||||
U64 slot_idx = hash%cache->slots_count;
|
||||
DF_AutoViewRuleSlot *slot = &cache->slots[slot_idx];
|
||||
DF_AutoViewRuleNode *node = push_array(cache->arena, DF_AutoViewRuleNode, 1);
|
||||
node->type = push_str8_copy(cache->arena, type);
|
||||
node->view_rule = push_str8_copy(cache->arena, view_rule);
|
||||
SLLQueuePush(slot->first, slot->last, node);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: general entity operations
|
||||
case DF_CoreCmdKind_EnableEntity:
|
||||
case DF_CoreCmdKind_EnableBreakpoint:
|
||||
|
||||
+29
-4
@@ -268,7 +268,7 @@ struct DF_Eval
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(name) DF_Eval name(Arena *arena, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, struct DF_CfgVal *val)
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name) df_core_view_rule_eval_resolution__##name
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name))
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_EvalView *eval_view, DF_Eval eval, struct DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, struct DF_CfgNode *cfg, struct DF_EvalVizBlockList *out)
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_EvalView *eval_view, DF_Eval eval, String8 string, struct DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, struct DF_CfgNode *cfg, struct DF_EvalVizBlockList *out)
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name) df_core_view_rule_viz_block_prod__##name
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name))
|
||||
typedef DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CoreViewRuleEvalResolutionHookFunctionType);
|
||||
@@ -774,7 +774,8 @@ struct DF_EvalVizRow
|
||||
DF_Eval eval;
|
||||
|
||||
// rjf: basic visualization contents
|
||||
String8 expr;
|
||||
String8 display_expr;
|
||||
String8 edit_expr;
|
||||
String8 display_value;
|
||||
String8 edit_value;
|
||||
TG_KeyList inherited_type_key_chain;
|
||||
@@ -919,6 +920,31 @@ struct DF_EntityListCache
|
||||
DF_EntityList list;
|
||||
};
|
||||
|
||||
//- rjf: auto view rules hash table cache
|
||||
|
||||
typedef struct DF_AutoViewRuleNode DF_AutoViewRuleNode;
|
||||
struct DF_AutoViewRuleNode
|
||||
{
|
||||
DF_AutoViewRuleNode *next;
|
||||
String8 type;
|
||||
String8 view_rule;
|
||||
};
|
||||
|
||||
typedef struct DF_AutoViewRuleSlot DF_AutoViewRuleSlot;
|
||||
struct DF_AutoViewRuleSlot
|
||||
{
|
||||
DF_AutoViewRuleNode *first;
|
||||
DF_AutoViewRuleNode *last;
|
||||
};
|
||||
|
||||
typedef struct DF_AutoViewRuleMapCache DF_AutoViewRuleMapCache;
|
||||
struct DF_AutoViewRuleMapCache
|
||||
{
|
||||
Arena *arena;
|
||||
U64 slots_count;
|
||||
DF_AutoViewRuleSlot *slots;
|
||||
};
|
||||
|
||||
//- rjf: per-run unwind cache
|
||||
|
||||
typedef struct DF_RunUnwindCacheNode DF_RunUnwindCacheNode;
|
||||
@@ -1116,8 +1142,7 @@ struct DF_State
|
||||
// rjf: entity query caches
|
||||
U64 kind_alloc_gens[DF_EntityKind_COUNT];
|
||||
DF_EntityListCache kind_caches[DF_EntityKind_COUNT];
|
||||
DF_EntityListCache dbg_info_cache;
|
||||
DF_EntityListCache bin_file_cache;
|
||||
DF_AutoViewRuleMapCache auto_view_rule_cache;
|
||||
|
||||
// rjf: per-run caches
|
||||
U64 unwind_cache_reggen_idx;
|
||||
|
||||
@@ -28,6 +28,9 @@ DF_EntityKindTable:
|
||||
{OverrideFileLink override_file_link 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 "Label" FileOutline "Override File Link" }
|
||||
{PendingFileChange pending_file_change 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" FileOutline "Pending File Change" }
|
||||
|
||||
//- rjf: auto view rules
|
||||
{AutoViewRule auto_view_rule 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 "Label" Binoculars "Auto View Rule" }
|
||||
|
||||
//- rjf: diagnostics log
|
||||
{DiagLog diag_log 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "Label" FileOutline "Diagnostics Log" }
|
||||
|
||||
@@ -85,12 +88,14 @@ DF_CmdParamSlotTable:
|
||||
{TextPoint text_point `TxtPt`}
|
||||
{CmdSpec cmd_spec `struct DF_CmdSpec *`}
|
||||
{ViewSpec view_spec `struct DF_ViewSpec *`}
|
||||
{CfgNode cfg_node `struct DF_CfgNode *`}
|
||||
{VirtualAddr vaddr `U64`}
|
||||
{VirtualOff voff `U64`}
|
||||
{Index index `U64`}
|
||||
{ID id `U64`}
|
||||
{PreferDisassembly prefer_dasm `B32`}
|
||||
{ForceConfirm force_confirm `B32`}
|
||||
{Dir2 dir2 `Dir2`}
|
||||
}
|
||||
|
||||
@table(name lister_omit q_slot q_ent_kind q_allow_files q_allow_folders q_keep_oi q_select_oi q_is_code q_required canonical_icon string display_name desc search_tags )
|
||||
@@ -172,8 +177,11 @@ DF_CoreCmdTable:// | | |
|
||||
|
||||
//- rjf: panel splitting
|
||||
{ResetToDefaultPanels 0 Null Nil 0 0 0 0 0 0 Window "reset_to_default_panels" "Reset To Default Panel Layout" "Resets the window to the default panel layout." "panel" }
|
||||
{NewPanelRight 0 Null Nil 0 0 0 0 0 0 XSplit "new_panel_right" "Split Panel Vertically" "Creates a new panel to the right of the active panel." "panel" }
|
||||
{NewPanelDown 0 Null Nil 0 0 0 0 0 0 YSplit "new_panel_down" "Split Panel Horizontally" "Creates a new panel at the bottom of the active panel." "panel" }
|
||||
{NewPanelLeft 0 Null Nil 0 0 0 0 0 0 XSplit "new_panel_left" "Split Panel Left" "Creates a new panel to the left of the active panel." "panel" }
|
||||
{NewPanelUp 0 Null Nil 0 0 0 0 0 0 YSplit "new_panel_up" "Split Panel Up" "Creates a new panel at the top of the active panel." "panel" }
|
||||
{NewPanelRight 0 Null Nil 0 0 0 0 0 0 XSplit "new_panel_right" "Split Panel Right" "Creates a new panel to the right of the active panel." "panel" }
|
||||
{NewPanelDown 0 Null Nil 0 0 0 0 0 0 YSplit "new_panel_down" "Split Panel Down" "Creates a new panel at the bottom of the active panel." "panel" }
|
||||
{SplitPanel 1 Null Nil 0 0 0 0 0 0 Null "split_panel" "Split Panel" "Creates a new panel in a given direction, and moves a tab to it, if specified." "" }
|
||||
|
||||
//- rjf: panel rotation
|
||||
{RotatePanelColumns 0 Null Nil 0 0 0 0 0 0 Null "rotate_panel_columns" "Rotate Panel Columns" "Rotates all panels at the closest column level of the panel hierarchy." "" }
|
||||
@@ -222,6 +230,10 @@ DF_CoreCmdTable:// | | |
|
||||
{SetFileOverrideLinkDst 1 Null Nil 0 0 0 0 0 0 Null "set_file_override_link_dst" "Set File Override Link Destination" "Sets the destination path for an override file link." "" }
|
||||
{SetFileReplacementPath 1 Null Nil 0 0 0 0 0 0 Null "set_file_replacement_path" "Set File Replacement Path" "Sets the path which should be used as the replacement for the passed file." "" }
|
||||
|
||||
//- rjf: auto view rules
|
||||
{SetAutoViewRuleType 1 Null Nil 0 0 0 0 0 0 Null "set_auto_view_rule_type" "Set Auto View Rule Type" "Sets the type for an auto view rule." "" }
|
||||
{SetAutoViewRuleViewRule 1 Null Nil 0 0 0 0 0 0 Null "set_auto_view_rule_view_rule""Set Auto View Rule View Rule" "Sets the view rule string for an auto view rule." "" }
|
||||
|
||||
//- rjf: setting config paths
|
||||
{OpenUser 0 FilePath Nil 1 0 0 0 0 1 Person "open_user" "Open User" "Opens a user file path, immediately loading it, and begins autosaving to it." "load,user,profile,layout" }
|
||||
{OpenProfile 0 FilePath Nil 1 0 0 0 0 1 Briefcase "open_profile" "Open Profile" "Opens a profile file path, immediately loading it, and begins autosaving to it." "profile,project,session" }
|
||||
@@ -355,6 +367,7 @@ DF_CoreCmdTable:// | | |
|
||||
{Target 1 Null Nil 0 0 0 0 0 0 Target "target" "Target" "Opens the editor for a target." "" }
|
||||
{Targets 0 Null Nil 0 0 0 0 0 0 Target "targets" "Targets" "Opens the list of all targets." "" }
|
||||
{FilePathMap 0 Null Nil 0 0 0 0 0 0 FileOutline "file_path_map" "File Path Map" "Opens the file path mapping editor." "" }
|
||||
{AutoViewRules 0 Null Nil 0 0 0 0 0 0 Binoculars "auto_view_rules" "Auto View Rules" "Opens the auto view rule editor." "" }
|
||||
{Scheduler 0 Null Nil 0 0 0 0 0 0 Scheduler "scheduler" "Scheduler" "Opens the scheduler view, for process and thread controls." "threads,processes,targets" }
|
||||
{CallStack 0 Null Nil 0 0 0 0 0 0 Thread "call_stack" "Call Stack" "Opens the call stack view." "callstack,thread" }
|
||||
{Modules 0 Null Nil 0 0 0 0 0 0 Module "modules" "Modules" "Opens the modules view." "" }
|
||||
@@ -454,12 +467,10 @@ DF_CoreCmdTable:// | | |
|
||||
// rows, this stage offers the ability to build a ui
|
||||
// stretching over all of the rows.
|
||||
//
|
||||
// whole ui build, "wu" -> sometimes, more sophisticated interfaces need to be
|
||||
// provided for a view rule, that stretch beyond the
|
||||
// limits of what could be offered inside a watch
|
||||
// window block. in such cases, the eval/view-rule
|
||||
// combo will be granted its own tab for example, and
|
||||
// this stage is used to fill such a ui.
|
||||
// tab ui build, "tu" -> when a view rule also wants to implement ui for a
|
||||
// dedicated tab, it can supply hooks for that as well
|
||||
// in which case an eval/view-rule can be opened in a
|
||||
// fully fledged, dedicated ui
|
||||
//
|
||||
// A few other bits are included for various ways in which a view rule may be
|
||||
// applied throughout the eval visualization pipeline. A list follows:
|
||||
@@ -498,6 +509,7 @@ DF_CoreViewRuleTable:
|
||||
{RGBA rgba "rgba" - x - x "Color (RGBA)" x "Displays as a color, interpreting the data as encoding R, G, B, and A values." }
|
||||
{Text text "text" - x - x "Text" x "Displays as text." }
|
||||
{Disasm disasm "disasm" - x - x "Disassembly" x "Displays as disassembled instructions, interpreting the data as raw machine code." }
|
||||
{Graph graph "graph" - x - x "Graph" x "Displays as a pointer graph, visualizing nodes and edges formed by pointers directly." }
|
||||
{Bitmap bitmap "bitmap" - x - x "Bitmap" x "Displays as a bitmap, interpreting the data as raw pixel data." }
|
||||
{Geo geo "geo" - x - x "Geometry" x "Displays as geometry, interpreting the data as vertex data." }
|
||||
{OdinMap odin_map "odin_map" - x - x "Odin map" x "Specifies that a struct to be rendered as an Odin map type." }
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//- GENERATED CODE
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
Rng1U64 df_g_cmd_param_slot_range_table[19] =
|
||||
Rng1U64 df_g_cmd_param_slot_range_table[21] =
|
||||
{
|
||||
{0},
|
||||
{OffsetOf(DF_CmdParams, window), OffsetOf(DF_CmdParams, window) + sizeof(DF_Handle)},
|
||||
@@ -19,15 +19,17 @@ Rng1U64 df_g_cmd_param_slot_range_table[19] =
|
||||
{OffsetOf(DF_CmdParams, text_point), OffsetOf(DF_CmdParams, text_point) + sizeof(TxtPt)},
|
||||
{OffsetOf(DF_CmdParams, cmd_spec), OffsetOf(DF_CmdParams, cmd_spec) + sizeof(struct DF_CmdSpec *)},
|
||||
{OffsetOf(DF_CmdParams, view_spec), OffsetOf(DF_CmdParams, view_spec) + sizeof(struct DF_ViewSpec *)},
|
||||
{OffsetOf(DF_CmdParams, cfg_node), OffsetOf(DF_CmdParams, cfg_node) + sizeof(struct DF_CfgNode *)},
|
||||
{OffsetOf(DF_CmdParams, vaddr), OffsetOf(DF_CmdParams, vaddr) + sizeof(U64)},
|
||||
{OffsetOf(DF_CmdParams, voff), OffsetOf(DF_CmdParams, voff) + sizeof(U64)},
|
||||
{OffsetOf(DF_CmdParams, index), OffsetOf(DF_CmdParams, index) + sizeof(U64)},
|
||||
{OffsetOf(DF_CmdParams, id), OffsetOf(DF_CmdParams, id) + sizeof(U64)},
|
||||
{OffsetOf(DF_CmdParams, prefer_dasm), OffsetOf(DF_CmdParams, prefer_dasm) + sizeof(B32)},
|
||||
{OffsetOf(DF_CmdParams, force_confirm), OffsetOf(DF_CmdParams, force_confirm) + sizeof(B32)},
|
||||
{OffsetOf(DF_CmdParams, dir2), OffsetOf(DF_CmdParams, dir2) + sizeof(Dir2)},
|
||||
};
|
||||
|
||||
DF_IconKind df_g_entity_kind_icon_kind_table[26] =
|
||||
DF_IconKind df_g_entity_kind_icon_kind_table[27] =
|
||||
{
|
||||
DF_IconKind_Null,
|
||||
DF_IconKind_Null,
|
||||
@@ -35,6 +37,7 @@ DF_IconKind_Machine,
|
||||
DF_IconKind_FileOutline,
|
||||
DF_IconKind_FileOutline,
|
||||
DF_IconKind_FileOutline,
|
||||
DF_IconKind_Binoculars,
|
||||
DF_IconKind_FileOutline,
|
||||
DF_IconKind_Null,
|
||||
DF_IconKind_Pin,
|
||||
@@ -57,7 +60,7 @@ DF_IconKind_Null,
|
||||
DF_IconKind_Null,
|
||||
};
|
||||
|
||||
String8 df_g_entity_kind_display_string_table[26] =
|
||||
String8 df_g_entity_kind_display_string_table[27] =
|
||||
{
|
||||
str8_lit_comp("Nil"),
|
||||
str8_lit_comp("Root"),
|
||||
@@ -65,6 +68,7 @@ str8_lit_comp("Machine"),
|
||||
str8_lit_comp("File"),
|
||||
str8_lit_comp("Override File Link"),
|
||||
str8_lit_comp("Pending File Change"),
|
||||
str8_lit_comp("Auto View Rule"),
|
||||
str8_lit_comp("Diagnostics Log"),
|
||||
str8_lit_comp("Flash Marker"),
|
||||
str8_lit_comp("Watch Pin"),
|
||||
@@ -87,7 +91,7 @@ str8_lit_comp("Conversion Failure"),
|
||||
str8_lit_comp("EndedProcess"),
|
||||
};
|
||||
|
||||
String8 df_g_entity_kind_name_label_table[26] =
|
||||
String8 df_g_entity_kind_name_label_table[27] =
|
||||
{
|
||||
str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
@@ -97,6 +101,7 @@ 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("Label"),
|
||||
str8_lit_comp("Expression"),
|
||||
@@ -117,7 +122,7 @@ str8_lit_comp("Label"),
|
||||
str8_lit_comp("Label"),
|
||||
};
|
||||
|
||||
DF_EntityKindFlags df_g_entity_kind_flags_table[26] =
|
||||
DF_EntityKindFlags df_g_entity_kind_flags_table[27] =
|
||||
{
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
@@ -125,6 +130,7 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[26] =
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(1*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 1*DF_EntityKindFlag_NameIsCode | 1*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
@@ -147,7 +153,7 @@ DF_EntityKindFlags df_g_entity_kind_flags_table[26] =
|
||||
(0*DF_EntityKindFlag_LeafMutationUserConfig | 0*DF_EntityKindFlag_LeafMutationProfileConfig | 0*DF_EntityKindFlag_LeafMutationSoftHalt | 0*DF_EntityKindFlag_LeafMutationDebugInfoMap | 0*DF_EntityKindFlag_TreeMutationUserConfig | 0*DF_EntityKindFlag_TreeMutationProfileConfig | 0*DF_EntityKindFlag_TreeMutationSoftHalt | 0*DF_EntityKindFlag_TreeMutationDebugInfoMap | 0*DF_EntityKindFlag_NameIsCode | 0*DF_EntityKindFlag_UserDefinedLifetime),
|
||||
};
|
||||
|
||||
DF_EntityOpFlags df_g_entity_kind_op_flags_table[26] =
|
||||
DF_EntityOpFlags df_g_entity_kind_op_flags_table[27] =
|
||||
{
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
@@ -157,6 +163,7 @@ DF_EntityOpFlags df_g_entity_kind_op_flags_table[26] =
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
|
||||
(1*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (1*DF_EntityOpFlag_Rename) | (1*DF_EntityOpFlag_Enable) | (1*DF_EntityOpFlag_Condition) | (1*DF_EntityOpFlag_Duplicate),
|
||||
(0*DF_EntityOpFlag_Delete) | (0*DF_EntityOpFlag_Freeze) | (0*DF_EntityOpFlag_Edit) | (0*DF_EntityOpFlag_Rename) | (0*DF_EntityOpFlag_Enable) | (0*DF_EntityOpFlag_Condition) | (0*DF_EntityOpFlag_Duplicate),
|
||||
@@ -209,7 +216,7 @@ DF_CoreCmdKind_Null,
|
||||
DF_CoreCmdKind_Null,
|
||||
};
|
||||
|
||||
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
|
||||
DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[212] =
|
||||
{
|
||||
{ str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("exit"), str8_lit_comp("Exits the debugger."), str8_lit_comp("quit,close,abort"), str8_lit_comp("Exit"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_X},
|
||||
@@ -263,8 +270,11 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
|
||||
{ str8_lit_comp("confirm_accept"), str8_lit_comp("Accepts the active confirmation prompt."), str8_lit_comp(""), str8_lit_comp("Confirm Accept"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("confirm_cancel"), str8_lit_comp("Cancels the active confirmation prompt."), str8_lit_comp(""), str8_lit_comp("Confirm Cancel"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("reset_to_default_panels"), str8_lit_comp("Resets the window to the default panel layout."), str8_lit_comp("panel"), str8_lit_comp("Reset To Default Panel Layout"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Window},
|
||||
{ str8_lit_comp("new_panel_right"), str8_lit_comp("Creates a new panel to the right of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Vertically"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_XSplit},
|
||||
{ str8_lit_comp("new_panel_down"), str8_lit_comp("Creates a new panel at the bottom of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Horizontally"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_YSplit},
|
||||
{ str8_lit_comp("new_panel_left"), str8_lit_comp("Creates a new panel to the left of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Left"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_XSplit},
|
||||
{ str8_lit_comp("new_panel_up"), str8_lit_comp("Creates a new panel at the top of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Up"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_YSplit},
|
||||
{ str8_lit_comp("new_panel_right"), str8_lit_comp("Creates a new panel to the right of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Right"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_XSplit},
|
||||
{ str8_lit_comp("new_panel_down"), str8_lit_comp("Creates a new panel at the bottom of the active panel."), str8_lit_comp("panel"), str8_lit_comp("Split Panel Down"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_YSplit},
|
||||
{ str8_lit_comp("split_panel"), str8_lit_comp("Creates a new panel in a given direction, and moves a tab to it, if specified."), str8_lit_comp(""), str8_lit_comp("Split Panel"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("rotate_panel_columns"), str8_lit_comp("Rotates all panels at the closest column level of the panel hierarchy."), str8_lit_comp(""), str8_lit_comp("Rotate Panel Columns"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("next_panel"), str8_lit_comp("Cycles the active panel forward."), str8_lit_comp(""), str8_lit_comp("Focus Next Panel"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_RightArrow},
|
||||
{ str8_lit_comp("prev_panel"), str8_lit_comp("Cycles the active panel backwards."), str8_lit_comp(""), str8_lit_comp("Focus Previous Panel"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_LeftArrow},
|
||||
@@ -296,6 +306,8 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
|
||||
{ str8_lit_comp("set_file_override_link_src"), str8_lit_comp("Sets the source path for an override file link."), str8_lit_comp(""), str8_lit_comp("Set File Override Link Source"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("set_file_override_link_dst"), str8_lit_comp("Sets the destination path for an override file link."), str8_lit_comp(""), str8_lit_comp("Set File Override Link Destination"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("set_file_replacement_path"), str8_lit_comp("Sets the path which should be used as the replacement for the passed file."), str8_lit_comp(""), str8_lit_comp("Set File Replacement Path"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("set_auto_view_rule_type"), str8_lit_comp("Sets the type for an auto view rule."), str8_lit_comp(""), str8_lit_comp("Set Auto View Rule Type"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("set_auto_view_rule_view_rule"), str8_lit_comp("Sets the view rule string for an auto view rule."), str8_lit_comp(""), str8_lit_comp("Set Auto View Rule View Rule"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
{ str8_lit_comp("open_user"), str8_lit_comp("Opens a user file path, immediately loading it, and begins autosaving to it."), str8_lit_comp("load,user,profile,layout"), str8_lit_comp("Open User"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*1)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Person},
|
||||
{ str8_lit_comp("open_profile"), str8_lit_comp("Opens a profile file path, immediately loading it, and begins autosaving to it."), str8_lit_comp("profile,project,session"), str8_lit_comp("Open Profile"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_FilePath, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*1)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*1)}, DF_IconKind_Briefcase},
|
||||
{ str8_lit_comp("apply_user_data"), str8_lit_comp("Applies user data from the active user file."), str8_lit_comp(""), str8_lit_comp("Apply User Data"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
@@ -392,6 +404,7 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
|
||||
{ str8_lit_comp("target"), str8_lit_comp("Opens the editor for a target."), str8_lit_comp(""), str8_lit_comp("Target"), (DF_CmdSpecFlag_OmitFromLists*1), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Target},
|
||||
{ str8_lit_comp("targets"), str8_lit_comp("Opens the list of all targets."), str8_lit_comp(""), str8_lit_comp("Targets"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Target},
|
||||
{ str8_lit_comp("file_path_map"), str8_lit_comp("Opens the file path mapping editor."), str8_lit_comp(""), str8_lit_comp("File Path Map"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_FileOutline},
|
||||
{ str8_lit_comp("auto_view_rules"), str8_lit_comp("Opens the auto view rule editor."), str8_lit_comp(""), str8_lit_comp("Auto View Rules"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Binoculars},
|
||||
{ str8_lit_comp("scheduler"), str8_lit_comp("Opens the scheduler view, for process and thread controls."), str8_lit_comp("threads,processes,targets"), str8_lit_comp("Scheduler"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Scheduler},
|
||||
{ str8_lit_comp("call_stack"), str8_lit_comp("Opens the call stack view."), str8_lit_comp("callstack,thread"), str8_lit_comp("Call Stack"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Thread},
|
||||
{ str8_lit_comp("modules"), str8_lit_comp("Opens the modules view."), str8_lit_comp(""), str8_lit_comp("Modules"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Module},
|
||||
@@ -419,11 +432,10 @@ DF_CmdSpecInfo df_g_core_cmd_kind_spec_info_table[206] =
|
||||
{ str8_lit_comp("toggle_dev_menu"), str8_lit_comp("Opens and closes the developer menu."), str8_lit_comp(""), str8_lit_comp("Toggle Developer Menu"), (DF_CmdSpecFlag_OmitFromLists*0), {DF_CmdParamSlot_Null, DF_EntityKind_Nil, (DF_CmdQueryFlag_AllowFiles*0)|(DF_CmdQueryFlag_AllowFolders*0)|(DF_CmdQueryFlag_CodeInput*0)|(DF_CmdQueryFlag_KeepOldInput*0)|(DF_CmdQueryFlag_SelectOldInput*0)|(DF_CmdQueryFlag_Required*0)}, DF_IconKind_Null},
|
||||
};
|
||||
|
||||
DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[18] =
|
||||
DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[17] =
|
||||
{
|
||||
{str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
|
||||
{str8_lit_comp("array"), str8_lit_comp("Array"), str8_lit_comp("Specifies that a pointer points to N elements, rather than only 1."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(array) , 0, },
|
||||
{str8_lit_comp("slice"), str8_lit_comp("Slice"), str8_lit_comp("Specifies that a struct to be rendered as a slice."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(slice) , 0, },
|
||||
{str8_lit_comp("list"), str8_lit_comp("List"), str8_lit_comp("Specifies that some struct, union, or class forms the top of a linked list, and the member which points at the following element in the list."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(list) , },
|
||||
{str8_lit_comp("bswap"), str8_lit_comp("Byte Swap"), str8_lit_comp("Specifies that all integer primitives should be byte-swapped, such that their endianness is reversed."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*1)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(bswap) , 0, },
|
||||
{str8_lit_comp("dec"), str8_lit_comp("Decimal Base (Base 10)"), str8_lit_comp("Specifies that all integral evaluations should appear in base-10 form."), (DF_CoreViewRuleSpecInfoFlag_Inherited*1)|(DF_CoreViewRuleSpecInfoFlag_Expandable*0)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*0), 0, 0, },
|
||||
@@ -436,9 +448,9 @@ DF_CoreViewRuleSpecInfo df_g_core_view_rule_spec_info_table[18] =
|
||||
{str8_lit_comp("rgba"), str8_lit_comp("Color (RGBA)"), str8_lit_comp("Displays as a color, interpreting the data as encoding R, G, B, and A values."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(rgba) , },
|
||||
{str8_lit_comp("text"), str8_lit_comp("Text"), str8_lit_comp("Displays as text."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(text) , },
|
||||
{str8_lit_comp("disasm"), str8_lit_comp("Disassembly"), str8_lit_comp("Displays as disassembled instructions, interpreting the data as raw machine code."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(disasm) , },
|
||||
{str8_lit_comp("graph"), str8_lit_comp("Graph"), str8_lit_comp("Displays as a pointer graph, visualizing nodes and edges formed by pointers directly."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(graph) , },
|
||||
{str8_lit_comp("bitmap"), str8_lit_comp("Bitmap"), str8_lit_comp("Displays as a bitmap, interpreting the data as raw pixel data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(bitmap) , },
|
||||
{str8_lit_comp("geo"), str8_lit_comp("Geometry"), str8_lit_comp("Displays as geometry, interpreting the data as vertex data."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(geo) , },
|
||||
{str8_lit_comp("odin_map"), str8_lit_comp("Odin map"), str8_lit_comp("Specifies that a struct to be rendered as an Odin map type."), (DF_CoreViewRuleSpecInfoFlag_Inherited*0)|(DF_CoreViewRuleSpecInfoFlag_Expandable*1)|(DF_CoreViewRuleSpecInfoFlag_EvalResolution*0)|(DF_CoreViewRuleSpecInfoFlag_VizBlockProd*1), 0, DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(odin_map) , },
|
||||
};
|
||||
|
||||
String8 df_g_icon_kind_text_table[69] =
|
||||
|
||||
@@ -23,6 +23,7 @@ DF_EntityKind_Machine,
|
||||
DF_EntityKind_File,
|
||||
DF_EntityKind_OverrideFileLink,
|
||||
DF_EntityKind_PendingFileChange,
|
||||
DF_EntityKind_AutoViewRule,
|
||||
DF_EntityKind_DiagLog,
|
||||
DF_EntityKind_FlashMarker,
|
||||
DF_EntityKind_WatchPin,
|
||||
@@ -100,8 +101,11 @@ DF_CoreCmdKind_ToggleFullscreen,
|
||||
DF_CoreCmdKind_ConfirmAccept,
|
||||
DF_CoreCmdKind_ConfirmCancel,
|
||||
DF_CoreCmdKind_ResetToDefaultPanels,
|
||||
DF_CoreCmdKind_NewPanelLeft,
|
||||
DF_CoreCmdKind_NewPanelUp,
|
||||
DF_CoreCmdKind_NewPanelRight,
|
||||
DF_CoreCmdKind_NewPanelDown,
|
||||
DF_CoreCmdKind_SplitPanel,
|
||||
DF_CoreCmdKind_RotatePanelColumns,
|
||||
DF_CoreCmdKind_NextPanel,
|
||||
DF_CoreCmdKind_PrevPanel,
|
||||
@@ -133,6 +137,8 @@ DF_CoreCmdKind_SwitchToPartnerFile,
|
||||
DF_CoreCmdKind_SetFileOverrideLinkSrc,
|
||||
DF_CoreCmdKind_SetFileOverrideLinkDst,
|
||||
DF_CoreCmdKind_SetFileReplacementPath,
|
||||
DF_CoreCmdKind_SetAutoViewRuleType,
|
||||
DF_CoreCmdKind_SetAutoViewRuleViewRule,
|
||||
DF_CoreCmdKind_OpenUser,
|
||||
DF_CoreCmdKind_OpenProfile,
|
||||
DF_CoreCmdKind_ApplyUserData,
|
||||
@@ -229,6 +235,7 @@ DF_CoreCmdKind_Commands,
|
||||
DF_CoreCmdKind_Target,
|
||||
DF_CoreCmdKind_Targets,
|
||||
DF_CoreCmdKind_FilePathMap,
|
||||
DF_CoreCmdKind_AutoViewRules,
|
||||
DF_CoreCmdKind_Scheduler,
|
||||
DF_CoreCmdKind_CallStack,
|
||||
DF_CoreCmdKind_Modules,
|
||||
@@ -348,6 +355,7 @@ DF_CoreViewRuleKind_NoAddr,
|
||||
DF_CoreViewRuleKind_RGBA,
|
||||
DF_CoreViewRuleKind_Text,
|
||||
DF_CoreViewRuleKind_Disasm,
|
||||
DF_CoreViewRuleKind_Graph,
|
||||
DF_CoreViewRuleKind_Bitmap,
|
||||
DF_CoreViewRuleKind_Geo,
|
||||
DF_CoreViewRuleKind_OdinMap,
|
||||
@@ -369,12 +377,14 @@ DF_CmdParamSlot_FilePath,
|
||||
DF_CmdParamSlot_TextPoint,
|
||||
DF_CmdParamSlot_CmdSpec,
|
||||
DF_CmdParamSlot_ViewSpec,
|
||||
DF_CmdParamSlot_CfgNode,
|
||||
DF_CmdParamSlot_VirtualAddr,
|
||||
DF_CmdParamSlot_VirtualOff,
|
||||
DF_CmdParamSlot_Index,
|
||||
DF_CmdParamSlot_ID,
|
||||
DF_CmdParamSlot_PreferDisassembly,
|
||||
DF_CmdParamSlot_ForceConfirm,
|
||||
DF_CmdParamSlot_Dir2,
|
||||
DF_CmdParamSlot_COUNT,
|
||||
} DF_CmdParamSlot;
|
||||
|
||||
@@ -394,12 +404,14 @@ String8 file_path;
|
||||
TxtPt text_point;
|
||||
struct DF_CmdSpec * cmd_spec;
|
||||
struct DF_ViewSpec * view_spec;
|
||||
struct DF_CfgNode * cfg_node;
|
||||
U64 vaddr;
|
||||
U64 voff;
|
||||
U64 index;
|
||||
U64 id;
|
||||
B32 prefer_dasm;
|
||||
B32 force_confirm;
|
||||
Dir2 dir2;
|
||||
};
|
||||
|
||||
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(array);
|
||||
@@ -411,6 +423,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(omit);
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(rgba);
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text);
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm);
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(graph);
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap);
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo);
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(odin_map);
|
||||
@@ -1511,12 +1524,12 @@ struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
|
||||
{&DEV_updating_indicator, str8_lit_comp("updating_indicator")},
|
||||
};
|
||||
C_LINKAGE_BEGIN
|
||||
extern Rng1U64 df_g_cmd_param_slot_range_table[19];
|
||||
extern DF_IconKind df_g_entity_kind_icon_kind_table[26];
|
||||
extern String8 df_g_entity_kind_display_string_table[26];
|
||||
extern String8 df_g_entity_kind_name_label_table[26];
|
||||
extern DF_EntityKindFlags df_g_entity_kind_flags_table[26];
|
||||
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[26];
|
||||
extern Rng1U64 df_g_cmd_param_slot_range_table[21];
|
||||
extern DF_IconKind df_g_entity_kind_icon_kind_table[27];
|
||||
extern String8 df_g_entity_kind_display_string_table[27];
|
||||
extern String8 df_g_entity_kind_name_label_table[27];
|
||||
extern DF_EntityKindFlags df_g_entity_kind_flags_table[27];
|
||||
extern DF_EntityOpFlags df_g_entity_kind_op_flags_table[27];
|
||||
extern String8 df_g_cfg_src_string_table[4];
|
||||
extern DF_CoreCmdKind df_g_cfg_src_load_cmd_kind_table[4];
|
||||
extern DF_CoreCmdKind df_g_cfg_src_write_cmd_kind_table[4];
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
#include "df/core/df_core.c"
|
||||
#include "df/gfx/df_gfx.c"
|
||||
#include "df/gfx/df_views.c"
|
||||
#include "df/gfx/df_view_rule_hooks.c"
|
||||
#include "df/gfx/df_view_rules.c"
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@
|
||||
#include "df/core/df_core.h"
|
||||
#include "df/gfx/df_gfx.h"
|
||||
#include "df/gfx/df_views.h"
|
||||
#include "df/gfx/df_view_rule_hooks.h"
|
||||
#include "df/gfx/df_view_rules.h"
|
||||
|
||||
#endif // DEBUG_FRONTEND_INC_H
|
||||
|
||||
+1564
-706
File diff suppressed because it is too large
Load Diff
+20
-19
@@ -73,7 +73,7 @@ struct DF_View;
|
||||
struct DF_Panel;
|
||||
struct DF_Window;
|
||||
|
||||
#define DF_VIEW_SETUP_FUNCTION_SIG(name) void name(struct DF_View *view, DF_CfgNode *cfg_root)
|
||||
#define DF_VIEW_SETUP_FUNCTION_SIG(name) void name(DF_Window *ws, struct DF_View *view, DF_CfgNode *cfg_root)
|
||||
#define DF_VIEW_SETUP_FUNCTION_NAME(name) df_view_setup_##name
|
||||
#define DF_VIEW_SETUP_FUNCTION_DEF(name) internal DF_VIEW_SETUP_FUNCTION_SIG(DF_VIEW_SETUP_FUNCTION_NAME(name))
|
||||
typedef DF_VIEW_SETUP_FUNCTION_SIG(DF_ViewSetupFunctionType);
|
||||
@@ -102,9 +102,10 @@ enum
|
||||
DF_ViewSpecFlag_ParameterizedByEntity = (1<<0),
|
||||
DF_ViewSpecFlag_CanSerialize = (1<<1),
|
||||
DF_ViewSpecFlag_CanSerializeEntityPath = (1<<2),
|
||||
DF_ViewSpecFlag_CanFilter = (1<<3),
|
||||
DF_ViewSpecFlag_FilterIsCode = (1<<4),
|
||||
DF_ViewSpecFlag_TypingAutomaticallyFilters = (1<<5),
|
||||
DF_ViewSpecFlag_CanSerializeQuery = (1<<3),
|
||||
DF_ViewSpecFlag_CanFilter = (1<<4),
|
||||
DF_ViewSpecFlag_FilterIsCode = (1<<5),
|
||||
DF_ViewSpecFlag_TypingAutomaticallyFilters = (1<<6),
|
||||
};
|
||||
|
||||
typedef struct DF_ViewSpecInfo DF_ViewSpecInfo;
|
||||
@@ -226,10 +227,10 @@ struct DF_Panel
|
||||
|
||||
// rjf: split data
|
||||
Axis2 split_axis;
|
||||
Vec2F32 off_pct_of_parent;
|
||||
Vec2F32 off_pct_of_parent_target;
|
||||
Vec2F32 size_pct_of_parent;
|
||||
Vec2F32 size_pct_of_parent_target;
|
||||
F32 pct_of_parent;
|
||||
|
||||
// rjf: animated rectangle data
|
||||
Rng2F32 animated_rect_pct;
|
||||
|
||||
// rjf: tab params
|
||||
Side tab_side;
|
||||
@@ -281,7 +282,6 @@ enum
|
||||
DF_GfxViewRuleSpecInfoFlag_LineStringize = (1<<1),
|
||||
DF_GfxViewRuleSpecInfoFlag_RowUI = (1<<2),
|
||||
DF_GfxViewRuleSpecInfoFlag_BlockUI = (1<<3),
|
||||
DF_GfxViewRuleSpecInfoFlag_WholeUI = (1<<4),
|
||||
};
|
||||
|
||||
#define DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_SIG(name) void name(void)
|
||||
@@ -296,19 +296,14 @@ enum
|
||||
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name) df_gfx_view_rule_row_ui__##name
|
||||
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name))
|
||||
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg, Vec2F32 dim)
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, String8 string, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg, Vec2F32 dim)
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name) df_gfx_view_rule_block_ui__##name
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name))
|
||||
|
||||
#define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, struct DF_Panel *panel, struct DF_View *view, Rng2F32 rect, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg)
|
||||
#define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(name) df_gfx_view_rule_whole_ui__##name
|
||||
#define DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(name))
|
||||
|
||||
typedef DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_SIG(DF_GfxViewRuleVizRowProdHookFunctionType);
|
||||
typedef DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(DF_GfxViewRuleLineStringizeHookFunctionType);
|
||||
typedef DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_GfxViewRuleRowUIFunctionType);
|
||||
typedef DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(DF_GfxViewRuleBlockUIFunctionType);
|
||||
typedef DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_SIG(DF_GfxViewRuleWholeUIFunctionType);
|
||||
|
||||
typedef struct DF_GfxViewRuleSpecInfo DF_GfxViewRuleSpecInfo;
|
||||
struct DF_GfxViewRuleSpecInfo
|
||||
@@ -319,7 +314,7 @@ struct DF_GfxViewRuleSpecInfo
|
||||
DF_GfxViewRuleLineStringizeHookFunctionType *line_stringize;
|
||||
DF_GfxViewRuleRowUIFunctionType *row_ui;
|
||||
DF_GfxViewRuleBlockUIFunctionType *block_ui;
|
||||
DF_GfxViewRuleWholeUIFunctionType *whole_ui;
|
||||
String8 tab_view_spec_name;
|
||||
};
|
||||
|
||||
typedef struct DF_GfxViewRuleSpecInfoArray DF_GfxViewRuleSpecInfoArray;
|
||||
@@ -707,6 +702,9 @@ struct DF_GfxState
|
||||
String8 cfg_main_font_path;
|
||||
String8 cfg_code_font_path;
|
||||
F_Tag cfg_font_tags[DF_FontSlot_COUNT];
|
||||
|
||||
// rjf: icon texture
|
||||
R_Handle icon_texture;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -765,6 +763,8 @@ read_only global DF_Panel df_g_nil_panel =
|
||||
|
||||
global DF_GfxState *df_gfx_state = 0;
|
||||
global DF_DragDropPayload df_g_drag_drop_payload = {0};
|
||||
global DF_Handle df_g_last_drag_drop_panel = {0};
|
||||
global DF_Handle df_g_last_drag_drop_prev_tab = {0};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Helpers
|
||||
@@ -805,8 +805,8 @@ internal DF_PanelRec df_panel_rec_df(DF_Panel *panel, U64 sib_off, U64 child_off
|
||||
#define df_panel_rec_df_post(panel) df_panel_rec_df(panel, OffsetOf(DF_Panel, prev), OffsetOf(DF_Panel, last))
|
||||
|
||||
//- rjf: panel -> rect calculations
|
||||
internal Rng2F32 df_rect_from_panel_child(Rng2F32 parent_rect, DF_Panel *parent, DF_Panel *panel);
|
||||
internal Rng2F32 df_rect_from_panel(Rng2F32 root_rect, DF_Panel *root, DF_Panel *panel);
|
||||
internal Rng2F32 df_target_rect_from_panel_child(Rng2F32 parent_rect, DF_Panel *parent, DF_Panel *panel);
|
||||
internal Rng2F32 df_target_rect_from_panel(Rng2F32 root_rect, DF_Panel *root, DF_Panel *panel);
|
||||
|
||||
//- rjf: view ownership insertion/removal
|
||||
internal void df_panel_insert_tab_view(DF_Panel *panel, DF_View *prev_view, DF_View *view);
|
||||
@@ -864,13 +864,14 @@ internal DF_ViewSpec *df_view_spec_from_cmd_param_slot_spec(DF_CmdParamSlot slot
|
||||
|
||||
internal void df_register_gfx_view_rule_specs(DF_GfxViewRuleSpecInfoArray specs);
|
||||
internal DF_GfxViewRuleSpec *df_gfx_view_rule_spec_from_string(String8 string);
|
||||
internal DF_ViewSpec *df_tab_view_spec_from_gfx_view_rule_spec(DF_GfxViewRuleSpec *spec);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: View State Functions
|
||||
|
||||
internal DF_View *df_view_alloc(void);
|
||||
internal void df_view_release(DF_View *view);
|
||||
internal void df_view_equip_spec(DF_View *view, DF_ViewSpec *spec, DF_Entity *entity, String8 default_query, DF_CfgNode *cfg_root);
|
||||
internal void df_view_equip_spec(DF_Window *window, DF_View *view, DF_ViewSpec *spec, DF_Entity *entity, String8 default_query, DF_CfgNode *cfg_root);
|
||||
internal void df_view_equip_loading_info(DF_View *view, B32 is_loading, U64 progress_v, U64 progress_target);
|
||||
internal void df_view_clear_user_state(DF_View *view);
|
||||
internal void *df_view_get_or_push_user_state(DF_View *view, U64 size);
|
||||
|
||||
+34
-22
@@ -8,6 +8,7 @@
|
||||
@embed_file df_g_default_main_font_bytes: "../data/Roboto-Regular.ttf"
|
||||
@embed_file df_g_default_code_font_bytes: "../data/liberation-mono.ttf"
|
||||
//@embed_file df_g_default_code_font_bytes: "../data/Inconsolata-Regular.ttf"
|
||||
@embed_file df_g_icon_file_bytes: "../data/logo.ico"
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Default Bindings
|
||||
@@ -182,7 +183,6 @@ DF_NameKindTable:
|
||||
{
|
||||
{Null}
|
||||
{EntityName}
|
||||
{EntityKindName}
|
||||
}
|
||||
|
||||
@table(name, name_lower, display_string, name_kind, icon, parameterized_by_entity, can_serialize, can_serialize_entity_path, can_filter, filter_is_code, typing_automatically_filters, inc_in_docs, docs_desc)
|
||||
@@ -193,18 +193,18 @@ DF_GfxViewTable:
|
||||
{ Commands "commands" "Commands" Null List 0 0 0 0 0 0 0 "" }
|
||||
{ FileSystem "file_system" "File System" Null FileOutline 0 0 0 0 0 0 0 "" }
|
||||
{ SystemProcesses "system_processes" "System Processes" Null Null 0 0 0 0 0 0 0 "" }
|
||||
{ EntityLister "entity_lister" "Entity List" EntityKindName Null 0 0 0 0 0 0 0 "" }
|
||||
{ EntityLister "entity_lister" "Entity List" Null Null 0 0 0 0 0 0 0 "" }
|
||||
{ SymbolLister "symbol_lister" "Symbols" Null Null 0 0 0 0 0 0 0 "" }
|
||||
{ Target "target" "Target" EntityName Target 1 0 0 0 0 0 0 "" }
|
||||
{ Targets "targets" "Targets" Null Target 0 1 0 1 0 1 1 "Displays a list of all targets, as well as controls for enabling, disabling, launching, editing, or deleting each target. For more information on targets, read the `Targets` section." }
|
||||
{ FilePathMap "file_path_map" "File Path Map" Null FileOutline 0 1 0 0 0 0 1 "Displays a table of *path maps*. Each path map is a pair of file or folder paths, one being a 'source' path, and one being a 'destination' path. These pairs are used by the debugger when automatically searching for specific files - for instance, when attempting to snap to a source code location specified by debug info. If debug info refers to a path on the machine on which a target executable was originally built, but that path is not valid on the debugger machine, but some alternative path exists, then path maps may be used to redirect the debugger from the debug info's specified paths to the associated appropriate debugger machine file paths." }
|
||||
{ AutoViewRules "auto_view_rules" "Auto View Rules" Null Binoculars 0 1 0 0 0 0 1 "Displays a table of *auto view rules*. Each *auto view rule* is a pair, with one element being a type, and the other being a view rule, which should be automatically applied to expressions of that type, when possible." }
|
||||
{ Scheduler "scheduler" "Scheduler" Null Scheduler 0 1 0 1 1 1 1 "Displays all processes and threads to which the debugger is currently attached, and contains controls for selecting and freezing threads." }
|
||||
{ CallStack "call_stack" "Call Stack" Null Thread 0 1 0 0 0 0 1 "Displays the call stack of the currently selected thread. Each frame in the call stack contains the associated module, function name, and return address. Allows selection of a particular call stack frame other than the top." }
|
||||
{ Modules "modules" "Modules" Null Module 0 1 0 1 0 1 1 "Displays a table of all modules currently loaded by any process to which the debugger is attached. This table displays each module's name, virtual address range in the containing process' address space, and which debug info file is being used by the debugger for the associated module." }
|
||||
{ PendingEntity "pending_entity" "Pending Entity" EntityName FileOutline 1 0 0 0 0 0 0 "" }
|
||||
{ Code "code" "Code" EntityName FileOutline 1 1 1 0 0 0 0 "" }
|
||||
{ Disassembly "disassembly" "Disassembly" Null Glasses 0 1 0 0 0 0 1 "Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space." }
|
||||
{ EvalViewer "eval_viewer" "Evaluation Viewer" Null Binoculars 0 1 0 0 0 0 0 "." }
|
||||
{ Watch "watch" "Watch" Null Binoculars 0 1 0 1 1 1 1 "The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section." }
|
||||
{ Locals "locals" "Locals" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with local variables found within the selected call stack frame of the selected thread, according to the associated debug info. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
{ Registers "registers" "Registers" Null Binoculars 0 1 0 1 1 1 1 "Nearly identical to `Watch`, but automatically filled with all register names according to the selected thread's architecture. View rules and evaluation values can be edited, like in `Watch`, but unlike `Watch`, expressions cannot be edited or added to the table." }
|
||||
@@ -240,25 +240,25 @@ DF_CmdParamSlot2ViewSpecMap:
|
||||
//
|
||||
// NOTE(rjf): see @view_rule_info
|
||||
|
||||
@table(string vr ls ru bu wu)
|
||||
@table(string vr ls ru bu tu tab_display_string)
|
||||
DF_GfxViewRuleTable:
|
||||
{
|
||||
{"array" - - - - - }
|
||||
{"slice" - - - - - }
|
||||
{"list" x - - - - }
|
||||
{"dec" - x - - - }
|
||||
{"bin" - x - - - }
|
||||
{"oct" - x - - - }
|
||||
{"hex" - x - - - }
|
||||
{"only" x x - - - }
|
||||
{"omit" x x - - - }
|
||||
{"no_addr" - x - - - }
|
||||
{"rgba" - - x x - }
|
||||
{"text" - - - x - }
|
||||
{"disasm" - - - x - }
|
||||
{"bitmap" - - x x x }
|
||||
{"odin_map" - - x x x }
|
||||
{"geo" - - x x - }
|
||||
{"array" - - - - - "" }
|
||||
{"slice" - - - - - "" }
|
||||
{"list" x - - - - "" }
|
||||
{"dec" - x - - - "" }
|
||||
{"bin" - x - - - "" }
|
||||
{"oct" - x - - - "" }
|
||||
{"hex" - x - - - "" }
|
||||
{"only" x x - - - "" }
|
||||
{"omit" x x - - - "" }
|
||||
{"no_addr" - x - - - "" }
|
||||
{"rgba" - - x x - "" }
|
||||
{"text" - - - x x "Text" }
|
||||
{"disasm" - - - x x "Disassembly" }
|
||||
{"bitmap" - - x x x "Bitmap" }
|
||||
{"odin_map" - - x x x "Odin HashMap" }
|
||||
{"geo" - - x x x "Geometry" }
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -559,7 +559,13 @@ DF_ThemePresetColorTable:
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
`$(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
`$(a.wu == "x" -> "DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
`$(a.tu == "x" -> "DF_VIEW_SETUP_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
`$(a.tu == "x" -> "DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
`$(a.tu == "x" -> "DF_VIEW_CMD_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
`$(a.tu == "x" -> "DF_VIEW_UI_FUNCTION_DEF(" .. a.name_lower .. ");")`;
|
||||
}
|
||||
|
||||
//- rjf: gfx view rule tables
|
||||
@@ -567,7 +573,13 @@ DF_ThemePresetColorTable:
|
||||
@data(DF_GfxViewRuleSpecInfo) @c_file df_g_gfx_view_rule_spec_info_table:
|
||||
{
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
```{ str8_lit_comp("$(a.string)"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*$(a.vr == "x"))|(DF_GfxViewRuleSpecInfoFlag_LineStringize*$(a.ls == "x"))|(DF_GfxViewRuleSpecInfoFlag_RowUI*$(a.ru == "x"))|(DF_GfxViewRuleSpecInfoFlag_BlockUI*$(a.bu == "x")), $(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vr != "x" -> 0), $(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME("..a.name_lower..")") $(a.ls != "x" -> 0), $(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME("..a.name_lower..")") $(a.ru != "x" -> 0), $(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME("..a.name_lower..")") $(a.bu != "x" -> 0), $(a.wu == "x" -> "DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME("..a.name_lower..")") $(a.wu != "x" -> 0) }```;
|
||||
```{ str8_lit_comp("$(a.string)"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*$(a.vr == "x"))|(DF_GfxViewRuleSpecInfoFlag_LineStringize*$(a.ls == "x"))|(DF_GfxViewRuleSpecInfoFlag_RowUI*$(a.ru == "x"))|(DF_GfxViewRuleSpecInfoFlag_BlockUI*$(a.bu == "x")), $(a.vr == "x" -> "DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME("..a.name_lower..")") $(a.vr != "x" -> 0), $(a.ls == "x" -> "DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME("..a.name_lower..")") $(a.ls != "x" -> 0), $(a.ru == "x" -> "DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME("..a.name_lower..")") $(a.ru != "x" -> 0), $(a.bu == "x" -> "DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME("..a.name_lower..")") $(a.bu != "x" -> 0), str8_lit_comp("$(a.tu == 'x' -> a.string..'_view_rule')") }```;
|
||||
}
|
||||
|
||||
@data(DF_ViewSpecInfo) @c_file df_g_gfx_view_rule_tab_view_spec_info_table:
|
||||
{
|
||||
@expand(DF_GfxViewRuleTable a)
|
||||
```$(a.tu == "x" -> '{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("' .. a.string .. '_view_rule"), str8_lit_comp("' .. a.tab_display_string .. '"), DF_NameKind_Null, DF_IconKind_Binoculars, ' .. 'DF_VIEW_SETUP_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_CMD_FUNCTION_NAME(' .. a.string .. '), DF_VIEW_UI_FUNCTION_NAME(' .. a.string .. ') }')```;
|
||||
}
|
||||
|
||||
//- rjf: default view spec info table
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef DF_VIEW_RULE_HOOKS_H
|
||||
#define DF_VIEW_RULE_HOOKS_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Helper Types
|
||||
|
||||
typedef struct DF_BitmapTopologyInfo DF_BitmapTopologyInfo;
|
||||
struct DF_BitmapTopologyInfo
|
||||
{
|
||||
U64 width;
|
||||
U64 height;
|
||||
R_Tex2DFormat fmt;
|
||||
};
|
||||
|
||||
typedef struct DF_GeoTopologyInfo DF_GeoTopologyInfo;
|
||||
struct DF_GeoTopologyInfo
|
||||
{
|
||||
U64 index_count;
|
||||
Rng1U64 vertices_vaddr_range;
|
||||
};
|
||||
|
||||
typedef struct DF_TxtTopologyInfo DF_TxtTopologyInfo;
|
||||
struct DF_TxtTopologyInfo
|
||||
{
|
||||
TXT_LangKind lang;
|
||||
U64 size_cap;
|
||||
};
|
||||
|
||||
typedef struct DF_DisasmTopologyInfo DF_DisasmTopologyInfo;
|
||||
struct DF_DisasmTopologyInfo
|
||||
{
|
||||
Architecture arch;
|
||||
U64 size_cap;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Helpers
|
||||
|
||||
internal Vec4F32 df_view_rule_hooks__rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entity *process);
|
||||
internal void df_view_rule_hooks__eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_CtrlCtx *ctrl_ctx, Vec4F32 rgba);
|
||||
internal DF_BitmapTopologyInfo df_view_rule_hooks__bitmap_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
internal DF_GeoTopologyInfo df_view_rule_hooks__geo_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
internal DF_TxtTopologyInfo df_view_rule_hooks__txt_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
internal DF_DisasmTopologyInfo df_view_rule_hooks__disasm_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
|
||||
#endif //DF_VIEW_RULE_HOOKS_H
|
||||
@@ -2,10 +2,124 @@
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Helpers
|
||||
//~ rjf: "array"
|
||||
|
||||
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(array)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
TG_Key type_key = eval.type_key;
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
if(type_kind == TG_Kind_Ptr || type_kind == TG_Kind_LRef || type_kind == TG_Kind_RRef)
|
||||
{
|
||||
DF_CfgNode *array_node = val->last;
|
||||
if(array_node != &df_g_nil_cfg_node)
|
||||
{
|
||||
// rjf: determine array size
|
||||
U64 array_size = 0;
|
||||
{
|
||||
String8List array_size_expr_strs = {0};
|
||||
for(DF_CfgNode *child = array_node->first; child != &df_g_nil_cfg_node; child = child->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &array_size_expr_strs, child->string);
|
||||
}
|
||||
String8 array_size_expr = str8_list_join(scratch.arena, &array_size_expr_strs, 0);
|
||||
DF_Eval array_size_eval = df_eval_from_string(arena, dbgi_scope, ctrl_ctx, parse_ctx, macro_map, array_size_expr);
|
||||
DF_Eval array_size_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, array_size_eval);
|
||||
eval_error_list_concat_in_place(&eval.errors, &array_size_eval.errors);
|
||||
array_size = array_size_eval_value.imm_u64;
|
||||
}
|
||||
|
||||
// rjf: apply array size to type
|
||||
TG_Key pointee = tg_ptee_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, type_key);
|
||||
TG_Key array_type = tg_cons_type_make(parse_ctx->type_graph, TG_Kind_Array, pointee, array_size);
|
||||
eval.type_key = tg_cons_type_make(parse_ctx->type_graph, TG_Kind_Ptr, array_type, 0);
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return eval;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "list"
|
||||
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(list){}
|
||||
DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(list){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "bswap"
|
||||
|
||||
DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(bswap)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
TG_Key type_key = eval.type_key;
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
U64 type_size_bytes = tg_byte_size_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, type_key);
|
||||
if(TG_Kind_Char8 <= type_kind && type_kind <= TG_Kind_S256 &&
|
||||
(type_size_bytes == 2 ||
|
||||
type_size_bytes == 4 ||
|
||||
type_size_bytes == 8))
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
if(value_eval.mode == EVAL_EvalMode_Value)
|
||||
{
|
||||
switch(type_size_bytes)
|
||||
{
|
||||
default:{}break;
|
||||
case 2:{U16 v = (U16)value_eval.imm_u64; v = bswap_u16(v); value_eval.imm_u64 = (U64)v;}break;
|
||||
case 4:{U32 v = (U32)value_eval.imm_u64; v = bswap_u32(v); value_eval.imm_u64 = (U64)v;}break;
|
||||
case 8:{U64 v = value_eval.imm_u64; v = bswap_u64(v); value_eval.imm_u64 = v;}break;
|
||||
}
|
||||
}
|
||||
eval = value_eval;
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return eval;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "dec"
|
||||
|
||||
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(dec){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "bin"
|
||||
|
||||
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(bin){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "oct"
|
||||
|
||||
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(oct){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "hex"
|
||||
|
||||
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(hex){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "only"
|
||||
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(only){}
|
||||
DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(only){}
|
||||
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(only){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "omit"
|
||||
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(omit){}
|
||||
DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_DEF(omit){}
|
||||
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(omit){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "no_addr"
|
||||
|
||||
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(no_addr){}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "rgba"
|
||||
|
||||
internal Vec4F32
|
||||
df_view_rule_hooks__rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entity *process)
|
||||
df_vr_rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entity *process)
|
||||
{
|
||||
Vec4F32 rgba = {0};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
@@ -102,7 +216,7 @@ df_view_rule_hooks__rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *ra
|
||||
}
|
||||
|
||||
internal void
|
||||
df_view_rule_hooks__eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_CtrlCtx *ctrl_ctx, Vec4F32 rgba)
|
||||
df_vr_eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_CtrlCtx *ctrl_ctx, Vec4F32 rgba)
|
||||
{
|
||||
TG_Key type_key = eval.type_key;
|
||||
TG_Kind type_kind = tg_kind_from_key(type_key);
|
||||
@@ -913,6 +1027,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(rgba)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -927,7 +1042,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba)
|
||||
|
||||
//- rjf: grab hsva
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
Vec4F32 rgba = df_view_rule_hooks__rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdi, process);
|
||||
Vec4F32 rgba = df_vr_rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdi, process);
|
||||
Vec4F32 hsva = hsva_from_rgba(rgba);
|
||||
|
||||
//- rjf: build text box
|
||||
@@ -987,7 +1102,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
DF_ViewRuleHooks_RGBAState *state = df_view_rule_block_user_state(key, DF_ViewRuleHooks_RGBAState);
|
||||
DF_VR_RGBAState *state = df_view_rule_block_user_state(key, DF_VR_RGBAState);
|
||||
|
||||
//- rjf: grab hsva
|
||||
Vec4F32 rgba = {0};
|
||||
@@ -1001,7 +1116,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
else
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
rgba = df_view_rule_hooks__rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdi, process);
|
||||
rgba = df_vr_rgba_from_eval(value_eval, parse_ctx->type_graph, parse_ctx->rdi, process);
|
||||
state->hsva = hsva = hsva_from_rgba(rgba);
|
||||
state->memgen_idx = ctrl_mem_gen();
|
||||
}
|
||||
@@ -1051,7 +1166,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
if(commit)
|
||||
{
|
||||
Vec4F32 rgba = rgba_from_hsva(hsva);
|
||||
df_view_rule_hooks__eval_commit_rgba(eval, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, rgba);
|
||||
df_vr_eval_commit_rgba(eval, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, rgba);
|
||||
state->memgen_idx = ctrl_mem_gen();
|
||||
}
|
||||
|
||||
@@ -1064,21 +1179,38 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba)
|
||||
////////////////////////////////
|
||||
//~ rjf: "text"
|
||||
|
||||
typedef struct DF_ViewRuleHooks_TextState DF_ViewRuleHooks_TextState;
|
||||
struct DF_ViewRuleHooks_TextState
|
||||
internal DF_TxtTopologyInfo
|
||||
df_vr_txt_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg)
|
||||
{
|
||||
B32 initialized;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
S64 preferred_column;
|
||||
U64 last_open_frame_idx;
|
||||
F32 loaded_t;
|
||||
};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_TxtTopologyInfo result = zero_struct;
|
||||
{
|
||||
StringJoin join = {0};
|
||||
join.sep = str8_lit(" ");
|
||||
DF_CfgNode *size_cfg = df_cfg_node_child_from_string(cfg, str8_lit("size"), 0);
|
||||
DF_CfgNode *lang_cfg = df_cfg_node_child_from_string(cfg, str8_lit("lang"), 0);
|
||||
String8List size_expr_strs = {0};
|
||||
String8 lang_string = {0};
|
||||
for(DF_CfgNode *child = size_cfg->first; child != &df_g_nil_cfg_node; child = child->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &size_expr_strs, child->string);
|
||||
}
|
||||
lang_string = lang_cfg->first->string;
|
||||
String8 size_expr = str8_list_join(scratch.arena, &size_expr_strs, &join);
|
||||
DF_Eval size_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, size_expr);
|
||||
DF_Eval size_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, size_eval);
|
||||
result.lang = txt_lang_kind_from_extension(lang_string);
|
||||
result.size_cap = size_val_eval.imm_u64;
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -1094,7 +1226,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
//////////////////////////////
|
||||
//- rjf: get & initialize state
|
||||
//
|
||||
DF_ViewRuleHooks_TextState *state = df_view_rule_block_user_state(key, DF_ViewRuleHooks_TextState);
|
||||
DF_VR_TextState *state = df_view_rule_block_user_state(key, DF_VR_TextState);
|
||||
if(!state->initialized)
|
||||
{
|
||||
state->initialized = 1;
|
||||
@@ -1106,7 +1238,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
//
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
DF_TxtTopologyInfo top = df_view_rule_hooks__txt_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
DF_TxtTopologyInfo top = df_vr_txt_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr + (top.size_cap ? top.size_cap : 2048));
|
||||
@@ -1178,24 +1310,51 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text)
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(text) {}
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(text) { return str8_lit(""); }
|
||||
DF_VIEW_CMD_FUNCTION_DEF(text) {}
|
||||
DF_VIEW_UI_FUNCTION_DEF(text)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "disasm"
|
||||
|
||||
typedef struct DF_ViewRuleHooks_DisasmState DF_ViewRuleHooks_DisasmState;
|
||||
struct DF_ViewRuleHooks_DisasmState
|
||||
internal DF_DisasmTopologyInfo
|
||||
df_vr_disasm_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg)
|
||||
{
|
||||
B32 initialized;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
S64 preferred_column;
|
||||
U64 last_open_frame_idx;
|
||||
F32 loaded_t;
|
||||
};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_DisasmTopologyInfo result = zero_struct;
|
||||
{
|
||||
StringJoin join = {0};
|
||||
join.sep = str8_lit(" ");
|
||||
DF_CfgNode *size_cfg = df_cfg_node_child_from_string(cfg, str8_lit("size"), 0);
|
||||
DF_CfgNode *arch_cfg = df_cfg_node_child_from_string(cfg, str8_lit("arch"), 0);
|
||||
String8List size_expr_strs = {0};
|
||||
String8 arch_string = {0};
|
||||
for(DF_CfgNode *child = size_cfg->first; child != &df_g_nil_cfg_node; child = child->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &size_expr_strs, child->string);
|
||||
}
|
||||
arch_string = arch_cfg->first->string;
|
||||
String8 size_expr = str8_list_join(scratch.arena, &size_expr_strs, &join);
|
||||
DF_Eval size_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, size_expr);
|
||||
DF_Eval size_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, size_eval);
|
||||
if(str8_match(arch_string, str8_lit("x64"), StringMatchFlag_CaseInsensitive))
|
||||
{
|
||||
result.arch = Architecture_x64;
|
||||
}
|
||||
result.size_cap = size_val_eval.imm_u64;
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -1208,7 +1367,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
TXT_Scope *txt_scope = txt_scope_open();
|
||||
DASM_Scope *dasm_scope = dasm_scope_open();
|
||||
DF_ViewRuleHooks_DisasmState *state = df_view_rule_block_user_state(key, DF_ViewRuleHooks_DisasmState);
|
||||
DF_VR_DisasmState *state = df_view_rule_block_user_state(key, DF_VR_DisasmState);
|
||||
if(!state->initialized)
|
||||
{
|
||||
state->initialized = 1;
|
||||
@@ -1221,7 +1380,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
state->last_open_frame_idx = df_frame_index();
|
||||
{
|
||||
//- rjf: unpack params
|
||||
DF_DisasmTopologyInfo top = df_view_rule_hooks__disasm_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
DF_DisasmTopologyInfo top = df_vr_disasm_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
|
||||
//- rjf: resolve to address value & range
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
@@ -1237,7 +1396,16 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
|
||||
//- rjf: key -> parsed text info
|
||||
U128 data_hash = {0};
|
||||
DASM_Info dasm_info = dasm_info_from_key_addr_arch_style(dasm_scope, dasm_key, vaddr_range.min, top.arch, 0, DASM_Syntax_Intel, &data_hash);
|
||||
DASM_Params dasm_params = {0};
|
||||
{
|
||||
dasm_params.vaddr = vaddr_range.min;
|
||||
dasm_params.arch = top.arch;
|
||||
dasm_params.style_flags = DASM_StyleFlag_Addresses;
|
||||
dasm_params.syntax = DASM_Syntax_Intel;
|
||||
dasm_params.base_vaddr = 0;
|
||||
dasm_params.exe_path = str8_zero();
|
||||
}
|
||||
DASM_Info dasm_info = dasm_info_from_key_params(dasm_scope, dasm_key, &dasm_params, &data_hash);
|
||||
String8 dasm_text_data = {0};
|
||||
TXT_TextInfo dasm_text_info = {0};
|
||||
for(U64 rewind_idx = 0; rewind_idx < 2; rewind_idx += 1)
|
||||
@@ -1292,37 +1460,127 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm)
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(disasm) {}
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(disasm) { return str8_lit(""); }
|
||||
DF_VIEW_CMD_FUNCTION_DEF(disasm) {}
|
||||
DF_VIEW_UI_FUNCTION_DEF(disasm)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "graph"
|
||||
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(graph)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
df_eval_viz_block_end(out, vb);
|
||||
}
|
||||
|
||||
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(graph)
|
||||
{
|
||||
}
|
||||
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(graph) {}
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(graph) { return str8_lit(""); }
|
||||
DF_VIEW_CMD_FUNCTION_DEF(graph) {}
|
||||
DF_VIEW_UI_FUNCTION_DEF(graph)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "bitmap"
|
||||
|
||||
typedef struct DF_ViewRuleHooks_BitmapState DF_ViewRuleHooks_BitmapState;
|
||||
struct DF_ViewRuleHooks_BitmapState
|
||||
internal Vec2F32
|
||||
df_bitmap_view_state__screen_from_canvas_pos(DF_BitmapViewState *bvs, Rng2F32 rect, Vec2F32 cvs)
|
||||
{
|
||||
U64 last_open_frame_idx;
|
||||
F32 loaded_t;
|
||||
};
|
||||
Vec2F32 scr =
|
||||
{
|
||||
(rect.x0+rect.x1)/2 + (cvs.x - bvs->view_center_pos.x) * bvs->zoom,
|
||||
(rect.y0+rect.y1)/2 + (cvs.y - bvs->view_center_pos.y) * bvs->zoom,
|
||||
};
|
||||
return scr;
|
||||
}
|
||||
|
||||
typedef struct DF_ViewRuleHooks_BitmapBoxDrawData DF_ViewRuleHooks_BitmapBoxDrawData;
|
||||
struct DF_ViewRuleHooks_BitmapBoxDrawData
|
||||
internal Rng2F32
|
||||
df_bitmap_view_state__screen_from_canvas_rect(DF_BitmapViewState *bvs, Rng2F32 rect, Rng2F32 cvs)
|
||||
{
|
||||
Rng2F32 src;
|
||||
R_Handle texture;
|
||||
F32 loaded_t;
|
||||
B32 hovered;
|
||||
Vec2S32 mouse_px;
|
||||
F32 ui_per_bmp_px;
|
||||
};
|
||||
Rng2F32 scr = r2f32(df_bitmap_view_state__screen_from_canvas_pos(bvs, rect, cvs.p0), df_bitmap_view_state__screen_from_canvas_pos(bvs, rect, cvs.p1));
|
||||
return scr;
|
||||
}
|
||||
|
||||
typedef struct DF_ViewRuleHooks_BitmapZoomDrawData DF_ViewRuleHooks_BitmapZoomDrawData;
|
||||
struct DF_ViewRuleHooks_BitmapZoomDrawData
|
||||
internal Vec2F32
|
||||
df_bitmap_view_state__canvas_from_screen_pos(DF_BitmapViewState *bvs, Rng2F32 rect, Vec2F32 scr)
|
||||
{
|
||||
Rng2F32 src;
|
||||
R_Handle texture;
|
||||
};
|
||||
Vec2F32 cvs =
|
||||
{
|
||||
(scr.x - (rect.x0+rect.x1)/2) / bvs->zoom + bvs->view_center_pos.x,
|
||||
(scr.y - (rect.y0+rect.y1)/2) / bvs->zoom + bvs->view_center_pos.y,
|
||||
};
|
||||
return cvs;
|
||||
}
|
||||
|
||||
internal UI_BOX_CUSTOM_DRAW(df_view_rule_hooks__bitmap_box_draw)
|
||||
internal Rng2F32
|
||||
df_bitmap_view_state__canvas_from_screen_rect(DF_BitmapViewState *bvs, Rng2F32 rect, Rng2F32 scr)
|
||||
{
|
||||
DF_ViewRuleHooks_BitmapBoxDrawData *draw_data = (DF_ViewRuleHooks_BitmapBoxDrawData *)user_data;
|
||||
Rng2F32 cvs = r2f32(df_bitmap_view_state__canvas_from_screen_pos(bvs, rect, scr.p0), df_bitmap_view_state__canvas_from_screen_pos(bvs, rect, scr.p1));
|
||||
return cvs;
|
||||
}
|
||||
|
||||
internal DF_BitmapTopologyInfo
|
||||
df_vr_bitmap_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_BitmapTopologyInfo info = {0};
|
||||
{
|
||||
info.fmt = R_Tex2DFormat_RGBA8;
|
||||
}
|
||||
{
|
||||
DF_CfgNode *width_cfg = df_cfg_node_child_from_string(cfg, str8_lit("w"), 0);
|
||||
DF_CfgNode *height_cfg = df_cfg_node_child_from_string(cfg, str8_lit("h"), 0);
|
||||
DF_CfgNode *fmt_cfg = df_cfg_node_child_from_string(cfg, str8_lit("fmt"), 0);
|
||||
String8List width_expr_strs = {0};
|
||||
String8List height_expr_strs = {0};
|
||||
for(DF_CfgNode *child = width_cfg->first; child != &df_g_nil_cfg_node; child = child->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &width_expr_strs, child->string);
|
||||
}
|
||||
for(DF_CfgNode *child = height_cfg->first; child != &df_g_nil_cfg_node; child = child->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &height_expr_strs, child->string);
|
||||
}
|
||||
String8 width_expr = str8_list_join(scratch.arena, &width_expr_strs, 0);
|
||||
String8 height_expr = str8_list_join(scratch.arena, &height_expr_strs, 0);
|
||||
String8 fmt_string = fmt_cfg->first->string;
|
||||
DF_Eval width_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, width_expr);
|
||||
DF_Eval width_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, width_eval);
|
||||
info.width = width_eval_value.imm_u64;
|
||||
DF_Eval height_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, height_expr);
|
||||
DF_Eval height_eval_value = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, height_eval);
|
||||
info.height = height_eval_value.imm_u64;
|
||||
if(fmt_string.size != 0)
|
||||
{
|
||||
for(R_Tex2DFormat fmt = (R_Tex2DFormat)0; fmt < R_Tex2DFormat_COUNT; fmt = (R_Tex2DFormat)(fmt+1))
|
||||
{
|
||||
if(str8_match(r_tex2d_format_display_string_table[fmt], fmt_string, StringMatchFlag_CaseInsensitive))
|
||||
{
|
||||
info.fmt = fmt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return info;
|
||||
}
|
||||
|
||||
internal UI_BOX_CUSTOM_DRAW(df_vr_bitmap_box_draw)
|
||||
{
|
||||
DF_VR_BitmapBoxDrawData *draw_data = (DF_VR_BitmapBoxDrawData *)user_data;
|
||||
Vec4F32 bg_color = box->background_color;
|
||||
d_img(box->rect, draw_data->src, draw_data->texture, v4f32(1, 1, 1, 1), 0, 0, 0);
|
||||
if(draw_data->loaded_t < 0.98f)
|
||||
@@ -1355,16 +1613,11 @@ internal UI_BOX_CUSTOM_DRAW(df_view_rule_hooks__bitmap_box_draw)
|
||||
}
|
||||
}
|
||||
|
||||
internal UI_BOX_CUSTOM_DRAW(df_view_rule_hooks__bitmap_zoom_draw)
|
||||
{
|
||||
DF_ViewRuleHooks_BitmapZoomDrawData *draw_data = (DF_ViewRuleHooks_BitmapZoomDrawData *)user_data;
|
||||
d_img(box->rect, draw_data->src, draw_data->texture, v4f32(1, 1, 1, 1), 0, 0, 0);
|
||||
}
|
||||
|
||||
DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -1375,7 +1628,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
DF_BitmapTopologyInfo topology = df_view_rule_hooks__bitmap_topology_info_from_cfg(scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
DF_BitmapTopologyInfo topology = df_vr_bitmap_topology_info_from_cfg(scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
U64 expected_size = topology.width*topology.height*r_tex2d_format_bytes_per_pixel_table[topology.fmt];
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
ui_labelf("0x%I64x -> Bitmap (%I64u x %I64u)", base_vaddr, topology.width, topology.height);
|
||||
@@ -1386,35 +1639,59 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap)
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
TEX_Scope *tex_scope = tex_scope_open();
|
||||
DF_ViewRuleHooks_BitmapState *state = df_view_rule_block_user_state(key, DF_ViewRuleHooks_BitmapState);
|
||||
DF_VR_BitmapState *state = df_view_rule_block_user_state(key, DF_VR_BitmapState);
|
||||
if(state->last_open_frame_idx+1 < df_frame_index())
|
||||
{
|
||||
state->loaded_t = 0;
|
||||
}
|
||||
state->last_open_frame_idx = df_frame_index();
|
||||
|
||||
//- rjf: resolve to address value
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
|
||||
//- rjf: unpack thread/process of eval
|
||||
//////////////////////////////
|
||||
//- rjf: unpack context
|
||||
//
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx->thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
|
||||
//- rjf: unpack image dimensions & form vaddr range
|
||||
DF_BitmapTopologyInfo topology_info = df_view_rule_hooks__bitmap_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
//////////////////////////////
|
||||
//- rjf: evaluate expression
|
||||
//
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
DF_BitmapTopologyInfo topology_info = df_vr_bitmap_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
U64 expected_size = topology_info.width*topology_info.height*r_tex2d_format_bytes_per_pixel_table[topology_info.fmt];
|
||||
Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr+expected_size);
|
||||
|
||||
//- rjf: obtain key for this data range
|
||||
//////////////////////////////
|
||||
//- rjf: map expression artifacts -> texture
|
||||
//
|
||||
U128 texture_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, vaddr_range, 0);
|
||||
|
||||
//- rjf: hash & topology -> texture
|
||||
TEX_Topology topology = tex_topology_make(v2s32((S32)topology_info.width, (S32)topology_info.height), topology_info.fmt);
|
||||
R_Handle texture = tex_texture_from_key_topology(tex_scope, texture_key, topology);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: animate
|
||||
//
|
||||
if(expected_size != 0)
|
||||
{
|
||||
if(r_handle_match(r_handle_zero(), texture))
|
||||
{
|
||||
df_gfx_request_frame();
|
||||
state->loaded_t = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 rate = 1 - pow_f32(2, (-15.f * df_dt()));
|
||||
state->loaded_t += (1.f - state->loaded_t) * rate;
|
||||
if(state->loaded_t < 0.99f)
|
||||
{
|
||||
df_gfx_request_frame();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: build preview
|
||||
F32 rate = 1 - pow_f32(2, (-15.f * df_dt()));
|
||||
//
|
||||
if(expected_size != 0)
|
||||
{
|
||||
F32 img_dim = dim.y - ui_top_font_size()*2.f;
|
||||
@@ -1423,105 +1700,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap)
|
||||
UI_Column UI_Padding(ui_pct(1.f, 0.f))
|
||||
UI_PrefHeight(ui_px(img_dim, 1.f))
|
||||
{
|
||||
ui_set_next_hover_cursor(OS_Cursor_HandPoint);
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground|UI_BoxFlag_Clickable|UI_BoxFlag_DrawHotEffects, "image_box");
|
||||
UI_Signal sig = ui_signal_from_box(box);
|
||||
F32 ui_per_bmp_px = dim.y / (F32)topology_info.height;
|
||||
Vec2F32 mouse_ui_px_off = sub_2f32(ui_mouse(), box->rect.p0);
|
||||
Vec2S32 mouse_bitmap_px_off = v2s32(floor_f32(mouse_ui_px_off.x/ui_per_bmp_px), floor_f32(mouse_ui_px_off.y/ui_per_bmp_px));
|
||||
DF_ViewRuleHooks_BitmapBoxDrawData *draw_data = push_array(ui_build_arena(), DF_ViewRuleHooks_BitmapBoxDrawData, 1);
|
||||
draw_data->texture = texture;
|
||||
draw_data->src = r2f32(v2f32(0, 0), v2f32((F32)topology_info.width, (F32)topology_info.height));
|
||||
draw_data->loaded_t = state->loaded_t;
|
||||
draw_data->hovered = ui_hovering(sig);
|
||||
draw_data->mouse_px = mouse_bitmap_px_off;
|
||||
draw_data->ui_per_bmp_px = ui_per_bmp_px;
|
||||
ui_box_equip_custom_draw(box, df_view_rule_hooks__bitmap_box_draw, draw_data);
|
||||
if(r_handle_match(r_handle_zero(), texture))
|
||||
{
|
||||
df_gfx_request_frame();
|
||||
state->loaded_t = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->loaded_t += (1.f - state->loaded_t) * rate;
|
||||
if(state->loaded_t < 0.99f)
|
||||
{
|
||||
df_gfx_request_frame();
|
||||
}
|
||||
}
|
||||
if(ui_hovering(sig) && r_handle_match(texture, r_handle_zero())) UI_Tooltip
|
||||
{
|
||||
ui_labelf("Texture not loaded.");
|
||||
}
|
||||
if(ui_hovering(sig) && !r_handle_match(texture, r_handle_zero()))
|
||||
{
|
||||
if(dim.y > (F32)topology_info.height)
|
||||
{
|
||||
U128 hash = hs_hash_from_key(texture_key, 0);
|
||||
String8 data = hs_data_from_hash(hs_scope, hash);
|
||||
U64 bytes_per_pixel = r_tex2d_format_bytes_per_pixel_table[topology.fmt];
|
||||
U64 mouse_pixel_off = mouse_bitmap_px_off.y*topology_info.width + mouse_bitmap_px_off.x;
|
||||
U64 mouse_byte_off = mouse_pixel_off * bytes_per_pixel;
|
||||
B32 got_color = 0;
|
||||
Vec4F32 hsva = {0};
|
||||
if(mouse_byte_off + bytes_per_pixel <= data.size)
|
||||
{
|
||||
got_color = 1;
|
||||
switch(topology.fmt)
|
||||
{
|
||||
default:{got_color = 0;}break;
|
||||
case R_Tex2DFormat_RGBA8:
|
||||
{
|
||||
U8 r = data.str[mouse_byte_off+0];
|
||||
U8 g = data.str[mouse_byte_off+1];
|
||||
U8 b = data.str[mouse_byte_off+2];
|
||||
U8 a = data.str[mouse_byte_off+3];
|
||||
Vec4F32 rgba = v4f32(r/255.f, g/255.f, b/255.f, a/255.f);
|
||||
hsva = hsva_from_rgba(rgba);
|
||||
}break;
|
||||
case R_Tex2DFormat_BGRA8:
|
||||
{
|
||||
U8 r = data.str[mouse_byte_off+2];
|
||||
U8 g = data.str[mouse_byte_off+1];
|
||||
U8 b = data.str[mouse_byte_off+0];
|
||||
U8 a = data.str[mouse_byte_off+3];
|
||||
Vec4F32 rgba = v4f32(r/255.f, g/255.f, b/255.f, a/255.f);
|
||||
hsva = hsva_from_rgba(rgba);
|
||||
}break;
|
||||
case R_Tex2DFormat_R8:
|
||||
{
|
||||
U8 r = data.str[mouse_byte_off+0];
|
||||
Vec4F32 rgba = v4f32(r/255.f, 0, 0, 1.f);
|
||||
hsva = hsva_from_rgba(rgba);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
if(got_color)
|
||||
{
|
||||
ui_do_color_tooltip_hsva(hsva);
|
||||
}
|
||||
}
|
||||
else UI_Tooltip UI_Font(df_font_from_slot(DF_FontSlot_Code))
|
||||
{
|
||||
ui_label(r_tex2d_format_display_string_table[topology.fmt]);
|
||||
ui_labelf("%I64u x %I64u", topology_info.width, topology_info.height);
|
||||
UI_Padding(ui_em(2.f, 1.f))
|
||||
UI_PrefWidth(ui_children_sum(1.f))
|
||||
UI_PrefHeight(ui_children_sum(1.f))
|
||||
UI_Row
|
||||
UI_PrefWidth(ui_em(15.f, 1.f))
|
||||
UI_PrefHeight(ui_em(15.f, 1.f))
|
||||
UI_Padding(ui_em(2.f, 1.f))
|
||||
{
|
||||
UI_Box *zoom_box = ui_build_box_from_key(UI_BoxFlag_DrawBorder, ui_key_zero());
|
||||
DF_ViewRuleHooks_BitmapZoomDrawData *draw_data = push_array(ui_build_arena(), DF_ViewRuleHooks_BitmapZoomDrawData, 1);
|
||||
draw_data->src = r2f32p(mouse_bitmap_px_off.x - 16, mouse_bitmap_px_off.y - 16, mouse_bitmap_px_off.x + 16, mouse_bitmap_px_off.y + 16);
|
||||
draw_data->texture = texture;
|
||||
ui_box_equip_custom_draw(zoom_box, df_view_rule_hooks__bitmap_zoom_draw, draw_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
ui_image(texture, R_Tex2DSampleKind_Nearest, r2f32(v2f32(0, 0), v2f32((F32)topology_info.width, (F32)topology_info.height)), v4f32(1, 1, 1, state->loaded_t), 10.f*(1-state->loaded_t), str8_lit("image_box"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1530,41 +1709,226 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap)
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(bitmap)
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_BitmapViewState *bvs = df_view_user_state(view, DF_BitmapViewState);
|
||||
DBGI_Scope *dbgi_scope = dbgi_scope_open();
|
||||
DF_CfgNode *view_center_cfg = df_cfg_node_child_from_string(cfg_root, str8_lit("view_center"), StringMatchFlag_CaseInsensitive);
|
||||
DF_CfgNode *zoom_cfg = df_cfg_node_child_from_string(cfg_root, str8_lit("zoom"), StringMatchFlag_CaseInsensitive);
|
||||
DF_CfgNode *bitmap_cfg = df_cfg_node_child_from_string(cfg_root, str8_lit("bitmap"), StringMatchFlag_CaseInsensitive);
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
U64 thread_unwind_rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, ctrl_ctx.unwind_count);
|
||||
EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(dbgi_scope, process, thread_unwind_rip_vaddr);
|
||||
bvs->view_center_pos.x = (F32)f64_from_str8(bitmap_cfg->first->string);
|
||||
bvs->view_center_pos.y = (F32)f64_from_str8(bitmap_cfg->first->next->string);
|
||||
bvs->zoom = (F32)f64_from_str8(zoom_cfg->first->string);
|
||||
bvs->top = df_vr_bitmap_topology_info_from_cfg(dbgi_scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, bitmap_cfg);
|
||||
if(bvs->zoom == 0)
|
||||
{
|
||||
bvs->zoom = 1.f;
|
||||
}
|
||||
dbgi_scope_close(dbgi_scope);
|
||||
}
|
||||
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_BitmapViewState *bvs = df_view_user_state(view, DF_BitmapViewState);
|
||||
String8 result = push_str8f(arena, "view_center:(%.2f %.2f) zoom:(%.2f) bitmap:(w:%I64u, h:%I64u, fmt:%S)",
|
||||
bvs->view_center_pos.x,
|
||||
bvs->view_center_pos.y,
|
||||
bvs->zoom,
|
||||
bvs->top.width,
|
||||
bvs->top.height,
|
||||
r_tex2d_format_display_string_table[bvs->top.fmt]);
|
||||
return result;
|
||||
}
|
||||
|
||||
DF_VIEW_CMD_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
}
|
||||
|
||||
internal UI_BOX_CUSTOM_DRAW(df_bitmap_view_canvas_box_draw)
|
||||
{
|
||||
DF_BitmapViewState *bvs = (DF_BitmapViewState *)user_data;
|
||||
Rng2F32 rect_scrn = box->rect;
|
||||
Rng2F32 rect_cvs = df_bitmap_view_state__canvas_from_screen_rect(bvs, rect_scrn, rect_scrn);
|
||||
F32 grid_cell_size_cvs = box->font_size*10.f;
|
||||
F32 grid_line_thickness_px = Max(2.f, box->font_size*0.1f);
|
||||
Vec4F32 grid_line_color = df_rgba_from_theme_color(DF_ThemeColor_WeakText);
|
||||
for(EachEnumVal(Axis2, axis))
|
||||
{
|
||||
for(F32 v = rect_cvs.p0.v[axis] - mod_f32(rect_cvs.p0.v[axis], grid_cell_size_cvs);
|
||||
v < rect_cvs.p1.v[axis];
|
||||
v += grid_cell_size_cvs)
|
||||
{
|
||||
Vec2F32 p_cvs = {0};
|
||||
p_cvs.v[axis] = v;
|
||||
Vec2F32 p_scr = df_bitmap_view_state__screen_from_canvas_pos(bvs, rect_scrn, p_cvs);
|
||||
Rng2F32 rect = {0};
|
||||
rect.p0.v[axis] = p_scr.v[axis] - grid_line_thickness_px/2;
|
||||
rect.p1.v[axis] = p_scr.v[axis] + grid_line_thickness_px/2;
|
||||
rect.p0.v[axis2_flip(axis)] = box->rect.p0.v[axis2_flip(axis)];
|
||||
rect.p1.v[axis2_flip(axis)] = box->rect.p1.v[axis2_flip(axis)];
|
||||
d_rect(rect, grid_line_color, 0, 0, 1.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DF_VIEW_UI_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_BitmapViewState *bvs = df_view_user_state(view, DF_BitmapViewState);
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DBGI_Scope *dbgi_scope = dbgi_scope_open();
|
||||
HS_Scope *hs_scope = hs_scope_open();
|
||||
TEX_Scope *tex_scope = tex_scope_open();
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: unpack context
|
||||
//
|
||||
DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view);
|
||||
DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread);
|
||||
DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process);
|
||||
U64 thread_unwind_rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, ctrl_ctx.unwind_count);
|
||||
EVAL_ParseCtx parse_ctx = df_eval_parse_ctx_from_process_vaddr(dbgi_scope, process, thread_unwind_rip_vaddr);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: evaluate expression
|
||||
//
|
||||
String8 expr = str8(view->query_buffer, view->query_string_size);
|
||||
DF_Eval eval = df_eval_from_string(scratch.arena, dbgi_scope, &ctrl_ctx, &parse_ctx, &eval_string2expr_map_nil, expr);
|
||||
DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx.type_graph, parse_ctx.rdi, &ctrl_ctx, eval);
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
U64 expected_size = bvs->top.width*bvs->top.height*r_tex2d_format_bytes_per_pixel_table[bvs->top.fmt];
|
||||
Rng1U64 vaddr_range = r1u64(base_vaddr, base_vaddr+expected_size);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: map expression artifacts -> texture
|
||||
//
|
||||
U128 texture_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, vaddr_range, 0);
|
||||
TEX_Topology topology = tex_topology_make(v2s32((S32)bvs->top.width, (S32)bvs->top.height), bvs->top.fmt);
|
||||
R_Handle texture = tex_texture_from_key_topology(tex_scope, texture_key, topology);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: build canvas box
|
||||
//
|
||||
UI_Box *canvas_box = &ui_g_nil_box;
|
||||
Vec2F32 canvas_dim = dim_2f32(rect);
|
||||
Rng2F32 canvas_rect = r2f32p(0, 0, canvas_dim.x, canvas_dim.y);
|
||||
UI_Rect(canvas_rect)
|
||||
{
|
||||
canvas_box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable|UI_BoxFlag_Scroll, "bmp_canvas_%p", view);
|
||||
ui_box_equip_custom_draw(canvas_box, df_bitmap_view_canvas_box_draw, bvs);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: canvas box interaction
|
||||
//
|
||||
{
|
||||
UI_Signal canvas_sig = ui_signal_from_box(canvas_box);
|
||||
if(ui_dragging(canvas_sig))
|
||||
{
|
||||
if(ui_pressed(canvas_sig))
|
||||
{
|
||||
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel));
|
||||
ui_store_drag_struct(&bvs->view_center_pos);
|
||||
}
|
||||
Vec2F32 start_view_center_pos = *ui_get_drag_struct(Vec2F32);
|
||||
Vec2F32 drag_delta_scr = ui_drag_delta();
|
||||
Vec2F32 drag_delta_cvs = scale_2f32(drag_delta_scr, 1.f/bvs->zoom);
|
||||
Vec2F32 new_view_center_pos = sub_2f32(start_view_center_pos, drag_delta_cvs);
|
||||
bvs->view_center_pos = new_view_center_pos;
|
||||
}
|
||||
if(canvas_sig.scroll.y != 0)
|
||||
{
|
||||
F32 new_zoom = bvs->zoom - bvs->zoom*canvas_sig.scroll.y/10.f;
|
||||
new_zoom = Clamp(1.f/256.f, new_zoom, 256.f);
|
||||
Vec2F32 mouse_scr_pre = sub_2f32(ui_mouse(), rect.p0);
|
||||
Vec2F32 mouse_cvs = df_bitmap_view_state__canvas_from_screen_pos(bvs, canvas_rect, mouse_scr_pre);
|
||||
bvs->zoom = new_zoom;
|
||||
Vec2F32 mouse_scr_pst = df_bitmap_view_state__screen_from_canvas_pos(bvs, canvas_rect, mouse_cvs);
|
||||
Vec2F32 drift_scr = sub_2f32(mouse_scr_pst, mouse_scr_pre);
|
||||
bvs->view_center_pos = add_2f32(bvs->view_center_pos, scale_2f32(drift_scr, 1.f/new_zoom));
|
||||
}
|
||||
if(ui_double_clicked(canvas_sig))
|
||||
{
|
||||
ui_kill_action();
|
||||
MemoryZeroStruct(&bvs->view_center_pos);
|
||||
bvs->zoom = 1.f;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: build image
|
||||
//
|
||||
UI_Parent(canvas_box)
|
||||
{
|
||||
Rng2F32 img_rect_cvs = r2f32p(-topology.dim.x/2, -topology.dim.y/2, +topology.dim.x/2, +topology.dim.y/2);
|
||||
Rng2F32 img_rect_scr = df_bitmap_view_state__screen_from_canvas_rect(bvs, canvas_rect, img_rect_cvs);
|
||||
UI_Rect(img_rect_scr) UI_Flags(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawDropShadow|UI_BoxFlag_Floating)
|
||||
{
|
||||
ui_image(texture, R_Tex2DSampleKind_Nearest, r2f32p(0, 0, (F32)bvs->top.width, (F32)bvs->top.height), v4f32(1, 1, 1, 1), 0, str8_lit("bmp_image"));
|
||||
}
|
||||
}
|
||||
|
||||
hs_scope_close(hs_scope);
|
||||
tex_scope_close(tex_scope);
|
||||
dbgi_scope_close(dbgi_scope);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "geo"
|
||||
|
||||
typedef struct DF_ViewRuleHooks_GeoState DF_ViewRuleHooks_GeoState;
|
||||
struct DF_ViewRuleHooks_GeoState
|
||||
internal DF_GeoTopologyInfo
|
||||
df_vr_geo_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg)
|
||||
{
|
||||
B32 initialized;
|
||||
U64 last_open_frame_idx;
|
||||
F32 loaded_t;
|
||||
F32 pitch;
|
||||
F32 pitch_target;
|
||||
F32 yaw;
|
||||
F32 yaw_target;
|
||||
F32 zoom;
|
||||
F32 zoom_target;
|
||||
};
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_GeoTopologyInfo result = {0};
|
||||
{
|
||||
StringJoin join = {0};
|
||||
join.sep = str8_lit(" ");
|
||||
DF_CfgNode *count_cfg = df_cfg_node_child_from_string(cfg, str8_lit("count"), 0);
|
||||
DF_CfgNode *vertices_base_cfg = df_cfg_node_child_from_string(cfg, str8_lit("vertices_base"), 0);
|
||||
DF_CfgNode *vertices_size_cfg = df_cfg_node_child_from_string(cfg, str8_lit("vertices_size"), 0);
|
||||
String8List count_expr_strs = {0};
|
||||
String8List vertices_base_expr_strs = {0};
|
||||
String8List vertices_size_expr_strs = {0};
|
||||
for(DF_CfgNode *child = count_cfg->first; child != &df_g_nil_cfg_node; child = child->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &count_expr_strs, child->string);
|
||||
}
|
||||
for(DF_CfgNode *child = vertices_base_cfg->first; child != &df_g_nil_cfg_node; child = child->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &vertices_base_expr_strs, child->string);
|
||||
}
|
||||
for(DF_CfgNode *child = vertices_size_cfg->first; child != &df_g_nil_cfg_node; child = child->next)
|
||||
{
|
||||
str8_list_push(scratch.arena, &vertices_size_expr_strs, child->string);
|
||||
}
|
||||
String8 count_expr = str8_list_join(scratch.arena, &count_expr_strs, &join);
|
||||
String8 vertices_base_expr = str8_list_join(scratch.arena, &vertices_base_expr_strs, &join);
|
||||
String8 vertices_size_expr = str8_list_join(scratch.arena, &vertices_size_expr_strs, &join);
|
||||
DF_Eval count_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, count_expr);
|
||||
DF_Eval vertices_base_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, vertices_base_expr);
|
||||
DF_Eval vertices_size_eval = df_eval_from_string(scratch.arena, scope, ctrl_ctx, parse_ctx, macro_map, vertices_size_expr);
|
||||
DF_Eval count_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, count_eval);
|
||||
DF_Eval vertices_base_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, vertices_base_eval);
|
||||
DF_Eval vertices_size_val_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, vertices_size_eval);
|
||||
U64 vertices_base_vaddr = vertices_base_val_eval.imm_u64 ? vertices_base_val_eval.imm_u64 : vertices_base_val_eval.offset;
|
||||
result.index_count = count_val_eval.imm_u64;
|
||||
result.vertices_vaddr_range = r1u64(vertices_base_vaddr, vertices_base_vaddr+vertices_size_val_eval.imm_u64);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef struct DF_ViewRuleHooks_GeoBoxDrawData DF_ViewRuleHooks_GeoBoxDrawData;
|
||||
struct DF_ViewRuleHooks_GeoBoxDrawData
|
||||
internal UI_BOX_CUSTOM_DRAW(df_vr_geo_box_draw)
|
||||
{
|
||||
DF_ExpandKey key;
|
||||
R_Handle vertex_buffer;
|
||||
R_Handle index_buffer;
|
||||
F32 loaded_t;
|
||||
};
|
||||
|
||||
internal UI_BOX_CUSTOM_DRAW(df_view_rule_hooks__geo_box_draw)
|
||||
{
|
||||
DF_ViewRuleHooks_GeoBoxDrawData *draw_data = (DF_ViewRuleHooks_GeoBoxDrawData *)user_data;
|
||||
DF_ViewRuleHooks_GeoState *state = df_view_rule_block_user_state(draw_data->key, DF_ViewRuleHooks_GeoState);
|
||||
DF_VR_GeoBoxDrawData *draw_data = (DF_VR_GeoBoxDrawData *)user_data;
|
||||
DF_VR_GeoState *state = df_view_rule_block_user_state(draw_data->key, DF_VR_GeoState);
|
||||
Vec4F32 bg_color = box->background_color;
|
||||
|
||||
// rjf: get clip
|
||||
@@ -1602,6 +1966,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 16);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -1620,7 +1985,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
GEO_Scope *geo_scope = geo_scope_open();
|
||||
DF_ViewRuleHooks_GeoState *state = df_view_rule_block_user_state(key, DF_ViewRuleHooks_GeoState);
|
||||
DF_VR_GeoState *state = df_view_rule_block_user_state(key, DF_VR_GeoState);
|
||||
if(!state->initialized)
|
||||
{
|
||||
state->initialized = 1;
|
||||
@@ -1639,7 +2004,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo)
|
||||
U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset;
|
||||
|
||||
//- rjf: extract extra geo topology info from view rule
|
||||
DF_GeoTopologyInfo top = df_view_rule_hooks__geo_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
DF_GeoTopologyInfo top = df_vr_geo_topology_info_from_cfg(dbgi_scope, ctrl_ctx, parse_ctx, macro_map, cfg);
|
||||
Rng1U64 index_buffer_vaddr_range = r1u64(base_vaddr, base_vaddr+top.index_count*sizeof(U32));
|
||||
Rng1U64 vertex_buffer_vaddr_range = top.vertices_vaddr_range;
|
||||
|
||||
@@ -1687,12 +2052,12 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo)
|
||||
{
|
||||
df_gfx_request_frame();
|
||||
}
|
||||
DF_ViewRuleHooks_GeoBoxDrawData *draw_data = push_array(ui_build_arena(), DF_ViewRuleHooks_GeoBoxDrawData, 1);
|
||||
DF_VR_GeoBoxDrawData *draw_data = push_array(ui_build_arena(), DF_VR_GeoBoxDrawData, 1);
|
||||
draw_data->key = key;
|
||||
draw_data->vertex_buffer = vertex_buffer;
|
||||
draw_data->index_buffer = index_buffer;
|
||||
draw_data->loaded_t = state->loaded_t;
|
||||
ui_box_equip_custom_draw(box, df_view_rule_hooks__geo_box_draw, draw_data);
|
||||
ui_box_equip_custom_draw(box, df_vr_geo_box_draw, draw_data);
|
||||
if(r_handle_match(r_handle_zero(), vertex_buffer))
|
||||
{
|
||||
df_gfx_request_frame();
|
||||
@@ -1712,3 +2077,10 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo)
|
||||
geo_scope_close(geo_scope);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(geo) {}
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(geo) { return str8_lit(""); }
|
||||
DF_VIEW_CMD_FUNCTION_DEF(geo) {}
|
||||
DF_VIEW_UI_FUNCTION_DEF(geo)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef DF_VIEW_RULES_H
|
||||
#define DF_VIEW_RULES_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "rgba"
|
||||
|
||||
typedef struct DF_VR_RGBAState DF_VR_RGBAState;
|
||||
struct DF_VR_RGBAState
|
||||
{
|
||||
Vec4F32 hsva;
|
||||
U64 memgen_idx;
|
||||
};
|
||||
|
||||
internal Vec4F32 df_vr_rgba_from_eval(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_Entity *process);
|
||||
internal void df_vr_eval_commit_rgba(DF_Eval eval, TG_Graph *graph, RDI_Parsed *raddbg, DF_CtrlCtx *ctrl_ctx, Vec4F32 rgba);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "text"
|
||||
|
||||
typedef struct DF_TxtTopologyInfo DF_TxtTopologyInfo;
|
||||
struct DF_TxtTopologyInfo
|
||||
{
|
||||
TXT_LangKind lang;
|
||||
U64 size_cap;
|
||||
};
|
||||
|
||||
typedef struct DF_VR_TextState DF_VR_TextState;
|
||||
struct DF_VR_TextState
|
||||
{
|
||||
B32 initialized;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
S64 preferred_column;
|
||||
U64 last_open_frame_idx;
|
||||
F32 loaded_t;
|
||||
};
|
||||
|
||||
internal DF_TxtTopologyInfo df_vr_txt_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "disasm"
|
||||
|
||||
typedef struct DF_DisasmTopologyInfo DF_DisasmTopologyInfo;
|
||||
struct DF_DisasmTopologyInfo
|
||||
{
|
||||
Architecture arch;
|
||||
U64 size_cap;
|
||||
};
|
||||
|
||||
typedef struct DF_VR_DisasmState DF_VR_DisasmState;
|
||||
struct DF_VR_DisasmState
|
||||
{
|
||||
B32 initialized;
|
||||
TxtPt cursor;
|
||||
TxtPt mark;
|
||||
S64 preferred_column;
|
||||
U64 last_open_frame_idx;
|
||||
F32 loaded_t;
|
||||
};
|
||||
|
||||
internal DF_DisasmTopologyInfo df_vr_disasm_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "bitmap"
|
||||
|
||||
typedef struct DF_BitmapTopologyInfo DF_BitmapTopologyInfo;
|
||||
struct DF_BitmapTopologyInfo
|
||||
{
|
||||
U64 width;
|
||||
U64 height;
|
||||
R_Tex2DFormat fmt;
|
||||
};
|
||||
|
||||
typedef struct DF_BitmapViewState DF_BitmapViewState;
|
||||
struct DF_BitmapViewState
|
||||
{
|
||||
Vec2F32 view_center_pos;
|
||||
F32 zoom;
|
||||
DF_BitmapTopologyInfo top;
|
||||
};
|
||||
|
||||
typedef struct DF_VR_BitmapState DF_VR_BitmapState;
|
||||
struct DF_VR_BitmapState
|
||||
{
|
||||
U64 last_open_frame_idx;
|
||||
F32 loaded_t;
|
||||
};
|
||||
|
||||
typedef struct DF_VR_BitmapBoxDrawData DF_VR_BitmapBoxDrawData;
|
||||
struct DF_VR_BitmapBoxDrawData
|
||||
{
|
||||
Rng2F32 src;
|
||||
R_Handle texture;
|
||||
F32 loaded_t;
|
||||
B32 hovered;
|
||||
Vec2S32 mouse_px;
|
||||
F32 ui_per_bmp_px;
|
||||
};
|
||||
|
||||
internal Vec2F32 df_bitmap_view_state__screen_from_canvas_pos(DF_BitmapViewState *bvs, Rng2F32 rect, Vec2F32 cvs);
|
||||
internal Rng2F32 df_bitmap_view_state__screen_from_canvas_rect(DF_BitmapViewState *bvs, Rng2F32 rect, Rng2F32 cvs);
|
||||
internal Vec2F32 df_bitmap_view_state__canvas_from_screen_pos(DF_BitmapViewState *bvs, Rng2F32 rect, Vec2F32 scr);
|
||||
internal Rng2F32 df_bitmap_view_state__canvas_from_screen_rect(DF_BitmapViewState *bvs, Rng2F32 rect, Rng2F32 scr);
|
||||
internal DF_BitmapTopologyInfo df_vr_bitmap_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: "geo"
|
||||
|
||||
typedef struct DF_GeoTopologyInfo DF_GeoTopologyInfo;
|
||||
struct DF_GeoTopologyInfo
|
||||
{
|
||||
U64 index_count;
|
||||
Rng1U64 vertices_vaddr_range;
|
||||
};
|
||||
|
||||
typedef struct DF_VR_GeoState DF_VR_GeoState;
|
||||
struct DF_VR_GeoState
|
||||
{
|
||||
B32 initialized;
|
||||
U64 last_open_frame_idx;
|
||||
F32 loaded_t;
|
||||
F32 pitch;
|
||||
F32 pitch_target;
|
||||
F32 yaw;
|
||||
F32 yaw_target;
|
||||
F32 zoom;
|
||||
F32 zoom_target;
|
||||
};
|
||||
|
||||
typedef struct DF_VR_GeoBoxDrawData DF_VR_GeoBoxDrawData;
|
||||
struct DF_VR_GeoBoxDrawData
|
||||
{
|
||||
DF_ExpandKey key;
|
||||
R_Handle vertex_buffer;
|
||||
R_Handle index_buffer;
|
||||
F32 loaded_t;
|
||||
};
|
||||
|
||||
internal DF_GeoTopologyInfo df_vr_geo_topology_info_from_cfg(DBGI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_CfgNode *cfg);
|
||||
|
||||
#endif // DF_VIEW_RULES_H
|
||||
+351
-30
@@ -997,7 +997,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
for(DF_EvalVizRow *row = rows.first; row != 0; row = row->next, semantic_idx += 1)
|
||||
{
|
||||
U64 row_hash = df_hash_from_expand_key(row->key);
|
||||
U64 expr_hash = df_hash_from_string(row->expr);
|
||||
U64 expr_hash = df_hash_from_string(row->display_expr);
|
||||
df_expand_tree_table_animate(&eval_view->expand_tree_table, df_dt());
|
||||
B32 row_selected = ((semantic_idx+1) == cursor_tbl.y);
|
||||
B32 row_expanded = df_expand_key_is_set(&eval_view->expand_tree_table, row->key);
|
||||
@@ -1037,6 +1037,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
//- rjf: build canvas row
|
||||
if(row->flags & DF_EvalVizRowFlag_Canvas) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off) ProfScope("canvas row")
|
||||
{
|
||||
//- rjf: build
|
||||
ui_set_next_flags(disabled_flags);
|
||||
ui_set_next_pref_width(ui_pct(1, 0));
|
||||
ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f));
|
||||
@@ -1053,22 +1054,40 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
{
|
||||
Vec2F32 canvas_dim = v2f32(scroll_list_params.dim_px.x - ui_top_font_size()*1.5f,
|
||||
(row->skipped_size_in_rows+row->size_in_rows+row->chopped_size_in_rows)*scroll_list_params.row_height_px);
|
||||
row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->expand_ui_rule_node, canvas_dim);
|
||||
row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, row->edit_expr, scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->expand_ui_rule_node, canvas_dim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: take interaction
|
||||
UI_Signal sig = ui_signal_from_box(vector);
|
||||
|
||||
//- rjf: press -> focus
|
||||
if(ui_pressed(sig))
|
||||
{
|
||||
edit_commit = edit_commit || (!row_selected && ewv->input_editing);
|
||||
next_cursor_tbl = v2s64(DF_EvalWatchViewColumnKind_Expr, (semantic_idx+1));
|
||||
pressed = 1;
|
||||
}
|
||||
if(ui_double_clicked(sig))
|
||||
|
||||
//- rjf: double clicked or keyboard clicked -> open dedicated tab
|
||||
if(ui_double_clicked(sig) || sig.f & UI_SignalFlag_KeyboardPressed)
|
||||
{
|
||||
DF_CfgNode *cfg = df_cfg_tree_copy(scratch.arena, row->expand_ui_rule_node);
|
||||
DF_CfgNode *cfg_root = push_array(scratch.arena, DF_CfgNode, 1);
|
||||
cfg_root->first = cfg_root->last = cfg;
|
||||
cfg_root->next = cfg_root->parent = &df_g_nil_cfg_node;
|
||||
if(cfg != &df_g_nil_cfg_node)
|
||||
{
|
||||
cfg->parent = cfg_root;
|
||||
}
|
||||
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
|
||||
p.view_spec = df_view_spec_from_gfx_view_kind(DF_GfxViewKind_EvalViewer);
|
||||
p.string = row->edit_expr;
|
||||
p.view_spec = df_tab_view_spec_from_gfx_view_rule_spec(row->expand_ui_rule_spec);
|
||||
p.cfg_node = cfg_root;
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_String);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_ViewSpec);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_CfgNode);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_OpenTab));
|
||||
}
|
||||
}
|
||||
@@ -1130,8 +1149,8 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
if(cell_selected && (edit_begin || (edit_begin_or_expand && !(row->flags & DF_EvalVizRowFlag_CanExpand))) && can_edit_expr)
|
||||
{
|
||||
ewv->input_editing = 1;
|
||||
ewv->input_size = Min(sizeof(ewv->input_buffer), row->expr.size);
|
||||
MemoryCopy(ewv->input_buffer, row->expr.str, ewv->input_size);
|
||||
ewv->input_size = Min(sizeof(ewv->input_buffer), row->display_expr.size);
|
||||
MemoryCopy(ewv->input_buffer, row->display_expr.str, ewv->input_size);
|
||||
ewv->input_cursor = txt_pt(1, 1+ewv->input_size);
|
||||
ewv->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
@@ -1163,7 +1182,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
FuzzyMatchRangeList matches = {0};
|
||||
if(filter.size != 0)
|
||||
{
|
||||
matches = fuzzy_match_find(scratch.arena, filter, row->expr);
|
||||
matches = fuzzy_match_find(scratch.arena, filter, row->display_expr);
|
||||
}
|
||||
sig = df_line_editf((DF_LineEditFlag_CodeContents*(!(row->flags & DF_EvalVizRowFlag_ExprIsSpecial))|
|
||||
DF_LineEditFlag_NoBackground*(!is_inherited)|
|
||||
@@ -1174,7 +1193,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
row->depth,
|
||||
filter.size ? &matches : 0,
|
||||
&ewv->input_cursor, &ewv->input_mark, ewv->input_buffer, sizeof(ewv->input_buffer), &ewv->input_size, &next_expanded,
|
||||
row->expr,
|
||||
row->display_expr,
|
||||
"###row_%I64x", row_hash);
|
||||
}
|
||||
edit_commit = edit_commit || ui_committed(sig);
|
||||
@@ -1206,7 +1225,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
if(DEV_eval_compiler_tooltips && row->depth == 0 && ui_hovering(sig)) UI_Tooltip
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 string = row->expr;
|
||||
String8 string = row->display_expr;
|
||||
|
||||
// rjf: lex & parse
|
||||
EVAL_TokenArray tokens = eval_token_array_from_text(scratch.arena, string);
|
||||
@@ -1270,8 +1289,8 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
{
|
||||
ui_kill_action();
|
||||
ewv->input_editing = 1;
|
||||
ewv->input_size = Min(sizeof(ewv->input_buffer), row->expr.size);
|
||||
MemoryCopy(ewv->input_buffer, row->expr.str, ewv->input_size);
|
||||
ewv->input_size = Min(sizeof(ewv->input_buffer), row->display_expr.size);
|
||||
MemoryCopy(ewv->input_buffer, row->display_expr.str, ewv->input_size);
|
||||
ewv->input_cursor = txt_pt(1, 1+ewv->input_size);
|
||||
ewv->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
@@ -2136,7 +2155,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem)
|
||||
if(query_normalized_with_opt_slash_props.flags & FilePropertyFlag_IsFolder)
|
||||
{
|
||||
String8 new_path = push_str8f(scratch.arena, "%S%S/", path_query.path, path_query.search);
|
||||
df_view_equip_spec(view, view->spec, df_entity_from_handle(view->entity), new_path, &df_g_nil_cfg_node);
|
||||
df_view_equip_spec(ws, view, view->spec, df_entity_from_handle(view->entity), new_path, &df_g_nil_cfg_node);
|
||||
}
|
||||
|
||||
// rjf: is a file -> complete view
|
||||
@@ -2166,7 +2185,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem)
|
||||
{
|
||||
String8 existing_path = str8_chop_last_slash(path_query.path);
|
||||
String8 new_path = push_str8f(scratch.arena, "%S/%S/", existing_path, files[0].filename);
|
||||
df_view_equip_spec(view, view->spec, df_entity_from_handle(view->entity), new_path, &df_g_nil_cfg_node);
|
||||
df_view_equip_spec(ws, view, view->spec, df_entity_from_handle(view->entity), new_path, &df_g_nil_cfg_node);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2298,7 +2317,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem)
|
||||
{
|
||||
new_path = path_normalized_from_string(scratch.arena, new_path);
|
||||
String8 new_cmd = push_str8f(scratch.arena, "%S/", new_path);
|
||||
df_view_equip_spec(view, view->spec, df_entity_from_handle(view->entity), new_cmd, &df_g_nil_cfg_node);
|
||||
df_view_equip_spec(ws, view, view->spec, df_entity_from_handle(view->entity), new_cmd, &df_g_nil_cfg_node);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2381,7 +2400,7 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem)
|
||||
if(file->props.flags & FilePropertyFlag_IsFolder)
|
||||
{
|
||||
String8 new_cmd = push_str8f(scratch.arena, "%S/", new_path);
|
||||
df_view_equip_spec(view, view->spec, df_entity_from_handle(view->entity), new_cmd, &df_g_nil_cfg_node);
|
||||
df_view_equip_spec(ws, view, view->spec, df_entity_from_handle(view->entity), new_cmd, &df_g_nil_cfg_node);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3435,7 +3454,7 @@ DF_VIEW_UI_FUNCTION_DEF(FilePathMap)
|
||||
B32 edit_end = 0;
|
||||
B32 edit_commit = 0;
|
||||
B32 edit_submit = 0;
|
||||
if(ui_is_focus_active())
|
||||
UI_Focus(UI_FocusKind_On) if(ui_is_focus_active())
|
||||
{
|
||||
if(!fpms->input_editing)
|
||||
{
|
||||
@@ -3699,6 +3718,296 @@ DF_VIEW_UI_FUNCTION_DEF(FilePathMap)
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: AutoViewRules @view_hook_impl
|
||||
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(AutoViewRules)
|
||||
{
|
||||
DF_AutoViewRulesViewState *avrs = df_view_user_state(view, DF_AutoViewRulesViewState);
|
||||
if(avrs->initialized == 0)
|
||||
{
|
||||
avrs->initialized = 1;
|
||||
avrs->src_column_pct = 0.5f;
|
||||
avrs->dst_column_pct = 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(AutoViewRules)
|
||||
{
|
||||
DF_AutoViewRulesViewState *avrs = df_view_user_state(view, DF_AutoViewRulesViewState);
|
||||
return str8_lit("");
|
||||
}
|
||||
|
||||
DF_VIEW_CMD_FUNCTION_DEF(AutoViewRules)
|
||||
{
|
||||
DF_AutoViewRulesViewState *avrs = df_view_user_state(view, DF_AutoViewRulesViewState);
|
||||
|
||||
// rjf: process commands
|
||||
for(DF_CmdNode *n = cmds->first; n != 0; n = n->next)
|
||||
{
|
||||
DF_Cmd *cmd = &n->cmd;
|
||||
|
||||
// rjf: mismatched window/panel => skip
|
||||
if(df_window_from_handle(cmd->params.window) != ws ||
|
||||
df_panel_from_handle(cmd->params.panel) != panel)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DF_VIEW_UI_FUNCTION_DEF(AutoViewRules)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
DF_EntityList maps_list = df_query_cached_entity_list_with_kind(DF_EntityKind_AutoViewRule);
|
||||
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
|
||||
DF_AutoViewRulesViewState *avrs = df_view_user_state(view, DF_AutoViewRulesViewState);
|
||||
|
||||
//- rjf: take controls to start/end editing
|
||||
B32 edit_begin = 0;
|
||||
B32 edit_end = 0;
|
||||
B32 edit_commit = 0;
|
||||
B32 edit_submit = 0;
|
||||
UI_Focus(UI_FocusKind_On) if(ui_is_focus_active())
|
||||
{
|
||||
if(!avrs->input_editing)
|
||||
{
|
||||
UI_NavActionList *nav_actions = ui_nav_actions();
|
||||
for(UI_NavActionNode *n = nav_actions->first; n != 0; n = n->next)
|
||||
{
|
||||
if(n->v.insertion.size != 0 || n->v.flags & UI_NavActionFlag_Paste)
|
||||
{
|
||||
edit_begin = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(os_key_press(ui_events(), ui_window(), 0, OS_Key_F2))
|
||||
{
|
||||
edit_begin = 1;
|
||||
}
|
||||
}
|
||||
if(avrs->input_editing)
|
||||
{
|
||||
if(os_key_press(ui_events(), ui_window(), 0, OS_Key_Esc))
|
||||
{
|
||||
edit_end = 1;
|
||||
edit_commit = 0;
|
||||
}
|
||||
if(os_key_press(ui_events(), ui_window(), 0, OS_Key_Return))
|
||||
{
|
||||
edit_end = 1;
|
||||
edit_commit = 1;
|
||||
edit_submit = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: build
|
||||
DF_Handle commit_map = df_handle_zero();
|
||||
Side commit_side = Side_Invalid;
|
||||
F32 *col_pcts[] = { &avrs->src_column_pct, &avrs->dst_column_pct };
|
||||
Vec2S64 next_cursor = avrs->cursor;
|
||||
Rng1S64 visible_row_range = {0};
|
||||
UI_ScrollListParams scroll_list_params = {0};
|
||||
{
|
||||
scroll_list_params.flags = UI_ScrollListFlag_All;
|
||||
scroll_list_params.row_height_px = row_height_px;
|
||||
scroll_list_params.dim_px = dim_2f32(rect);
|
||||
scroll_list_params.cursor_range = r2s64(v2s64(0, 0), v2s64(1, maps.count + 1));
|
||||
scroll_list_params.item_range = r1s64(0, maps.count+2);
|
||||
scroll_list_params.cursor_min_is_empty_selection[Axis2_Y] = 1;
|
||||
}
|
||||
UI_ScrollListSignal scroll_list_sig = {0};
|
||||
UI_Focus(UI_FocusKind_On)
|
||||
UI_ScrollList(&scroll_list_params, &view->scroll_pos.y, avrs->input_editing ? 0 : &avrs->cursor, &visible_row_range, &scroll_list_sig)
|
||||
UI_Focus(UI_FocusKind_Null)
|
||||
UI_TableF(ArrayCount(col_pcts), col_pcts, "###tbl")
|
||||
{
|
||||
next_cursor = avrs->cursor;
|
||||
|
||||
//- rjf: header
|
||||
if(visible_row_range.min == 0) UI_TableVector UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
{
|
||||
UI_TableCell ui_label(str8_lit("Type"));
|
||||
UI_TableCell ui_label(str8_lit("View Rule"));
|
||||
}
|
||||
|
||||
//- rjf: map rows
|
||||
for(S64 row_idx = Max(1, visible_row_range.min);
|
||||
row_idx <= visible_row_range.max && row_idx <= maps.count+1;
|
||||
row_idx += 1) UI_TableVector
|
||||
{
|
||||
U64 map_idx = row_idx-1;
|
||||
DF_Entity *map = (map_idx < maps.count ? maps.v[map_idx] : &df_g_nil_entity);
|
||||
DF_Entity *source = df_entity_child_from_kind(map, DF_EntityKind_Source);
|
||||
DF_Entity *dest = df_entity_child_from_kind(map, DF_EntityKind_Dest);
|
||||
String8 type = source->name;
|
||||
String8 view_rule = dest->name;
|
||||
B32 row_selected = (avrs->cursor.y == row_idx);
|
||||
|
||||
//- rjf: type
|
||||
UI_TableCell UI_WidthFill
|
||||
{
|
||||
//- rjf: editor
|
||||
{
|
||||
B32 value_selected = (row_selected && avrs->cursor.x == 0);
|
||||
|
||||
// rjf: begin editing
|
||||
if(value_selected && edit_begin)
|
||||
{
|
||||
avrs->input_editing = 1;
|
||||
avrs->input_size = Min(sizeof(avrs->input_buffer), type.size);
|
||||
MemoryCopy(avrs->input_buffer, type.str, avrs->input_size);
|
||||
avrs->input_cursor = txt_pt(1, 1+avrs->input_size);
|
||||
avrs->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
|
||||
// rjf: build
|
||||
UI_Signal sig = {0};
|
||||
UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((value_selected && avrs->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code))
|
||||
{
|
||||
sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground|DF_LineEditFlag_DisplayStringIsCode, 0, 0, &avrs->input_cursor, &avrs->input_mark, avrs->input_buffer, sizeof(avrs->input_buffer), &avrs->input_size, 0, type, "###src_editor_%p", map);
|
||||
edit_commit = edit_commit || ui_committed(sig);
|
||||
}
|
||||
|
||||
// rjf: focus panel on press
|
||||
if(ui_pressed(sig))
|
||||
{
|
||||
DF_CmdParams p = df_cmd_params_from_panel(ws, panel);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel));
|
||||
}
|
||||
|
||||
// rjf: begin editing on double-click
|
||||
if(!avrs->input_editing && ui_double_clicked(sig))
|
||||
{
|
||||
avrs->input_editing = 1;
|
||||
avrs->input_size = Min(sizeof(avrs->input_buffer), type.size);
|
||||
MemoryCopy(avrs->input_buffer, type.str, avrs->input_size);
|
||||
avrs->input_cursor = txt_pt(1, 1+avrs->input_size);
|
||||
avrs->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
|
||||
// rjf: press on non-selected => commit edit, change selected cell
|
||||
if(ui_pressed(sig) && !value_selected)
|
||||
{
|
||||
edit_end = 1;
|
||||
edit_commit = avrs->input_editing;
|
||||
next_cursor.x = 0;
|
||||
next_cursor.y = map_idx+1;
|
||||
}
|
||||
|
||||
// rjf: store commit information
|
||||
if(value_selected)
|
||||
{
|
||||
commit_side = Side_Min;
|
||||
commit_map = df_handle_from_entity(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: dst
|
||||
UI_TableCell UI_WidthFill
|
||||
{
|
||||
//- rjf: editor
|
||||
{
|
||||
B32 value_selected = (row_selected && avrs->cursor.x == 1);
|
||||
|
||||
// rjf: begin editing
|
||||
if(value_selected && edit_begin)
|
||||
{
|
||||
avrs->input_editing = 1;
|
||||
avrs->input_size = Min(sizeof(avrs->input_buffer), view_rule.size);
|
||||
MemoryCopy(avrs->input_buffer, view_rule.str, avrs->input_size);
|
||||
avrs->input_cursor = txt_pt(1, 1+avrs->input_size);
|
||||
avrs->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
|
||||
// rjf: build
|
||||
UI_Signal sig = {0};
|
||||
UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((value_selected && avrs->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_Font(df_font_from_slot(DF_FontSlot_Code))
|
||||
{
|
||||
sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground|DF_LineEditFlag_DisplayStringIsCode, 0, 0, &avrs->input_cursor, &avrs->input_mark, avrs->input_buffer, sizeof(avrs->input_buffer), &avrs->input_size, 0, view_rule, "###dst_editor_%p", map);
|
||||
edit_commit = edit_commit || ui_committed(sig);
|
||||
}
|
||||
|
||||
// rjf: focus panel on press
|
||||
if(ui_pressed(sig))
|
||||
{
|
||||
DF_CmdParams p = df_cmd_params_from_panel(ws, panel);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_FocusPanel));
|
||||
}
|
||||
|
||||
// rjf: begin editing on double-click
|
||||
if(!avrs->input_editing && ui_double_clicked(sig))
|
||||
{
|
||||
avrs->input_editing = 1;
|
||||
avrs->input_size = Min(sizeof(avrs->input_buffer), view_rule.size);
|
||||
MemoryCopy(avrs->input_buffer, view_rule.str, avrs->input_size);
|
||||
avrs->input_cursor = txt_pt(1, 1+avrs->input_size);
|
||||
avrs->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
|
||||
// rjf: press on non-selected => commit edit, change selected cell
|
||||
if(ui_pressed(sig) && !value_selected)
|
||||
{
|
||||
edit_end = 1;
|
||||
edit_commit = avrs->input_editing;
|
||||
next_cursor.x = 1;
|
||||
next_cursor.y = map_idx+1;
|
||||
}
|
||||
|
||||
// rjf: store commit information
|
||||
if(value_selected)
|
||||
{
|
||||
commit_side = Side_Max;
|
||||
commit_map = df_handle_from_entity(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: apply commit
|
||||
if(edit_commit && commit_side != Side_Invalid)
|
||||
{
|
||||
String8 new_string = str8(avrs->input_buffer, avrs->input_size);
|
||||
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
|
||||
p.entity = commit_map;
|
||||
p.string = new_string;
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_Entity);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_FilePath);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(commit_side == Side_Min ?
|
||||
DF_CoreCmdKind_SetAutoViewRuleType :
|
||||
DF_CoreCmdKind_SetAutoViewRuleViewRule));
|
||||
}
|
||||
|
||||
//- rjf: apply editing finish
|
||||
if(edit_end)
|
||||
{
|
||||
avrs->input_editing = 0;
|
||||
}
|
||||
|
||||
//- rjf: move down one row if submitted
|
||||
if(edit_submit)
|
||||
{
|
||||
next_cursor.y += 1;
|
||||
}
|
||||
|
||||
//- rjf: apply moves to selection
|
||||
avrs->cursor = next_cursor;
|
||||
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Scheduler @view_hook_impl
|
||||
|
||||
@@ -4593,7 +4902,7 @@ DF_VIEW_CMD_FUNCTION_DEF(PendingEntity)
|
||||
{
|
||||
view_spec = df_view_spec_from_gfx_view_kind(viewer_kind);
|
||||
}
|
||||
df_view_equip_spec(view, view_spec, entity, str8_lit(""), cfg_root);
|
||||
df_view_equip_spec(ws, view, view_spec, entity, str8_lit(""), cfg_root);
|
||||
df_panel_notify_mutation(ws, panel);
|
||||
}
|
||||
|
||||
@@ -5729,7 +6038,7 @@ DF_VIEW_SETUP_FUNCTION_DEF(Disassembly)
|
||||
dv->mark = txt_pt(1, 1);
|
||||
dv->preferred_column = 1;
|
||||
dv->find_text_arena = df_view_push_arena_ext(view);
|
||||
dv->style_flags = DASM_StyleFlag_Addresses;
|
||||
dv->style_flags = DASM_StyleFlag_Addresses|DASM_StyleFlag_SourceFilesNames|DASM_StyleFlag_SourceLines|DASM_StyleFlag_SymbolNames;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5752,10 +6061,21 @@ DF_VIEW_CMD_FUNCTION_DEF(Disassembly)
|
||||
DF_Entity *process = df_entity_from_handle(dv->process);
|
||||
Architecture arch = df_architecture_from_entity(process);
|
||||
U64 dasm_base_vaddr = AlignDownPow2(dv->base_vaddr, KB(64));
|
||||
DF_Entity *dasm_module = df_module_from_process_vaddr(process, dasm_base_vaddr);
|
||||
DF_Entity *dasm_binary = df_binary_file_from_module(dasm_module);
|
||||
Rng1U64 dasm_vaddr_range = r1u64(dasm_base_vaddr, dasm_base_vaddr+KB(64));
|
||||
U128 dasm_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, dasm_vaddr_range, 0);
|
||||
U128 dasm_data_hash = {0};
|
||||
DASM_Info dasm_info = dasm_info_from_key_addr_arch_style(dasm_scope, dasm_key, dasm_vaddr_range.min, arch, dv->style_flags, DASM_Syntax_Intel, &dasm_data_hash);
|
||||
DASM_Params dasm_params = {0};
|
||||
{
|
||||
dasm_params.vaddr = dasm_vaddr_range.min;
|
||||
dasm_params.arch = arch;
|
||||
dasm_params.style_flags = dv->style_flags;
|
||||
dasm_params.syntax = DASM_Syntax_Intel;
|
||||
dasm_params.base_vaddr = dasm_module->vaddr_rng.min;
|
||||
dasm_params.exe_path = df_full_path_from_entity(scratch.arena, dasm_binary);
|
||||
}
|
||||
DASM_Info dasm_info = dasm_info_from_key_params(dasm_scope, dasm_key, &dasm_params, &dasm_data_hash);
|
||||
U128 dasm_text_hash = {0};
|
||||
TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, dasm_info.text_key, txt_lang_kind_from_architecture(arch), &dasm_text_hash);
|
||||
String8 dasm_text_data = hs_data_from_hash(hs_scope, dasm_text_hash);
|
||||
@@ -5995,10 +6315,21 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly)
|
||||
DF_Entity *process = df_entity_from_handle(dv->process);
|
||||
Architecture arch = df_architecture_from_entity(process);
|
||||
U64 dasm_base_vaddr = AlignDownPow2(dv->base_vaddr, KB(64));
|
||||
DF_Entity *dasm_module = df_module_from_process_vaddr(process, dasm_base_vaddr);
|
||||
DF_Entity *dasm_binary = df_binary_file_from_module(dasm_module);
|
||||
Rng1U64 dasm_vaddr_range = r1u64(dasm_base_vaddr, dasm_base_vaddr+KB(64));
|
||||
U128 dasm_key = ctrl_hash_store_key_from_process_vaddr_range(process->ctrl_machine_id, process->ctrl_handle, dasm_vaddr_range, 0);
|
||||
U128 dasm_data_hash = {0};
|
||||
DASM_Info dasm_info = dasm_info_from_key_addr_arch_style(dasm_scope, dasm_key, dasm_vaddr_range.min, arch, dv->style_flags, DASM_Syntax_Intel, &dasm_data_hash);
|
||||
DASM_Params dasm_params = {0};
|
||||
{
|
||||
dasm_params.vaddr = dasm_vaddr_range.min;
|
||||
dasm_params.arch = arch;
|
||||
dasm_params.style_flags = dv->style_flags;
|
||||
dasm_params.syntax = DASM_Syntax_Intel;
|
||||
dasm_params.base_vaddr = dasm_module->vaddr_rng.min;
|
||||
dasm_params.exe_path = df_full_path_from_entity(scratch.arena, dasm_binary);
|
||||
}
|
||||
DASM_Info dasm_info = dasm_info_from_key_params(dasm_scope, dasm_key, &dasm_params, &dasm_data_hash);
|
||||
U128 dasm_text_hash = {0};
|
||||
TXT_TextInfo dasm_text_info = txt_text_info_from_key_lang(txt_scope, dasm_info.text_key, txt_lang_kind_from_architecture(arch), &dasm_text_hash);
|
||||
String8 dasm_text_data = hs_data_from_hash(hs_scope, dasm_text_hash);
|
||||
@@ -6538,16 +6869,6 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly)
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: EvalViewer @view_hook_impl
|
||||
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(EvalViewer) {}
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(EvalViewer) { return str8_lit(""); }
|
||||
DF_VIEW_CMD_FUNCTION_DEF(EvalViewer) {}
|
||||
DF_VIEW_UI_FUNCTION_DEF(EvalViewer)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Watch @view_hook_impl
|
||||
|
||||
|
||||
@@ -230,6 +230,23 @@ struct DF_FilePathMapViewState
|
||||
F32 dst_column_pct;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: AutoViewRules @view_types
|
||||
|
||||
typedef struct DF_AutoViewRulesViewState DF_AutoViewRulesViewState;
|
||||
struct DF_AutoViewRulesViewState
|
||||
{
|
||||
B32 initialized;
|
||||
Vec2S64 cursor;
|
||||
TxtPt input_cursor;
|
||||
TxtPt input_mark;
|
||||
U8 input_buffer[1024];
|
||||
U64 input_size;
|
||||
B32 input_editing;
|
||||
F32 src_column_pct;
|
||||
F32 dst_column_pct;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Modules @view_types
|
||||
|
||||
|
||||
@@ -713,24 +713,30 @@ str8_lit_comp("open_user"),
|
||||
str8_lit_comp("open_profile"),
|
||||
};
|
||||
|
||||
DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[16] =
|
||||
DF_GfxViewRuleSpecInfo df_g_gfx_view_rule_spec_info_table[14] =
|
||||
{
|
||||
{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, 0 },
|
||||
{ str8_lit_comp("slice"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, 0 },
|
||||
{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, 0 },
|
||||
{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, 0 },
|
||||
{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, 0 },
|
||||
{ str8_lit_comp("oct"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(oct) , 0, 0, 0 },
|
||||
{ str8_lit_comp("hex"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(hex) , 0, 0, 0 },
|
||||
{ str8_lit_comp("only"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(only) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(only) , 0, 0, 0 },
|
||||
{ str8_lit_comp("omit"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(omit) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(omit) , 0, 0, 0 },
|
||||
{ str8_lit_comp("no_addr"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(no_addr) , 0, 0, 0 },
|
||||
{ str8_lit_comp("rgba"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(rgba) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(rgba) , 0 },
|
||||
{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , 0 },
|
||||
{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , 0 },
|
||||
{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(bitmap) },
|
||||
{ str8_lit_comp("odin_map"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(odin_map) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(odin_map) , DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_NAME(odin_map) },
|
||||
{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , 0 },
|
||||
{ str8_lit_comp("array"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, 0, 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("list"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(list) , 0, 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("dec"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(dec) , 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("bin"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(bin) , 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("oct"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(oct) , 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("hex"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(hex) , 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("only"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(only) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(only) , 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("omit"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*1)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), DF_GFX_VIEW_RULE_VIZ_ROW_PROD_FUNCTION_NAME(omit) , DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(omit) , 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("no_addr"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*1)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*0), 0, DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(no_addr) , 0, 0, str8_lit_comp("") },
|
||||
{ str8_lit_comp("rgba"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(rgba) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(rgba) , str8_lit_comp("") },
|
||||
{ str8_lit_comp("text"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(text) , str8_lit_comp("text_view_rule") },
|
||||
{ str8_lit_comp("disasm"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*0)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, 0, DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(disasm) , str8_lit_comp("disasm_view_rule") },
|
||||
{ str8_lit_comp("bitmap"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(bitmap) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(bitmap) , str8_lit_comp("bitmap_view_rule") },
|
||||
{ str8_lit_comp("geo"), (DF_GfxViewRuleSpecInfoFlag_VizRowProd*0)|(DF_GfxViewRuleSpecInfoFlag_LineStringize*0)|(DF_GfxViewRuleSpecInfoFlag_RowUI*1)|(DF_GfxViewRuleSpecInfoFlag_BlockUI*1), 0, 0, DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(geo) , DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(geo) , str8_lit_comp("geo_view_rule") },
|
||||
};
|
||||
|
||||
DF_ViewSpecInfo df_g_gfx_view_rule_tab_view_spec_info_table[4] =
|
||||
{
|
||||
{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("text_view_rule"), str8_lit_comp("Text"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(text), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(text), DF_VIEW_CMD_FUNCTION_NAME(text), DF_VIEW_UI_FUNCTION_NAME(text) },
|
||||
{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("disasm_view_rule"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(disasm), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(disasm), DF_VIEW_CMD_FUNCTION_NAME(disasm), DF_VIEW_UI_FUNCTION_NAME(disasm) },
|
||||
{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("bitmap_view_rule"), str8_lit_comp("Bitmap"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(bitmap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(bitmap), DF_VIEW_CMD_FUNCTION_NAME(bitmap), DF_VIEW_UI_FUNCTION_NAME(bitmap) },
|
||||
{ DF_ViewSpecFlag_CanSerialize|DF_ViewSpecFlag_CanSerializeQuery, str8_lit_comp("geo_view_rule"), str8_lit_comp("Geometry"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(geo), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(geo), DF_VIEW_CMD_FUNCTION_NAME(geo), DF_VIEW_UI_FUNCTION_NAME(geo) },
|
||||
};
|
||||
|
||||
DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[30] =
|
||||
@@ -740,18 +746,18 @@ DF_ViewSpecInfo df_g_gfx_view_kind_spec_info_table[30] =
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("commands"), str8_lit_comp("Commands"), DF_NameKind_Null, DF_IconKind_List, DF_VIEW_SETUP_FUNCTION_NAME(Commands), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Commands), DF_VIEW_CMD_FUNCTION_NAME(Commands), DF_VIEW_UI_FUNCTION_NAME(Commands)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_system"), str8_lit_comp("File System"), DF_NameKind_Null, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(FileSystem), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(FileSystem), DF_VIEW_CMD_FUNCTION_NAME(FileSystem), DF_VIEW_UI_FUNCTION_NAME(FileSystem)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("system_processes"), str8_lit_comp("System Processes"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(SystemProcesses), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(SystemProcesses), DF_VIEW_CMD_FUNCTION_NAME(SystemProcesses), DF_VIEW_UI_FUNCTION_NAME(SystemProcesses)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("entity_lister"), str8_lit_comp("Entity List"), DF_NameKind_EntityKindName, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(EntityLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EntityLister), DF_VIEW_CMD_FUNCTION_NAME(EntityLister), DF_VIEW_UI_FUNCTION_NAME(EntityLister)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("entity_lister"), str8_lit_comp("Entity List"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(EntityLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EntityLister), DF_VIEW_CMD_FUNCTION_NAME(EntityLister), DF_VIEW_UI_FUNCTION_NAME(EntityLister)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("symbol_lister"), str8_lit_comp("Symbols"), DF_NameKind_Null, DF_IconKind_Null, DF_VIEW_SETUP_FUNCTION_NAME(SymbolLister), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(SymbolLister), DF_VIEW_CMD_FUNCTION_NAME(SymbolLister), DF_VIEW_UI_FUNCTION_NAME(SymbolLister)},
|
||||
{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("target"), str8_lit_comp("Target"), DF_NameKind_EntityName, DF_IconKind_Target, DF_VIEW_SETUP_FUNCTION_NAME(Target), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Target), DF_VIEW_CMD_FUNCTION_NAME(Target), DF_VIEW_UI_FUNCTION_NAME(Target)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("targets"), str8_lit_comp("Targets"), DF_NameKind_Null, DF_IconKind_Target, DF_VIEW_SETUP_FUNCTION_NAME(Targets), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Targets), DF_VIEW_CMD_FUNCTION_NAME(Targets), DF_VIEW_UI_FUNCTION_NAME(Targets)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("file_path_map"), str8_lit_comp("File Path Map"), DF_NameKind_Null, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(FilePathMap), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(FilePathMap), DF_VIEW_CMD_FUNCTION_NAME(FilePathMap), DF_VIEW_UI_FUNCTION_NAME(FilePathMap)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rules"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(AutoViewRules), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(AutoViewRules), DF_VIEW_CMD_FUNCTION_NAME(AutoViewRules), DF_VIEW_UI_FUNCTION_NAME(AutoViewRules)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("scheduler"), str8_lit_comp("Scheduler"), DF_NameKind_Null, DF_IconKind_Scheduler, DF_VIEW_SETUP_FUNCTION_NAME(Scheduler), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Scheduler), DF_VIEW_CMD_FUNCTION_NAME(Scheduler), DF_VIEW_UI_FUNCTION_NAME(Scheduler)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("call_stack"), str8_lit_comp("Call Stack"), DF_NameKind_Null, DF_IconKind_Thread, DF_VIEW_SETUP_FUNCTION_NAME(CallStack), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(CallStack), DF_VIEW_CMD_FUNCTION_NAME(CallStack), DF_VIEW_UI_FUNCTION_NAME(CallStack)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("modules"), str8_lit_comp("Modules"), DF_NameKind_Null, DF_IconKind_Module, DF_VIEW_SETUP_FUNCTION_NAME(Modules), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Modules), DF_VIEW_CMD_FUNCTION_NAME(Modules), DF_VIEW_UI_FUNCTION_NAME(Modules)},
|
||||
{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|0*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("pending_entity"), str8_lit_comp("Pending Entity"), DF_NameKind_EntityName, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(PendingEntity), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(PendingEntity), DF_VIEW_CMD_FUNCTION_NAME(PendingEntity), DF_VIEW_UI_FUNCTION_NAME(PendingEntity)},
|
||||
{(0|1*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|1*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("code"), str8_lit_comp("Code"), DF_NameKind_EntityName, DF_IconKind_FileOutline, DF_VIEW_SETUP_FUNCTION_NAME(Code), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Code), DF_VIEW_CMD_FUNCTION_NAME(Code), DF_VIEW_UI_FUNCTION_NAME(Code)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("disassembly"), str8_lit_comp("Disassembly"), DF_NameKind_Null, DF_IconKind_Glasses, DF_VIEW_SETUP_FUNCTION_NAME(Disassembly), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Disassembly), DF_VIEW_CMD_FUNCTION_NAME(Disassembly), DF_VIEW_UI_FUNCTION_NAME(Disassembly)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|0*DF_ViewSpecFlag_CanFilter|0*DF_ViewSpecFlag_FilterIsCode|0*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("eval_viewer"), str8_lit_comp("Evaluation Viewer"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(EvalViewer), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(EvalViewer), DF_VIEW_CMD_FUNCTION_NAME(EvalViewer), DF_VIEW_UI_FUNCTION_NAME(EvalViewer)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("watch"), str8_lit_comp("Watch"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Watch), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Watch), DF_VIEW_CMD_FUNCTION_NAME(Watch), DF_VIEW_UI_FUNCTION_NAME(Watch)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("locals"), str8_lit_comp("Locals"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Locals), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Locals), DF_VIEW_CMD_FUNCTION_NAME(Locals), DF_VIEW_UI_FUNCTION_NAME(Locals)},
|
||||
{(0|0*DF_ViewSpecFlag_ParameterizedByEntity|1*DF_ViewSpecFlag_CanSerialize|0*DF_ViewSpecFlag_CanSerializeEntityPath|1*DF_ViewSpecFlag_CanFilter|1*DF_ViewSpecFlag_FilterIsCode|1*DF_ViewSpecFlag_TypingAutomaticallyFilters), str8_lit_comp("registers"), str8_lit_comp("Registers"), DF_NameKind_Null, DF_IconKind_Binoculars, DF_VIEW_SETUP_FUNCTION_NAME(Registers), DF_VIEW_STRING_FROM_STATE_FUNCTION_NAME(Registers), DF_VIEW_CMD_FUNCTION_NAME(Registers), DF_VIEW_UI_FUNCTION_NAME(Registers)},
|
||||
|
||||
@@ -10,7 +10,6 @@ typedef enum DF_NameKind
|
||||
{
|
||||
DF_NameKind_Null,
|
||||
DF_NameKind_EntityName,
|
||||
DF_NameKind_EntityKindName,
|
||||
DF_NameKind_COUNT,
|
||||
} DF_NameKind;
|
||||
|
||||
@@ -26,13 +25,13 @@ DF_GfxViewKind_SymbolLister,
|
||||
DF_GfxViewKind_Target,
|
||||
DF_GfxViewKind_Targets,
|
||||
DF_GfxViewKind_FilePathMap,
|
||||
DF_GfxViewKind_AutoViewRules,
|
||||
DF_GfxViewKind_Scheduler,
|
||||
DF_GfxViewKind_CallStack,
|
||||
DF_GfxViewKind_Modules,
|
||||
DF_GfxViewKind_PendingEntity,
|
||||
DF_GfxViewKind_Code,
|
||||
DF_GfxViewKind_Disassembly,
|
||||
DF_GfxViewKind_EvalViewer,
|
||||
DF_GfxViewKind_Watch,
|
||||
DF_GfxViewKind_Locals,
|
||||
DF_GfxViewKind_Registers,
|
||||
@@ -132,13 +131,13 @@ DF_VIEW_SETUP_FUNCTION_DEF(SymbolLister);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Target);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Targets);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(FilePathMap);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(AutoViewRules);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Scheduler);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(CallStack);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Modules);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(PendingEntity);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Code);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Disassembly);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(EvalViewer);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Watch);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Locals);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(Registers);
|
||||
@@ -162,13 +161,13 @@ DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(SymbolLister);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Target);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Targets);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(FilePathMap);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(AutoViewRules);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Scheduler);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(CallStack);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Modules);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(PendingEntity);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Code);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Disassembly);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(EvalViewer);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Watch);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Locals);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(Registers);
|
||||
@@ -192,13 +191,13 @@ DF_VIEW_CMD_FUNCTION_DEF(SymbolLister);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Target);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Targets);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(FilePathMap);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(AutoViewRules);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Scheduler);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(CallStack);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Modules);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(PendingEntity);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Code);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Disassembly);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(EvalViewer);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Watch);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Locals);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(Registers);
|
||||
@@ -222,13 +221,13 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Target);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Targets);
|
||||
DF_VIEW_UI_FUNCTION_DEF(FilePathMap);
|
||||
DF_VIEW_UI_FUNCTION_DEF(AutoViewRules);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Scheduler);
|
||||
DF_VIEW_UI_FUNCTION_DEF(CallStack);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Modules);
|
||||
DF_VIEW_UI_FUNCTION_DEF(PendingEntity);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Code);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Disassembly);
|
||||
DF_VIEW_UI_FUNCTION_DEF(EvalViewer);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Watch);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Locals);
|
||||
DF_VIEW_UI_FUNCTION_DEF(Registers);
|
||||
@@ -255,16 +254,28 @@ DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(omit);
|
||||
DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(no_addr);
|
||||
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba);
|
||||
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(bitmap);
|
||||
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(odin_map);
|
||||
DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(geo);
|
||||
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba);
|
||||
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(text);
|
||||
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(disasm);
|
||||
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(bitmap);
|
||||
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(odin_map);
|
||||
DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(geo);
|
||||
DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(bitmap);
|
||||
DF_GFX_VIEW_RULE_WHOLE_UI_FUNCTION_DEF(odin_map);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(text);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(disasm);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(bitmap);
|
||||
DF_VIEW_SETUP_FUNCTION_DEF(geo);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(text);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(disasm);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(bitmap);
|
||||
DF_VIEW_STRING_FROM_STATE_FUNCTION_DEF(geo);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(text);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(disasm);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(bitmap);
|
||||
DF_VIEW_CMD_FUNCTION_DEF(geo);
|
||||
DF_VIEW_UI_FUNCTION_DEF(text);
|
||||
DF_VIEW_UI_FUNCTION_DEF(disasm);
|
||||
DF_VIEW_UI_FUNCTION_DEF(bitmap);
|
||||
DF_VIEW_UI_FUNCTION_DEF(geo);
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 df_g_theme_preset_display_string_table[9];
|
||||
extern String8 df_g_theme_preset_code_string_table[9];
|
||||
@@ -4867,6 +4878,132 @@ read_only global U8 df_g_default_code_font_bytes__data[] =
|
||||
};
|
||||
|
||||
read_only global String8 df_g_default_code_font_bytes = {df_g_default_code_font_bytes__data, sizeof(df_g_default_code_font_bytes__data)};
|
||||
read_only global U8 df_g_icon_file_bytes__data[] =
|
||||
{
|
||||
0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x02,0x1e,0x00,0x00,0x16,0x00,0x00,0x00,0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x08,0x06,0x00,0x00,0x00,0x5c,0x72,0xa8,0x66,0x00,0x00,0x1d,0xc9,0x49,0x44,0x41,0x54,0x78,
|
||||
0x9c,0xed,0xdd,0x7b,0x7c,0x14,0xe5,0xbd,0xc7,0xf1,0xcf,0x6e,0xb2,0x9b,0x04,0x12,0x20,0x10,0xae,0xe2,0x25,0x52,0x06,0x05,0xe5,0x12,0x14,0x6f,0xc7,0x56,0x99,0x5a,0xd4,0xaa,0xd5,0xda,0x8b,0xb7,0xa2,0x55,0x4f,0x6d,0x6b,0xab,0xb5,0xf6,0x72,0x7a,0xb1,0xb5,0x1e,0x41,0xce,0xd1,0xb6,0x5a,0x4f,0xeb,0xa9,0x56,0x8b,0x37,0xb4,0x5a,
|
||||
0xfb,0xaa,0x56,0x5a,0xa4,0x1d,0xb5,0x20,0x2d,0x95,0x8a,0x8a,0xf5,0xa0,0x83,0x8a,0x37,0x10,0x08,0x90,0x70,0x0b,0xe4,0xb6,0x7b,0xfe,0x98,0x8d,0x44,0x48,0x42,0x36,0xf3,0xcc,0xfc,0x66,0x77,0x7e,0xef,0xd7,0x8b,0x57,0xbc,0x24,0xcf,0xf3,0xcb,0x32,0xcf,0x77,0x9f,0x99,0x9d,0x79,0x1e,0x50,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,
|
||||
0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x54,0xe1,0x4a,0x48,0x17,0xa0,0x82,0xe5,0x58,0x54,0x01,0xd5,0xc0,0xa0,0x4e,0x5f,0x3b,0xff,0x33,0x40,0x23,0xd0,0x90,0xfb,0xda,0xf9,0x9f,0x1b,0x6c,0x97,0x6d,0x61,0xd7,0xac,0xc2,0xa3,0x01,0x50,0xa0,0x1c,0x8b,0xa1,0xc0,0x54,0x60,0x0a,0x70,0x30,0x7b,
|
||||
0x0f,0xec,0x6a,0x60,0x20,0x50,0xe2,0xb3,0xab,0x76,0x60,0x0b,0x9d,0x42,0x81,0xdd,0x41,0xf1,0x06,0xf0,0x3c,0xf0,0x9c,0xed,0x52,0xef,0xb3,0x1f,0x25,0x40,0x03,0xa0,0x00,0x38,0x16,0xfb,0x03,0x75,0x78,0x83,0xbd,0x2e,0xf7,0x67,0x3f,0xd1,0xa2,0xf6,0xb6,0x06,0x58,0xde,0xf9,0x8f,0xed,0xf2,0xae,0x6c,0x49,0x6a,0x5f,0x34,0x00,0x22,
|
||||
0xc4,0xb1,0x48,0xe0,0xbd,0x9b,0xd7,0x75,0xfa,0x33,0x05,0x18,0x2a,0x59,0x97,0x0f,0xf5,0x78,0x33,0x84,0xce,0xa1,0xf0,0xba,0x6c,0x49,0xaa,0x33,0x0d,0x80,0x88,0x70,0x2c,0x7e,0x0f,0x9c,0x80,0x37,0x6d,0x2f,0x66,0x5b,0x80,0xa7,0x6d,0x97,0x33,0xa5,0x0b,0x51,0x1a,0x00,0x91,0xe0,0x58,0xd4,0xe2,0x9d,0x4f,0xc7,0x49,0xad,0xed,0xf2,
|
||||
0xa6,0x74,0x11,0x71,0x97,0x94,0x2e,0x40,0x01,0x30,0x5d,0xba,0x00,0x01,0x71,0xfc,0x9d,0x23,0x47,0x03,0x20,0x1a,0xe2,0x38,0x18,0xe2,0xf8,0x3b,0x47,0x8e,0x06,0x40,0x34,0x9c,0x28,0x5d,0x80,0x80,0x38,0xfe,0xce,0x91,0xa3,0x01,0x20,0xcc,0xb1,0x38,0x04,0x18,0x29,0x5d,0x87,0x80,0x51,0x8e,0xc5,0x38,0xe9,0x22,0xe2,0x4e,0x03,0x40,
|
||||
0x5e,0x9c,0xa7,0xc2,0x71,0xfe,0xdd,0x23,0x41,0x03,0x40,0x5e,0x9c,0x07,0x41,0x9c,0x7f,0xf7,0x48,0xd0,0x8f,0x01,0x05,0xe5,0x6e,0xfc,0xa9,0x07,0x86,0x48,0xd7,0x22,0x64,0x23,0x30,0xcc,0x76,0xc9,0x4a,0x17,0x12,0x57,0x3a,0x03,0x90,0x35,0x91,0xf8,0x0e,0x7e,0x80,0x1a,0xe0,0x70,0xe9,0x22,0xe2,0x4c,0x03,0x40,0x96,0x4e,0x81,0xf5,
|
||||
0x35,0x10,0xa5,0x01,0x20,0x4b,0x0f,0x7e,0x7d,0x0d,0x44,0xe9,0x35,0x00,0x21,0x8e,0x45,0x09,0xb0,0x19,0x18,0x20,0x5d,0x8b,0xb0,0x2d,0xc0,0x10,0xdb,0xa5,0x5d,0xba,0x90,0x38,0xd2,0x19,0x80,0x9c,0xa9,0xe8,0xe0,0x07,0xef,0xe1,0xa7,0x3a,0xe9,0x22,0xe2,0x4a,0x03,0x40,0x8e,0x4e,0x7d,0x77,0xd3,0xd7,0x42,0x88,0x06,0x80,0x1c,0x3d,
|
||||
0xe8,0x77,0xd3,0xd7,0x42,0x88,0x5e,0x03,0x10,0xe0,0x58,0xa4,0xf1,0x96,0xd6,0xea,0x27,0x5d,0x4b,0x44,0x34,0x01,0x83,0x6c,0x97,0x56,0xe9,0x42,0xe2,0x46,0x67,0x00,0x32,0x8e,0x42,0x07,0x7f,0x67,0xfd,0xf0,0x5e,0x13,0x15,0x32,0x0d,0x00,0x19,0x3a,0xe5,0xdd,0x9b,0xbe,0x26,0x02,0x34,0x00,0x64,0xe8,0xc1,0xbe,0x37,0x7d,0x4d,0x04,
|
||||
0xe8,0x35,0x80,0x90,0x39,0x16,0x15,0x78,0x4b,0x6a,0xa7,0xa5,0x6b,0x89,0x98,0x66,0xa0,0xda,0x76,0xd9,0x29,0x5d,0x48,0x9c,0xe8,0x0c,0x20,0x7c,0xc7,0xa1,0x83,0xbf,0x2b,0x65,0xc0,0xb1,0xd2,0x45,0xc4,0x8d,0x06,0x40,0xf8,0x74,0xaa,0xdb,0x3d,0x7d,0x6d,0x42,0xa6,0x01,0x10,0x3e,0x3d,0xc8,0xbb,0xa7,0xaf,0x4d,0xc8,0xf4,0x1a,0x40,
|
||||
0x88,0x1c,0x8b,0x01,0x78,0xf7,0xff,0xfb,0xdd,0xae,0xab,0x58,0xb5,0x01,0x83,0x75,0x3f,0xc2,0xf0,0xe8,0x0c,0x20,0x5c,0xc7,0xa3,0x83,0xbf,0x27,0xa5,0x78,0xaf,0x91,0x0a,0x89,0xce,0x00,0x42,0xe0,0x58,0x94,0x03,0x5f,0x00,0xbe,0x0d,0x8c,0x12,0x2e,0x27,0xea,0xd6,0x02,0x73,0x80,0x3b,0x6c,0x97,0x5d,0xd2,0xc5,0x14,0x3b,0x0d,0x80,
|
||||
0x00,0xe5,0x3e,0xf2,0xfb,0x22,0xf0,0x2d,0x60,0x84,0x70,0x39,0x85,0xe6,0x3d,0xe0,0x46,0xe0,0x7f,0xf5,0xa3,0xc1,0xe0,0x68,0x00,0x04,0xc0,0xb1,0xe8,0x0f,0x7c,0x19,0xb8,0x1a,0x18,0x2e,0x5c,0x4e,0xa1,0x5b,0x0f,0xdc,0x04,0xdc,0x66,0xbb,0xec,0x90,0x2e,0xa6,0xd8,0x68,0x00,0x18,0xe4,0x58,0x54,0x02,0x5f,0x01,0xbe,0x4e,0xe1,0xee,
|
||||
0xe8,0x1b,0x55,0xf5,0xc0,0x4f,0x80,0xff,0xb1,0x5d,0xb6,0x4b,0x17,0x53,0x2c,0x34,0x00,0x0c,0xc8,0x5d,0xdd,0xbf,0x02,0xf8,0x1a,0xf1,0x5e,0xe4,0x33,0x0c,0x9b,0x80,0x9b,0x81,0x9f,0xd9,0x2e,0x5b,0xa5,0x8b,0x29,0x74,0x05,0x15,0x00,0x8e,0x45,0x12,0xf8,0x11,0xb0,0x1a,0x58,0x60,0xbb,0xac,0x15,0xae,0x27,0x0d,0x7c,0x13,0xf8,0x06,
|
||||
0x30,0x48,0xb2,0x96,0x18,0x6a,0x00,0x7e,0x0c,0xdc,0x68,0xbb,0xb4,0x48,0x16,0xe2,0x58,0x8c,0x02,0x4e,0x06,0x0e,0x02,0xae,0xb5,0x5d,0x32,0x92,0xf5,0xe4,0xa3,0xd0,0x02,0xe0,0x66,0xe0,0xca,0x4e,0xff,0xe9,0x5f,0xc0,0x02,0xe0,0x09,0x60,0xb1,0xed,0xd2,0x1c,0x62,0x2d,0x75,0xc0,0x5c,0x74,0x59,0x6b,0x69,0x2f,0x01,0x17,0xda,0x2e,
|
||||
0xcf,0x87,0xd5,0xa1,0x63,0x51,0x86,0xf7,0x71,0xe5,0x0c,0xbc,0x81,0x7f,0x58,0xa7,0xff,0x7d,0xb3,0xed,0x72,0x55,0x58,0xb5,0xf8,0x55,0x30,0x01,0xe0,0x58,0x5c,0x89,0x37,0xf5,0xeb,0x4e,0x13,0xf0,0x34,0xb9,0x40,0xb0,0x5d,0xdc,0x80,0xea,0x48,0x01,0xd7,0x00,0xdf,0xc1,0xfb,0xdc,0x5a,0xc9,0x6b,0x03,0x6e,0x00,0xfe,0x33,0xa8,0x45,
|
||||
0x45,0x1c,0x0b,0x8b,0xdd,0x03,0xfe,0x04,0x7a,0x5e,0xcf,0xe1,0x4a,0xdb,0xe5,0x67,0x41,0xd4,0x61,0x5a,0x41,0x04,0x80,0x63,0x71,0x26,0xf0,0x08,0xf9,0xdd,0xb8,0xb4,0x1a,0x6f,0x66,0xb0,0x00,0x78,0xd2,0xc4,0xdd,0x65,0x8e,0xc5,0x14,0xbc,0x77,0xfd,0x89,0x7e,0xdb,0x52,0x81,0x58,0x01,0x5c,0x64,0x62,0x36,0xe0,0x58,0x54,0x01,0x36,
|
||||
0xde,0xa0,0x9f,0x01,0xd4,0xe6,0xf1,0xe3,0x19,0xe0,0x93,0xb6,0xcb,0xa3,0x7e,0xeb,0x08,0x5a,0xe4,0x03,0xc0,0xb1,0x98,0x86,0xf7,0xce,0x5e,0xe1,0xa3,0x99,0x56,0xe0,0x6f,0xec,0x0e,0x84,0x17,0xf2,0xd9,0x8e,0x2a,0xf7,0xae,0xff,0x7d,0xe0,0xbb,0xe8,0xbb,0x7e,0xd4,0xb5,0x02,0xb3,0x81,0x59,0xf9,0xcc,0x06,0x72,0xdb,0xb4,0x4d,0x61,
|
||||
0xf7,0xbb,0xfc,0x31,0x40,0xca,0x47,0x1d,0x4d,0xc0,0x09,0xb6,0xcb,0x32,0x1f,0x6d,0x04,0x2e,0xd2,0x01,0xe0,0x58,0xd4,0x02,0x4b,0x81,0x61,0x86,0x9b,0x5e,0x0f,0x2c,0xc4,0x0b,0x84,0x85,0xb6,0x4b,0x7d,0x0f,0x35,0x4c,0xc6,0x7b,0xd7,0x9f,0x64,0xb8,0x06,0x15,0xac,0x17,0xf1,0xae,0x0d,0xbc,0xd8,0xdd,0x37,0x38,0x16,0x43,0x81,0x8f,
|
||||
0xe1,0x0d,0xf8,0x93,0x30,0x7f,0xcf,0xc6,0x06,0xe0,0x68,0xdb,0x65,0xb5,0xe1,0x76,0x8d,0x89,0x6c,0x00,0x38,0x16,0xd5,0x78,0xef,0xda,0x87,0x04,0xdc,0x55,0x16,0x58,0xce,0xee,0xd9,0xc1,0xdf,0x6d,0x97,0xb6,0xdc,0xbb,0xfe,0xf7,0xf0,0xde,0xf5,0xfd,0xbc,0x13,0x28,0x39,0xad,0xc0,0x2c,0x60,0xb6,0xed,0xd2,0xea,0x58,0x94,0xe2,0xbd,
|
||||
0xb3,0x9f,0x8c,0xf7,0x4e,0x5f,0x47,0xf0,0x63,0xe0,0x15,0xe0,0x58,0xdb,0xa5,0x21,0xe0,0x7e,0xfa,0x24,0x92,0x01,0x90,0xbb,0xca,0xba,0x10,0xf8,0xb0,0x40,0xf7,0x5b,0x01,0x07,0xef,0x9c,0x6f,0xb2,0x40,0xff,0xca,0xbc,0x17,0xf0,0xae,0x09,0xd9,0xc8,0x6c,0xc6,0xb2,0x08,0x38,0x49,0xfa,0xe3,0xca,0xae,0x44,0x2e,0x00,0x72,0xe7,0x62,
|
||||
0xf7,0x03,0xe7,0x4a,0xd7,0xa2,0x94,0x41,0xf3,0x80,0x0b,0xa2,0xb6,0x15,0x7a,0x14,0x1f,0x07,0xbe,0x1e,0x1d,0xfc,0xaa,0xf8,0x9c,0x07,0xfc,0xa7,0x74,0x11,0x7b,0x8a,0xd4,0x0c,0xc0,0xb1,0xb8,0x14,0xb8,0x43,0xba,0x0e,0xa5,0x02,0x74,0xa9,0xed,0x72,0xa7,0x74,0x11,0x1d,0x22,0x13,0x00,0x8e,0xc5,0x47,0x81,0x3f,0xa1,0x1f,0xb3,0xa9,
|
||||
0xe2,0xd6,0x06,0x9c,0x62,0xbb,0xfc,0x45,0xba,0x10,0x88,0x48,0x00,0xe4,0xae,0xf8,0xbf,0x0c,0x8c,0x94,0xae,0x45,0xa9,0x10,0xbc,0x07,0x4c,0x88,0xc2,0x27,0x03,0x51,0xb9,0x06,0xf0,0x33,0x74,0xf0,0xab,0xf8,0x18,0x09,0xdc,0x22,0x5d,0x04,0x44,0x60,0x06,0xe0,0x58,0x9c,0x0e,0x3c,0x26,0x5d,0x87,0x52,0x02,0x4e,0xb7,0x5d,0x1e,0x97,
|
||||
0x2c,0x40,0x34,0x00,0x74,0xea,0xaf,0x62,0x4e,0xfc,0x54,0x40,0xfa,0x14,0xe0,0x16,0x74,0xf0,0xab,0xf8,0x1a,0x49,0xcf,0x4f,0xb8,0x06,0x4e,0x6c,0x06,0xa0,0x53,0x7f,0xa5,0xde,0x27,0x76,0x2a,0x20,0x12,0x00,0x3a,0xf5,0x57,0xea,0x03,0xd6,0xe2,0x9d,0x0a,0x34,0x86,0xdd,0xb1,0xd4,0x29,0x80,0x4e,0xfd,0x95,0xda,0x6d,0x14,0x42,0x9f,
|
||||
0x0a,0x84,0x3e,0x03,0xd0,0xa9,0xbf,0x52,0xdd,0x0a,0xfd,0x54,0x20,0xd4,0x00,0xd0,0xa9,0xbf,0x52,0x3d,0x0a,0xfd,0x54,0x20,0xec,0x53,0x00,0x9d,0xfa,0x2b,0xd5,0xbd,0xd0,0x4f,0x05,0x42,0x9b,0x01,0x38,0x16,0xa7,0x01,0x7f,0x08,0xab,0x3f,0xa5,0x0a,0x58,0x68,0xa7,0x02,0xa1,0x04,0x40,0x6e,0x81,0x8f,0x55,0xc0,0xfe,0x61,0xf4,0xa7,
|
||||
0x54,0x81,0x7b,0x07,0xf8,0x50,0x18,0x0b,0x88,0x84,0x75,0x0a,0x70,0x09,0x3a,0xf8,0x95,0xea,0xad,0xfd,0xf1,0xc6,0x4c,0xe0,0x02,0x9f,0x01,0xe4,0x76,0xcf,0x79,0x0d,0x0d,0x00,0xa5,0xf2,0xf1,0x36,0x30,0x36,0xe8,0x59,0x40,0x18,0x33,0x80,0xcf,0xa3,0x83,0x5f,0xa9,0x7c,0x1d,0x00,0x5c,0x14,0x74,0x27,0x81,0xce,0x00,0x72,0x2b,0xeb,
|
||||
0xae,0x02,0x0e,0x0c,0xb2,0x1f,0xa5,0x8a,0xd4,0x5b,0x78,0xb3,0x80,0x40,0x76,0x3b,0x82,0xe0,0x67,0x00,0x17,0xa2,0x83,0x5f,0xa9,0xbe,0x3a,0x10,0x98,0x19,0x64,0x07,0x81,0xcd,0x00,0x72,0x6b,0xb0,0xbb,0xe4,0xb7,0xa5,0x92,0x52,0xea,0x83,0x56,0x03,0x96,0xed,0xd2,0x16,0x44,0xe3,0x41,0xce,0x00,0x66,0xa2,0x83,0x5f,0x29,0xbf,0x6a,
|
||||
0x81,0xcf,0x05,0xd5,0x78,0x20,0x33,0x80,0xdc,0xbb,0xff,0xab,0xc0,0xc1,0x41,0xb4,0xaf,0x54,0xcc,0xbc,0x0e,0x8c,0xb3,0x5d,0xda,0x4d,0x37,0x1c,0xd4,0x0c,0xe0,0x7c,0x74,0xf0,0x2b,0x65,0xca,0x18,0xbc,0x31,0x65,0x9c,0xf1,0x19,0x80,0x63,0x51,0x82,0xb7,0x1f,0xda,0x87,0x4c,0xb7,0xad,0x54,0x8c,0xad,0x02,0x0e,0x35,0x3d,0x0b,0x08,
|
||||
0x62,0x0d,0xfe,0xf3,0xd0,0xc1,0xdf,0xa3,0x64,0x2a,0xcd,0x90,0xe9,0xa7,0x33,0xea,0xd3,0x97,0x52,0x7d,0xe4,0x47,0x00,0xc8,0x66,0xb3,0x40,0x16,0x32,0x19,0xef,0x9f,0x73,0x7f,0xb2,0xd9,0xcc,0xfb,0xff,0x4c,0x36,0x4b,0x36,0x93,0xf1,0xbe,0x2f,0x9b,0xf5,0xbe,0xaf,0xf3,0xf7,0x93,0xfb,0xff,0xdd,0xfc,0x7c,0xc7,0xf7,0x43,0x76,0xf7,
|
||||
0xcf,0x7c,0xa0,0xbf,0x3d,0xfa,0xee,0xa2,0x2f,0xb2,0x59,0xb2,0x74,0xf5,0xb3,0xbd,0xab,0xb5,0xf3,0xcf,0xaf,0x7b,0xf4,0x3e,0x36,0x3e,0xa9,0x4f,0x86,0xf7,0xd2,0x58,0xbc,0x1d,0xb3,0xee,0x33,0xd9,0xa8,0xd1,0x19,0x80,0x63,0x91,0x04,0x56,0x02,0x96,0xc9,0x76,0x8b,0x59,0xbf,0x03,0xc7,0x32,0xf2,0x33,0x97,0x32,0xf2,0xac,0x8b,0x48,
|
||||
0x0f,0x31,0xbd,0x0b,0x7a,0xb4,0x65,0xdb,0x5a,0x59,0xf1,0xc5,0x33,0xd8,0xb4,0x78,0x81,0x74,0x29,0x85,0xe2,0x55,0x60,0xbc,0xed,0x92,0x31,0xd5,0xa0,0xe9,0x00,0x38,0x07,0x78,0xc0,0x64,0x9b,0x71,0x91,0x4c,0xa5,0x19,0x72,0xe2,0x69,0x1c,0x70,0xf1,0x37,0x18,0x38,0xe5,0x18,0xe9,0x72,0x42,0x93,0x69,0xde,0xc5,0x8b,0x97,0x9e,0x42,
|
||||
0xc3,0xb3,0x4f,0x4b,0x97,0x52,0x28,0xce,0xb5,0x5d,0x1e,0x34,0xd5,0x98,0xe9,0x8b,0x80,0xa1,0x3c,0xc0,0x50,0x8c,0x32,0xad,0x2d,0xd4,0x2f,0xfc,0x1d,0xcb,0xcf,0x3f,0x9e,0x55,0x37,0x7c,0x9d,0x4c,0xf3,0x2e,0xe9,0x92,0x42,0x91,0x2c,0x2b,0x67,0xe2,0xed,0x8f,0x33,0x60,0xf2,0xd1,0xd2,0xa5,0x14,0x8a,0x8b,0x4d,0x36,0x66,0x6c,0x06,
|
||||
0xe0,0x58,0x0c,0xc3,0x5b,0xd1,0xa4,0xc4,0x54,0x9b,0x71,0xd6,0xef,0xe0,0x43,0x18,0x3f,0x67,0x2e,0x03,0x26,0x1d,0x25,0x5d,0x4a,0x28,0xda,0xb6,0x36,0xb2,0x7c,0xe6,0x89,0x6c,0x5f,0xf9,0x82,0x74,0x29,0x51,0xd7,0x0e,0x8c,0xb4,0x5d,0xea,0x4d,0x34,0x66,0x72,0x06,0xf0,0x69,0x74,0xf0,0x1b,0xd3,0xf4,0xc6,0x2b,0x3c,0x77,0xee,0xbf,
|
||||
0xf1,0xfa,0x8f,0xbf,0x43,0xa6,0x35,0xf0,0xc7,0xc2,0xc5,0x95,0x0e,0x18,0xc4,0x94,0x5f,0xff,0x99,0xfe,0x1f,0x1a,0x2f,0x5d,0x4a,0xd4,0x95,0xe0,0x8d,0x35,0x23,0x4c,0x06,0xc0,0x39,0x06,0xdb,0x52,0x40,0xb6,0xbd,0x8d,0xb7,0x6e,0x9f,0xc3,0xb2,0xb3,0xa6,0xd2,0xb4,0xfa,0x55,0xe9,0x72,0x02,0x97,0xaa,0xae,0x61,0xca,0xdc,0xbf,0x50,
|
||||
0x71,0xc0,0x18,0xe9,0x52,0xa2,0xce,0xd8,0x58,0x33,0x72,0x0a,0xe0,0x58,0x8c,0xc6,0x7b,0x7e,0x59,0x7c,0xaf,0xc1,0x62,0x55,0x36,0x7c,0x3f,0xea,0xe6,0x2d,0xa6,0x62,0x74,0xf1,0xdf,0x5d,0xbd,0x6b,0xed,0x5b,0x2c,0x3f,0xff,0xc3,0xec,0x5a,0xfb,0xb6,0x74,0x29,0x51,0x95,0x05,0xf6,0xb7,0x5d,0xd6,0xf8,0x6d,0xc8,0x54,0x00,0x5c,0x0d,
|
||||
0xdc,0x64,0xa2,0xad,0x42,0x52,0x5a,0x99,0xa0,0xfa,0xb0,0x34,0xe5,0x43,0x4b,0x28,0xab,0x4e,0x92,0xae,0x4e,0x52,0x36,0x38,0x49,0x32,0x95,0xa0,0x79,0x73,0x86,0x96,0xcd,0x19,0x9a,0x1b,0xda,0x69,0xde,0x94,0xa1,0x71,0x65,0x2b,0xbb,0xea,0xfd,0xdd,0xc3,0x51,0x31,0xba,0x96,0xba,0x79,0x8b,0x29,0x1b,0xbe,0x9f,0xa1,0xdf,0x20,0xba,
|
||||
0x9a,0xde,0x5a,0xc5,0xf2,0xf3,0x3e,0x4c,0xcb,0xc6,0x75,0xd2,0xa5,0x44,0xd5,0xd5,0xb6,0xcb,0x4f,0xfc,0x36,0x62,0x2a,0x00,0x96,0x01,0x47,0x98,0x68,0x2b,0xea,0xca,0x6b,0x4a,0xa8,0x99,0x96,0x66,0xe8,0xb4,0x32,0x06,0x8d,0x4f,0x93,0xc8,0xe3,0xaa,0xc7,0xf6,0xd5,0x6d,0xd4,0x3f,0xdb,0x4c,0xfd,0xb2,0x66,0xb6,0xbf,0xd9,0xe6,0xe5,
|
||||
0x78,0x9e,0xfa,0xd5,0x8e,0xa3,0xee,0xfe,0x45,0xb1,0xb8,0x67,0x60,0xc7,0xaa,0x97,0x59,0xfe,0xb9,0x13,0x68,0x6d,0xd8,0x28,0x5d,0x4a,0x14,0x2d,0xb3,0x5d,0xa6,0xf9,0x6d,0xc4,0x77,0x00,0x38,0x16,0x63,0xf0,0x96,0xfc,0x2a,0x6a,0xfd,0x46,0x95,0x30,0xe6,0x82,0x4a,0x86,0x1e,0x55,0x66,0xa4,0xbd,0x6d,0xaf,0xb7,0xf1,0xda,0xbd,0xdb,
|
||||
0x69,0x78,0x29,0xff,0x0b,0x7c,0x95,0xe3,0x26,0x52,0x77,0xdf,0xd3,0x94,0x0e,0xa8,0x36,0x52,0x4b,0x94,0x6d,0x7b,0x79,0x39,0xcf,0x5f,0x38,0x9d,0xb6,0x6d,0x5b,0xa4,0x4b,0x89,0xa2,0x31,0xb6,0xcb,0x1b,0x7e,0x1a,0x30,0x71,0x11,0xb0,0xa8,0x2f,0xfe,0xa5,0xab,0x93,0x8c,0xbb,0xac,0x8a,0xa3,0x6e,0x19,0x62,0x6c,0xf0,0x03,0x54,0x8d,
|
||||
0x29,0x65,0xca,0xb5,0x83,0x98,0x7c,0xcd,0x20,0x2a,0x0f,0xca,0xef,0x8e,0xec,0xed,0xaf,0xae,0xe0,0x85,0x4b,0x4e,0x8e,0xc5,0xbd,0x02,0x55,0x13,0xea,0x98,0x74,0xc7,0x1f,0x29,0xe9,0x57,0x29,0x5d,0x4a,0x14,0xf9,0x1e,0x7b,0xbe,0x3f,0xb6,0xbb,0x70,0x08,0xbf,0x00,0x8a,0x72,0x3e,0x3a,0xfc,0xdf,0xca,0x99,0x72,0xed,0x20,0x06,0x8e,
|
||||
0x4b,0x91,0x08,0xe8,0xf2,0x66,0xc5,0x88,0x12,0xf6,0xfb,0x58,0x05,0xc9,0x74,0x82,0xc6,0x7f,0xb5,0xf4,0xfa,0xb4,0xa0,0x79,0xfd,0x1a,0x48,0x24,0xa8,0x3e,0x7a,0x7a,0x30,0x85,0x45,0x48,0xf9,0xc8,0xfd,0x19,0x38,0xf9,0x68,0x36,0x2c,0x78,0x98,0x6c,0x5b,0x20,0xeb,0x62,0x14,0xaa,0x61,0xf7,0x6c,0xe2,0x36,0x3f,0x0d,0xf8,0x3a,0xac,
|
||||
0x1d,0x8b,0x09,0xc0,0xbf,0xfc,0xb4,0x11,0x45,0x89,0x04,0xd4,0x9e,0xdb,0x9f,0x83,0xce,0xee,0x1f,0x6a,0xbf,0x9b,0x9e,0x6b,0xe1,0xe5,0x9f,0x6e,0xa1,0x6d,0x67,0xef,0x52,0x20,0x99,0x2e,0x63,0xda,0xe3,0x2f,0xd1,0xef,0xc0,0xb1,0x01,0x57,0x16,0x0d,0x9b,0xfe,0xfa,0x47,0x5e,0xba,0xfc,0xac,0x58,0xdc,0x17,0x91,0x87,0x09,0xb6,0xcb,
|
||||
0xff,0xf5,0xf5,0x87,0xfd,0x9e,0x02,0x14,0xdd,0xf4,0xbf,0xa4,0x3c,0xc1,0x61,0xdf,0x1a,0x18,0xfa,0xe0,0x07,0x18,0x32,0x35,0xcd,0xd4,0x39,0xd5,0x54,0x0c,0xef,0xdd,0xc4,0x2c,0xd3,0xd2,0x8c,0x7b,0xdd,0x57,0x02,0xae,0x2a,0x3a,0x86,0x7c,0xe4,0x54,0xc6,0xff,0xf8,0x7e,0x12,0x25,0x41,0x3c,0xc4,0x5a,0xb0,0x7c,0x8d,0x41,0xbf,0x01,
|
||||
0xf0,0x59,0x9f,0x3f,0x1f,0x29,0x89,0x12,0x98,0xf8,0x9d,0x81,0x0c,0x9d,0x66,0xee,0x5c,0x3f,0x5f,0xfd,0x47,0x97,0x52,0x77,0x7d,0x35,0x65,0x83,0x7b,0xf7,0x57,0xb3,0xf9,0x99,0x85,0x6c,0x58,0xf0,0x70,0xc0,0x55,0x45,0xc7,0xb0,0x19,0x9f,0xe2,0xd0,0x1b,0xee,0x22,0x91,0x94,0xda,0xd9,0x3e,0x72,0x7c,0x8d,0xc1,0x3e,0xbf,0x8a,0x8e,
|
||||
0x45,0x1d,0xde,0x33,0xca,0x45,0xc3,0xba,0xa4,0x8a,0xea,0xc3,0xd2,0xd2,0x65,0x50,0x36,0x38,0xc9,0xe1,0xdf,0x1e,0x48,0x32,0xdd,0xbb,0x33,0xb4,0x55,0xb3,0xaf,0xa2,0xbd,0x69,0x7b,0xc0,0x55,0x45,0xc7,0x88,0x4f,0x7c,0x0e,0xeb,0x07,0x3f,0x27,0xb0,0x0b,0x33,0x85,0xc5,0xca,0x8d,0xc5,0x3e,0xe9,0xf3,0x45,0xc0,0x0b,0x87,0xd0,0x04,
|
||||
0x9c,0x08,0x8c,0xee,0x6b,0x1b,0x51,0xb2,0xdf,0xc9,0x15,0xd4,0x7e,0x26,0xfc,0x69,0x7f,0x77,0xca,0x06,0x97,0x50,0x31,0xbc,0x84,0xfa,0x7f,0x34,0xef,0xf3,0x7b,0xdb,0x77,0x6c,0xa3,0x75,0xd3,0x06,0x4a,0xaa,0x06,0xd0,0xb2,0x61,0x2d,0xad,0x9b,0xd6,0xd3,0xda,0xb0,0x91,0xb6,0xad,0x0d,0xb4,0x6d,0xdf,0x4a,0x66,0xe7,0x0e,0x32,0xcd,
|
||||
0xbb,0xc8,0xb6,0xb5,0x92,0xcd,0x64,0x48,0x24,0x13,0x05,0xff,0x0e,0x3a,0xe0,0xf0,0x23,0x28,0xe9,0x5f,0xc5,0xe6,0x25,0x7f,0x96,0x2e,0x45,0xda,0x52,0xe0,0xd6,0x7b,0x36,0xb1,0xef,0x03,0xa5,0x0b,0x7e,0x2f,0x02,0x0e,0x00,0xfe,0x04,0x1c,0xeb,0xa7,0x1d,0x69,0x03,0xac,0x14,0x53,0x67,0x55,0x93,0x88,0xe0,0x98,0x58,0x75,0xd7,0x76,
|
||||
0xde,0x99,0xdf,0x64,0xbc,0xdd,0x44,0x32,0x49,0xa2,0x34,0x45,0x22,0x95,0x26,0x99,0x4a,0xbf,0xff,0x35,0x99,0x4a,0x93,0x48,0x7f,0xf0,0xbf,0x75,0xf7,0x3d,0x89,0xd2,0xd4,0xee,0x7f,0xcf,0x7d,0x4d,0x0d,0x1a,0xc2,0x7e,0xe7,0x5f,0x4e,0xa2,0x24,0x9c,0xe7,0xc2,0x56,0x7c,0xf1,0x74,0x36,0x3e,0x15,0xca,0x46,0xba,0x51,0xb4,0x04,0x38,
|
||||
0xc5,0x76,0xd9,0xd6,0xd7,0x06,0x7c,0x5d,0x4d,0xb1,0x5d,0xb6,0x3a,0x16,0x33,0x80,0xf9,0xc0,0x87,0xfd,0xb4,0x25,0x26,0x01,0x63,0x2f,0xaa,0x8c,0xe4,0xe0,0x07,0xa8,0x3d,0xa7,0x3f,0xeb,0x16,0xed,0xa2,0x75,0x9b,0xb1,0x45,0x60,0x00,0xc8,0x66,0x32,0x64,0x5b,0x9a,0xa1,0xa5,0xd9,0xd8,0x22,0x73,0x65,0xc3,0x46,0x31,0xe9,0xf6,0xf9,
|
||||
0xa1,0x0d,0xfe,0x77,0xef,0xbd,0x95,0x8d,0x4f,0xcf,0x0f,0xa5,0xaf,0x08,0xfa,0x2b,0x70,0x9a,0xed,0xe2,0xeb,0xdc,0xcf,0xf7,0x61,0x9f,0x2b,0xe0,0x14,0xe0,0x49,0xbf,0x6d,0x49,0x18,0x3a,0xad,0x8c,0x81,0xe3,0x52,0xd2,0x65,0x74,0xab,0xb4,0x5f,0x82,0x03,0xcf,0xee,0x27,0x5d,0xc6,0x3e,0xf5,0x1f,0x7b,0x18,0x53,0x1f,0x5a,0x4a,0xe5,
|
||||
0xa1,0x93,0x43,0xe9,0xef,0xdd,0x7b,0x6f,0xc5,0x9d,0x75,0x65,0x6e,0x2d,0xc4,0xd8,0x71,0x80,0x53,0xfd,0x0e,0x7e,0x30,0xf4,0x38,0xb0,0xed,0xd2,0x04,0x9c,0x06,0x2c,0x34,0xd1,0x5e,0x58,0x12,0x25,0x30,0xe6,0x82,0xe8,0xdf,0x61,0x36,0xfa,0x94,0x0a,0xca,0x87,0x45,0x77,0xa9,0x85,0xea,0x63,0x6c,0xa6,0x3e,0xb8,0x84,0xf2,0x91,0xe1,
|
||||
0xec,0x01,0x1b,0xf3,0xc1,0xff,0x04,0x70,0x7a,0x6e,0xcc,0xf9,0x66,0x6c,0xe2,0x6b,0xbb,0xec,0x04,0xce,0x00,0xfe,0x68,0xaa,0xcd,0xa0,0x0d,0x3f,0xbe,0x9c,0x7e,0xa3,0xa2,0x3b,0xb0,0x3a,0x24,0x4b,0x13,0x1c,0xf4,0xc9,0x68,0xce,0x02,0x46,0x9c,0x39,0x93,0xc9,0x77,0x2e,0xa0,0xb4,0x72,0x40,0x28,0xfd,0xc5,0x7c,0xf0,0xcf,0x07,0x3e,
|
||||
0x91,0x1b,0x6b,0x46,0x18,0x3d,0xf3,0xb5,0x5d,0x9a,0x81,0xb3,0x80,0x82,0x58,0xeb,0x79,0xd8,0x31,0x72,0x9f,0xf7,0xe7,0x6b,0xe8,0xd1,0x65,0x79,0x3d,0x79,0x18,0xb8,0x44,0x82,0xda,0xcb,0x7f,0xc0,0xf8,0xff,0xba,0x3b,0xb4,0x1b,0x73,0x62,0x3e,0xf8,0x1f,0x05,0x3e,0x99,0x1b,0x63,0xc6,0x18,0xbf,0xf4,0x65,0xbb,0xb4,0x00,0x9f,0x02,
|
||||
0x1e,0x31,0xdd,0xb6,0x49,0x25,0xe5,0x09,0x06,0x4f,0x92,0xff,0xcc,0xbf,0xb7,0x52,0x55,0xc9,0xc8,0x5c,0xab,0x48,0x94,0xa6,0x38,0x74,0xd6,0x9d,0xd4,0x5e,0xf1,0xa3,0xd0,0xfa,0x8c,0xf9,0xe0,0x7f,0x04,0xf8,0x74,0x6e,0x6c,0x19,0x15,0xc8,0xb5,0xef,0xdc,0x7e,0xe6,0xe7,0x00,0x0f,0x05,0xd1,0xbe,0x09,0x83,0x27,0xa7,0x49,0xa6,0x0a,
|
||||
0xeb,0x46,0x12,0xc9,0x3b,0x14,0x3b,0x94,0x56,0x0e,0x60,0xd2,0xed,0xf3,0x19,0x79,0xf6,0xe7,0x43,0xeb,0x33,0xe6,0x83,0xff,0x37,0xc0,0x39,0xb9,0x31,0x65,0x5c,0x60,0x1f,0x7e,0xe5,0xb6,0x33,0x3e,0x0f,0xb8,0x3f,0xa8,0x3e,0xfc,0xa8,0x39,0x52,0x7e,0x30,0xe5,0xab,0x46,0x38,0x00,0xca,0x46,0x8c,0xa6,0x6e,0xde,0x62,0x06,0x1f,0x77,
|
||||
0x52,0x68,0x7d,0xc6,0x7c,0xf0,0xdf,0x07,0x9c,0x1f,0xd4,0xd6,0xe0,0x10,0xec,0xf6,0xe0,0xe4,0xf6,0x31,0x9b,0x09,0xcc,0x0d,0xb2,0x9f,0xbe,0xa8,0xdc,0xbf,0xf0,0x1e,0x28,0xa9,0x18,0x5e,0xd2,0xeb,0xdb,0x83,0x4d,0xab,0x1c,0x37,0x91,0x23,0x1e,0x5a,0x4a,0xe5,0xb8,0x89,0xa1,0xf5,0x19,0xf3,0xc1,0xff,0x6b,0xe0,0xc2,0x20,0x76,0x04,
|
||||
0xee,0x2c,0xf0,0xdb,0x5f,0x72,0xdb,0x18,0x5d,0x0c,0xdc,0x11,0x74,0x5f,0xf9,0xe8,0xed,0xc3,0x36,0x51,0x53,0x56,0x1d,0x7e,0xdd,0x83,0x8f,0x3b,0x89,0xa9,0x0f,0x3c,0x13,0xea,0x5a,0x84,0x31,0x1f,0xfc,0x77,0x00,0x97,0x98,0xdc,0x02,0xac,0x3b,0xa1,0x1c,0x4d,0xb6,0x4b,0x16,0xb8,0x0c,0xf8,0x45,0x18,0xfd,0xed,0x4b,0xa2,0x04,0x52,
|
||||
0x83,0x0a,0x34,0x00,0x42,0x0e,0xae,0x91,0x67,0x7f,0xde,0x5b,0x91,0xa7,0x7f,0x55,0x68,0x7d,0xc6,0x7c,0xf0,0xff,0x02,0xb8,0x2c,0x37,0x66,0x02,0x17,0xda,0x3c,0x38,0xf7,0x0b,0x5d,0xee,0x58,0xb4,0x02,0x57,0x86,0xd5,0x6f,0x57,0xd2,0x03,0x93,0x05,0xfb,0x20,0x59,0x3a,0xac,0x19,0x40,0x22,0x41,0xed,0x57,0xaf,0xa5,0xf6,0xf2,0x1f,
|
||||
0x84,0xd3,0x5f,0x4e,0xcc,0x07,0xff,0xcd,0xb6,0xcb,0x55,0x61,0x76,0x18,0xfa,0xdb,0xa0,0xed,0xf2,0x35,0x84,0x97,0x10,0x4f,0x55,0x15,0xe6,0xbb,0x3f,0x40,0x6a,0x40,0xf0,0xb5,0x27,0x53,0x69,0xc6,0xcf,0x99,0xab,0x83,0x3f,0x5c,0x37,0x86,0x3d,0xf8,0x41,0x20,0x00,0x00,0x6c,0x97,0x6f,0x02,0x37,0x48,0xf4,0x0d,0x18,0x7f,0xb0,0x26,
|
||||
0x4c,0xad,0x5b,0x83,0xad,0xbd,0xb4,0x6a,0x20,0x93,0x7e,0xf5,0x27,0x46,0x9c,0x39,0x33,0xd0,0x7e,0xf6,0x14,0xf3,0xc1,0x3f,0xdb,0x76,0xf9,0x96,0x44,0xc7,0x62,0x6f,0x85,0xb6,0xcb,0x77,0x81,0xeb,0x24,0xfa,0x6e,0xd9,0x92,0xe9,0xd3,0x9a,0xfc,0x51,0xd0,0xd2,0x10,0x5c,0x00,0x94,0x8f,0xdc,0x9f,0xa9,0x0f,0x3c,0x13,0xfa,0x42,0xa3,
|
||||
0x31,0x1f,0xfc,0x3f,0xb2,0x5d,0xbe,0x27,0xd5,0xb9,0xe8,0x5c,0xd8,0x76,0xf9,0x21,0x70,0x4d,0xd8,0xfd,0x66,0xdb,0x73,0x21,0x50,0x80,0x9a,0x03,0x0a,0x80,0xca,0x43,0x27,0x33,0xf5,0xa1,0xa5,0xf4,0x1f,0x7b,0x58,0x20,0xed,0x77,0x27,0xe6,0x83,0xff,0xfb,0xb6,0xcb,0xb5,0x92,0x05,0x88,0x9f,0x0c,0xdb,0x2e,0xd7,0x03,0xb7,0x84,0xdd,
|
||||
0x6f,0xf3,0xe6,0xc2,0x0c,0x80,0x20,0x66,0x00,0x43,0x8e,0x3f,0x99,0xa9,0xf3,0x16,0x53,0x36,0x6c,0x94,0xf1,0xb6,0x7b,0x12,0xf3,0xc1,0x7f,0xb3,0xed,0x32,0x4b,0xba,0x08,0xf1,0x00,0xc8,0x79,0x27,0xec,0x0e,0x77,0xbc,0x5b,0x78,0xeb,0xcb,0xef,0xda,0xd0,0x4e,0x7b,0xb3,0xd9,0xc1,0x32,0xea,0xd3,0x97,0x32,0xf1,0x97,0x8f,0x87,0xbe,
|
||||
0xf1,0x46,0xcc,0x07,0x3f,0x08,0x1c,0xf3,0x5d,0x89,0x4a,0x00,0x0c,0x0a,0xbb,0xc3,0x8d,0xcb,0x8c,0x3e,0x54,0x15,0x8a,0x8d,0xcb,0x0c,0x3e,0x0b,0x92,0x48,0x70,0xf0,0xd7,0xae,0xe7,0x90,0xeb,0xef,0x08,0x6d,0x05,0x9f,0x0e,0x3a,0xf8,0x01,0x81,0x63,0xbe,0x2b,0x51,0xb9,0x1f,0x36,0xf4,0x4d,0xee,0x36,0x3d,0xdf,0x42,0xa6,0x2d,0x4b,
|
||||
0xb2,0xb4,0x70,0x6e,0x08,0xa8,0x7f,0xd6,0x4c,0x68,0x25,0x53,0x69,0x0e,0x99,0x7d,0x27,0x23,0xce,0xb8,0xc0,0x48,0x7b,0xf9,0xd0,0xc1,0xff,0xbe,0x48,0x6c,0xec,0x18,0x95,0x19,0x40,0xe8,0x2f,0x46,0xfb,0xce,0x2c,0x0d,0x2b,0x02,0x79,0xc0,0x2a,0x10,0x6d,0xdb,0xb3,0x34,0xae,0xf4,0x3f,0x03,0x28,0x1d,0x30,0x88,0x49,0x77,0x2e,0xd0,
|
||||
0xc1,0x2f,0x4f,0x03,0xa0,0x13,0x91,0x17,0x63,0xc3,0xdf,0x0b,0x67,0x73,0xcd,0xfa,0x67,0x9b,0xc9,0xfa,0x7c,0x2c,0xa4,0x7c,0xd4,0x81,0x4c,0x7d,0x60,0x09,0xd5,0x47,0x9d,0x68,0xa6,0xa8,0x3c,0xe8,0xe0,0xdf,0x8b,0x06,0x40,0x27,0x22,0xe7,0x43,0xeb,0x17,0x35,0xb3,0x73,0x5d,0xa0,0x0f,0x5b,0x19,0x91,0x6d,0x87,0x37,0x7f,0xbb,0xc3,
|
||||
0x57,0x1b,0x55,0x13,0xea,0x38,0xe2,0xe1,0xa5,0xf4,0xff,0xd0,0x78,0x43,0x55,0xf5,0x9e,0x0e,0xfe,0x2e,0x45,0xe2,0x1a,0x40,0x54,0x02,0x40,0x24,0x0d,0x33,0x6d,0x59,0x5e,0xbf,0x3f,0xfa,0x3b,0xea,0xac,0x59,0xb0,0x93,0x9d,0xeb,0xfb,0x1e,0x54,0x43,0x3e,0x72,0x2a,0x75,0xf7,0x2f,0x22,0x5d,0x33,0xc2,0x60,0x55,0xbd,0xa3,0x83,0xbf,
|
||||
0x5b,0x3a,0x03,0xe8,0x44,0xec,0xc5,0xd8,0xf0,0xf7,0x66,0xb6,0xbe,0x16,0xdd,0x6b,0x01,0xed,0x3b,0xb3,0xac,0xf6,0xf1,0xee,0x3f,0xea,0xb3,0x5f,0x60,0xe2,0x6d,0x8f,0x51,0x52,0x11,0xfe,0xae,0x47,0x3a,0xf8,0x7b,0xa4,0x01,0xd0,0x89,0xdc,0x74,0x28,0x0b,0xaf,0xcd,0xdd,0x1e,0xd9,0x63,0x74,0xf5,0xc3,0x3b,0xfa,0x74,0xff,0x7f,0x22,
|
||||
0x99,0x64,0xcc,0xd7,0x67,0x73,0xc8,0x75,0xbf,0x0c,0xfd,0x63,0x3e,0xd0,0xc1,0xdf,0x0b,0x1a,0x00,0x00,0x8e,0x45,0x05,0x20,0xba,0xd6,0x55,0xe3,0xca,0x56,0x5e,0x9b,0x1b,0xbd,0x53,0x81,0x0d,0x7f,0x6f,0xe6,0x9d,0xc7,0xf2,0x5f,0xfe,0x3d,0x99,0x2e,0x63,0xfc,0x8d,0xf7,0x71,0xe0,0x65,0xdf,0x09,0xa0,0xaa,0x7d,0xd3,0xc1,0xdf,0x2b,
|
||||
0x65,0x8e,0x45,0xb9,0x74,0x11,0xe2,0x01,0x40,0x44,0x92,0xf0,0x9d,0xf9,0x4d,0xbc,0xf7,0x64,0x74,0x3e,0x15,0xd8,0xb6,0xba,0x8d,0x95,0xb7,0x6e,0xcd,0x7b,0x0c,0xa5,0x06,0x0e,0x66,0xf2,0x5d,0x0b,0x19,0x7e,0xda,0xb9,0xc1,0x14,0xb6,0x0f,0x3a,0xf8,0xf3,0x22,0x7e,0xec,0x6b,0x00,0x74,0xc8,0xc2,0xab,0xb7,0x6f,0xa3,0x71,0xa5,0xfc,
|
||||
0xf5,0x80,0x96,0xc6,0x0c,0x2f,0xcd,0xd9,0x92,0xf7,0x6d,0xbf,0x15,0xa3,0x6b,0x99,0xfa,0xe0,0x12,0x06,0x1d,0x29,0xb3,0x4d,0xa3,0x0e,0xfe,0xbc,0x89,0x1f,0xfb,0x51,0x08,0x80,0xc8,0xc8,0xb4,0x66,0x59,0x31,0xbb,0x91,0x4d,0xcb,0x8d,0x2f,0xbf,0xde,0x6b,0x4d,0xef,0xb5,0xb3,0xfc,0x07,0x0d,0xec,0xda,0x98,0xdf,0x55,0xff,0xaa,0xc3,
|
||||
0x8e,0x60,0xea,0x43,0x4b,0xe9,0x77,0xf0,0x21,0x01,0x55,0xd6,0x33,0x1d,0xfc,0x85,0x29,0x0a,0x01,0xd0,0x20,0x5d,0x40,0x67,0x6d,0x4d,0x59,0x56,0xdc,0xd0,0xc8,0xdb,0x7d,0x38,0xf7,0xf6,0x6b,0xf3,0x8b,0x2d,0xfc,0xf3,0x3f,0x36,0xd3,0xb4,0x26,0xbf,0xc1,0x5f,0x33,0xfd,0x74,0xea,0xee,0xfb,0x2b,0xe9,0x21,0xc3,0x02,0xaa,0xac,0x67,
|
||||
0x3a,0xf8,0xfb,0x4c,0xfc,0xd8,0xd7,0x00,0xe8,0x42,0x36,0x03,0xaf,0xdd,0xbd,0x9d,0x95,0xff,0xb3,0x95,0x4c,0x6b,0x38,0x07,0xf5,0x3b,0xf3,0x9b,0x78,0x71,0x56,0x23,0x6d,0xdb,0xf3,0xeb,0x6f,0xbf,0xf3,0xbe,0xcc,0xe1,0x3f,0xff,0x3d,0x25,0x15,0x32,0x7b,0x07,0xae,0xfb,0xfd,0x3d,0x3a,0xf8,0xfb,0x4e,0xfc,0xd8,0x8f,0xc4,0x93,0x30,
|
||||
0x8e,0xc5,0x2e,0x84,0x3f,0x09,0xe8,0x4e,0x79,0x4d,0x09,0xb5,0xe7,0xf4,0x67,0xe4,0x09,0xe5,0x81,0xbc,0x5a,0x8d,0x2f,0xb7,0xf2,0xda,0xbd,0xdb,0xd9,0xba,0x2a,0xbf,0x6b,0x0f,0x89,0x64,0x92,0x31,0x57,0xcf,0xe1,0x80,0x4b,0xbf,0x69,0xbe,0xa8,0x3c,0xb4,0x6c,0x5c,0xc7,0xf2,0xcf,0x9d,0x48,0xd3,0x1b,0xaf,0x88,0xd6,0x51,0x80,0x9a,
|
||||
0x6d,0x57,0xfe,0x53,0x80,0xa8,0x04,0xc0,0x3a,0x60,0xb8,0x74,0x1d,0x3d,0xa9,0x3c,0xb0,0x94,0x31,0x17,0x54,0x32,0xa4,0xce,0xcc,0x7e,0x82,0x3b,0xde,0x6e,0xe3,0xb5,0x7b,0xb7,0xb3,0xe9,0xf9,0x96,0xbc,0x97,0x27,0x4b,0x96,0x95,0x33,0xfe,0xbf,0xee,0x66,0xd8,0x29,0x9f,0x31,0x52,0x8b,0x5f,0x1a,0x02,0x7d,0xb2,0xce,0x76,0x19,0x29,
|
||||
0x5d,0x44,0x54,0x02,0x60,0x25,0x20,0x73,0xf5,0x2a,0x4f,0xfd,0x46,0x95,0x50,0x73,0x64,0x19,0x43,0xa7,0x95,0x79,0x9b,0x75,0xe6,0xf1,0x0a,0x36,0xad,0x69,0xa7,0xfe,0xd9,0x66,0xea,0x9f,0x6d,0x66,0xdb,0xaa,0xd6,0x3e,0xcd,0x9a,0x4b,0xab,0x06,0x32,0xf1,0xb6,0xc7,0xc4,0xae,0xf4,0x77,0x47,0x43,0x20,0x6f,0x2b,0x6d,0x97,0xf0,0x1f,
|
||||
0xcc,0xd8,0x43,0x54,0x02,0xe0,0x6f,0xc0,0x31,0xd2,0x75,0xe4,0x2b,0x3d,0x28,0xc9,0xe0,0x89,0x69,0xca,0x6a,0x92,0x94,0x0d,0x2e,0xa1,0xac,0x3a,0x49,0xba,0x3a,0x49,0x32,0x95,0xa0,0x79,0x73,0x3b,0x2d,0x0d,0x19,0x9a,0x37,0x67,0x68,0x6e,0xc8,0xd0,0xf8,0x72,0x0b,0x4d,0x6b,0xfd,0x3d,0x78,0x94,0xaa,0xae,0x61,0xf2,0x9d,0x4f,0x50,
|
||||
0x35,0xa1,0xce,0xd0,0x6f,0x60,0x96,0x86,0x40,0x5e,0xfe,0x66,0xbb,0x1c,0x27,0x5d,0x44,0x54,0x16,0x04,0x69,0x94,0x2e,0xa0,0x2f,0x5a,0x1a,0x33,0xac,0x5b,0x14,0xce,0xcd,0x43,0x65,0xc3,0x46,0x31,0xf9,0xd7,0x7f,0x16,0x79,0x9a,0xaf,0xb7,0xd2,0x35,0x23,0xa8,0xbb,0xf7,0x29,0x0d,0x81,0xde,0x89,0xc4,0x31,0x1f,0x85,0x4f,0x01,0x20,
|
||||
0x02,0x57,0x43,0xa3,0xac,0x62,0x74,0x2d,0x75,0xf3,0x16,0x47,0x7a,0xf0,0x77,0xe8,0x08,0x01,0xa9,0xfb,0x11,0x0a,0x48,0x24,0x8e,0x79,0x0d,0x80,0x28,0x4b,0x24,0x18,0x7e,0xea,0x67,0x39,0xe2,0x91,0x65,0x54,0xec,0x7f,0xb0,0x74,0x35,0xbd,0xa6,0x21,0xd0,0x2b,0x91,0x38,0xe6,0x35,0x00,0x22,0x2a,0x35,0x78,0x28,0x87,0xdd,0xf2,0x10,
|
||||
0x13,0x7e,0xfa,0x20,0xa9,0x41,0x43,0xa4,0xcb,0xc9,0x9b,0x86,0xc0,0x3e,0x45,0xe2,0x98,0x8f,0x4a,0x00,0x44,0xe2,0x7c,0x28,0x2a,0x86,0xce,0x38,0x9b,0xa3,0xe7,0xbf,0xcc,0xb0,0x19,0x9f,0x92,0x2e,0xc5,0x17,0x0d,0x81,0x1e,0x45,0xe2,0x98,0x8f,0x4a,0x00,0xec,0x2f,0x5d,0x80,0xb4,0x44,0x32,0x49,0xcd,0xf4,0x33,0xa8,0x9b,0xb7,0x98,
|
||||
0xc3,0x7f,0xf6,0x5b,0x52,0x83,0x87,0x4a,0x97,0x64,0x84,0x86,0x40,0xb7,0x22,0x71,0xcc,0x8b,0x7f,0x0c,0xe8,0x58,0x5c,0x83,0xd0,0x1e,0x81,0x51,0x90,0x2c,0x2b,0x67,0xc4,0x99,0x33,0x39,0xe0,0xe2,0xab,0xe9,0x77,0x90,0x25,0x5d,0x4e,0x60,0xf4,0x23,0xc2,0x2e,0x5d,0x93,0xdb,0x19,0x4b,0x8c,0x68,0x00,0x38,0x16,0xd7,0x21,0xb0,0x37,
|
||||
0xa0,0xb4,0x54,0x75,0x0d,0xd5,0x47,0x9d,0xc8,0xe0,0x63,0x3f,0x4a,0xcd,0x47,0xcf,0x14,0x7b,0x88,0x27,0x6c,0x1a,0x02,0x5d,0xba,0x2e,0xb7,0x47,0xa6,0x08,0xb1,0x00,0x70,0x2c,0x66,0x03,0x32,0x4b,0xd6,0x98,0x92,0x48,0xf4,0xfa,0x21,0x98,0x44,0x49,0x09,0x55,0xe3,0xeb,0xa8,0x3e,0xf6,0xa3,0x54,0x1d,0x3a,0xd9,0xfb,0xd9,0x8e,0x36,
|
||||
0xf6,0xfc,0xde,0xae,0xfe,0x5a,0xba,0xf8,0x3e,0x12,0x09,0x12,0x25,0x25,0x24,0x52,0x69,0x92,0xa5,0x29,0xef,0x6b,0x2a,0x9d,0xfb,0xba,0xc7,0xbf,0xef,0xf1,0xff,0x25,0x96,0x09,0x03,0x0d,0x81,0x6e,0xcc,0x96,0xda,0x21,0x58,0x24,0x00,0x1c,0x8b,0x9b,0x80,0xab,0x25,0xfa,0x56,0x9e,0x44,0x32,0x49,0xa2,0x53,0x28,0x54,0x1f,0x3d,0x9d,
|
||||
0x09,0x3f,0x99,0x47,0xa2,0x24,0xf8,0x7b,0xc3,0x34,0x04,0xba,0x74,0x93,0xed,0x12,0xfa,0x93,0x5d,0xa1,0x07,0x80,0x63,0x71,0x0b,0x70,0x45,0xd8,0xfd,0xaa,0x7d,0xab,0xb1,0x3f,0xc1,0xe1,0xb7,0xfe,0x56,0x43,0x40,0xce,0x2d,0xb6,0xcb,0xd7,0xc2,0xec,0x30,0xb4,0x00,0x70,0x2c,0x12,0xc0,0xcf,0x81,0x2f,0x85,0xd5,0xa7,0xca,0x9f,0x86,
|
||||
0x80,0xb8,0x5f,0x00,0x5f,0xb1,0xdd,0x7c,0x9f,0x11,0xed,0x9b,0x50,0x02,0xc0,0xb1,0x48,0x02,0xbf,0x04,0x2e,0x0d,0xa3,0x3f,0xe5,0x8f,0x86,0x80,0xb8,0x3b,0x80,0xcb,0xc2,0x08,0x81,0xc0,0x03,0x20,0x37,0xf8,0xef,0x02,0x2e,0x0c,0xba,0x2f,0x65,0x8e,0x86,0x80,0xb8,0xb9,0xc0,0x25,0xb6,0x4b,0xfe,0x9b,0x42,0xe4,0x21,0xd0,0x00,0x70,
|
||||
0x2c,0x4a,0x80,0xbb,0x81,0xf3,0x83,0xec,0x47,0x05,0x43,0x43,0x40,0xdc,0xfd,0xc0,0x85,0xb6,0x4b,0x60,0x1b,0x58,0x06,0x16,0x00,0x8e,0x45,0x29,0xde,0x2f,0x10,0x8d,0x65,0x6b,0x54,0x9f,0x68,0x08,0x88,0xfb,0x0d,0x70,0x81,0xed,0xd2,0x16,0x44,0xe3,0x81,0x04,0x80,0x63,0x91,0x02,0x1e,0x04,0x3e,0x19,0x44,0xfb,0x2a,0x5c,0x1a,0x02,
|
||||
0xe2,0x1e,0x01,0xce,0xb5,0x5d,0x8c,0x6f,0x5a,0x61,0x3c,0x00,0x1c,0x8b,0x34,0xf0,0x30,0x70,0x86,0xe9,0xb6,0x95,0x1c,0x0d,0x01,0x71,0x8f,0x02,0x9f,0xb1,0x5d,0x8c,0x6e,0x5a,0x61,0x34,0x00,0x1c,0x8b,0x32,0xe0,0x77,0xc0,0xa9,0x26,0xdb,0x55,0xd1,0xa0,0x21,0x20,0x6e,0x3e,0x70,0xb6,0xed,0xd2,0x6c,0xaa,0x41,0x63,0x01,0x90,0xdb,
|
||||
0xe4,0xf3,0xf7,0xc0,0xc7,0x4c,0xb5,0xa9,0xa2,0x47,0x43,0x40,0xdc,0x42,0xe0,0x4c,0xdb,0x65,0xa7,0x89,0xc6,0x8c,0x04,0x80,0x63,0xd1,0x0f,0xf8,0x03,0x30,0xdd,0x44,0x7b,0x2a,0xda,0x34,0x04,0xc4,0x3d,0x09,0x9c,0x6e,0xbb,0xf8,0xde,0xbe,0xca,0x77,0x00,0x38,0x16,0x95,0x78,0x53,0x93,0x68,0xad,0x53,0xad,0x02,0xa5,0x21,0x20,0x6e,
|
||||
0x11,0xf0,0x71,0xdb,0xc5,0xd7,0xbe,0xf6,0xbe,0x02,0xc0,0xb1,0x18,0x00,0xfc,0x09,0x38,0xd6,0x4f,0x3b,0xaa,0x30,0x69,0x08,0x88,0x5b,0x02,0x9c,0x62,0xbb,0x6c,0xeb,0x6b,0x03,0x7d,0x0e,0x00,0xc7,0x62,0x20,0xf0,0x04,0x70,0x54,0x5f,0xdb,0x50,0x85,0x4f,0x43,0x40,0xdc,0x3f,0x80,0x19,0xb6,0xcb,0x96,0xbe,0xfc,0xb0,0x9f,0x25,0xc1,
|
||||
0xc6,0xa0,0x83,0x3f,0xf6,0x36,0x3a,0x8f,0xf2,0xd2,0x57,0x3f,0x45,0xb6,0x3d,0x90,0xfb,0x54,0x3e,0x40,0x97,0x17,0xeb,0xd2,0x51,0x78,0x63,0xb1,0x4f,0xfc,0x9e,0x02,0xb8,0xc0,0x58,0x3f,0x6d,0xa8,0xe2,0xa0,0x33,0x01,0x31,0xae,0xed,0x32,0xae,0xaf,0x3f,0xec,0x77,0x51,0xd0,0xdf,0xf8,0xfc,0x79,0x55,0x24,0x74,0x26,0x20,0xc6,0xd7,
|
||||
0x18,0xf4,0x1b,0x00,0x0f,0xf8,0xfc,0x79,0x55,0x44,0x34,0x04,0x44,0xf8,0x1a,0x83,0xbe,0x02,0xc0,0x76,0xf9,0x3f,0xe0,0x5f,0x7e,0xda,0x50,0xc5,0x25,0xec,0x10,0x18,0x79,0x56,0xac,0x9f,0x32,0x7f,0xc9,0x76,0x59,0xe9,0xa7,0x01,0x13,0xfb,0x02,0x3c,0x68,0xa0,0x0d,0x55,0x44,0xc2,0x0c,0x81,0x4c,0xab,0xd1,0x5b,0xe3,0x0b,0x8d,0xef,
|
||||
0xb1,0xa7,0x01,0xa0,0x02,0x11,0x56,0x08,0x64,0x35,0x00,0x7c,0xf1,0x1d,0x00,0xb6,0xcb,0xeb,0xc0,0x3f,0xfd,0xb6,0xa3,0x8a,0x4f,0x18,0x21,0x10,0xe3,0x19,0xc0,0x32,0xdb,0xe5,0x0d,0xbf,0x8d,0x98,0xda,0x1a,0x4c,0x67,0x01,0xaa,0x4b,0x41,0x87,0x40,0xb6,0xd5,0xf8,0x23,0xf2,0x85,0xc2,0xc8,0x98,0x33,0x15,0x00,0xbf,0x81,0x70,0x56,
|
||||
0x31,0x55,0x85,0x27,0xc8,0x10,0x88,0xe9,0x0c,0x20,0x8b,0xa1,0x8f,0xe0,0x8d,0x04,0x80,0xed,0xf2,0x2e,0xde,0x7d,0xc9,0x4a,0x75,0x29,0xa8,0x10,0x88,0xe9,0x35,0x80,0x67,0x6c,0x97,0x35,0x26,0x1a,0x32,0xb9,0x3b,0xb0,0x9e,0x06,0xa8,0x1e,0x05,0x11,0x02,0x31,0x9d,0x01,0x18,0x1b,0x6b,0x26,0x03,0xe0,0x61,0x08,0x6e,0xf5,0x52,0x55,
|
||||
0x1c,0x4c,0x87,0x40,0xb6,0x2d,0x76,0xd7,0x00,0xda,0xf1,0xc6,0x9a,0x11,0xc6,0x02,0xc0,0x76,0xd9,0x00,0x3c,0x65,0xaa,0x3d,0x55,0xbc,0x4c,0x86,0x40,0x0c,0x67,0x00,0x4f,0xda,0x2e,0xf5,0xa6,0x1a,0x33,0x39,0x03,0x00,0xb8,0xd3,0x70,0x7b,0xaa,0x48,0x99,0x0a,0x81,0x18,0x5e,0x03,0xb8,0xcb,0x64,0x63,0xa6,0x03,0xe0,0x21,0xe0,0x55,
|
||||
0xc3,0x6d,0xaa,0x22,0x65,0x22,0x04,0x32,0x2d,0xb1,0x0a,0x80,0x57,0xf1,0xc6,0x98,0x31,0x46,0x03,0x20,0xb7,0x8d,0xd1,0x2c,0x93,0x6d,0xaa,0xe2,0xe6,0x37,0x04,0x62,0x76,0x0d,0xe0,0x7a,0xd3,0x5b,0x85,0x99,0x9e,0x01,0x00,0xcc,0x03,0x56,0x05,0xd0,0xae,0x2a,0x52,0x7e,0x42,0x20,0x46,0xa7,0x00,0xab,0x08,0xe0,0xe9,0x5b,0xe3,0x01,
|
||||
0x90,0xdb,0xc7,0x4c,0x67,0x01,0x2a,0x2f,0x7d,0x0d,0x81,0x18,0x5d,0x04,0xbc,0x3e,0x88,0x3d,0x02,0x83,0x98,0x01,0x80,0xb7,0x27,0xe0,0xeb,0x01,0xb5,0xad,0x8a,0x54,0x5f,0x42,0x20,0x26,0x01,0xf0,0x3a,0xde,0x98,0x32,0x2e,0x90,0x00,0xc8,0x6d,0x64,0x38,0x3b,0x88,0xb6,0x55,0x71,0xcb,0x37,0x04,0x62,0x72,0x0a,0x30,0x2b,0xa8,0x1d,
|
||||
0x82,0x83,0x9a,0x01,0x00,0xdc,0x03,0xac,0x0e,0xb0,0x7d,0x55,0xa4,0xf2,0x09,0x81,0x18,0x3c,0x0c,0xf4,0x06,0x70,0x6f,0x50,0x8d,0x07,0x16,0x00,0x3a,0x0b,0x50,0x7e,0xf4,0x36,0x04,0x62,0x70,0x0a,0x30,0x3b,0xa8,0xad,0xc1,0x21,0xd8,0x19,0x00,0xc0,0xdd,0xc0,0x5b,0x01,0xf7,0xa1,0x8a,0x54,0x6f,0x42,0xa0,0xc8,0x03,0xe0,0x4d,0xbc,
|
||||
0x99,0x74,0x60,0x02,0x0d,0x80,0xdc,0x7e,0xe6,0x37,0x04,0xd9,0x87,0x2a,0x6e,0xfb,0x0a,0x81,0x22,0xbf,0x06,0x70,0x43,0x6e,0x0c,0x05,0x26,0xe8,0x19,0x00,0xc0,0xaf,0x81,0x77,0x42,0xe8,0x47,0x15,0xa9,0x9e,0x42,0xa0,0x88,0x6f,0x04,0x7a,0x1b,0x6f,0xec,0x04,0x2a,0xf0,0x00,0xb0,0x5d,0x5a,0x80,0x39,0x41,0xf7,0xa3,0x8a,0x5b,0x77,
|
||||
0x21,0x50,0xc4,0xa7,0x00,0x73,0x82,0x7e,0xf7,0x87,0x70,0x66,0x00,0xe0,0x3d,0x24,0xa4,0xb3,0x00,0xe5,0x4b,0x57,0x21,0x50,0xa4,0x33,0x80,0x77,0x08,0xe9,0xc1,0xba,0x50,0x02,0xc0,0x76,0x69,0x06,0xbe,0x1c,0x46,0x5f,0xaa,0xb8,0x75,0x0e,0x81,0x6c,0x7b,0x3b,0xd9,0xf6,0xa2,0x5c,0x82,0xe2,0x4b,0xb9,0x99,0x73,0xe0,0xc2,0x9a,0x01,
|
||||
0x60,0xbb,0x3c,0x4e,0x80,0x9f,0x67,0xaa,0xf8,0xe8,0x08,0x81,0xf6,0x9d,0x3b,0xa4,0x4b,0x09,0xc2,0x3d,0xb6,0xcb,0xfc,0xb0,0x3a,0xf3,0xb5,0x39,0x68,0xbe,0x1c,0x8b,0x6a,0xe0,0x65,0x60,0x64,0x98,0xfd,0xaa,0xe2,0x34,0xf8,0xb8,0x93,0xd8,0xbc,0xe4,0xcf,0xd2,0x65,0x98,0xb4,0x16,0x98,0x60,0xbb,0x34,0x86,0xd5,0x61,0xa8,0x01,0x00,
|
||||
0xe0,0x58,0x9c,0x06,0xfc,0x21,0xec,0x7e,0x95,0x2a,0x00,0xa7,0xe7,0x66,0xca,0xa1,0x09,0xed,0x14,0xa0,0x83,0x9e,0x0a,0x28,0xd5,0xa5,0x7b,0xc2,0x1e,0xfc,0x20,0x10,0x00,0x39,0x57,0x02,0xef,0x09,0xf5,0xad,0x54,0xd4,0xac,0xc5,0x1b,0x13,0xa1,0x13,0x09,0x00,0xdb,0xa5,0x01,0xf8,0x82,0x44,0xdf,0x4a,0x45,0xd0,0x65,0x61,0x9e,0xf7,
|
||||
0x77,0x26,0x35,0x03,0xd0,0x53,0x01,0xa5,0x3c,0x22,0x53,0xff,0x0e,0x62,0x01,0x90,0xa3,0xa7,0x02,0x2a,0xce,0xc4,0xa6,0xfe,0x1d,0x44,0x03,0x20,0x77,0x2a,0x70,0x99,0x64,0x0d,0x4a,0x09,0x12,0x9b,0xfa,0x77,0x90,0x9e,0x01,0x60,0xbb,0xfc,0x01,0xb8,0x4f,0xba,0x0e,0xa5,0x42,0x76,0xaf,0xe4,0xd4,0xbf,0x83,0x78,0x00,0xe4,0x5c,0x81,
|
||||
0x9e,0x0a,0xa8,0xf8,0x78,0x0f,0xe1,0xa9,0x7f,0x87,0x48,0x04,0x40,0xee,0x54,0x60,0x26,0x04,0xb7,0xf2,0x89,0x52,0x11,0xd1,0x06,0xcc,0xcc,0x1d,0xf3,0xe2,0x22,0x11,0x00,0x00,0xb6,0xcb,0x5f,0x80,0x2f,0x49,0xd7,0xa1,0x54,0xc0,0xbe,0x98,0x3b,0xd6,0x23,0x21,0x32,0x01,0x00,0x60,0xbb,0xfc,0x0a,0x5d,0x47,0x50,0x15,0xaf,0x59,0xb6,
|
||||
0x1b,0xad,0xfd,0x33,0x23,0x15,0x00,0x39,0xdf,0xc7,0xdb,0x5d,0x48,0xa9,0x62,0x72,0xbf,0xed,0xf2,0x7d,0xe9,0x22,0xf6,0x14,0xb9,0x00,0xb0,0x5d,0xb2,0xc0,0xc5,0xc0,0x22,0xa1,0x12,0xb6,0x00,0xbf,0x03,0x5e,0x10,0xea,0x5f,0x99,0xf7,0x02,0xde,0xdf,0xe9,0x16,0xa1,0xfe,0xff,0x8a,0x77,0x4c,0x47,0x4e,0xe4,0x02,0x00,0xde,0x5f,0x40,
|
||||
0xe4,0x4c,0xe0,0x95,0x10,0xba,0xcb,0x02,0xff,0xc4,0xdb,0xce,0xec,0x78,0xa0,0xc6,0x76,0x39,0x1b,0x98,0x06,0x5c,0x0b,0xc1,0x2f,0xcb,0xa4,0x02,0xd3,0x0a,0xfc,0x10,0x38,0x32,0xf7,0x77,0x5a,0x83,0xf7,0x77,0x3c,0x0b,0xef,0xef,0x3c,0x1b,0x42,0x0d,0xaf,0x00,0x67,0x85,0xb5,0xc0,0x47,0xbe,0x42,0x7f,0x1c,0x38,0x1f,0x8e,0x45,0x2d,
|
||||
0xb0,0x14,0x18,0x66,0xb8,0xe9,0xf5,0xc0,0x13,0xb9,0x3f,0x0b,0x6d,0x97,0x8d,0x3d,0xd4,0x30,0x19,0x98,0x0b,0x4c,0x32,0x5c,0x83,0x0a,0xd6,0x0b,0xc0,0x45,0xb6,0xcb,0x8b,0xdd,0x7d,0x83,0x63,0x31,0x14,0x38,0x09,0x38,0x19,0xf8,0x18,0x30,0xdc,0x70,0x0d,0xeb,0x81,0xa3,0x6d,0x97,0x37,0x0d,0xb7,0x6b,0x4c,0xa4,0x03,0x00,0xc0,0xb1,
|
||||
0x98,0x06,0x3c,0x05,0xf4,0xf3,0xd1,0x4c,0x2b,0xb0,0x04,0x6f,0xc0,0x2f,0x00,0x5e,0xcc,0x9d,0x6a,0xf4,0xb6,0x86,0x14,0xf0,0x3d,0xe0,0xbb,0x40,0xca,0x47,0x1d,0x2a,0x78,0xad,0x78,0xef,0xf0,0xb3,0xf3,0x59,0x54,0xd3,0xb1,0x48,0x00,0x93,0x81,0x19,0x78,0x81,0x70,0x2c,0xfe,0xfe,0xae,0x9b,0x80,0x13,0x6c,0x97,0x65,0x3e,0xda,0x08,
|
||||
0x5c,0xe4,0x03,0x00,0xc0,0xb1,0xf8,0x04,0xde,0x39,0x5c,0x3e,0xa7,0x2c,0x6f,0xb0,0x7b,0xc0,0x3f,0x65,0xbb,0x6c,0x33,0x50,0xc7,0x64,0xbc,0xcd,0x4e,0x26,0xfa,0x6d,0x4b,0x05,0xe2,0x45,0xbc,0x77,0x7d,0xdf,0xd7,0x6f,0x1c,0x8b,0x2a,0x60,0x3a,0x5e,0x20,0xcc,0x00,0x0e,0xce,0xe3,0xc7,0x33,0x78,0xd3,0xfe,0xc7,0xfc,0xd6,0x11,0xb4,
|
||||
0x82,0x08,0x00,0x00,0xc7,0xe2,0x4a,0xe0,0xe6,0x1e,0xbe,0x65,0x07,0xf0,0x34,0xde,0x80,0x7f,0xc2,0x76,0x59,0x15,0x50,0x1d,0x29,0xbc,0x4f,0x2a,0xbe,0x0b,0x94,0x06,0xd1,0x87,0xca,0x5b,0xc7,0x36,0x74,0xd7,0x07,0xb5,0x94,0xb6,0x63,0x31,0x96,0xdd,0xb3,0x83,0x13,0x80,0xfe,0x3d,0x7c,0xfb,0x15,0xb6,0xcb,0xad,0x41,0xd4,0x61,0x5a,
|
||||
0xc1,0x04,0x00,0x80,0x63,0x71,0x33,0x1f,0xbc,0x85,0xf2,0x25,0x72,0x03,0x1e,0x58,0x1c,0xe6,0x85,0x16,0xc7,0xa2,0x0e,0xef,0xda,0xc0,0xe1,0x61,0xf5,0xa9,0xba,0xb4,0x02,0xef,0x5d,0xff,0xf9,0xb0,0x3a,0x74,0x2c,0xd2,0x78,0x17,0x13,0x3b,0x02,0xa1,0xf3,0x31,0x70,0xb3,0xed,0x72,0x55,0x58,0xb5,0xf8,0x55,0x68,0x01,0x90,0xc4,0xbb,
|
||||
0x32,0xbf,0x1a,0xef,0x5d,0x7e,0xad,0x70,0x3d,0x69,0xe0,0x9b,0xc0,0xd5,0x40,0xb5,0x64,0x2d,0x31,0xd4,0x00,0xdc,0x04,0xdc,0x18,0xc6,0x06,0x1a,0x3d,0x71,0x2c,0x46,0xe1,0x85,0x41,0x2d,0x70,0xad,0xed,0x92,0x91,0xac,0x27,0x1f,0x05,0x15,0x00,0x51,0xe5,0x58,0x0c,0x00,0xbe,0x0a,0x5c,0x05,0x0c,0x11,0x2e,0xa7,0xd8,0x6d,0x02,0x7e,
|
||||
0x0a,0xdc,0x6a,0xbb,0x6c,0x95,0x2e,0xa6,0xd0,0x69,0x00,0x18,0xe4,0x58,0x54,0x02,0x97,0xe3,0xcd,0x08,0x86,0x0a,0x97,0x53,0x6c,0xea,0x81,0x1f,0x03,0x3f,0xb7,0x5d,0xb6,0x4b,0x17,0x53,0x2c,0x34,0x00,0x02,0xe0,0x58,0xf4,0xc7,0x7b,0xb0,0xe9,0x1b,0x98,0xff,0x6c,0x39,0x6e,0xd6,0x03,0x37,0x02,0xb7,0xd9,0x2e,0x4d,0xd2,0xc5,0x14,
|
||||
0x1b,0x0d,0x80,0x00,0x39,0x16,0x15,0x78,0x2b,0x1e,0x7d,0x0b,0xdd,0x0c,0x25,0x5f,0xef,0x01,0xff,0x0d,0xfc,0xd2,0x76,0xd9,0x29,0x5d,0x4c,0xb1,0xd2,0x00,0x08,0x81,0x63,0x51,0x0e,0xfc,0x3b,0xf0,0x6d,0x60,0x3f,0xe1,0x72,0xa2,0x6e,0x0d,0xde,0x6e,0xd2,0xbf,0xb2,0x5d,0x76,0x49,0x17,0x53,0xec,0x34,0x00,0x42,0xe4,0x58,0x7c,0x1c,
|
||||
0xe4,0x97,0x81,0x8a,0xb8,0x8f,0xdb,0x2e,0x7f,0x94,0x2e,0x22,0x2e,0x22,0xf9,0x30,0x50,0x11,0x5b,0x84,0xae,0x7a,0xd4,0x93,0x36,0x60,0xb1,0x74,0x11,0x71,0xa2,0x01,0x10,0xa2,0xdc,0xed,0xc8,0xcf,0x49,0xd7,0x11,0x61,0xff,0x34,0x71,0xcb,0xb6,0xea,0x3d,0x0d,0x80,0xf0,0x3d,0x29,0x5d,0x40,0x84,0xe9,0x6b,0x13,0x32,0x0d,0x80,0xf0,
|
||||
0xe9,0x41,0xde,0x3d,0x7d,0x6d,0x42,0xa6,0x01,0x10,0xbe,0x25,0x10,0xcd,0xc5,0x21,0x84,0x35,0x03,0x7f,0x93,0x2e,0x22,0x6e,0x34,0x00,0x42,0x96,0xfb,0x4c,0x7b,0xa9,0x74,0x1d,0x11,0xb4,0x54,0x3f,0xef,0x0f,0x9f,0x06,0x80,0x0c,0x9d,0xea,0xee,0x4d,0x5f,0x13,0x01,0x1a,0x00,0x32,0xf4,0x60,0xdf,0x9b,0xbe,0x26,0x02,0x34,0x00,0x64,
|
||||
0xfc,0x03,0xf4,0xbe,0xf6,0x4e,0x9a,0xf0,0x5e,0x13,0x15,0x32,0x0d,0x00,0x01,0xb9,0x85,0x4b,0x96,0x48,0xd7,0x11,0x21,0xcf,0x48,0x3f,0xd3,0x1f,0x57,0x1a,0x00,0x72,0x74,0xca,0xbb,0x9b,0xbe,0x16,0x42,0x34,0x00,0xe4,0xe8,0x41,0xbf,0x9b,0xbe,0x16,0x42,0x34,0x00,0xe4,0x3c,0x07,0xba,0xa2,0x0d,0xde,0x6e,0x3d,0xcb,0xa5,0x8b,0x88,
|
||||
0x2b,0x0d,0x00,0x21,0xb6,0x4b,0x3b,0x72,0xdb,0x9f,0x45,0xc9,0xa2,0xdc,0x6b,0xa1,0x04,0x68,0x00,0xc8,0xd2,0xa9,0xaf,0xbe,0x06,0xa2,0x34,0x00,0x64,0xe9,0xc1,0xaf,0xaf,0x81,0x28,0x0d,0x00,0x59,0x2b,0xf0,0x56,0xb9,0x8d,0xab,0x8d,0x78,0x7b,0x3b,0x28,0x21,0x1a,0x00,0x82,0x72,0xfb,0x13,0x3e,0x2d,0x5d,0x87,0xa0,0xa7,0xf3,0xd9,
|
||||
0xa3,0x51,0x99,0xa7,0x01,0x20,0x2f,0xce,0x53,0xe0,0x38,0xff,0xee,0x91,0xa0,0x01,0x20,0x2f,0xce,0x83,0x20,0xce,0xbf,0x7b,0x24,0xe8,0xa2,0xa0,0x11,0xe0,0x58,0xac,0x25,0x7e,0xcb,0x86,0xaf,0xb5,0x5d,0x5d,0x21,0x59,0x9a,0xce,0x00,0xa2,0xe1,0x29,0xe9,0x02,0x04,0xc4,0xf1,0x77,0x8e,0x1c,0x0d,0x80,0x68,0x88,0xe3,0x54,0x38,0x8e,
|
||||
0xbf,0x73,0xe4,0x68,0x00,0x44,0x43,0x1c,0x07,0x83,0x23,0x5d,0x80,0xd2,0x00,0x88,0x04,0xdb,0x65,0x35,0xf0,0x28,0xde,0x7d,0xf1,0xc5,0xae,0x11,0x78,0xd4,0x76,0x79,0x4b,0xba,0x10,0xa5,0x17,0x01,0x23,0xc5,0xb1,0x48,0xe0,0xed,0x31,0x5f,0xb7,0xc7,0x9f,0x42,0xdd,0x69,0x78,0x03,0xf0,0x3c,0xde,0xc3,0x3e,0xcb,0x81,0xe5,0xb6,0xcb,
|
||||
0x1b,0xb2,0x25,0xa9,0xce,0x34,0x00,0x0a,0x80,0x63,0x31,0x1a,0x2f,0x08,0xa6,0xb0,0x3b,0x14,0x46,0x8b,0x16,0xb5,0xb7,0x77,0xe9,0x34,0xd0,0xf1,0x06,0xfb,0x1a,0xd9,0x92,0xd4,0xbe,0x68,0x00,0x14,0x28,0xc7,0x62,0x28,0xbb,0xc3,0xa0,0x16,0x18,0x94,0xfb,0x53,0xdd,0xe9,0xeb,0x40,0xa0,0xd4,0x67,0x57,0x6d,0x78,0xa7,0x26,0x0d,0x78,
|
||||
0xd3,0xf7,0x8e,0xaf,0x8d,0xc0,0x6a,0x76,0x0f,0xf6,0x7a,0x9f,0xfd,0x28,0x01,0x1a,0x00,0x45,0xce,0xb1,0xa8,0xe4,0x83,0xa1,0xb0,0x67,0x50,0xc0,0xde,0x03,0xfb,0xfd,0xc1,0x6e,0xbb,0x6c,0x0f,0xbb,0x66,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,0xa5,0x94,0x52,0x4a,0x29,
|
||||
0xd5,0x1b,0xff,0x0f,0x5c,0x56,0xd9,0x0b,0x64,0x90,0x3b,0x82,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
|
||||
};
|
||||
|
||||
read_only global String8 df_g_icon_file_bytes = {df_g_icon_file_bytes__data, sizeof(df_g_icon_file_bytes__data)};
|
||||
C_LINKAGE_END
|
||||
|
||||
#endif // DF_GFX_META_H
|
||||
|
||||
@@ -952,8 +952,10 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
|
||||
// generate ir tree
|
||||
if (can_generate){
|
||||
EVAL_IRTree *new_tree = l.tree;
|
||||
EVAL_EvalMode mode = l.mode;
|
||||
if (l_resolve){
|
||||
new_tree = eval_irtree_resolve_to_value(arena, graph, rdi, l.mode, new_tree, l_restype);
|
||||
mode = EVAL_EvalMode_Addr;
|
||||
}
|
||||
if (r_off != 0){
|
||||
EVAL_IRTree *const_tree = eval_irtree_const_u(arena, r_off);
|
||||
@@ -963,7 +965,7 @@ eval_irtree_and_type_from_expr(Arena *arena, TG_Graph *graph, RDI_Parsed *rdi, E
|
||||
// fill result
|
||||
result.tree = new_tree;
|
||||
result.type_key = r_type;
|
||||
result.mode = l.mode;
|
||||
result.mode = mode;
|
||||
}
|
||||
}break;
|
||||
}
|
||||
|
||||
@@ -414,6 +414,14 @@ eval_token_array_from_text(Arena *arena, String8 text)
|
||||
eval_token_chunk_list_push(scratch.arena, &tokens, 256, &token);
|
||||
}
|
||||
|
||||
// rjf: symbolic strings matching `--` mean the remainder of the string
|
||||
// is reserved for external usage. the rest of the stream should not
|
||||
// be tokenized.
|
||||
else if(idx == active_token_start_idx+2 && text.str[active_token_start_idx] == '-' && text.str[active_token_start_idx+1] == '-')
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// rjf: if we got a symbol string of N>1 characters, then we need to
|
||||
// apply the maximum-munch rule, and produce M<=N tokens, where each
|
||||
// formed token is the maximum size possible, given the legal
|
||||
|
||||
@@ -10,6 +10,7 @@ fs_init(void)
|
||||
Arena *arena = arena_alloc();
|
||||
fs_shared = push_array(arena, FS_Shared, 1);
|
||||
fs_shared->arena = arena;
|
||||
fs_shared->change_gen = 1;
|
||||
fs_shared->slots_count = 1024;
|
||||
fs_shared->stripes_count = os_logical_core_count();
|
||||
fs_shared->slots = push_array(arena, FS_Slot, fs_shared->slots_count);
|
||||
@@ -33,6 +34,15 @@ fs_init(void)
|
||||
fs_shared->detector_thread = os_launch_thread(fs_detector_thread__entry_point, 0, 0);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Change Generation
|
||||
|
||||
internal U64
|
||||
fs_change_gen(void)
|
||||
{
|
||||
return ins_atomic_u64_eval(&fs_shared->change_gen);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Cache Interaction
|
||||
|
||||
@@ -220,6 +230,10 @@ fs_streamer_thread__entry_point(void *p)
|
||||
}
|
||||
if(node != 0)
|
||||
{
|
||||
if(node->timestamp != 0)
|
||||
{
|
||||
ins_atomic_u64_inc_eval(&fs_shared->change_gen);
|
||||
}
|
||||
if(post_props.modified == pre_props.modified)
|
||||
{
|
||||
node->timestamp = post_props.modified;
|
||||
|
||||
@@ -38,6 +38,7 @@ typedef struct FS_Shared FS_Shared;
|
||||
struct FS_Shared
|
||||
{
|
||||
Arena *arena;
|
||||
U64 change_gen;
|
||||
|
||||
// rjf: path info cache
|
||||
U64 slots_count;
|
||||
@@ -71,6 +72,11 @@ global FS_Shared *fs_shared = 0;
|
||||
|
||||
internal void fs_init(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Change Generation
|
||||
|
||||
internal U64 fs_change_gen(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Cache Interaction
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
@@ -0,0 +1,43 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef ICO_H
|
||||
#define ICO_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: ICO File Format Types
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
typedef struct ICO_Header ICO_Header;
|
||||
struct ICO_Header
|
||||
{
|
||||
U16 reserved_padding; // must be 0
|
||||
U16 image_type; // if 1 -> ICO, if 2 -> CUR
|
||||
U16 num_images;
|
||||
};
|
||||
|
||||
typedef struct ICO_Entry ICO_Entry;
|
||||
struct ICO_Entry
|
||||
{
|
||||
U8 image_width_px;
|
||||
U8 image_height_px;
|
||||
U8 num_colors;
|
||||
U8 reserved_padding; // should be 0
|
||||
union
|
||||
{
|
||||
U16 ico_color_planes; // in ICO
|
||||
U16 cur_hotspot_x_px; // in CUR
|
||||
};
|
||||
union
|
||||
{
|
||||
U16 ico_bits_per_pixel; // in ICO
|
||||
U16 cur_hotspot_y_px; // in CUR
|
||||
};
|
||||
U32 image_data_size;
|
||||
U32 image_data_off;
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif // ICO_H
|
||||
@@ -300,7 +300,8 @@ typedef enum RDI_DataSectionTagEnum{
|
||||
|
||||
|
||||
#define RDI_DataSectionEncodingXList(X) \
|
||||
X(Unpacked, 0)
|
||||
X(Unpacked, 0)\
|
||||
X(LZB, 1)
|
||||
|
||||
typedef RDI_U32 RDI_DataSectionEncoding;
|
||||
typedef enum RDI_DataSectionEncodingEnum{
|
||||
|
||||
@@ -537,23 +537,23 @@ rdi_first_voff_from_proc(RDI_Parsed *p, RDI_U32 proc_id){
|
||||
RDI_PROC void*
|
||||
rdi_data_from_dsec(RDI_Parsed *parsed, RDI_U32 idx, RDI_U32 item_size,
|
||||
RDI_DataSectionTag expected_tag,
|
||||
RDI_U64 *count_out){
|
||||
RDI_U64 *count_out)
|
||||
{
|
||||
void *result = 0;
|
||||
RDI_U32 count_result = 0;
|
||||
|
||||
// TODO(allen): need a version of this that works with encodings other than "Unpacked"
|
||||
|
||||
if (0 < idx && idx < parsed->dsec_count){
|
||||
if(0 < idx && idx < parsed->dsec_count)
|
||||
{
|
||||
RDI_DataSection *ds = parsed->dsecs + idx;
|
||||
if (ds->tag == expected_tag){
|
||||
RDI_U64 opl = ds->off + ds->encoded_size;
|
||||
if (opl <= parsed->raw_data_size){
|
||||
count_result = ds->encoded_size/item_size;
|
||||
if(ds->tag == expected_tag)
|
||||
{
|
||||
RDI_U64 encoded_opl = ds->off + ds->encoded_size;
|
||||
if(encoded_opl <= parsed->raw_data_size)
|
||||
{
|
||||
count_result = ds->unpacked_size/item_size;
|
||||
result = (parsed->raw_data + ds->off);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*count_out = count_result;
|
||||
return(result);
|
||||
}
|
||||
|
||||
@@ -1744,11 +1744,13 @@ rdim_bake_section_list_push(RDIM_Arena *arena, RDIM_BakeSectionList *list)
|
||||
}
|
||||
|
||||
RDI_PROC RDIM_BakeSection *
|
||||
rdim_bake_section_list_push_new(RDIM_Arena *arena, RDIM_BakeSectionList *list, void *data, RDI_U64 size, RDI_DataSectionTag tag, RDI_U64 tag_idx)
|
||||
rdim_bake_section_list_push_new_unpacked(RDIM_Arena *arena, RDIM_BakeSectionList *list, void *data, RDI_U64 size, RDI_DataSectionTag tag, RDI_U64 tag_idx)
|
||||
{
|
||||
RDIM_BakeSection *section = rdim_bake_section_list_push(arena, list);
|
||||
section->data = data;
|
||||
section->size = size;
|
||||
section->encoding = RDI_DataSectionEncoding_Unpacked;
|
||||
section->encoded_size = size;
|
||||
section->unpacked_size = size;
|
||||
section->tag = tag;
|
||||
section->tag_idx = tag_idx;
|
||||
return section;
|
||||
@@ -2142,7 +2144,7 @@ rdim_bake_top_level_info_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
|
||||
dst_tli->exe_name_string_idx = rdim_bake_idx_from_string(strings, src_tli->exe_name);
|
||||
dst_tli->exe_hash = src_tli->exe_hash;
|
||||
dst_tli->voff_max = src_tli->voff_max;
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_tli, sizeof(*dst_tli), RDI_DataSectionTag_TopLevelInfo, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, dst_tli, sizeof(*dst_tli), RDI_DataSectionTag_TopLevelInfo, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -2166,7 +2168,7 @@ rdim_bake_binary_section_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
|
||||
dst->foff_first = src->foff_first;
|
||||
dst->foff_opl = src->foff_opl;
|
||||
}
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_base, sizeof(*dst_base)*dst_idx, RDI_DataSectionTag_BinarySections, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, dst_base, sizeof(*dst_base)*dst_idx, RDI_DataSectionTag_BinarySections, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -2286,11 +2288,11 @@ rdim_bake_section_list_from_unit(RDIM_Arena *arena, RDIM_Unit *unit)
|
||||
//- rjf: build line info sections
|
||||
//
|
||||
U64 unit_idx = rdim_idx_from_unit(unit);
|
||||
rdim_bake_section_list_push_new(arena, §ions, unit_voffs, sizeof(RDI_U64)*(unit_line_count+1), RDI_DataSectionTag_LineInfoVoffs, unit_idx);
|
||||
rdim_bake_section_list_push_new(arena, §ions, unit_lines, sizeof(RDI_Line)*unit_line_count, RDI_DataSectionTag_LineInfoData, unit_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, unit_voffs, sizeof(RDI_U64)*(unit_line_count+1), RDI_DataSectionTag_LineInfoVoffs, unit_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, unit_lines, sizeof(RDI_Line)*unit_line_count, RDI_DataSectionTag_LineInfoData, unit_idx);
|
||||
if(unit_cols != 0)
|
||||
{
|
||||
rdim_bake_section_list_push_new(arena, §ions, unit_cols, sizeof(RDI_Column)*unit_line_count, RDI_DataSectionTag_LineInfoColumns, unit_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, unit_cols, sizeof(RDI_Column)*unit_line_count, RDI_DataSectionTag_LineInfoColumns, unit_idx);
|
||||
}
|
||||
|
||||
return sections;
|
||||
@@ -2417,11 +2419,11 @@ rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
|
||||
////////////////////////
|
||||
//- rjf: build line info sections
|
||||
//
|
||||
rdim_bake_section_list_push_new(arena, §ions, unit_voffs, sizeof(RDI_U64)*(unit_line_count+1), RDI_DataSectionTag_LineInfoVoffs, dst_idx);
|
||||
rdim_bake_section_list_push_new(arena, §ions, unit_lines, sizeof(RDI_Line)*unit_line_count, RDI_DataSectionTag_LineInfoData, dst_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, unit_voffs, sizeof(RDI_U64)*(unit_line_count+1), RDI_DataSectionTag_LineInfoVoffs, dst_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, unit_lines, sizeof(RDI_Line)*unit_line_count, RDI_DataSectionTag_LineInfoData, dst_idx);
|
||||
if(unit_cols != 0)
|
||||
{
|
||||
rdim_bake_section_list_push_new(arena, §ions, unit_cols, sizeof(RDI_Column)*unit_line_count, RDI_DataSectionTag_LineInfoColumns, dst_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, unit_cols, sizeof(RDI_Column)*unit_line_count, RDI_DataSectionTag_LineInfoColumns, dst_idx);
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
@@ -2439,7 +2441,7 @@ rdim_bake_unit_top_level_section_list_from_params(RDIM_Arena *arena, RDIM_BakeSt
|
||||
dst->line_info_col_data_idx = (RDI_U32)rdim_bake_section_idx_from_params_tag_idx(params, RDI_DataSectionTag_LineInfoColumns, dst_idx); // TODO(rjf): @u64_to_u32
|
||||
}
|
||||
}
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_base, sizeof(*dst_base)*dst_idx, RDI_DataSectionTag_Units, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, dst_base, sizeof(*dst_base)*dst_idx, RDI_DataSectionTag_Units, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -2514,7 +2516,7 @@ rdim_bake_unit_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams
|
||||
//- rjf: build section
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
RDI_U64 unit_vmap_size = sizeof(unit_vmap.vmap[0])*(unit_vmap.count+1);
|
||||
rdim_bake_section_list_push_new(arena, §ions, unit_vmap.vmap, unit_vmap_size, RDI_DataSectionTag_UnitVmap, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, unit_vmap.vmap, unit_vmap_size, RDI_DataSectionTag_UnitVmap, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -2689,9 +2691,9 @@ rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMa
|
||||
dst_file->line_map_nums_data_idx = (RDI_U32)rdim_bake_section_idx_from_params_tag_idx(params, RDI_DataSectionTag_LineMapNumbers, dst_file_idx); // TODO(rjf): @u64_to_u32
|
||||
dst_file->line_map_range_data_idx = (RDI_U32)rdim_bake_section_idx_from_params_tag_idx(params, RDI_DataSectionTag_LineMapRanges, dst_file_idx); // TODO(rjf): @u64_to_u32
|
||||
dst_file->line_map_voff_data_idx = (RDI_U32)rdim_bake_section_idx_from_params_tag_idx(params, RDI_DataSectionTag_LineMapVoffs, dst_file_idx); // TODO(rjf): @u64_to_u32
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_line_nums, sizeof(*src_file_line_nums)*src_file_line_count, RDI_DataSectionTag_LineMapNumbers, dst_file_idx);
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_line_ranges, sizeof(*src_file_line_ranges)*(src_file_line_count + 1), RDI_DataSectionTag_LineMapRanges, dst_file_idx);
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_voffs, sizeof(*src_file_voffs)*src_file_voff_count, RDI_DataSectionTag_LineMapVoffs, dst_file_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, src_file_line_nums, sizeof(*src_file_line_nums)*src_file_line_count, RDI_DataSectionTag_LineMapNumbers, dst_file_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, src_file_line_ranges, sizeof(*src_file_line_ranges)*(src_file_line_count + 1), RDI_DataSectionTag_LineMapRanges, dst_file_idx);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, src_file_voffs, sizeof(*src_file_voffs)*src_file_voff_count, RDI_DataSectionTag_LineMapVoffs, dst_file_idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2699,7 +2701,7 @@ rdim_bake_src_file_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMa
|
||||
////////////////////////////
|
||||
//- rjf: build section for all source files
|
||||
//
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_files, sizeof(RDI_SourceFile)*dst_files_count, RDI_DataSectionTag_SourceFiles, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, dst_files, sizeof(RDI_SourceFile)*dst_files_count, RDI_DataSectionTag_SourceFiles, 0);
|
||||
|
||||
return sections;
|
||||
}
|
||||
@@ -2775,7 +2777,7 @@ rdim_bake_type_node_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringM
|
||||
|
||||
//- rjf: build sections
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
rdim_bake_section_list_push_new(arena, §ions, type_nodes, sizeof(RDI_TypeNode)*(params->types.total_count+1), RDI_DataSectionTag_TypeNodes, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, type_nodes, sizeof(RDI_TypeNode)*(params->types.total_count+1), RDI_DataSectionTag_TypeNodes, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -2843,9 +2845,9 @@ rdim_bake_udt_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTigh
|
||||
|
||||
//- rjf: build sections
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
rdim_bake_section_list_push_new(arena, §ions, udts, sizeof(RDI_UDT) * (params->udts.total_count+1), RDI_DataSectionTag_UDTs, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, members , sizeof(RDI_Member) * (params->udts.total_member_count+1), RDI_DataSectionTag_Members, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, enum_members, sizeof(RDI_EnumMember) * (params->udts.total_enum_val_count+1), RDI_DataSectionTag_EnumMembers, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, udts, sizeof(RDI_UDT) * (params->udts.total_count+1), RDI_DataSectionTag_UDTs, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, members , sizeof(RDI_Member) * (params->udts.total_member_count+1), RDI_DataSectionTag_Members, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, enum_members, sizeof(RDI_EnumMember) * (params->udts.total_enum_val_count+1), RDI_DataSectionTag_EnumMembers, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -2887,7 +2889,7 @@ rdim_bake_global_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeS
|
||||
|
||||
//- rjf: build sections
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
rdim_bake_section_list_push_new(arena, §ions, global_variables, sizeof(RDI_GlobalVariable)*(params->global_variables.total_count+1), RDI_DataSectionTag_GlobalVariables, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, global_variables, sizeof(RDI_GlobalVariable)*(params->global_variables.total_count+1), RDI_DataSectionTag_GlobalVariables, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -2918,9 +2920,10 @@ rdim_bake_global_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParam
|
||||
{
|
||||
RDIM_Symbol *global_var = &n->v[chunk_idx];
|
||||
RDI_U32 global_var_idx = (RDI_U32)rdim_idx_from_symbol(global_var); // TODO(rjf): @u64_to_u32
|
||||
RDI_U64 global_var_size = global_var->type ? global_var->type->byte_size : 1;
|
||||
|
||||
RDI_U64 first = global_var->offset;
|
||||
RDI_U64 opl = first + global_var->type->byte_size;
|
||||
RDI_U64 opl = first + global_var_size;
|
||||
|
||||
key_ptr->key = first;
|
||||
key_ptr->val = marker_ptr;
|
||||
@@ -2966,7 +2969,7 @@ rdim_bake_global_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParam
|
||||
|
||||
//- rjf: build sections
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
rdim_bake_section_list_push_new(arena, §ions, global_vmap.vmap, sizeof(RDI_VMapEntry)*(global_vmap.count+1), RDI_DataSectionTag_GlobalVmap, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, global_vmap.vmap, sizeof(RDI_VMapEntry)*(global_vmap.count+1), RDI_DataSectionTag_GlobalVmap, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -3008,7 +3011,7 @@ rdim_bake_thread_variable_section_list_from_params(RDIM_Arena *arena, RDIM_BakeS
|
||||
|
||||
//- rjf: build sections
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
rdim_bake_section_list_push_new(arena, §ions, thread_variables, sizeof(RDI_ThreadVariable)*(params->thread_variables.total_count+1), RDI_DataSectionTag_ThreadVariables, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, thread_variables, sizeof(RDI_ThreadVariable)*(params->thread_variables.total_count+1), RDI_DataSectionTag_ThreadVariables, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -3051,7 +3054,7 @@ rdim_bake_procedure_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringM
|
||||
|
||||
//- rjf: build sections
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
rdim_bake_section_list_push_new(arena, §ions, procedures, sizeof(RDI_Procedure)*(params->procedures.total_count+1), RDI_DataSectionTag_Procedures, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, procedures, sizeof(RDI_Procedure)*(params->procedures.total_count+1), RDI_DataSectionTag_Procedures, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -3218,11 +3221,11 @@ rdim_bake_scope_section_list_from_params(RDIM_Arena *arena, RDIM_BakeStringMapTi
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
RDIM_ProfScope("push all symbol info sections")
|
||||
{
|
||||
rdim_bake_section_list_push_new(arena, §ions, scopes, sizeof(RDI_Scope) * (params->scopes.total_count+1), RDI_DataSectionTag_Scopes, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, scope_voffs, sizeof(RDI_U64) * (params->scopes.scope_voff_count+1), RDI_DataSectionTag_ScopeVoffData, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, locals, sizeof(RDI_Local) * (params->scopes.local_count+1), RDI_DataSectionTag_Locals, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, location_blocks, sizeof(RDI_LocationBlock) * (params->scopes.location_count+1), RDI_DataSectionTag_LocationBlocks, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, location_data_blob.str, location_data_blob.size, RDI_DataSectionTag_LocationData, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, scopes, sizeof(RDI_Scope) * (params->scopes.total_count+1), RDI_DataSectionTag_Scopes, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, scope_voffs, sizeof(RDI_U64) * (params->scopes.scope_voff_count+1), RDI_DataSectionTag_ScopeVoffData, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, locals, sizeof(RDI_Local) * (params->scopes.local_count+1), RDI_DataSectionTag_Locals, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, location_blocks, sizeof(RDI_LocationBlock) * (params->scopes.location_count+1), RDI_DataSectionTag_LocationBlocks, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, location_data_blob.str, location_data_blob.size, RDI_DataSectionTag_LocationData, 0);
|
||||
}
|
||||
rdim_scratch_end(scratch);
|
||||
return sections;
|
||||
@@ -3280,7 +3283,7 @@ rdim_bake_scope_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams
|
||||
|
||||
//- rjf: build sections
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
rdim_bake_section_list_push_new(arena, §ions, scope_vmap.vmap, sizeof(RDI_VMapEntry)*(scope_vmap.count+1), RDI_DataSectionTag_ScopeVmap, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, scope_vmap.vmap, sizeof(RDI_VMapEntry)*(scope_vmap.count+1), RDI_DataSectionTag_ScopeVmap, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -3322,7 +3325,7 @@ rdim_bake_top_level_name_map_section_list_from_params_maps(RDIM_Arena *arena, RD
|
||||
}
|
||||
|
||||
// rjf: push section for all name maps
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_maps, sizeof(RDI_NameMap)*name_map_count, RDI_DataSectionTag_NameMaps, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, dst_maps, sizeof(RDI_NameMap)*name_map_count, RDI_DataSectionTag_NameMaps, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -3424,8 +3427,8 @@ rdim_bake_name_map_section_list_from_params_kind_map(RDIM_Arena *arena, RDIM_Bak
|
||||
}
|
||||
|
||||
// rjf: sections for buckets/nodes
|
||||
rdim_bake_section_list_push_new(arena, §ions, baked_buckets, sizeof(RDI_NameMapBucket)* baked_buckets_count, RDI_DataSectionTag_NameMapBuckets, (RDI_U64)k);
|
||||
rdim_bake_section_list_push_new(arena, §ions, baked_nodes, sizeof(RDI_NameMapNode) * baked_nodes_count, RDI_DataSectionTag_NameMapNodes, (RDI_U64)k);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, baked_buckets, sizeof(RDI_NameMapBucket)* baked_buckets_count, RDI_DataSectionTag_NameMapBuckets, (RDI_U64)k);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, baked_nodes, sizeof(RDI_NameMapNode) * baked_nodes_count, RDI_DataSectionTag_NameMapNodes, (RDI_U64)k);
|
||||
}
|
||||
return sections;
|
||||
}
|
||||
@@ -3461,7 +3464,7 @@ rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStri
|
||||
}
|
||||
}
|
||||
RDIM_BakeSectionList sections = {0};
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_nodes, sizeof(RDI_FilePathNode)*dst_nodes_count, RDI_DataSectionTag_FilePathNodes, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, dst_nodes, sizeof(RDI_FilePathNode)*dst_nodes_count, RDI_DataSectionTag_FilePathNodes, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -3507,8 +3510,8 @@ rdim_bake_string_section_list_from_string_map(RDIM_Arena *arena, RDIM_BakeString
|
||||
}
|
||||
}
|
||||
}
|
||||
rdim_bake_section_list_push_new(arena, §ions, str_offs, sizeof(RDI_U32)*(strings->total_count+1), RDI_DataSectionTag_StringTable, 0);
|
||||
rdim_bake_section_list_push_new(arena, §ions, buf, off_cursor, RDI_DataSectionTag_StringData, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, str_offs, sizeof(RDI_U32)*(strings->total_count+1), RDI_DataSectionTag_StringTable, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, buf, off_cursor, RDI_DataSectionTag_StringData, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -3530,7 +3533,7 @@ rdim_bake_idx_run_section_list_from_idx_run_map(RDIM_Arena *arena, RDIM_BakeIdxR
|
||||
out_ptr += node->count;
|
||||
}
|
||||
}
|
||||
rdim_bake_section_list_push_new(arena, §ions, idx_data, sizeof(RDI_U32)*idx_runs->idx_count, RDI_DataSectionTag_IndexRuns, 0);
|
||||
rdim_bake_section_list_push_new_unpacked(arena, §ions, idx_data, sizeof(RDI_U32)*idx_runs->idx_count, RDI_DataSectionTag_IndexRuns, 0);
|
||||
return sections;
|
||||
}
|
||||
|
||||
@@ -3591,17 +3594,17 @@ rdim_serialized_strings_from_params_bake_section_list(RDIM_Arena *arena, RDIM_Ba
|
||||
if(src == 0) { continue; }
|
||||
RDI_DataSection *dst = rdi_sections+dst_idx;
|
||||
U64 data_section_off = 0;
|
||||
if(src->size != 0)
|
||||
if(src->encoded_size != 0)
|
||||
{
|
||||
rdim_str8_list_push_align(arena, &strings, 8);
|
||||
data_section_off = strings.total_size;
|
||||
rdim_str8_list_push(arena, &strings, rdim_str8((RDI_U8 *)src->data, src->size));
|
||||
rdim_str8_list_push(arena, &strings, rdim_str8((RDI_U8 *)src->data, src->encoded_size));
|
||||
}
|
||||
dst->tag = src->tag;
|
||||
dst->encoding = RDI_DataSectionEncoding_Unpacked;
|
||||
dst->encoding = src->encoding;
|
||||
dst->off = data_section_off;
|
||||
dst->encoded_size = src->size;
|
||||
dst->unpacked_size = src->size;
|
||||
dst->encoded_size = src->encoded_size;
|
||||
dst->unpacked_size = src->unpacked_size;
|
||||
}
|
||||
|
||||
rdim_scratch_end(scratch);
|
||||
|
||||
@@ -811,7 +811,9 @@ typedef struct RDIM_BakeSection RDIM_BakeSection;
|
||||
struct RDIM_BakeSection
|
||||
{
|
||||
void *data;
|
||||
RDI_U64 size;
|
||||
RDI_DataSectionEncoding encoding;
|
||||
RDI_U64 encoded_size;
|
||||
RDI_U64 unpacked_size;
|
||||
RDI_DataSectionTag tag;
|
||||
RDI_U64 tag_idx;
|
||||
};
|
||||
@@ -1153,7 +1155,7 @@ RDI_PROC void rdim_bake_name_map_push(RDIM_Arena *arena, RDIM_BakeNameMap *map,
|
||||
//~ rjf: [Baking Helpers] Data Section List Building Helpers
|
||||
|
||||
RDI_PROC RDIM_BakeSection *rdim_bake_section_list_push(RDIM_Arena *arena, RDIM_BakeSectionList *list);
|
||||
RDI_PROC RDIM_BakeSection *rdim_bake_section_list_push_new(RDIM_Arena *arena, RDIM_BakeSectionList *list, void *data, RDI_U64 size, RDI_DataSectionTag tag, RDI_U64 tag_idx);
|
||||
RDI_PROC RDIM_BakeSection *rdim_bake_section_list_push_new_unpacked(RDIM_Arena *arena, RDIM_BakeSectionList *list, void *data, RDI_U64 size, RDI_DataSectionTag tag, RDI_U64 tag_idx);
|
||||
RDI_PROC void rdim_bake_section_list_concat_in_place(RDIM_BakeSectionList *dst, RDIM_BakeSectionList *to_push);
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -326,6 +326,9 @@ type_coverage_eval_tests(void){
|
||||
swea.z = 'z';
|
||||
}
|
||||
|
||||
Struct_With_Embedded_Arrays *swea_ptr = &swea;
|
||||
int access_via_ptr_member = swea_ptr->x;
|
||||
|
||||
Custom_Index_Type custom_index = 42;
|
||||
Custom_Index_Type more_custom_indices[] = {
|
||||
04,13,22,31,40
|
||||
|
||||
@@ -113,6 +113,24 @@ os_write_data_list_to_file_path(String8 path, String8List list)
|
||||
return good;
|
||||
}
|
||||
|
||||
internal B32
|
||||
os_append_data_to_file_path(String8 path, String8 data)
|
||||
{
|
||||
B32 good = 0;
|
||||
if(data.size != 0)
|
||||
{
|
||||
OS_Handle file = os_file_open(OS_AccessFlag_Write|OS_AccessFlag_Append, path);
|
||||
if(!os_handle_match(file, os_handle_zero()))
|
||||
{
|
||||
good = 1;
|
||||
U64 pos = os_properties_from_file(file).size;
|
||||
os_file_write(file, r1u64(pos, pos+data.size), data.str);
|
||||
os_file_close(file);
|
||||
}
|
||||
}
|
||||
return good;
|
||||
}
|
||||
|
||||
internal OS_FileID
|
||||
os_id_from_file_path(String8 path)
|
||||
{
|
||||
|
||||
@@ -13,8 +13,9 @@ enum
|
||||
OS_AccessFlag_Read = (1<<0),
|
||||
OS_AccessFlag_Write = (1<<1),
|
||||
OS_AccessFlag_Execute = (1<<2),
|
||||
OS_AccessFlag_ShareRead = (1<<3),
|
||||
OS_AccessFlag_ShareWrite = (1<<4),
|
||||
OS_AccessFlag_Append = (1<<3),
|
||||
OS_AccessFlag_ShareRead = (1<<4),
|
||||
OS_AccessFlag_ShareWrite = (1<<5),
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -171,6 +172,7 @@ internal String8List os_string_list_from_argcv(Arena *arena, int argc, char **ar
|
||||
internal String8 os_data_from_file_path(Arena *arena, String8 path);
|
||||
internal B32 os_write_data_to_file_path(String8 path, String8 data);
|
||||
internal B32 os_write_data_list_to_file_path(String8 path, String8List list);
|
||||
internal B32 os_append_data_to_file_path(String8 path, String8 data);
|
||||
internal OS_FileID os_id_from_file_path(String8 path);
|
||||
internal S64 os_file_id_compare(OS_FileID a, OS_FileID b);
|
||||
internal String8 os_string_from_file_range(Arena *arena, OS_Handle file, Rng1U64 range);
|
||||
|
||||
@@ -664,6 +664,7 @@ os_file_open(OS_AccessFlags flags, String8 path)
|
||||
if(flags & OS_AccessFlag_ShareRead) {share_mode |= FILE_SHARE_READ;}
|
||||
if(flags & OS_AccessFlag_ShareWrite) {share_mode |= FILE_SHARE_WRITE|FILE_SHARE_DELETE;}
|
||||
if(flags & OS_AccessFlag_Write) {creation_disposition = CREATE_ALWAYS;}
|
||||
if(flags & OS_AccessFlag_Append) {creation_disposition = OPEN_ALWAYS;}
|
||||
HANDLE file = CreateFileW((WCHAR *)path16.str, access_flags, share_mode, 0, creation_disposition, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
if(file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
||||
@@ -7,22 +7,12 @@
|
||||
////////////////////////////////
|
||||
//~ NOTE(allen): Negotiate the windows header include order
|
||||
|
||||
#if OS_FEATURE_SOCKET
|
||||
#include <WinSock2.h>
|
||||
#endif
|
||||
|
||||
#include <Windows.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <timeapi.h>
|
||||
#include <tlhelp32.h>
|
||||
#include <Shlobj.h>
|
||||
|
||||
#if OS_FEATURE_GRAPHICAL
|
||||
#include <shellscalingapi.h>
|
||||
#endif
|
||||
|
||||
#if OS_FEATURE_SOCKET
|
||||
#include <WS2tcpip.h>
|
||||
#include <Mswsock.h>
|
||||
#endif
|
||||
|
||||
#include <processthreadsapi.h>
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
+12
-1
@@ -7,6 +7,12 @@
|
||||
////////////////////////////////
|
||||
//~ rjf: Window Types
|
||||
|
||||
typedef U32 OS_WindowFlags;
|
||||
enum
|
||||
{
|
||||
OS_WindowFlag_CustomBorder = (1<<0),
|
||||
};
|
||||
|
||||
typedef void OS_WindowRepaintFunctionType(OS_Handle window, void *user_data);
|
||||
|
||||
////////////////////////////////
|
||||
@@ -112,7 +118,7 @@ internal String8 os_get_clipboard_text(Arena *arena);
|
||||
////////////////////////////////
|
||||
//~ rjf: @os_hooks Windows (Implemented Per-OS)
|
||||
|
||||
internal OS_Handle os_window_open(Vec2F32 resolution, String8 title);
|
||||
internal OS_Handle os_window_open(Vec2F32 resolution, OS_WindowFlags flags, String8 title);
|
||||
internal void os_window_close(OS_Handle window);
|
||||
internal void os_window_first_paint(OS_Handle window);
|
||||
internal void os_window_equip_repaint(OS_Handle window, OS_WindowRepaintFunctionType *repaint, void *user_data);
|
||||
@@ -122,8 +128,13 @@ internal B32 os_window_is_fullscreen(OS_Handle window);
|
||||
internal void os_window_set_fullscreen(OS_Handle window, B32 fullscreen);
|
||||
internal B32 os_window_is_maximized(OS_Handle window);
|
||||
internal void os_window_set_maximized(OS_Handle window, B32 maximized);
|
||||
internal void os_window_minimize(OS_Handle window);
|
||||
internal void os_window_bring_to_front(OS_Handle window);
|
||||
internal void os_window_set_monitor(OS_Handle window, OS_Handle monitor);
|
||||
internal void os_window_clear_custom_border_data(OS_Handle handle);
|
||||
internal void os_window_push_custom_title_bar(OS_Handle handle, F32 thickness);
|
||||
internal void os_window_push_custom_edges(OS_Handle handle, F32 thickness);
|
||||
internal void os_window_push_custom_title_bar_client_area(OS_Handle handle, Rng2F32 rect);
|
||||
internal Rng2F32 os_rect_from_window(OS_Handle window);
|
||||
internal Rng2F32 os_client_rect_from_window(OS_Handle window);
|
||||
internal F32 os_dpi_from_window(OS_Handle window);
|
||||
|
||||
@@ -24,7 +24,7 @@ os_get_clipboard_text(Arena *arena)
|
||||
//~ rjf: @os_hooks Windows (Implemented Per-OS)
|
||||
|
||||
internal OS_Handle
|
||||
os_window_open(Vec2F32 resolution, String8 title)
|
||||
os_window_open(Vec2F32 resolution, OS_WindowFlags flags, String8 title)
|
||||
{
|
||||
OS_Handle handle = {1};
|
||||
return handle;
|
||||
@@ -78,6 +78,11 @@ os_window_set_maximized(OS_Handle window, B32 maximized)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_minimize(OS_Handle window)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_bring_to_front(OS_Handle window)
|
||||
{
|
||||
@@ -88,6 +93,26 @@ os_window_set_monitor(OS_Handle window, OS_Handle monitor)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_clear_custom_border_data(OS_Handle handle)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_push_custom_title_bar(OS_Handle handle, F32 thickness)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_push_custom_edges(OS_Handle handle, F32 thickness)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_push_custom_title_bar_client_area(OS_Handle handle, Rng2F32 rect)
|
||||
{
|
||||
}
|
||||
|
||||
internal Rng2F32
|
||||
os_rect_from_window(OS_Handle window)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Includes
|
||||
|
||||
#include <uxtheme.h>
|
||||
#include <dwmapi.h>
|
||||
#include <shellscalingapi.h>
|
||||
#pragma comment(lib, "gdi32")
|
||||
#pragma comment(lib, "dwmapi")
|
||||
#pragma comment(lib, "UxTheme")
|
||||
#pragma comment(lib, "ole32")
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
@@ -100,6 +111,10 @@ w32_allocate_window(void)
|
||||
internal void
|
||||
w32_free_window(W32_Window *window)
|
||||
{
|
||||
if(window->paint_arena != 0)
|
||||
{
|
||||
arena_release(window->paint_arena);
|
||||
}
|
||||
DestroyWindow(window->hwnd);
|
||||
DLLRemove(w32_first_window, w32_last_window, window);
|
||||
window->next = w32_first_free_window;
|
||||
@@ -530,8 +545,19 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case WM_SETCURSOR:
|
||||
{
|
||||
if(!w32_resizing &&
|
||||
contains_2f32(os_client_rect_from_window(window_handle), os_mouse_from_window(window_handle)))
|
||||
Rng2F32 window_rect = os_client_rect_from_window(window_handle);
|
||||
Vec2F32 mouse = os_mouse_from_window(window_handle);
|
||||
B32 on_border = 0;
|
||||
DWORD window_style = window ? GetWindowLong(window->hwnd, GWL_STYLE) : 0;
|
||||
B32 is_fullscreen = !(window_style & WS_OVERLAPPEDWINDOW);
|
||||
if(window != 0 && window->custom_border && !is_fullscreen)
|
||||
{
|
||||
B32 on_border_x = (mouse.x <= window->custom_border_edge_thickness || window_rect.x1-window->custom_border_edge_thickness <= mouse.x);
|
||||
B32 on_border_y = (mouse.y <= window->custom_border_edge_thickness || window_rect.y1-window->custom_border_edge_thickness <= mouse.y);
|
||||
on_border = on_border_x || on_border_y;
|
||||
}
|
||||
if(!w32_resizing && !on_border &&
|
||||
contains_2f32(window_rect, mouse))
|
||||
{
|
||||
SetCursor(w32_hcursor);
|
||||
}
|
||||
@@ -546,6 +572,225 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
F32 new_dpi = (F32)(wParam & 0xffff);
|
||||
window->dpi = new_dpi;
|
||||
}break;
|
||||
|
||||
//- rjf: [custom border]
|
||||
case WM_NCPAINT:
|
||||
{
|
||||
if(window != 0 && window->custom_border && !window->custom_border_composition_enabled)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
}break;
|
||||
case WM_DWMCOMPOSITIONCHANGED:
|
||||
{
|
||||
if(window != 0 && window->custom_border)
|
||||
{
|
||||
BOOL enabled = 0;
|
||||
DwmIsCompositionEnabled(&enabled);
|
||||
window->custom_border_composition_enabled = enabled;
|
||||
if(enabled)
|
||||
{
|
||||
MARGINS m = { 0, 0, 1, 0 };
|
||||
DwmExtendFrameIntoClientArea(hwnd, &m);
|
||||
DWORD dwmncrp_enabled = DWMNCRP_ENABLED;
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_NCRENDERING_POLICY, &enabled, sizeof(dwmncrp_enabled));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
}break;
|
||||
case WM_WINDOWPOSCHANGED:
|
||||
{
|
||||
result = 0;
|
||||
}break;
|
||||
case WM_NCUAHDRAWCAPTION:
|
||||
case WM_NCUAHDRAWFRAME:
|
||||
{
|
||||
// NOTE(rjf): undocumented messages for drawing themed window borders.
|
||||
if(window != 0 && window->custom_border)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
}break;
|
||||
case WM_SETICON:
|
||||
case WM_SETTEXT:
|
||||
{
|
||||
if(window && window->custom_border && !window->custom_border_composition_enabled)
|
||||
{
|
||||
// NOTE(rjf):
|
||||
// https://blogs.msdn.microsoft.com/wpfsdk/2008/09/08/custom-window-chrome-in-wpf/
|
||||
LONG_PTR old_style = GetWindowLongPtrW(hwnd, GWL_STYLE);
|
||||
SetWindowLongPtrW(hwnd, GWL_STYLE, old_style & ~WS_VISIBLE);
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
SetWindowLongPtrW(hwnd, GWL_STYLE, old_style);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: [custom border] activation - without this `result`, stuff flickers.
|
||||
case WM_NCACTIVATE:
|
||||
{
|
||||
if(window == 0 || window->custom_border == 0)
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, -1);
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: [custom border] client/window size calculation
|
||||
case WM_NCCALCSIZE:
|
||||
if(window != 0)
|
||||
{
|
||||
if(window->custom_border == 0)
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
MARGINS m = {0, 0, 0, 0};
|
||||
RECT *r = (RECT *)lParam;
|
||||
DWORD window_style = window ? GetWindowLong(window->hwnd, GWL_STYLE) : 0;
|
||||
B32 is_fullscreen = !(window_style & WS_OVERLAPPEDWINDOW);
|
||||
if(IsZoomed(hwnd) && !is_fullscreen)
|
||||
{
|
||||
int x_push_in = GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
|
||||
int y_push_in = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
|
||||
r->left += x_push_in;
|
||||
r->top += y_push_in;
|
||||
r->bottom -= x_push_in;
|
||||
r->right -= y_push_in;
|
||||
m.cxLeftWidth = m.cxRightWidth = x_push_in;
|
||||
m.cyTopHeight = m.cyBottomHeight = y_push_in;
|
||||
}
|
||||
DwmExtendFrameIntoClientArea(hwnd, &m);
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: [custom border] client/window hit testing (mapping mouse -> action)
|
||||
case WM_NCHITTEST:
|
||||
{
|
||||
DWORD window_style = window ? GetWindowLong(window->hwnd, GWL_STYLE) : 0;
|
||||
B32 is_fullscreen = !(window_style & WS_OVERLAPPEDWINDOW);
|
||||
if(window == 0 || window->custom_border == 0 || is_fullscreen)
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
POINT pos_monitor;
|
||||
pos_monitor.x = GET_X_LPARAM(lParam);
|
||||
pos_monitor.y = GET_Y_LPARAM(lParam);
|
||||
POINT pos_client = pos_monitor;
|
||||
ScreenToClient(hwnd, &pos_client);
|
||||
|
||||
//- rjf: check against window boundaries
|
||||
RECT frame_rect;
|
||||
GetWindowRect(hwnd, &frame_rect);
|
||||
B32 is_over_window = (frame_rect.left <= pos_monitor.x && pos_monitor.x < frame_rect.right &&
|
||||
frame_rect.top <= pos_monitor.y && pos_monitor.y < frame_rect.bottom);
|
||||
|
||||
//- rjf: check against borders
|
||||
B32 is_over_left = 0;
|
||||
B32 is_over_right = 0;
|
||||
B32 is_over_top = 0;
|
||||
B32 is_over_bottom = 0;
|
||||
{
|
||||
RECT rect;
|
||||
GetClientRect(hwnd, &rect);
|
||||
if(!IsZoomed(hwnd))
|
||||
{
|
||||
if(rect.left <= pos_client.x && pos_client.x < rect.left + window->custom_border_edge_thickness)
|
||||
{
|
||||
is_over_left = 1;
|
||||
}
|
||||
if(rect.right - window->custom_border_edge_thickness <= pos_client.x && pos_client.x < rect.right)
|
||||
{
|
||||
is_over_right = 1;
|
||||
}
|
||||
if(rect.bottom - window->custom_border_edge_thickness <= pos_client.y && pos_client.y < rect.bottom)
|
||||
{
|
||||
is_over_bottom = 1;
|
||||
}
|
||||
if(rect.top <= pos_client.y && pos_client.y < rect.top + window->custom_border_edge_thickness)
|
||||
{
|
||||
is_over_top = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: check against title bar
|
||||
B32 is_over_title_bar = 0;
|
||||
{
|
||||
RECT rect;
|
||||
GetClientRect(hwnd, &rect);
|
||||
is_over_title_bar = (rect.left <= pos_client.x && pos_client.x < rect.right &&
|
||||
rect.top <= pos_client.y && pos_client.y < rect.top + window->custom_border_title_thickness);
|
||||
}
|
||||
|
||||
//- rjf: check against title bar client areas
|
||||
B32 is_over_title_bar_client_area = 0;
|
||||
for(W32_TitleBarClientArea *area = window->first_title_bar_client_area;
|
||||
area != 0;
|
||||
area = area->next)
|
||||
{
|
||||
Rng2F32 rect = area->rect;
|
||||
if(rect.x0 <= pos_client.x && pos_client.x < rect.x1 &&
|
||||
rect.y0 <= pos_client.y && pos_client.y < rect.y1)
|
||||
{
|
||||
is_over_title_bar_client_area = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: resolve hovering to result
|
||||
result = HTNOWHERE;
|
||||
if(is_over_window)
|
||||
{
|
||||
// rjf: default to client area
|
||||
result = HTCLIENT;
|
||||
|
||||
// rjf: title bar
|
||||
if(is_over_title_bar)
|
||||
{
|
||||
result = HTCAPTION;
|
||||
}
|
||||
|
||||
// rjf: title bar client area
|
||||
if(is_over_title_bar_client_area)
|
||||
{
|
||||
result = HTCLIENT;
|
||||
}
|
||||
|
||||
// rjf: normal edges
|
||||
if(is_over_left) { result = HTLEFT; }
|
||||
if(is_over_right) { result = HTRIGHT; }
|
||||
if(is_over_top) { result = HTTOP; }
|
||||
if(is_over_bottom) { result = HTBOTTOM; }
|
||||
|
||||
// rjf: corners
|
||||
if(is_over_left && is_over_top) { result = HTTOPLEFT; }
|
||||
if(is_over_left && is_over_bottom) { result = HTBOTTOMLEFT; }
|
||||
if(is_over_right && is_over_top) { result = HTTOPRIGHT; }
|
||||
if(is_over_right && is_over_bottom) { result = HTBOTTOMRIGHT; }
|
||||
}
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,7 +825,7 @@ os_graphical_init(void)
|
||||
//- rjf: set dpi awareness
|
||||
w32_SetProcessDpiAwarenessContext_Type *SetProcessDpiAwarenessContext_func = 0;
|
||||
HMODULE module = LoadLibraryA("user32.dll");
|
||||
if (module != 0)
|
||||
if(module != 0)
|
||||
{
|
||||
SetProcessDpiAwarenessContext_func =
|
||||
(w32_SetProcessDpiAwarenessContext_Type*)GetProcAddress(module, "SetProcessDpiAwarenessContext");
|
||||
@@ -588,7 +833,7 @@ os_graphical_init(void)
|
||||
(w32_GetDpiForWindow_Type*)GetProcAddress(module, "GetDpiForWindow");
|
||||
FreeLibrary(module);
|
||||
}
|
||||
if (SetProcessDpiAwarenessContext_func != 0)
|
||||
if(SetProcessDpiAwarenessContext_func != 0)
|
||||
{
|
||||
SetProcessDpiAwarenessContext_func(w32_DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||
}
|
||||
@@ -601,6 +846,7 @@ os_graphical_init(void)
|
||||
wndclass.lpszClassName = L"graphical-window";
|
||||
wndclass.hCursor = LoadCursorA(0, IDC_ARROW);
|
||||
wndclass.hIcon = LoadIcon(w32_h_instance, MAKEINTRESOURCE(1));
|
||||
wndclass.style = CS_VREDRAW|CS_HREDRAW;
|
||||
ATOM wndatom = RegisterClassExW(&wndclass);
|
||||
(void)wndatom;
|
||||
}
|
||||
@@ -667,17 +913,17 @@ os_get_clipboard_text(Arena *arena)
|
||||
//~ rjf: @os_hooks Windows (Implemented Per-OS)
|
||||
|
||||
internal OS_Handle
|
||||
os_window_open(Vec2F32 resolution, String8 title)
|
||||
os_window_open(Vec2F32 resolution, OS_WindowFlags flags, String8 title)
|
||||
{
|
||||
//- rjf: make hwnd
|
||||
HWND hwnd = 0;
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String16 title16 = str16_from_8(scratch.arena, title);
|
||||
hwnd = CreateWindowExW(0,
|
||||
hwnd = CreateWindowExW(WS_EX_APPWINDOW,
|
||||
L"graphical-window",
|
||||
(WCHAR*)title16.str,
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
WS_OVERLAPPEDWINDOW | WS_SIZEBOX,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
(int)resolution.x,
|
||||
(int)resolution.y,
|
||||
@@ -699,8 +945,23 @@ os_window_open(Vec2F32 resolution, String8 title)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: early detection of composition
|
||||
{
|
||||
BOOL enabled = 0;
|
||||
DwmIsCompositionEnabled(&enabled);
|
||||
window->custom_border_composition_enabled = enabled;
|
||||
}
|
||||
|
||||
//- rjf: custom border
|
||||
if(flags & OS_WindowFlag_CustomBorder)
|
||||
{
|
||||
window->custom_border = 1;
|
||||
window->paint_arena = arena_alloc();
|
||||
}
|
||||
|
||||
//- rjf: convert to handle + return
|
||||
return os_window_from_w32_window(window);
|
||||
OS_Handle result = os_window_from_w32_window(window);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void
|
||||
@@ -825,6 +1086,16 @@ os_window_set_maximized(OS_Handle handle, B32 maximized)
|
||||
}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_minimize(OS_Handle handle)
|
||||
{
|
||||
W32_Window *window = w32_window_from_os_window(handle);
|
||||
if(window != 0)
|
||||
{
|
||||
ShowWindow(window->hwnd, SW_MINIMIZE);
|
||||
}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_bring_to_front(OS_Handle handle)
|
||||
{
|
||||
@@ -856,6 +1127,48 @@ os_window_set_monitor(OS_Handle window_handle, OS_Handle monitor)
|
||||
}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_clear_custom_border_data(OS_Handle handle)
|
||||
{
|
||||
W32_Window *window = w32_window_from_os_window(handle);
|
||||
if(window->custom_border)
|
||||
{
|
||||
arena_clear(window->paint_arena);
|
||||
window->first_title_bar_client_area = window->last_title_bar_client_area = 0;
|
||||
window->custom_border_title_thickness = 0;
|
||||
window->custom_border_edge_thickness = 0;
|
||||
}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_push_custom_title_bar(OS_Handle handle, F32 thickness)
|
||||
{
|
||||
W32_Window *window = w32_window_from_os_window(handle);
|
||||
window->custom_border_title_thickness = thickness;
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_push_custom_edges(OS_Handle handle, F32 thickness)
|
||||
{
|
||||
W32_Window *window = w32_window_from_os_window(handle);
|
||||
window->custom_border_edge_thickness = thickness;
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_push_custom_title_bar_client_area(OS_Handle handle, Rng2F32 rect)
|
||||
{
|
||||
W32_Window *window = w32_window_from_os_window(handle);
|
||||
if(window->custom_border)
|
||||
{
|
||||
W32_TitleBarClientArea *area = push_array(window->paint_arena, W32_TitleBarClientArea, 1);
|
||||
if(area != 0)
|
||||
{
|
||||
area->rect = rect;
|
||||
SLLQueuePush(window->first_title_bar_client_area, window->last_title_bar_client_area, area);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal Rng2F32
|
||||
os_rect_from_window(OS_Handle handle)
|
||||
{
|
||||
|
||||
@@ -7,9 +7,23 @@
|
||||
#pragma comment(lib, "user32")
|
||||
#pragma comment(lib, "gdi32")
|
||||
|
||||
#ifndef WM_NCUAHDRAWCAPTION
|
||||
#define WM_NCUAHDRAWCAPTION (0x00AE)
|
||||
#endif
|
||||
#ifndef WM_NCUAHDRAWFRAME
|
||||
#define WM_NCUAHDRAWFRAME (0x00AF)
|
||||
#endif
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Windows
|
||||
|
||||
typedef struct W32_TitleBarClientArea W32_TitleBarClientArea;
|
||||
struct W32_TitleBarClientArea
|
||||
{
|
||||
W32_TitleBarClientArea *next;
|
||||
Rng2F32 rect;
|
||||
};
|
||||
|
||||
typedef struct W32_Window W32_Window;
|
||||
struct W32_Window
|
||||
{
|
||||
@@ -22,6 +36,13 @@ struct W32_Window
|
||||
F32 dpi;
|
||||
B32 first_paint_done;
|
||||
B32 maximized;
|
||||
B32 custom_border;
|
||||
F32 custom_border_title_thickness;
|
||||
F32 custom_border_edge_thickness;
|
||||
B32 custom_border_composition_enabled;
|
||||
Arena *paint_arena;
|
||||
W32_TitleBarClientArea *first_title_bar_client_area;
|
||||
W32_TitleBarClientArea *last_title_bar_client_area;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -11,8 +11,22 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
|
||||
ProfBeginFunction();
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
|
||||
//- rjf: begin logging
|
||||
if(main_thread_log == 0)
|
||||
{
|
||||
main_thread_log = log_alloc();
|
||||
String8 user_program_data_path = os_string_from_system_path(scratch.arena, OS_SystemPath_UserProgramData);
|
||||
String8 user_data_folder = push_str8f(scratch.arena, "%S/raddbg/logs", user_program_data_path);
|
||||
main_thread_log_path = push_str8f(df_state->arena, "%S/ui_thread.raddbg_log", user_data_folder);
|
||||
os_make_directory(user_data_folder);
|
||||
os_write_data_to_file_path(main_thread_log_path, str8_zero());
|
||||
}
|
||||
log_select(main_thread_log);
|
||||
log_scope_begin();
|
||||
|
||||
//- rjf: tick cache layers
|
||||
txt_user_clock_tick();
|
||||
dasm_user_clock_tick();
|
||||
geo_user_clock_tick();
|
||||
tex_user_clock_tick();
|
||||
|
||||
@@ -152,6 +166,10 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
|
||||
window->menu_bar_focus_press_started = 0;
|
||||
}
|
||||
}
|
||||
else if(OS_Key_F1 <= event->key && event->key <= OS_Key_F19)
|
||||
{
|
||||
window->menu_bar_focus_press_started = 0;
|
||||
}
|
||||
df_gfx_request_frame();
|
||||
}
|
||||
else if(event->kind == OS_EventKind_Text)
|
||||
@@ -324,6 +342,12 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
|
||||
frame_time_us_history[frame_time_us_history_idx%ArrayCount(frame_time_us_history)] = frame_time_us;
|
||||
frame_time_us_history_idx += 1;
|
||||
|
||||
//- rjf: end logging
|
||||
{
|
||||
String8 log = log_scope_end(scratch.arena);
|
||||
os_append_data_to_file_path(main_thread_log_path, log);
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
+14
-45
@@ -1,14 +1,6 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Demon/Cleanup Pass Tasks
|
||||
//
|
||||
// [ ] TLS eval -> in-process-memory EXE info
|
||||
// [ ] unwinding -> in-process-memory EXE info
|
||||
// [ ] "root" concept in hash store, which buckets keys & allows usage code to
|
||||
// jettison a collection of keys in retained mode fashion
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Frontend/UI Pass Tasks
|
||||
//
|
||||
@@ -22,7 +14,6 @@
|
||||
// [ ] source view -> floating margin/line-nums
|
||||
// [ ] theme colors -> more explicit about e.g. opaque backgrounds vs. floating
|
||||
// & scrollbars etc.
|
||||
// [ ] drag/drop tab cleanup
|
||||
// [ ] target/breakpoint/watch-pin reordering
|
||||
// [ ] watch window reordering
|
||||
// [ ] standard way to filter
|
||||
@@ -57,6 +48,9 @@
|
||||
////////////////////////////////
|
||||
//~ rjf: Hot, High Priority Tasks (Complete Unusability, Crashes, Fire-Worthy)
|
||||
//
|
||||
// [ ] robustify dbgi layer to renames (cache should not be based only on
|
||||
// path - must invalidate naturally when new filetime occurs)
|
||||
//
|
||||
// [ ] raddbg jai.exe my_file.jai -- foobar -> raddbg consumes `--` incorrectly
|
||||
// [ ] PDB files distributed with the build are not found by DbgHelp!!!
|
||||
// [ ] Jai compiler debugging crash
|
||||
@@ -64,23 +58,17 @@
|
||||
//
|
||||
// [ ] Jump table thunks, on code w/o /INCREMENTAL:NO
|
||||
//
|
||||
// [ ] ** Thread/process control bullet-proofing, including solo-step mode
|
||||
//
|
||||
// [ ] ** In solo-stepping mode, if I step over something like CreateFileA, it
|
||||
// pseudo-hangs the debugger. I can't seem to do anything else, including
|
||||
// "Kill All". I have to close the debugger and restart it, AFAICT?
|
||||
//
|
||||
// [ ] ** I tried to debug a console program, and "step into" didn't seem to
|
||||
// work. Instead, it just started running the program, but the program
|
||||
// seemed to hang, and then the debugger pseudo-hung with a continual
|
||||
// progress bar in the disassembly window. I had to close and restart. Is
|
||||
// console app debugging not working yet, perhaps?
|
||||
//
|
||||
// [ ] Setting the code_font/main_font values to a font name doesn't work.
|
||||
// Should probably make note that you have to set it to a path to a TTF,
|
||||
// since that's not normally how Windows fonts work.
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Demon/Cleanup Pass Tasks
|
||||
//
|
||||
// [ ] ** Converter performance & heuristics for asynchronously doing it early
|
||||
// [ ] TLS eval -> in-process-memory EXE info
|
||||
// [ ] unwinding -> in-process-memory EXE info
|
||||
// [ ] "root" concept in hash store, which buckets keys & allows usage code to
|
||||
// jettison a collection of keys in retained mode fashion
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Hot, Medium Priority Tasks (Low-Hanging-Fruit Features, UI Jank, Cleanup)
|
||||
@@ -88,6 +76,8 @@
|
||||
// [ ] investigate /DEBUG:FASTLINK - can we somehow alert that we do not
|
||||
// support it?
|
||||
//
|
||||
// [ ] ** Converter performance & heuristics for asynchronously doing it early
|
||||
//
|
||||
// [ ] visualize conversion failures
|
||||
//
|
||||
// [ ] I was a little confused about what a profile file was. I understood
|
||||
@@ -182,11 +172,6 @@
|
||||
// item, then releasing, does not trigger that item as expected. Instead,
|
||||
// it is a nop, and it waits for you to click again on the item.
|
||||
//
|
||||
// [ ] Working with panels felt cumbersome. I couldn't figure out any way to
|
||||
// quickly arrange the display without manually selecting "split panel"
|
||||
// and "close panel" and stuff from the menu, which took a long time.
|
||||
// - @polish @feature ui for dragging tab -> bundling panel split options
|
||||
//
|
||||
// [ ] I found the "context menu" convention to be confusing. For example, if
|
||||
// I left-click on a tab, it selects the tab. If I right-click on a tab,
|
||||
// it opens the context menu. However, if I left-click on a module, it
|
||||
@@ -198,7 +183,6 @@
|
||||
// the files myself in the shell, but it seemed weird that there was no
|
||||
// "save" option in the menus.
|
||||
//
|
||||
// [ ] @cleanup @feature double & triple click select in source views
|
||||
// [ ] @feature debug info overrides (both path-based AND module-based)
|
||||
// [ ] configure tab size
|
||||
// [ ] auto-scroll output window
|
||||
@@ -315,8 +299,6 @@
|
||||
// [ ] @bug view-snapping in scroll-lists, accounting for mapping between
|
||||
// visual positions & logical positions (variably sized rows in watch,
|
||||
// table headers, etc.)
|
||||
// [ ] @bug selected frame should be keyed by run_idx or something so that it
|
||||
// can gracefully reset to the top frame when running
|
||||
// [ ] @cleanup collapse DF_CfgNodes into just being MD trees, find another way
|
||||
// to encode config source - don't need it at every node
|
||||
// [ ] @cleanup straighten out index/number space & types & terminology for
|
||||
@@ -335,8 +317,6 @@
|
||||
// when editing)
|
||||
// [ ] @feature eval system -> somehow evaluate breakpoint hit counts? "meta"
|
||||
// variables?
|
||||
// [ ] @feature watch window labels
|
||||
// [ ] @feature scheduler -> thread grid view?
|
||||
//
|
||||
// [ ] @feature disasm view improvement features
|
||||
// [ ] interleaved src/dasm view
|
||||
@@ -397,20 +377,7 @@
|
||||
////////////////////////////////
|
||||
//~ rjf: Recently Completed Task Log
|
||||
//
|
||||
// [x] solidify synchronization mechanisms for usage of demon layer
|
||||
// [x] TLS eval correctness
|
||||
// [x] freezing thread while running -> soft-halt
|
||||
// [x] Watch Window Filtering
|
||||
// [x] @feature disasm keyboard navigation & copy/paste
|
||||
// [x] run-to-line needs to work if no processes are running
|
||||
// - place temp bp, attach "die on hit" flag or something like that?
|
||||
// [x] disasm animation & go-to-address
|
||||
// [x] middle mouse button on tab should close it
|
||||
// [x] I didn't understand the terminology "Equip With Color". Does that just
|
||||
// mean specify the color used to display it? Is "Apply Color" perhaps a
|
||||
// bit more user-friendly?
|
||||
//
|
||||
// [x] The cursor feels a bit too huge vertically.
|
||||
|
||||
#ifndef RADDBG_H
|
||||
#define RADDBG_H
|
||||
@@ -442,6 +409,8 @@ read_only global String8 ipc_shared_memory_name = str8_lit_comp("_raddbg_ipc_sha
|
||||
read_only global String8 ipc_semaphore_name = str8_lit_comp("_raddbg_ipc_semaphore_");
|
||||
global U64 frame_time_us_history[64] = {0};
|
||||
global U64 frame_time_us_history_idx = 0;
|
||||
global Log *main_thread_log = 0;
|
||||
global String8 main_thread_log_path = {0};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Frontend Entry Points
|
||||
|
||||
@@ -16,14 +16,17 @@
|
||||
|
||||
//- rjf: [lib]
|
||||
#include "lib_raddbgi_format/raddbgi_format.h"
|
||||
#include "lib_raddbgi_format/raddbgi_format_parse.h"
|
||||
#include "lib_raddbgi_format/raddbgi_format.c"
|
||||
#include "lib_raddbgi_format/raddbgi_format_parse.h"
|
||||
#include "lib_raddbgi_format/raddbgi_format_parse.c"
|
||||
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
|
||||
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
|
||||
|
||||
//- rjf: [h]
|
||||
#include "base/base_inc.h"
|
||||
#include "os/os_inc.h"
|
||||
#include "task_system/task_system.h"
|
||||
#include "ico/ico.h"
|
||||
#include "raddbgi_make_local/raddbgi_make_local.h"
|
||||
#include "mdesk/mdesk.h"
|
||||
#include "hash_store/hash_store.h"
|
||||
@@ -62,6 +65,7 @@
|
||||
#include "base/base_inc.c"
|
||||
#include "os/os_inc.c"
|
||||
#include "task_system/task_system.c"
|
||||
#include "ico/ico.c"
|
||||
#include "raddbgi_make_local/raddbgi_make_local.c"
|
||||
#include "mdesk/mdesk.c"
|
||||
#include "hash_store/hash_store.c"
|
||||
@@ -389,8 +393,15 @@ entry_point(CmdLine *cmd_line)
|
||||
bake2srlz = p2r_bake(scratch.arena, convert2bake);
|
||||
}
|
||||
|
||||
//- rjf: compress
|
||||
P2R_Bake2Serialize *bake2srlz_compressed = bake2srlz;
|
||||
if(cmd_line_has_flag(cmd_line, str8_lit("compress"))) ProfScope("compress")
|
||||
{
|
||||
bake2srlz_compressed = p2r_compress(scratch.arena, bake2srlz);
|
||||
}
|
||||
|
||||
//- rjf: serialize
|
||||
String8List serialize_out = rdim_serialized_strings_from_params_bake_section_list(scratch.arena, &convert2bake->bake_params, &bake2srlz->sections);
|
||||
String8List serialize_out = rdim_serialized_strings_from_params_bake_section_list(scratch.arena, &convert2bake->bake_params, &bake2srlz_compressed->sections);
|
||||
|
||||
//- rjf: write
|
||||
if(out_file_is_good)
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include "lib_raddbgi_format/raddbgi_format_parse.h"
|
||||
#include "lib_raddbgi_format/raddbgi_format.c"
|
||||
#include "lib_raddbgi_format/raddbgi_format_parse.c"
|
||||
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
|
||||
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
|
||||
|
||||
|
||||
//- rjf: [h]
|
||||
#include "base/base_inc.h"
|
||||
@@ -78,7 +81,7 @@ internal TS_TASK_FUNCTION_DEF(p2b_bake_unit_vmap_task__entry_point)
|
||||
if(vmap_section != 0)
|
||||
{
|
||||
out->vmap_entries = (RDI_VMapEntry *)vmap_section->data;
|
||||
out->vmap_entries_count = vmap_section->size/sizeof(RDI_VMapEntry);
|
||||
out->vmap_entries_count = vmap_section->unpacked_size/sizeof(RDI_VMapEntry);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -117,7 +120,7 @@ internal TS_TASK_FUNCTION_DEF(p2b_bake_unit_task__entry_point)
|
||||
}
|
||||
if(voffs_section != 0 && lines_section != 0)
|
||||
{
|
||||
out->unit_line_count = lines_section->size/sizeof(RDI_Line);
|
||||
out->unit_line_count = lines_section->unpacked_size/sizeof(RDI_Line);
|
||||
out->unit_line_voffs = (U64 *)voffs_section->data;
|
||||
out->unit_lines = (RDI_Line *)lines_section->data;
|
||||
}
|
||||
|
||||
@@ -95,11 +95,54 @@ p2r_user2convert_from_cmdln(Arena *arena, CmdLine *cmdline)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: define string -> flag bits
|
||||
#define FlagNameMapXList \
|
||||
Case("sections", BinarySections)\
|
||||
Case("units", Units)\
|
||||
Case("procedures", Procedures)\
|
||||
Case("globals", GlobalVariables)\
|
||||
Case("threadvars", ThreadVariables)\
|
||||
Case("scopes", Scopes)\
|
||||
Case("locals", Locals)\
|
||||
Case("types", Types)\
|
||||
Case("udts", UDTs)\
|
||||
Case("lines", LineInfo)\
|
||||
Case("globals_name_map", GlobalVariableNameMap)\
|
||||
Case("threadvars_name_map", ThreadVariableNameMap)\
|
||||
Case("procedure_name_map", ProcedureNameMap)\
|
||||
Case("type_name_map", TypeNameMap)\
|
||||
Case("link_name_map", LinkNameProcedureNameMap)\
|
||||
Case("source_path_name_map",NormalSourcePathNameMap)\
|
||||
|
||||
//- rjf: get flags
|
||||
{
|
||||
result->flags = P2R_ConvertFlag_All;
|
||||
String8List only_names = cmd_line_strings(cmdline, str8_lit("only"));
|
||||
String8List omit_names = cmd_line_strings(cmdline, str8_lit("only"));
|
||||
if(only_names.node_count != 0)
|
||||
{
|
||||
result->flags = 0;
|
||||
for(String8Node *n = only_names.first; n != 0; n = n->next)
|
||||
{
|
||||
String8 string = n->string;
|
||||
#define Case(str, flag) if(str8_match(string, str8_lit(str), StringMatchFlag_CaseInsensitive)) {result->flags |= P2R_ConvertFlag_##flag;}
|
||||
FlagNameMapXList;
|
||||
#undef Case
|
||||
}
|
||||
}
|
||||
if(omit_names.node_count != 0)
|
||||
{
|
||||
for(String8Node *n = omit_names.first; n != 0; n = n->next)
|
||||
{
|
||||
String8 string = n->string;
|
||||
#define Case(str, flag) if(str8_match(string, str8_lit(str), StringMatchFlag_CaseInsensitive)) {result->flags &= ~P2R_ConvertFlag_##flag;}
|
||||
FlagNameMapXList;
|
||||
#undef Case
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef FlagNameMapXList
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2755,7 +2798,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
|
||||
RDIM_TopLevelInfo top_level_info = {0};
|
||||
{
|
||||
top_level_info.arch = arch;
|
||||
top_level_info.exe_name = in->input_exe_name;
|
||||
top_level_info.exe_name = str8_skip_last_slash(in->input_exe_name);
|
||||
top_level_info.exe_hash = exe_hash;
|
||||
top_level_info.voff_max = exe_voff_max;
|
||||
}
|
||||
@@ -4238,3 +4281,58 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
||||
scratch_end(scratch);
|
||||
return out;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Top-Level Compression Entry Point
|
||||
|
||||
internal P2R_Bake2Serialize *
|
||||
p2r_compress(Arena *arena, P2R_Bake2Serialize *in)
|
||||
{
|
||||
RDIM_BakeSectionList prepack_sections = in->sections;
|
||||
RDIM_BakeSectionList postpack_sections = {0};
|
||||
{
|
||||
//- rjf: set up compression context
|
||||
rr_lzb_simple_context ctx = {0};
|
||||
ctx.m_tableSizeBits = 14;
|
||||
ctx.m_hashTable = push_array(arena, U16, 1<<ctx.m_tableSizeBits);
|
||||
|
||||
//- rjf: compress, or just copy, all sections
|
||||
for(RDIM_BakeSectionNode *src_n = prepack_sections.first; src_n != 0; src_n = src_n->next)
|
||||
{
|
||||
RDIM_BakeSection *src = &src_n->v;
|
||||
|
||||
// rjf: push new section
|
||||
RDIM_BakeSection *dst = rdim_bake_section_list_push(arena, &postpack_sections);
|
||||
|
||||
// rjf: unpack uncompressed section info
|
||||
void *data = src->data;
|
||||
RDI_DataSectionEncoding encoding = src->encoding;
|
||||
RDI_U64 encoded_size = src->encoded_size;
|
||||
RDI_U64 unpacked_size = src->unpacked_size;
|
||||
|
||||
// rjf: determine if this section should be compressed
|
||||
B32 should_compress = 1;
|
||||
|
||||
// rjf: compress if needed
|
||||
if(should_compress)
|
||||
{
|
||||
MemoryZero(ctx.m_hashTable, sizeof(U16)*(1<<ctx.m_tableSizeBits));
|
||||
void *raw_data = data;
|
||||
data = push_array_no_zero(arena, U8, unpacked_size);
|
||||
encoded_size = rr_lzb_simple_encode_veryfast(&ctx, raw_data, unpacked_size, data);
|
||||
encoding = RDI_DataSectionEncoding_LZB;
|
||||
}
|
||||
|
||||
// rjf: fill
|
||||
dst->data = data;
|
||||
dst->encoding = encoding;
|
||||
dst->encoded_size = encoded_size;
|
||||
dst->unpacked_size = unpacked_size;
|
||||
dst->tag = src->tag;
|
||||
dst->tag_idx = src->tag_idx;
|
||||
}
|
||||
}
|
||||
P2R_Bake2Serialize *out = push_array(arena, P2R_Bake2Serialize, 1);
|
||||
out->sections = postpack_sections;
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -5,16 +5,35 @@
|
||||
#define RADDBGI_FROM_PDB_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Conversion Stage Inputs/Outputs
|
||||
//~ rjf: Export Artifact Flags
|
||||
|
||||
typedef U32 P2R_ConvertFlags;
|
||||
enum
|
||||
{
|
||||
P2R_ConvertFlag_Types = (1<<0),
|
||||
P2R_ConvertFlag_UDTs = (1<<1),
|
||||
P2R_ConvertFlag_Strings = (1<<0),
|
||||
P2R_ConvertFlag_IndexRuns = (1<<1),
|
||||
P2R_ConvertFlag_BinarySections = (1<<2),
|
||||
P2R_ConvertFlag_Units = (1<<3),
|
||||
P2R_ConvertFlag_Procedures = (1<<4),
|
||||
P2R_ConvertFlag_GlobalVariables = (1<<5),
|
||||
P2R_ConvertFlag_ThreadVariables = (1<<6),
|
||||
P2R_ConvertFlag_Scopes = (1<<7),
|
||||
P2R_ConvertFlag_Locals = (1<<8),
|
||||
P2R_ConvertFlag_Types = (1<<9),
|
||||
P2R_ConvertFlag_UDTs = (1<<10),
|
||||
P2R_ConvertFlag_LineInfo = (1<<11),
|
||||
P2R_ConvertFlag_GlobalVariableNameMap = (1<<12),
|
||||
P2R_ConvertFlag_ThreadVariableNameMap = (1<<13),
|
||||
P2R_ConvertFlag_ProcedureNameMap = (1<<14),
|
||||
P2R_ConvertFlag_TypeNameMap = (1<<15),
|
||||
P2R_ConvertFlag_LinkNameProcedureNameMap= (1<<16),
|
||||
P2R_ConvertFlag_NormalSourcePathNameMap = (1<<17),
|
||||
P2R_ConvertFlag_All = 0xffffffff,
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Conversion Stage Inputs/Outputs
|
||||
|
||||
typedef struct P2R_User2Convert P2R_User2Convert;
|
||||
struct P2R_User2Convert
|
||||
{
|
||||
@@ -602,4 +621,9 @@ internal TS_TASK_FUNCTION_DEF(p2r_bake_idx_runs_task__entry_point);
|
||||
|
||||
internal P2R_Bake2Serialize *p2r_bake(Arena *arena, P2R_Convert2Bake *in);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Top-Level Compression Entry Point
|
||||
|
||||
internal P2R_Bake2Serialize *p2r_compress(Arena *arena, P2R_Bake2Serialize *in);
|
||||
|
||||
#endif // RADDBGI_FROM_PDB_H
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
//- rjf: [lib]
|
||||
#include "lib_raddbgi_format/raddbgi_format.h"
|
||||
#include "lib_raddbgi_format/raddbgi_format.c"
|
||||
#include "third_party/rad_lzb_simple/rad_lzb_simple.h"
|
||||
#include "third_party/rad_lzb_simple/rad_lzb_simple.c"
|
||||
|
||||
//- rjf: [h]
|
||||
#include "base/base_inc.h"
|
||||
@@ -96,8 +98,15 @@ entry_point(CmdLine *cmdline)
|
||||
bake2srlz = p2r_bake(arena, convert2bake);
|
||||
}
|
||||
|
||||
//- rjf: compress
|
||||
P2R_Bake2Serialize *bake2srlz_compressed = bake2srlz;
|
||||
if(cmd_line_has_flag(cmdline, str8_lit("compress"))) ProfScope("compress")
|
||||
{
|
||||
bake2srlz_compressed = p2r_compress(arena, bake2srlz);
|
||||
}
|
||||
|
||||
//- rjf: serialize
|
||||
String8List serialize_out = rdim_serialized_strings_from_params_bake_section_list(arena, &convert2bake->bake_params, &bake2srlz->sections);
|
||||
String8List serialize_out = rdim_serialized_strings_from_params_bake_section_list(arena, &convert2bake->bake_params, &bake2srlz_compressed->sections);
|
||||
|
||||
//- rjf: write
|
||||
ProfScope("write")
|
||||
|
||||
@@ -1,30 +1,60 @@
|
||||
|
||||
struct Bar
|
||||
static int Static = 5;
|
||||
namespace NS
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
static int staticDataInNS = 99;
|
||||
struct A
|
||||
{
|
||||
static int staticData;
|
||||
int a = 20;
|
||||
int b = 30;
|
||||
void Foo()
|
||||
{
|
||||
Static += 1;
|
||||
staticDataInNS += 1;
|
||||
staticData++;
|
||||
a++;
|
||||
b++;
|
||||
}
|
||||
};
|
||||
int A::staticData = 123;
|
||||
}
|
||||
|
||||
struct Resource
|
||||
{
|
||||
int resourceType;
|
||||
};
|
||||
|
||||
struct BarContainer
|
||||
struct Stack
|
||||
{
|
||||
Bar *bar;
|
||||
int bar_count;
|
||||
int bar_cap;
|
||||
Resource *resource;
|
||||
};
|
||||
|
||||
struct Foo
|
||||
struct StackNode
|
||||
{
|
||||
BarContainer bar;
|
||||
int a;
|
||||
int b;
|
||||
int c;
|
||||
StackNode *next;
|
||||
Stack v;
|
||||
};
|
||||
|
||||
struct Context
|
||||
{
|
||||
StackNode *entry_stack_first;
|
||||
};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Bar bar[100] = {0};
|
||||
Foo foo_ = {bar, 50, sizeof(bar)/sizeof(Bar)};
|
||||
Foo &foo = foo_;
|
||||
Resource r_ = {0};
|
||||
Resource *r = &r_;
|
||||
Stack s = {r};
|
||||
StackNode n_ = {0, s};
|
||||
StackNode *n = &n_;
|
||||
Context c_ = {n};
|
||||
Context *context = &c_;
|
||||
|
||||
// evaluate `context.entry_stack_first.v.resource.resourceType == 0xd8`
|
||||
int x = 0;
|
||||
|
||||
NS::A a = {0};
|
||||
a.Foo();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -30,9 +30,36 @@ txt_lang_kind_from_extension(String8 extension)
|
||||
{
|
||||
kind = TXT_LangKind_Odin;
|
||||
}
|
||||
else if(str8_match(extension, str8_lit("jai"), StringMatchFlag_CaseInsensitive))
|
||||
{
|
||||
kind = TXT_LangKind_Jai;
|
||||
}
|
||||
else if(str8_match(extension, str8_lit("zig"), StringMatchFlag_CaseInsensitive))
|
||||
{
|
||||
kind = TXT_LangKind_Zig;
|
||||
}
|
||||
return kind;
|
||||
}
|
||||
|
||||
internal String8
|
||||
txt_extension_from_lang_kind(TXT_LangKind kind)
|
||||
{
|
||||
String8 result = {0};
|
||||
switch(kind)
|
||||
{
|
||||
case TXT_LangKind_Null:
|
||||
case TXT_LangKind_COUNT:
|
||||
case TXT_LangKind_DisasmX64Intel:
|
||||
{}break;
|
||||
case TXT_LangKind_C: {result = str8_lit("c");}break;
|
||||
case TXT_LangKind_CPlusPlus: {result = str8_lit("cpp");}break;
|
||||
case TXT_LangKind_Odin: {result = str8_lit("odin");}break;
|
||||
case TXT_LangKind_Jai: {result = str8_lit("jai");}break;
|
||||
case TXT_LangKind_Zig: {result = str8_lit("zig");}break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal TXT_LangKind
|
||||
txt_lang_kind_from_architecture(Architecture arch)
|
||||
{
|
||||
@@ -55,6 +82,8 @@ txt_lex_function_from_lang_kind(TXT_LangKind kind)
|
||||
case TXT_LangKind_C: {fn = txt_token_array_from_string__c_cpp;}break;
|
||||
case TXT_LangKind_CPlusPlus: {fn = txt_token_array_from_string__c_cpp;}break;
|
||||
case TXT_LangKind_Odin: {fn = txt_token_array_from_string__odin;}break;
|
||||
case TXT_LangKind_Jai: {fn = txt_token_array_from_string__jai;}break;
|
||||
case TXT_LangKind_Zig: {fn = txt_token_array_from_string__zig;}break;
|
||||
case TXT_LangKind_DisasmX64Intel:{fn = txt_token_array_from_string__disasm_x64_intel;}break;
|
||||
}
|
||||
return fn;
|
||||
@@ -565,6 +594,7 @@ txt_token_array_from_string__odin(Arena *arena, U64 *bytes_processed_counter, St
|
||||
{
|
||||
read_only local_persist String8 odin_keywords[] =
|
||||
{
|
||||
str8_lit_comp("align_of"),
|
||||
str8_lit_comp("asm"),
|
||||
str8_lit_comp("auto_cast"),
|
||||
str8_lit_comp("bit_set"),
|
||||
@@ -594,6 +624,7 @@ txt_token_array_from_string__odin(Arena *arena, U64 *bytes_processed_counter, St
|
||||
str8_lit_comp("package"),
|
||||
str8_lit_comp("proc"),
|
||||
str8_lit_comp("return"),
|
||||
str8_lit_comp("size_of"),
|
||||
str8_lit_comp("struct"),
|
||||
str8_lit_comp("switch"),
|
||||
str8_lit_comp("transmute"),
|
||||
@@ -637,6 +668,470 @@ txt_token_array_from_string__odin(Arena *arena, U64 *bytes_processed_counter, St
|
||||
return result;
|
||||
}
|
||||
|
||||
internal TXT_TokenArray
|
||||
txt_token_array_from_string__jai(Arena *arena, U64 *bytes_processed_counter, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
//- rjf: generate token list
|
||||
TXT_TokenChunkList tokens = {0};
|
||||
{
|
||||
B32 comment_is_single_line = 0;
|
||||
B32 string_is_char = 0;
|
||||
TXT_TokenKind active_token_kind = TXT_TokenKind_Null;
|
||||
U64 active_token_start_idx = 0;
|
||||
B32 escaped = 0;
|
||||
B32 next_escaped = 0;
|
||||
U64 byte_process_start_idx = 0;
|
||||
for(U64 idx = 0; idx <= string.size;)
|
||||
{
|
||||
U8 byte = (idx+0 < string.size) ? (string.str[idx+0]) : 0;
|
||||
U8 next_byte = (idx+1 < string.size) ? (string.str[idx+1]) : 0;
|
||||
|
||||
// rjf: update counter
|
||||
if(bytes_processed_counter != 0 && ((idx-byte_process_start_idx) >= 1000 || idx == string.size))
|
||||
{
|
||||
ins_atomic_u64_add_eval(bytes_processed_counter, (idx-byte_process_start_idx));
|
||||
byte_process_start_idx = idx;
|
||||
}
|
||||
|
||||
// rjf: escaping
|
||||
if(escaped && (byte != '\r' && byte != '\n'))
|
||||
{
|
||||
next_escaped = 0;
|
||||
}
|
||||
else if(!escaped && byte == '\\')
|
||||
{
|
||||
next_escaped = 1;
|
||||
}
|
||||
|
||||
// rjf: take starter, determine active token kind
|
||||
if(active_token_kind == TXT_TokenKind_Null)
|
||||
{
|
||||
// rjf: use next bytes to start a new token
|
||||
if(0){}
|
||||
else if(char_is_space(byte)) { active_token_kind = TXT_TokenKind_Whitespace; }
|
||||
else if(byte == '_' ||
|
||||
byte == '$' ||
|
||||
char_is_alpha(byte)) { active_token_kind = TXT_TokenKind_Identifier; }
|
||||
else if(char_is_digit(byte, 10) ||
|
||||
(byte == '.' &&
|
||||
char_is_digit(next_byte, 10))) { active_token_kind = TXT_TokenKind_Numeric; }
|
||||
else if(byte == '"') { active_token_kind = TXT_TokenKind_String; string_is_char = 0; }
|
||||
else if(byte == '\'') { active_token_kind = TXT_TokenKind_String; string_is_char = 1; }
|
||||
else if(byte == '/' && next_byte == '/') { active_token_kind = TXT_TokenKind_Comment; comment_is_single_line = 1; }
|
||||
else if(byte == '/' && next_byte == '*') { active_token_kind = TXT_TokenKind_Comment; comment_is_single_line = 0; }
|
||||
else if(byte == '~' || byte == '!' ||
|
||||
byte == '%' || byte == '^' ||
|
||||
byte == '&' || byte == '*' ||
|
||||
byte == '(' || byte == ')' ||
|
||||
byte == '-' || byte == '=' ||
|
||||
byte == '+' || byte == '[' ||
|
||||
byte == ']' || byte == '{' ||
|
||||
byte == '}' || byte == ':' ||
|
||||
byte == ';' || byte == ',' ||
|
||||
byte == '.' || byte == '<' ||
|
||||
byte == '>' || byte == '/' ||
|
||||
byte == '?' || byte == '|') { active_token_kind = TXT_TokenKind_Symbol; }
|
||||
else if(byte == '#') { active_token_kind = TXT_TokenKind_Meta; }
|
||||
|
||||
// rjf: start new token
|
||||
if(active_token_kind != TXT_TokenKind_Null)
|
||||
{
|
||||
active_token_start_idx = idx;
|
||||
}
|
||||
|
||||
// rjf: invalid token kind -> emit error
|
||||
else
|
||||
{
|
||||
TXT_Token token = {TXT_TokenKind_Error, r1u64(idx, idx+1)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: look for ender
|
||||
U64 ender_pad = 0;
|
||||
B32 ender_found = 0;
|
||||
if(active_token_kind != TXT_TokenKind_Null && idx>active_token_start_idx)
|
||||
{
|
||||
if(idx == string.size)
|
||||
{
|
||||
ender_pad = 0;
|
||||
ender_found = 1;
|
||||
}
|
||||
else switch(active_token_kind)
|
||||
{
|
||||
default:break;
|
||||
case TXT_TokenKind_Whitespace:
|
||||
{
|
||||
ender_found = !char_is_space(byte);
|
||||
}break;
|
||||
case TXT_TokenKind_Identifier:
|
||||
{
|
||||
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '$');
|
||||
}break;
|
||||
case TXT_TokenKind_Numeric:
|
||||
{
|
||||
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '.' && byte != '\'');
|
||||
}break;
|
||||
case TXT_TokenKind_String:
|
||||
{
|
||||
ender_found = (!escaped && ((!string_is_char && byte == '"') || (string_is_char && byte == '\'')));
|
||||
ender_pad += 1;
|
||||
}break;
|
||||
case TXT_TokenKind_Symbol:
|
||||
{
|
||||
ender_found = (byte != '~' && byte != '!' &&
|
||||
byte != '%' && byte != '^' &&
|
||||
byte != '&' && byte != '*' &&
|
||||
byte != '(' && byte != ')' &&
|
||||
byte != '-' && byte != '=' &&
|
||||
byte != '+' && byte != '[' &&
|
||||
byte != ']' && byte != '{' &&
|
||||
byte != '}' && byte != ':' &&
|
||||
byte != ';' && byte != ',' &&
|
||||
byte != '.' && byte != '<' &&
|
||||
byte != '>' && byte != '/' &&
|
||||
byte != '?' && byte != '|');
|
||||
}break;
|
||||
case TXT_TokenKind_Comment:
|
||||
{
|
||||
if(comment_is_single_line)
|
||||
{
|
||||
ender_found = (!escaped && (byte == '\r' || byte == '\n'));
|
||||
}
|
||||
else
|
||||
{
|
||||
ender_found = (active_token_start_idx+1 < idx && byte == '*' && next_byte == '/');
|
||||
ender_pad += 2;
|
||||
}
|
||||
}break;
|
||||
case TXT_TokenKind_Meta:
|
||||
{
|
||||
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '$');
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: next byte is ender => emit token
|
||||
if(ender_found)
|
||||
{
|
||||
TXT_Token token = {active_token_kind, r1u64(active_token_start_idx, idx+ender_pad)};
|
||||
active_token_kind = TXT_TokenKind_Null;
|
||||
|
||||
// rjf: identifier -> keyword in special cases
|
||||
if(token.kind == TXT_TokenKind_Identifier)
|
||||
{
|
||||
read_only local_persist String8 jai_keywords[] =
|
||||
{
|
||||
str8_lit_comp("bool"),
|
||||
str8_lit_comp("true"),
|
||||
str8_lit_comp("false"),
|
||||
str8_lit_comp("int"),
|
||||
str8_lit_comp("s8"),
|
||||
str8_lit_comp("u8"),
|
||||
str8_lit_comp("s16"),
|
||||
str8_lit_comp("u16"),
|
||||
str8_lit_comp("s32"),
|
||||
str8_lit_comp("u32"),
|
||||
str8_lit_comp("s64"),
|
||||
str8_lit_comp("u64"),
|
||||
str8_lit_comp("s128"),
|
||||
str8_lit_comp("u128"),
|
||||
str8_lit_comp("float"),
|
||||
str8_lit_comp("float32"),
|
||||
str8_lit_comp("float64"),
|
||||
str8_lit_comp("void"),
|
||||
str8_lit_comp("enum"),
|
||||
str8_lit_comp("enum_flags"),
|
||||
str8_lit_comp("size_of"),
|
||||
str8_lit_comp("string"),
|
||||
str8_lit_comp("type_of"),
|
||||
str8_lit_comp("cast"),
|
||||
str8_lit_comp("if"),
|
||||
str8_lit_comp("ifs"),
|
||||
str8_lit_comp("then"),
|
||||
str8_lit_comp("else"),
|
||||
str8_lit_comp("case"),
|
||||
str8_lit_comp("for"),
|
||||
str8_lit_comp("while"),
|
||||
str8_lit_comp("break"),
|
||||
str8_lit_comp("continue"),
|
||||
str8_lit_comp("remove"),
|
||||
str8_lit_comp("return"),
|
||||
str8_lit_comp("inline"),
|
||||
str8_lit_comp("null"),
|
||||
str8_lit_comp("defer"),
|
||||
str8_lit_comp("xx"),
|
||||
};
|
||||
String8 token_string = str8_substr(string, r1u64(active_token_start_idx, idx+ender_pad));
|
||||
for(U64 keyword_idx = 0; keyword_idx < ArrayCount(jai_keywords); keyword_idx += 1)
|
||||
{
|
||||
if(str8_match(jai_keywords[keyword_idx], token_string, 0))
|
||||
{
|
||||
token.kind = TXT_TokenKind_Keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: push
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
|
||||
// rjf: increment by ender padding
|
||||
idx += ender_pad;
|
||||
}
|
||||
|
||||
// rjf: advance by 1 byte if we haven't found an ender
|
||||
if(!ender_found)
|
||||
{
|
||||
idx += 1;
|
||||
}
|
||||
escaped = next_escaped;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: token list -> token array
|
||||
TXT_TokenArray result = txt_token_array_from_chunk_list(arena, &tokens);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal TXT_TokenArray
|
||||
txt_token_array_from_string__zig(Arena *arena, U64 *bytes_processed_counter, String8 string)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
//- rjf: generate token list
|
||||
TXT_TokenChunkList tokens = {0};
|
||||
{
|
||||
B32 string_is_char = 0;
|
||||
B32 string_is_line = 0;
|
||||
TXT_TokenKind active_token_kind = TXT_TokenKind_Null;
|
||||
U64 active_token_start_idx = 0;
|
||||
B32 escaped = 0;
|
||||
B32 next_escaped = 0;
|
||||
U64 byte_process_start_idx = 0;
|
||||
for(U64 idx = 0; idx <= string.size;)
|
||||
{
|
||||
U8 byte = (idx+0 < string.size) ? (string.str[idx+0]) : 0;
|
||||
U8 next_byte = (idx+1 < string.size) ? (string.str[idx+1]) : 0;
|
||||
|
||||
// rjf: update counter
|
||||
if(bytes_processed_counter != 0 && ((idx-byte_process_start_idx) >= 1000 || idx == string.size))
|
||||
{
|
||||
ins_atomic_u64_add_eval(bytes_processed_counter, (idx-byte_process_start_idx));
|
||||
byte_process_start_idx = idx;
|
||||
}
|
||||
|
||||
// rjf: escaping
|
||||
if(escaped && (byte != '\r' && byte != '\n'))
|
||||
{
|
||||
next_escaped = 0;
|
||||
}
|
||||
else if(!escaped && byte == '\\')
|
||||
{
|
||||
next_escaped = 1;
|
||||
}
|
||||
|
||||
// rjf: take starter, determine active token kind
|
||||
if(active_token_kind == TXT_TokenKind_Null)
|
||||
{
|
||||
// rjf: use next bytes to start a new token
|
||||
if(0){}
|
||||
else if(char_is_space(byte)) { active_token_kind = TXT_TokenKind_Whitespace; }
|
||||
else if(byte == '_' ||
|
||||
char_is_alpha(byte)) { active_token_kind = TXT_TokenKind_Identifier; }
|
||||
else if(char_is_digit(byte, 10) ||
|
||||
(byte == '.' &&
|
||||
char_is_digit(next_byte, 10))) { active_token_kind = TXT_TokenKind_Numeric; }
|
||||
else if(byte == '"') { active_token_kind = TXT_TokenKind_String; string_is_char = 0; }
|
||||
else if(byte == '\'') { active_token_kind = TXT_TokenKind_String; string_is_char = 1; }
|
||||
else if(byte == '\\' &&
|
||||
next_byte == '\\') { active_token_kind = TXT_TokenKind_String; string_is_line = 1; }
|
||||
else if(byte == '/' && next_byte == '/') { active_token_kind = TXT_TokenKind_Comment; }
|
||||
else if(byte == '~' || byte == '!' ||
|
||||
byte == '%' || byte == '^' ||
|
||||
byte == '&' || byte == '*' ||
|
||||
byte == '(' || byte == ')' ||
|
||||
byte == '-' || byte == '=' ||
|
||||
byte == '+' || byte == '[' ||
|
||||
byte == ']' || byte == '{' ||
|
||||
byte == '}' || byte == ':' ||
|
||||
byte == ';' || byte == ',' ||
|
||||
byte == '.' || byte == '<' ||
|
||||
byte == '>' || byte == '/' ||
|
||||
byte == '?' || byte == '|' ||
|
||||
byte == 'c') { active_token_kind = TXT_TokenKind_Symbol; }
|
||||
|
||||
// rjf: start new token
|
||||
if(active_token_kind != TXT_TokenKind_Null)
|
||||
{
|
||||
active_token_start_idx = idx;
|
||||
}
|
||||
|
||||
// rjf: invalid token kind -> emit error
|
||||
else
|
||||
{
|
||||
TXT_Token token = {TXT_TokenKind_Error, r1u64(idx, idx+1)};
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: look for ender
|
||||
U64 ender_pad = 0;
|
||||
B32 ender_found = 0;
|
||||
if(active_token_kind != TXT_TokenKind_Null && idx>active_token_start_idx)
|
||||
{
|
||||
if(idx == string.size)
|
||||
{
|
||||
ender_pad = 0;
|
||||
ender_found = 1;
|
||||
}
|
||||
else switch(active_token_kind)
|
||||
{
|
||||
default:break;
|
||||
case TXT_TokenKind_Whitespace:
|
||||
{
|
||||
ender_found = !char_is_space(byte);
|
||||
}break;
|
||||
case TXT_TokenKind_Identifier:
|
||||
{
|
||||
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '$');
|
||||
}break;
|
||||
case TXT_TokenKind_Numeric:
|
||||
{
|
||||
ender_found = (!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '_' && byte != '.' && byte != '\'');
|
||||
}break;
|
||||
case TXT_TokenKind_String:
|
||||
{
|
||||
if (string_is_line)
|
||||
{
|
||||
ender_found = (!escaped && (byte == '\r' || byte == '\n'));
|
||||
}
|
||||
else
|
||||
{
|
||||
ender_found = (!escaped && ((!string_is_char && byte == '"') || (string_is_char && byte == '\'')));
|
||||
ender_pad += 1;
|
||||
}
|
||||
}break;
|
||||
case TXT_TokenKind_Symbol:
|
||||
{
|
||||
ender_found = (byte != '~' && byte != '!' &&
|
||||
byte != '%' && byte != '^' &&
|
||||
byte != '&' && byte != '*' &&
|
||||
byte != '(' && byte != ')' &&
|
||||
byte != '-' && byte != '=' &&
|
||||
byte != '+' && byte != '[' &&
|
||||
byte != ']' && byte != '{' &&
|
||||
byte != '}' && byte != ':' &&
|
||||
byte != ';' && byte != ',' &&
|
||||
byte != '.' && byte != '<' &&
|
||||
byte != '>' && byte != '/' &&
|
||||
byte != '?' && byte != '|' &&
|
||||
byte != 'c');
|
||||
}break;
|
||||
case TXT_TokenKind_Comment:
|
||||
{
|
||||
ender_found = (!escaped && (byte == '\r' || byte == '\n'));
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: next byte is ender => emit token
|
||||
if(ender_found)
|
||||
{
|
||||
TXT_Token token = {active_token_kind, r1u64(active_token_start_idx, idx+ender_pad)};
|
||||
active_token_kind = TXT_TokenKind_Null;
|
||||
|
||||
// rjf: identifier -> keyword in special cases
|
||||
if(token.kind == TXT_TokenKind_Identifier)
|
||||
{
|
||||
read_only local_persist String8 zig_keywords[] =
|
||||
{
|
||||
str8_lit_comp("addrspace"),
|
||||
str8_lit_comp("align"),
|
||||
str8_lit_comp("allowzero"),
|
||||
str8_lit_comp("and"),
|
||||
str8_lit_comp("anyframe"),
|
||||
str8_lit_comp("anytype"),
|
||||
str8_lit_comp("asm"),
|
||||
str8_lit_comp("async"),
|
||||
str8_lit_comp("await"),
|
||||
str8_lit_comp("break"),
|
||||
str8_lit_comp("callconv"),
|
||||
str8_lit_comp("catch"),
|
||||
str8_lit_comp("comptime"),
|
||||
str8_lit_comp("const"),
|
||||
str8_lit_comp("continue"),
|
||||
str8_lit_comp("defer"),
|
||||
str8_lit_comp("else"),
|
||||
str8_lit_comp("enum"),
|
||||
str8_lit_comp("errdefer"),
|
||||
str8_lit_comp("error"),
|
||||
str8_lit_comp("export"),
|
||||
str8_lit_comp("extern"),
|
||||
str8_lit_comp("fn"),
|
||||
str8_lit_comp("for"),
|
||||
str8_lit_comp("if"),
|
||||
str8_lit_comp("inline"),
|
||||
str8_lit_comp("noalias"),
|
||||
str8_lit_comp("nosuspend"),
|
||||
str8_lit_comp("noinline"),
|
||||
str8_lit_comp("opaque"),
|
||||
str8_lit_comp("or"),
|
||||
str8_lit_comp("orelse"),
|
||||
str8_lit_comp("packed"),
|
||||
str8_lit_comp("pub"),
|
||||
str8_lit_comp("resume"),
|
||||
str8_lit_comp("return"),
|
||||
str8_lit_comp("linksection"),
|
||||
str8_lit_comp("struct"),
|
||||
str8_lit_comp("suspend"),
|
||||
str8_lit_comp("switch"),
|
||||
str8_lit_comp("test"),
|
||||
str8_lit_comp("threadlocal"),
|
||||
str8_lit_comp("try"),
|
||||
str8_lit_comp("union"),
|
||||
str8_lit_comp("unreachable"),
|
||||
str8_lit_comp("usingnamespace"),
|
||||
str8_lit_comp("var"),
|
||||
str8_lit_comp("volatile"),
|
||||
str8_lit_comp("while"),
|
||||
};
|
||||
String8 token_string = str8_substr(string, r1u64(active_token_start_idx, idx+ender_pad));
|
||||
for(U64 keyword_idx = 0; keyword_idx < ArrayCount(zig_keywords); keyword_idx += 1)
|
||||
{
|
||||
if(str8_match(zig_keywords[keyword_idx], token_string, 0))
|
||||
{
|
||||
token.kind = TXT_TokenKind_Keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: push
|
||||
txt_token_chunk_list_push(scratch.arena, &tokens, 4096, &token);
|
||||
|
||||
// rjf: increment by ender padding
|
||||
idx += ender_pad;
|
||||
}
|
||||
|
||||
// rjf: advance by 1 byte if we haven't found an ender
|
||||
if(!ender_found)
|
||||
{
|
||||
idx += 1;
|
||||
}
|
||||
escaped = next_escaped;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: token list -> token array
|
||||
TXT_TokenArray result = txt_token_array_from_chunk_list(arena, &tokens);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal TXT_TokenArray
|
||||
txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed_counter, String8 string)
|
||||
{
|
||||
@@ -651,6 +1146,7 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
|
||||
B32 escaped = 0;
|
||||
B32 string_is_char = 0;
|
||||
S32 brace_nest = 0;
|
||||
S32 paren_nest = 0;
|
||||
for(U64 advance = 0; off <= string.size; off += advance)
|
||||
{
|
||||
U8 byte = (off+0 < string.size) ? string.str[off+0] : 0;
|
||||
@@ -673,6 +1169,12 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
|
||||
active_token_kind = TXT_TokenKind_Whitespace;
|
||||
advance = 1;
|
||||
}
|
||||
else if(byte == '>' && brace_nest == 0 && paren_nest == 0)
|
||||
{
|
||||
active_token_start_off = off;
|
||||
active_token_kind = TXT_TokenKind_Comment;
|
||||
advance = 1;
|
||||
}
|
||||
else if(('a' <= byte && byte <= 'z') || ('A' <= byte && byte <= 'Z') || byte == '_')
|
||||
{
|
||||
active_token_start_off = off;
|
||||
@@ -717,6 +1219,14 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
|
||||
{
|
||||
brace_nest -= 1;
|
||||
}
|
||||
if(byte == '(')
|
||||
{
|
||||
paren_nest += 1;
|
||||
}
|
||||
else if(byte == ')')
|
||||
{
|
||||
paren_nest -= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -792,6 +1302,12 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
|
||||
ender_found = 1;
|
||||
advance = 0;
|
||||
}break;
|
||||
case TXT_TokenKind_Comment:
|
||||
if(byte == '\n')
|
||||
{
|
||||
ender_found = 1;
|
||||
advance = 1;
|
||||
}break;
|
||||
}
|
||||
if(ender_found != 0)
|
||||
{
|
||||
@@ -799,6 +1315,10 @@ txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed
|
||||
{
|
||||
active_token_kind = TXT_TokenKind_Numeric;
|
||||
}
|
||||
if(paren_nest != 0 && active_token_kind == TXT_TokenKind_Keyword)
|
||||
{
|
||||
active_token_kind = TXT_TokenKind_Identifier;
|
||||
}
|
||||
TXT_Token token = {active_token_kind, r1u64(active_token_start_off, off+advance)};
|
||||
txt_token_chunk_list_push(arena, &tokens, 1024, &token);
|
||||
active_token_kind = TXT_TokenKind_Null;
|
||||
|
||||
@@ -113,6 +113,8 @@ typedef enum TXT_LangKind
|
||||
TXT_LangKind_C,
|
||||
TXT_LangKind_CPlusPlus,
|
||||
TXT_LangKind_Odin,
|
||||
TXT_LangKind_Jai,
|
||||
TXT_LangKind_Zig,
|
||||
TXT_LangKind_DisasmX64Intel,
|
||||
TXT_LangKind_COUNT
|
||||
}
|
||||
@@ -234,6 +236,7 @@ global TXT_Shared *txt_shared = 0;
|
||||
//~ rjf: Basic Helpers
|
||||
|
||||
internal TXT_LangKind txt_lang_kind_from_extension(String8 extension);
|
||||
internal String8 txt_extension_from_lang_kind(TXT_LangKind kind);
|
||||
internal TXT_LangKind txt_lang_kind_from_architecture(Architecture arch);
|
||||
internal TXT_LangLexFunctionType *txt_lex_function_from_lang_kind(TXT_LangKind kind);
|
||||
|
||||
@@ -250,6 +253,8 @@ internal TXT_TokenArray txt_token_array_from_list(Arena *arena, TXT_TokenList *l
|
||||
|
||||
internal TXT_TokenArray txt_token_array_from_string__c_cpp(Arena *arena, U64 *bytes_processed_counter, String8 string);
|
||||
internal TXT_TokenArray txt_token_array_from_string__odin(Arena *arena, U64 *bytes_processed_counter, String8 string);
|
||||
internal TXT_TokenArray txt_token_array_from_string__jai(Arena *arena, U64 *bytes_processed_counter, String8 string);
|
||||
internal TXT_TokenArray txt_token_array_from_string__zig(Arena *arena, U64 *bytes_processed_counter, String8 string);
|
||||
internal TXT_TokenArray txt_token_array_from_string__disasm_x64_intel(Arena *arena, U64 *bytes_processed_counter, String8 string);
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
+1402
File diff suppressed because it is too large
Load Diff
+141
@@ -0,0 +1,141 @@
|
||||
#ifndef _RAD_LZB_SIMPLE_H_
|
||||
#define _RAD_LZB_SIMPLE_H_
|
||||
|
||||
/*======================================================
|
||||
|
||||
To encode :
|
||||
|
||||
Set up an rr_lzb_simple_context
|
||||
|
||||
fill out m_tableSizeBits (14-16 is typical)
|
||||
|
||||
allocate m_hashTable
|
||||
|
||||
rr_lzb_simple_context c;
|
||||
c.m_tableSizeBits = 14;
|
||||
c.m_hashTable = OODLE_MALLOC_ARRAY(U16,RR_ONE_SA<<c.m_tableSizeBits);
|
||||
|
||||
then call _encode
|
||||
|
||||
NOTE :
|
||||
compressed & raw size are not included in the encoded bytes. You must send
|
||||
them separately.
|
||||
|
||||
NOTE :
|
||||
lzb will never expand. comp_len is <= raw_len strictly.
|
||||
if comp_len = raw_len it indicates that the compressed bytes are just a memcpy
|
||||
of the raw bytes. In that case you do not need to decode.
|
||||
|
||||
To decode :
|
||||
|
||||
if comp_len is == raw_len, then the compressed bytes are just a copy of the
|
||||
raw bytes and you could use them directly without calling decode.
|
||||
|
||||
if you call rr_lzb_simple_decode in that case, then the compressed buffer will
|
||||
be memcpy'd to the raw buffer
|
||||
|
||||
===============================================================*/
|
||||
|
||||
//~ TODO(rjf): temporary glue for building this without the shared rad code:
|
||||
|
||||
#define __RAD64REGS__
|
||||
|
||||
#include <stdint.h>
|
||||
typedef uint8_t U8;
|
||||
typedef uint16_t U16;
|
||||
typedef uint32_t U32;
|
||||
typedef uint64_t U64;
|
||||
typedef int8_t S8;
|
||||
typedef int16_t S16;
|
||||
typedef int32_t S32;
|
||||
typedef int64_t S64;
|
||||
|
||||
typedef S64 SINTa;
|
||||
typedef U64 RAD_U64;
|
||||
typedef S64 RAD_S64;
|
||||
typedef U32 RAD_U32;
|
||||
typedef S32 RAD_S32;
|
||||
|
||||
#define RADINLINE __inline
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define RADFORCEINLINE __forceinline
|
||||
#elif defined(__clang__)
|
||||
# define RADFORCEINLINE __attribute__((always_inline))
|
||||
#else
|
||||
# error need force inline for this compiler
|
||||
#endif
|
||||
|
||||
#define RR_STRING_JOIN(arg1, arg2) RR_STRING_JOIN_DELAY(arg1, arg2)
|
||||
#define RR_STRING_JOIN_DELAY(arg1, arg2) RR_STRING_JOIN_IMMEDIATE(arg1, arg2)
|
||||
#define RR_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define RR_NUMBERNAME(name) RR_STRING_JOIN(name,__COUNTER__)
|
||||
#else
|
||||
#define RR_NUMBERNAME(name) RR_STRING_JOIN(name,__LINE__)
|
||||
#endif
|
||||
|
||||
#define RR_COMPILER_ASSERT(exp) typedef char RR_NUMBERNAME(_dummy_array) [ (exp) ? 1 : -1 ]
|
||||
|
||||
#if defined(__clang__)
|
||||
# define Expect(expr, val) __builtin_expect((expr), (val))
|
||||
#else
|
||||
# define Expect(expr, val) (expr)
|
||||
#endif
|
||||
|
||||
#define RAD_LIKELY(expr) Expect(expr,1)
|
||||
#define RAD_UNLIKELY(expr) Expect(expr,0)
|
||||
|
||||
#define __RADLITTLEENDIAN__ 1
|
||||
#define RAD_PTRBYTES 8
|
||||
#define RR_MIN(a,b) ( (a) < (b) ? (a) : (b) )
|
||||
#define RR_MAX(a,b) ( (a) > (b) ? (a) : (b) )
|
||||
#define RR_ASSERT_ALWAYS(c) do{if(!(c)) {__debugbreak();}}while(0)
|
||||
#define RR_ASSERT(c) RR_ASSERT_ALWAYS(c)
|
||||
|
||||
#define RR_PUT16_LE(ptr,val) *((U16 *)(ptr)) = (U16)(val)
|
||||
#define RR_GET16_LE_UNALIGNED(ptr) *((const U16 *)(ptr))
|
||||
|
||||
static RADINLINE U32
|
||||
rrCtzBytes32(U32 val)
|
||||
{
|
||||
// Don't get fancy here. Assumes val != 0.
|
||||
if (val & 0x000000ffu) return 0;
|
||||
if (val & 0x0000ff00u) return 1;
|
||||
if (val & 0x00ff0000u) return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
static RADINLINE U32
|
||||
rrCtzBytes64(U64 val)
|
||||
{
|
||||
U32 lo = (U32) val;
|
||||
return lo ? rrCtzBytes32(lo) : 4 + rrCtzBytes32((U32) (val >> 32));
|
||||
}
|
||||
|
||||
//~
|
||||
|
||||
//---------------------
|
||||
|
||||
typedef struct rr_lzb_simple_context rr_lzb_simple_context;
|
||||
struct rr_lzb_simple_context
|
||||
{
|
||||
U16 * m_hashTable; // must be allocated to sizeof(U16)*(1<<m_tableSizeBits)
|
||||
S32 m_tableSizeBits;
|
||||
};
|
||||
|
||||
SINTa rr_lzb_simple_encode_fast(rr_lzb_simple_context * ctx,
|
||||
const void * raw, SINTa rawLen, void * comp);
|
||||
|
||||
SINTa rr_lzb_simple_encode_veryfast(rr_lzb_simple_context * ctx,
|
||||
const void * raw, SINTa rawLen, void * comp);
|
||||
|
||||
//---------------------
|
||||
|
||||
// rr_lzb_simple_decode returns the number of compressed bytes consumed ( == compLen)
|
||||
SINTa rr_lzb_simple_decode(const void * comp, SINTa compLen, void * raw, SINTa rawLen);
|
||||
|
||||
//---------------------
|
||||
|
||||
#endif // _RAD_LZB_SIMPLE_H_
|
||||
Vendored
+7985
File diff suppressed because it is too large
Load Diff
@@ -330,6 +330,75 @@ ui_line_editf(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size,
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Images
|
||||
|
||||
typedef struct UI_ImageDrawData UI_ImageDrawData;
|
||||
struct UI_ImageDrawData
|
||||
{
|
||||
R_Handle texture;
|
||||
R_Tex2DSampleKind sample_kind;
|
||||
Rng2F32 region;
|
||||
Vec4F32 tint;
|
||||
F32 blur;
|
||||
};
|
||||
|
||||
internal UI_BOX_CUSTOM_DRAW(ui_image_draw)
|
||||
{
|
||||
UI_ImageDrawData *draw_data = (UI_ImageDrawData *)user_data;
|
||||
if(r_handle_match(draw_data->texture, r_handle_zero()))
|
||||
{
|
||||
R_Rect2DInst *inst = d_rect(box->rect, v4f32(0, 0, 0, 0), 0, 0, 1.f);
|
||||
MemoryCopyArray(inst->corner_radii, box->corner_radii);
|
||||
}
|
||||
else D_Tex2DSampleKindScope(draw_data->sample_kind)
|
||||
{
|
||||
R_Rect2DInst *inst = d_img(box->rect, draw_data->region, draw_data->texture, draw_data->tint, 0, 0, 0);
|
||||
MemoryCopyArray(inst->corner_radii, box->corner_radii);
|
||||
}
|
||||
if(draw_data->blur > 0.01f)
|
||||
{
|
||||
Rng2F32 clip = box->rect;
|
||||
for(UI_Box *b = box->parent; !ui_box_is_nil(b); b = b->parent)
|
||||
{
|
||||
if(b->flags & UI_BoxFlag_Clip)
|
||||
{
|
||||
clip = intersect_2f32(b->rect, clip);
|
||||
}
|
||||
}
|
||||
R_PassParams_Blur *blur = d_blur(intersect_2f32(clip, box->rect), draw_data->blur, 0);
|
||||
MemoryCopyArray(blur->corner_radii, box->corner_radii);
|
||||
}
|
||||
}
|
||||
|
||||
internal UI_Signal
|
||||
ui_image(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, String8 string)
|
||||
{
|
||||
UI_Box *box = ui_build_box_from_string(0, string);
|
||||
UI_ImageDrawData *draw_data = push_array(ui_build_arena(), UI_ImageDrawData, 1);
|
||||
draw_data->texture = texture;
|
||||
draw_data->sample_kind = sample_kind;
|
||||
draw_data->region = region;
|
||||
draw_data->tint = tint;
|
||||
draw_data->blur = blur;
|
||||
ui_box_equip_custom_draw(box, ui_image_draw, draw_data);
|
||||
UI_Signal sig = ui_signal_from_box(box);
|
||||
return sig;
|
||||
}
|
||||
|
||||
internal UI_Signal
|
||||
ui_imagef(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, char *fmt, ...)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
va_end(args);
|
||||
UI_Signal result = ui_image(texture, sample_kind, region, tint, blur, string);
|
||||
scratch_end(scratch);
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Special Buttons
|
||||
|
||||
|
||||
@@ -80,6 +80,12 @@ internal UI_Signal ui_hover_labelf(char *fmt, ...);
|
||||
internal UI_Signal ui_line_edit(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, String8 pre_edit_value, String8 string);
|
||||
internal UI_Signal ui_line_editf(TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, String8 pre_edit_value, char *fmt, ...);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Images
|
||||
|
||||
internal UI_Signal ui_image(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, String8 string);
|
||||
internal UI_Signal ui_imagef(R_Handle texture, R_Tex2DSampleKind sample_kind, Rng2F32 region, Vec4F32 tint, F32 blur, char *fmt, ...);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Special Buttons
|
||||
|
||||
|
||||
+57
-7
@@ -527,6 +527,12 @@ ui_dt(void)
|
||||
|
||||
//- rjf: drag data
|
||||
|
||||
internal Vec2F32
|
||||
ui_drag_start_mouse(void)
|
||||
{
|
||||
return ui_state->drag_start_mouse;
|
||||
}
|
||||
|
||||
internal Vec2F32
|
||||
ui_drag_delta(void)
|
||||
{
|
||||
@@ -596,6 +602,12 @@ ui_active_key(UI_MouseButtonKind button_kind)
|
||||
return ui_state->active_box_key[button_kind];
|
||||
}
|
||||
|
||||
internal UI_Key
|
||||
ui_drop_hot_key(void)
|
||||
{
|
||||
return ui_state->drop_hot_box_key;
|
||||
}
|
||||
|
||||
//- rjf: controls over interaction
|
||||
|
||||
internal void
|
||||
@@ -934,7 +946,7 @@ ui_begin_build(OS_EventList *events, OS_Handle window, UI_NavActionList *nav_act
|
||||
}
|
||||
|
||||
//- rjf: setup parent box for tooltip
|
||||
UI_FixedX(ui_state->mouse.x+15.f) UI_FixedY(ui_state->mouse.y) UI_PrefWidth(ui_children_sum(1.f)) UI_PrefHeight(ui_children_sum(1.f))
|
||||
UI_FixedX(ui_state->mouse.x+15.f) UI_FixedY(ui_state->mouse.y+15.f) UI_PrefWidth(ui_children_sum(1.f)) UI_PrefHeight(ui_children_sum(1.f))
|
||||
{
|
||||
ui_set_next_child_layout_axis(Axis2_Y);
|
||||
ui_state->tooltip_root = ui_build_box_from_stringf(0, "###tooltip_%I64x", window.u64[0]);
|
||||
@@ -976,6 +988,11 @@ ui_begin_build(OS_EventList *events, OS_Handle window, UI_NavActionList *nav_act
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: reset drop-hot key
|
||||
{
|
||||
ui_state->drop_hot_box_key = ui_key_zero();
|
||||
}
|
||||
|
||||
//- rjf: reset active if our active box is disabled
|
||||
for(EachEnumVal(UI_MouseButtonKind, k))
|
||||
{
|
||||
@@ -1084,17 +1101,20 @@ ui_end_build(void)
|
||||
|
||||
//- rjf: ensure special floating roots are within screen bounds
|
||||
UI_Box *floating_roots[] = {ui_state->tooltip_root, ui_state->ctx_menu_root};
|
||||
B32 force_contain[] = {0, 1};
|
||||
for(U64 idx = 0; idx < ArrayCount(floating_roots); idx += 1)
|
||||
{
|
||||
UI_Box *root = floating_roots[idx];
|
||||
if(!ui_box_is_nil(root))
|
||||
{
|
||||
Rng2F32 window_rect = os_client_rect_from_window(ui_window());
|
||||
Vec2F32 window_dim = dim_2f32(window_rect);
|
||||
Rng2F32 root_rect = root->rect;
|
||||
Vec2F32 root_rect_dim = dim_2f32(root_rect);
|
||||
Vec2F32 shift =
|
||||
{
|
||||
-ClampBot(0, root_rect.x1 - window_rect.x1),
|
||||
-ClampBot(0, root_rect.y1 - window_rect.y1),
|
||||
-ClampBot(0, root_rect.x1 - window_rect.x1) * (root_rect_dim.x < root->font_size*15.f || force_contain[idx]),
|
||||
-ClampBot(0, root_rect.y1 - window_rect.y1) * (root_rect_dim.y < root->font_size*15.f || force_contain[idx]),
|
||||
};
|
||||
Rng2F32 new_root_rect = shift_2f32(root_rect, shift);
|
||||
root->fixed_position = new_root_rect.p0;
|
||||
@@ -1711,7 +1731,6 @@ internal void
|
||||
ui_tooltip_end_base(void)
|
||||
{
|
||||
ui_pop_flags();
|
||||
ui_pop_transparency();
|
||||
ui_pop_parent();
|
||||
ui_pop_parent();
|
||||
}
|
||||
@@ -2283,7 +2302,7 @@ ui_box_text_position(UI_Box *box)
|
||||
case UI_TextAlign_Center:
|
||||
{
|
||||
Vec2F32 advance = box->display_string_runs.dim;
|
||||
result.x = (box->rect.p0.x + box->rect.p1.x)/2 - advance.x/2;
|
||||
result.x = floor_f32((box->rect.p0.x + box->rect.p1.x)/2 - advance.x/2 - 1.f);
|
||||
result.x = ClampBot(result.x, box->rect.x0);
|
||||
}break;
|
||||
case UI_TextAlign_Right:
|
||||
@@ -2519,8 +2538,13 @@ ui_signal_from_box(UI_Box *box)
|
||||
{
|
||||
Swap(F32, delta.x, delta.y);
|
||||
}
|
||||
sig.scroll.x += (S16)(delta.x/30.f);
|
||||
sig.scroll.y += (S16)(delta.y/30.f);
|
||||
Vec2S16 delta16 = v2s16((S16)(delta.x/30.f), (S16)(delta.y/30.f));
|
||||
if(delta.x > 0 && delta16.x == 0) { delta16.x = +1; }
|
||||
if(delta.x < 0 && delta16.x == 0) { delta16.x = -1; }
|
||||
if(delta.y > 0 && delta16.y == 0) { delta16.y = +1; }
|
||||
if(delta.y < 0 && delta16.y == 0) { delta16.y = -1; }
|
||||
sig.scroll.x += delta16.x;
|
||||
sig.scroll.y += delta16.y;
|
||||
taken = 1;
|
||||
}
|
||||
|
||||
@@ -2712,6 +2736,32 @@ ui_signal_from_box(UI_Box *box)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: mouse is over this box's rect, drop site, no other drop hot key? -> set drop hot key
|
||||
//
|
||||
{
|
||||
if(box->flags & UI_BoxFlag_DropSite &&
|
||||
contains_2f32(rect, ui_state->mouse) &&
|
||||
!contains_2f32(blacklist_rect, ui_state->mouse) &&
|
||||
(ui_key_match(ui_state->drop_hot_box_key, ui_key_zero()) || ui_key_match(ui_state->drop_hot_box_key, box->key)))
|
||||
{
|
||||
ui_state->drop_hot_box_key = box->key;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: mouse is not over this box's rect, but this is the drop hot key? -> zero drop hot key
|
||||
//
|
||||
{
|
||||
if(box->flags & UI_BoxFlag_DropSite &&
|
||||
(!contains_2f32(rect, ui_state->mouse) ||
|
||||
contains_2f32(blacklist_rect, ui_state->mouse)) &&
|
||||
ui_key_match(ui_state->drop_hot_box_key, box->key))
|
||||
{
|
||||
ui_state->drop_hot_box_key = ui_key_zero();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: clicking on something outside the context menu kills the context menu
|
||||
//
|
||||
|
||||
+51
-47
@@ -198,57 +198,58 @@ typedef U64 UI_BoxFlags;
|
||||
//- rjf: interaction
|
||||
# define UI_BoxFlag_MouseClickable (UI_BoxFlags)(1ull<<0)
|
||||
# define UI_BoxFlag_KeyboardClickable (UI_BoxFlags)(1ull<<1)
|
||||
# define UI_BoxFlag_ClickToFocus (UI_BoxFlags)(1ull<<2)
|
||||
# define UI_BoxFlag_Scroll (UI_BoxFlags)(1ull<<3)
|
||||
# define UI_BoxFlag_ViewScrollX (UI_BoxFlags)(1ull<<4)
|
||||
# define UI_BoxFlag_ViewScrollY (UI_BoxFlags)(1ull<<5)
|
||||
# define UI_BoxFlag_ViewClampX (UI_BoxFlags)(1ull<<6)
|
||||
# define UI_BoxFlag_ViewClampY (UI_BoxFlags)(1ull<<7)
|
||||
# define UI_BoxFlag_FocusHot (UI_BoxFlags)(1ull<<8)
|
||||
# define UI_BoxFlag_FocusActive (UI_BoxFlags)(1ull<<9)
|
||||
# define UI_BoxFlag_FocusHotDisabled (UI_BoxFlags)(1ull<<10)
|
||||
# define UI_BoxFlag_FocusActiveDisabled (UI_BoxFlags)(1ull<<11)
|
||||
# define UI_BoxFlag_DefaultFocusNavX (UI_BoxFlags)(1ull<<12)
|
||||
# define UI_BoxFlag_DefaultFocusNavY (UI_BoxFlags)(1ull<<13)
|
||||
# define UI_BoxFlag_DefaultFocusEdit (UI_BoxFlags)(1ull<<14)
|
||||
# define UI_BoxFlag_FocusNavSkip (UI_BoxFlags)(1ull<<15)
|
||||
# define UI_BoxFlag_Disabled (UI_BoxFlags)(1ull<<16)
|
||||
# define UI_BoxFlag_DropSite (UI_BoxFlags)(1ull<<2)
|
||||
# define UI_BoxFlag_ClickToFocus (UI_BoxFlags)(1ull<<3)
|
||||
# define UI_BoxFlag_Scroll (UI_BoxFlags)(1ull<<4)
|
||||
# define UI_BoxFlag_ViewScrollX (UI_BoxFlags)(1ull<<5)
|
||||
# define UI_BoxFlag_ViewScrollY (UI_BoxFlags)(1ull<<6)
|
||||
# define UI_BoxFlag_ViewClampX (UI_BoxFlags)(1ull<<7)
|
||||
# define UI_BoxFlag_ViewClampY (UI_BoxFlags)(1ull<<8)
|
||||
# define UI_BoxFlag_FocusHot (UI_BoxFlags)(1ull<<9)
|
||||
# define UI_BoxFlag_FocusActive (UI_BoxFlags)(1ull<<10)
|
||||
# define UI_BoxFlag_FocusHotDisabled (UI_BoxFlags)(1ull<<11)
|
||||
# define UI_BoxFlag_FocusActiveDisabled (UI_BoxFlags)(1ull<<12)
|
||||
# define UI_BoxFlag_DefaultFocusNavX (UI_BoxFlags)(1ull<<13)
|
||||
# define UI_BoxFlag_DefaultFocusNavY (UI_BoxFlags)(1ull<<14)
|
||||
# define UI_BoxFlag_DefaultFocusEdit (UI_BoxFlags)(1ull<<15)
|
||||
# define UI_BoxFlag_FocusNavSkip (UI_BoxFlags)(1ull<<16)
|
||||
# define UI_BoxFlag_Disabled (UI_BoxFlags)(1ull<<17)
|
||||
|
||||
//- rjf: layout
|
||||
# define UI_BoxFlag_FloatingX (UI_BoxFlags)(1ull<<17)
|
||||
# define UI_BoxFlag_FloatingY (UI_BoxFlags)(1ull<<18)
|
||||
# define UI_BoxFlag_FixedWidth (UI_BoxFlags)(1ull<<19)
|
||||
# define UI_BoxFlag_FixedHeight (UI_BoxFlags)(1ull<<20)
|
||||
# define UI_BoxFlag_AllowOverflowX (UI_BoxFlags)(1ull<<21)
|
||||
# define UI_BoxFlag_AllowOverflowY (UI_BoxFlags)(1ull<<22)
|
||||
# define UI_BoxFlag_SkipViewOffX (UI_BoxFlags)(1ull<<23)
|
||||
# define UI_BoxFlag_SkipViewOffY (UI_BoxFlags)(1ull<<24)
|
||||
# define UI_BoxFlag_FloatingX (UI_BoxFlags)(1ull<<18)
|
||||
# define UI_BoxFlag_FloatingY (UI_BoxFlags)(1ull<<19)
|
||||
# define UI_BoxFlag_FixedWidth (UI_BoxFlags)(1ull<<20)
|
||||
# define UI_BoxFlag_FixedHeight (UI_BoxFlags)(1ull<<21)
|
||||
# define UI_BoxFlag_AllowOverflowX (UI_BoxFlags)(1ull<<22)
|
||||
# define UI_BoxFlag_AllowOverflowY (UI_BoxFlags)(1ull<<23)
|
||||
# define UI_BoxFlag_SkipViewOffX (UI_BoxFlags)(1ull<<24)
|
||||
# define UI_BoxFlag_SkipViewOffY (UI_BoxFlags)(1ull<<25)
|
||||
|
||||
//- rjf: appearance / animation
|
||||
# define UI_BoxFlag_DrawDropShadow (UI_BoxFlags)(1ull<<25)
|
||||
# define UI_BoxFlag_DrawBackgroundBlur (UI_BoxFlags)(1ull<<26)
|
||||
# define UI_BoxFlag_DrawBackground (UI_BoxFlags)(1ull<<27)
|
||||
# define UI_BoxFlag_DrawBorder (UI_BoxFlags)(1ull<<28)
|
||||
# define UI_BoxFlag_DrawSideTop (UI_BoxFlags)(1ull<<29)
|
||||
# define UI_BoxFlag_DrawSideBottom (UI_BoxFlags)(1ull<<30)
|
||||
# define UI_BoxFlag_DrawSideLeft (UI_BoxFlags)(1ull<<31)
|
||||
# define UI_BoxFlag_DrawSideRight (UI_BoxFlags)(1ull<<32)
|
||||
# define UI_BoxFlag_DrawText (UI_BoxFlags)(1ull<<33)
|
||||
# define UI_BoxFlag_DrawTextFastpathCodepoint (UI_BoxFlags)(1ull<<34)
|
||||
# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<35)
|
||||
# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<36)
|
||||
# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<37)
|
||||
# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<38)
|
||||
# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<39)
|
||||
# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<40)
|
||||
# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<41)
|
||||
# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<42)
|
||||
# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<43)
|
||||
# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<44)
|
||||
# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<45)
|
||||
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<46)
|
||||
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<47)
|
||||
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<48)
|
||||
# define UI_BoxFlag_DrawDropShadow (UI_BoxFlags)(1ull<<26)
|
||||
# define UI_BoxFlag_DrawBackgroundBlur (UI_BoxFlags)(1ull<<27)
|
||||
# define UI_BoxFlag_DrawBackground (UI_BoxFlags)(1ull<<28)
|
||||
# define UI_BoxFlag_DrawBorder (UI_BoxFlags)(1ull<<29)
|
||||
# define UI_BoxFlag_DrawSideTop (UI_BoxFlags)(1ull<<30)
|
||||
# define UI_BoxFlag_DrawSideBottom (UI_BoxFlags)(1ull<<31)
|
||||
# define UI_BoxFlag_DrawSideLeft (UI_BoxFlags)(1ull<<32)
|
||||
# define UI_BoxFlag_DrawSideRight (UI_BoxFlags)(1ull<<33)
|
||||
# define UI_BoxFlag_DrawText (UI_BoxFlags)(1ull<<34)
|
||||
# define UI_BoxFlag_DrawTextFastpathCodepoint (UI_BoxFlags)(1ull<<35)
|
||||
# define UI_BoxFlag_DrawHotEffects (UI_BoxFlags)(1ull<<36)
|
||||
# define UI_BoxFlag_DrawActiveEffects (UI_BoxFlags)(1ull<<37)
|
||||
# define UI_BoxFlag_DrawOverlay (UI_BoxFlags)(1ull<<38)
|
||||
# define UI_BoxFlag_DrawBucket (UI_BoxFlags)(1ull<<39)
|
||||
# define UI_BoxFlag_Clip (UI_BoxFlags)(1ull<<40)
|
||||
# define UI_BoxFlag_AnimatePosX (UI_BoxFlags)(1ull<<41)
|
||||
# define UI_BoxFlag_AnimatePosY (UI_BoxFlags)(1ull<<42)
|
||||
# define UI_BoxFlag_DisableTextTrunc (UI_BoxFlags)(1ull<<43)
|
||||
# define UI_BoxFlag_DisableIDString (UI_BoxFlags)(1ull<<44)
|
||||
# define UI_BoxFlag_DisableFocusViz (UI_BoxFlags)(1ull<<45)
|
||||
# define UI_BoxFlag_RequireFocusBackground (UI_BoxFlags)(1ull<<46)
|
||||
# define UI_BoxFlag_HasDisplayString (UI_BoxFlags)(1ull<<47)
|
||||
# define UI_BoxFlag_HasFuzzyMatchRanges (UI_BoxFlags)(1ull<<48)
|
||||
# define UI_BoxFlag_RoundChildrenByParent (UI_BoxFlags)(1ull<<49)
|
||||
|
||||
//- rjf: bundles
|
||||
# define UI_BoxFlag_Clickable (UI_BoxFlag_MouseClickable|UI_BoxFlag_KeyboardClickable)
|
||||
@@ -493,6 +494,7 @@ struct UI_State
|
||||
//- rjf: user interaction state
|
||||
UI_Key hot_box_key;
|
||||
UI_Key active_box_key[UI_MouseButtonKind_COUNT];
|
||||
UI_Key drop_hot_box_key;
|
||||
UI_Key clipboard_copy_key;
|
||||
U64 press_timestamp_history_us[UI_MouseButtonKind_COUNT][3];
|
||||
UI_Key press_key_history[UI_MouseButtonKind_COUNT][3];
|
||||
@@ -617,6 +619,7 @@ internal String8 ui_icon_string_from_kind(UI_IconKind icon_kind);
|
||||
internal F32 ui_dt(void);
|
||||
|
||||
//- rjf: drag data
|
||||
internal Vec2F32 ui_drag_start_mouse(void);
|
||||
internal Vec2F32 ui_drag_delta(void);
|
||||
internal void ui_store_drag_data(String8 string);
|
||||
internal String8 ui_get_drag_data(U64 min_required_size);
|
||||
@@ -630,6 +633,7 @@ internal D_FancyRunList ui_string_hover_runs(Arena *arena);
|
||||
//- rjf: interaction keys
|
||||
internal UI_Key ui_hot_key(void);
|
||||
internal UI_Key ui_active_key(UI_MouseButtonKind button_kind);
|
||||
internal UI_Key ui_drop_hot_key(void);
|
||||
|
||||
//- rjf: controls over interaction
|
||||
internal void ui_kill_action(void);
|
||||
|
||||
Reference in New Issue
Block a user