diff --git a/build.sh b/build.sh index f5559620..07163698 100644 --- a/build.sh +++ b/build.sh @@ -63,7 +63,7 @@ fi # --- Build Everything (@build_targets) --------------------------------------- cd build -if [ -v raddbg ]; then didbuild=1 && $compile ../src/raddbg/raddbg_main.c $compile_link $link_os_gfx $out raddbg; fi +if [ -v raddbg ]; then didbuild=1 && $compile ../src/raddbg/raddbg_main.c $compile_link $link_os_gfx $link_render $out raddbg; fi if [ -v radlink ]; then didbuild=1 && $compile ../src/linker/lnk.c $compile_link $out radlink; fi if [ -v rdi_from_pdb ]; then didbuild=1 && $compile ../src/rdi_from_pdb/rdi_from_pdb_main.c $compile_link $out rdi_from_pdb; fi if [ -v rdi_from_dwarf ]; then didbuild=1 && $compile ../src/rdi_from_dwarf/rdi_from_dwarf.c $compile_link $out rdi_from_dwarf; fi diff --git a/project.4coder b/project.4coder index bc86d180..275657ca 100644 --- a/project.4coder +++ b/project.4coder @@ -55,12 +55,12 @@ commands = // .f1 = { .win = "raddbg_stable --ipc kill_all && build no_meta tester", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, //- rjf: [ryan_scratch] - .f1 = { .win = "raddbg_stable --ipc kill_all && wsl ./build.sh ryan_scratch", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, + .f1 = { .win = "raddbg_stable --ipc kill_all && wsl ./build.sh raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, //- rjf: running target // .f3 = { .win = "raddbg_stable --ipc run", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, // .f3 = { .win = "C:/devel/raddebugger/build/raddbg.exe --capture --user:C:/devel/raddebugger/build/local_dev.raddbg_user --project:C:/devel/raddebugger/build/local_dev.raddbg_project", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, - .f3 = { .win = "wsl_launch /mnt/c/devel/raddebugger/build/ryan_scratch", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, + .f3 = { .win = "wsl_launch /mnt/c/devel/raddebugger/build/raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, //- rjf: local target builds .build_raddbg = { .win = "build raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, }, diff --git a/src/base/base_log.h b/src/base/base_log.h index 3687390e..ba181ce2 100644 --- a/src/base/base_log.h +++ b/src/base/base_log.h @@ -49,12 +49,12 @@ internal void log_select(Log *log); internal void log_msg(LogMsgKind kind, String8 string); internal void log_msgf(LogMsgKind kind, char *fmt, ...); #define log_info(s) log_msg(LogMsgKind_Info, (s)) -#define log_infof(fmt, ...) log_msgf(LogMsgKind_Info, (fmt), __VA_ARGS__) +#define log_infof(...) log_msgf(LogMsgKind_Info, __VA_ARGS__) #define log_user_error(s) log_msg(LogMsgKind_UserError, (s)) -#define log_user_errorf(fmt, ...) log_msgf(LogMsgKind_UserError, (fmt), __VA_ARGS__) +#define log_user_errorf(...) log_msgf(LogMsgKind_UserError, __VA_ARGS__) #define LogInfoNamedBlock(s) DeferLoop(log_infof("%S:\n{\n", (s)), log_infof("}\n")) -#define LogInfoNamedBlockF(fmt, ...) DeferLoop((log_infof(fmt, __VA_ARGS__), log_infof(":\n{\n")), log_infof("}\n")) +#define LogInfoNamedBlockF(...) DeferLoop((log_infof(__VA_ARGS__), log_infof(":\n{\n")), log_infof("}\n")) //////////////////////////////// //~ rjf: Log Scopes diff --git a/src/ctrl/ctrl_core.c b/src/ctrl/ctrl_core.c index 1b9a4c48..b3d477d1 100644 --- a/src/ctrl/ctrl_core.c +++ b/src/ctrl/ctrl_core.c @@ -3928,7 +3928,7 @@ ctrl_thread__module_open(CTRL_Handle process, CTRL_Handle module, Rng1U64 vaddr_ dmn_process_read(process.dmn_handle, r1u64(vaddr_range.min + sec_array_off, vaddr_range.min + sec_array_off + sec_count*sizeof(COFF_SectionHeader)), sec); for EachIndex(idx, sec_count) { - String8 section_name = str8_cstring(sec[idx].name); + String8 section_name = str8_cstring((char *)sec[idx].name); if(str8_match(section_name, str8_lit(".raddbg"), 0)) { raddbg_section_voff_range.min = sec[idx].voff; diff --git a/src/demon/linux/demon_core_linux.c b/src/demon/linux/demon_core_linux.c index 861c21d3..ffa705af 100644 --- a/src/demon/linux/demon_core_linux.c +++ b/src/demon/linux/demon_core_linux.c @@ -15,6 +15,8 @@ dmn_init(void) internal DMN_CtrlCtx * dmn_ctrl_begin(void) { + DMN_CtrlCtx *ctx = (DMN_CtrlCtx *)1; + return ctx; } internal void @@ -30,26 +32,32 @@ dmn_ctrl_exclusive_access_end(void) internal U32 dmn_ctrl_launch(DMN_CtrlCtx *ctx, OS_ProcessLaunchParams *params) { + return 0; } internal B32 dmn_ctrl_attach(DMN_CtrlCtx *ctx, U32 pid) { + return 0; } internal B32 dmn_ctrl_kill(DMN_CtrlCtx *ctx, DMN_Handle process, U32 exit_code) { + return 0; } internal B32 dmn_ctrl_detach(DMN_CtrlCtx *ctx, DMN_Handle process) { + return 0; } internal DMN_EventList dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls) { + DMN_EventList evts = {0}; + return evts; } //////////////////////////////// @@ -68,16 +76,19 @@ dmn_halt(U64 code, U64 user_data) internal U64 dmn_run_gen(void) { + return 0; } internal U64 dmn_mem_gen(void) { + return 0; } internal U64 dmn_reg_gen(void) { + return 0; } //- rjf: non-blocking-control-thread access barriers @@ -85,6 +96,7 @@ dmn_reg_gen(void) internal B32 dmn_access_open(void) { + return 0; } internal void @@ -97,6 +109,7 @@ dmn_access_close(void) internal U64 dmn_process_memory_reserve(DMN_Handle process, U64 vaddr, U64 size) { + return 0; } internal void @@ -122,11 +135,13 @@ dmn_process_memory_protect(DMN_Handle process, U64 vaddr, U64 size, OS_AccessFla internal U64 dmn_process_read(DMN_Handle process, Rng1U64 range, void *dst) { + return 0; } internal B32 dmn_process_write(DMN_Handle process, Rng1U64 range, void *src) { + return 0; } //- rjf: threads @@ -134,26 +149,31 @@ dmn_process_write(DMN_Handle process, Rng1U64 range, void *src) internal Arch dmn_arch_from_thread(DMN_Handle handle) { + return Arch_Null; } internal U64 dmn_stack_base_vaddr_from_thread(DMN_Handle handle) { + return 0; } internal U64 dmn_tls_root_vaddr_from_thread(DMN_Handle handle) { + return 0; } internal B32 dmn_thread_read_reg_block(DMN_Handle handle, void *reg_block) { + return 0; } internal B32 dmn_thread_write_reg_block(DMN_Handle handle, void *reg_block) { + return 0; } //- rjf: system process listing @@ -166,6 +186,7 @@ dmn_process_iter_begin(DMN_ProcessIter *iter) internal B32 dmn_process_iter_next(Arena *arena, DMN_ProcessIter *iter, DMN_ProcessInfo *info_out) { + return 0; } internal void diff --git a/src/font_provider/font_provider_inc.c b/src/font_provider/font_provider_inc.c index d5c7665b..c589b27a 100644 --- a/src/font_provider/font_provider_inc.c +++ b/src/font_provider/font_provider_inc.c @@ -5,6 +5,8 @@ #if FP_BACKEND == FP_BACKEND_DWRITE # include "dwrite/font_provider_dwrite.c" +#elif FP_BACKEND == FP_BACKEND_FREETYPE +# include "freetype/font_provider_freetype.c" #else # error Font provider backend not specified. #endif diff --git a/src/font_provider/freetype/font_provider_freetype.c b/src/font_provider/freetype/font_provider_freetype.c index 8ac6bce5..a09a5148 100644 --- a/src/font_provider/freetype/font_provider_freetype.c +++ b/src/font_provider/freetype/font_provider_freetype.c @@ -1,2 +1,44 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) + +//////////////////////////////// +//~ rjf: Backend Implementations + +fp_hook void +fp_init(void) +{ + +} + +fp_hook FP_Handle +fp_font_open(String8 path) +{ + FP_Handle f = {0}; + return f; +} + +fp_hook FP_Handle +fp_font_open_from_static_data_string(String8 *data_ptr) +{ + FP_Handle f = {0}; + return f; +} + +fp_hook void +fp_font_close(FP_Handle handle) +{ +} + +fp_hook FP_Metrics +fp_metrics_from_font(FP_Handle font) +{ + FP_Metrics m = {0}; + return m; +} + +fp_hook NO_ASAN FP_RasterResult +fp_raster(Arena *arena, FP_Handle font, F32 size, FP_RasterFlags flags, String8 string) +{ + FP_RasterResult r = {0}; + return r; +} diff --git a/src/os/gfx/linux/os_gfx_linux.c b/src/os/gfx/linux/os_gfx_linux.c index 189a7ad8..aae73b6b 100644 --- a/src/os/gfx/linux/os_gfx_linux.c +++ b/src/os/gfx/linux/os_gfx_linux.c @@ -277,7 +277,7 @@ os_client_rect_from_window(OS_Handle handle) OS_LNX_Window *w = (OS_LNX_Window *)handle.u64[0]; XWindowAttributes atts = {0}; Status s = XGetWindowAttributes(os_lnx_gfx_state->display, w->window, &atts); - Rng2F32 result = r2f32p((F32)atts.x, (F32)atts.y, (F32)atts.x + (F32)atts.width, (F32)atts.y + (F32)atts.height); + Rng2F32 result = r2f32p(0, 0, (F32)atts.width, (F32)atts.height); return result; } diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index 736f3212..8de188d8 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -2243,13 +2243,13 @@ rd_commit_eval_value_string(E_Eval dst_eval, String8 string) // new value string as textual data if(!got_commit_data && ((type_kind == E_TypeKind_Ptr || type_kind == E_TypeKind_Array) && - direct_type_kind == E_TypeKind_Char8 || - direct_type_kind == E_TypeKind_Char16 || - direct_type_kind == E_TypeKind_Char32 || - direct_type_kind == E_TypeKind_UChar8 || - direct_type_kind == E_TypeKind_UChar16 || - direct_type_kind == E_TypeKind_UChar32 || - e_type_kind_is_integer(direct_type_kind))) + (direct_type_kind == E_TypeKind_Char8 || + direct_type_kind == E_TypeKind_Char16 || + direct_type_kind == E_TypeKind_Char32 || + direct_type_kind == E_TypeKind_UChar8 || + direct_type_kind == E_TypeKind_UChar16 || + direct_type_kind == E_TypeKind_UChar32 || + e_type_kind_is_integer(direct_type_kind)))) { got_commit_data = 1; B32 is_quoted = 0; diff --git a/src/scratch/ryan_scratch.c b/src/scratch/ryan_scratch.c index f84f5b24..48b3a3fc 100644 --- a/src/scratch/ryan_scratch.c +++ b/src/scratch/ryan_scratch.c @@ -14,11 +14,17 @@ #include "base/base_inc.h" #include "os/os_inc.h" #include "render/render_inc.h" +#include "font_provider/font_provider_inc.h" +#include "font_cache/font_cache.h" +#include "draw/draw.h" //- rjf: [c] #include "base/base_inc.c" #include "os/os_inc.c" #include "render/render_inc.c" +#include "font_provider/font_provider_inc.c" +#include "font_cache/font_cache.c" +#include "draw/draw.c" //////////////////////////////// //~ rjf: Globals