mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-08 23:08:08 +00:00
run-to-name, use to 'seed' test binary cases'
This commit is contained in:
@@ -140,7 +140,7 @@ popd
|
||||
:: --- Build Everything (@build_targets) --------------------------------------
|
||||
pushd build
|
||||
if "%raddbg%"=="1" set didbuild=1 && %compile% ..\src\raddbg\raddbg_main.c %compile_link% %link_icon% %out%raddbg.exe || exit /b 1
|
||||
if "%raddbg_non_graphical%"=="1" set didbuild=1 && %compile% -DWM_STUB=1 -DWM_STUB_DEFAULT_REFRESH_RATE=60.f -DR_BACKEND=R_BACKEND_STUB ..\src\raddbg\raddbg_main.c %compile_link% %link_icon% %out%raddbg_non_graphical.exe || exit /b 1
|
||||
if "%raddbg_non_graphical%"=="1" set didbuild=1 && %compile% -DWM_STUB=1 -DR_BACKEND=R_BACKEND_STUB ..\src\raddbg\raddbg_main.c %compile_link% %link_icon% %out%raddbg_non_graphical.exe || exit /b 1
|
||||
if "%radlink%"=="1" set didbuild=1 && %compile% ..\src\linker\lnk.c %compile_link% %linker% /NOIMPLIB %linker% /NATVIS:"%~dp0\src\linker\linker.natvis" %out%radlink.exe || exit /b 1
|
||||
if "%radbin%"=="1" set didbuild=1 && %compile% ..\src\radbin\radbin_main.c %compile_link% %out%radbin.exe || exit /b 1
|
||||
if "%raddump%"=="1" set didbuild=1 && %compile% ..\src\raddump\raddump_main.c %compile_link% %out%raddump.exe || exit /b 1
|
||||
|
||||
@@ -1475,6 +1475,21 @@ str8_from_version(Arena *arena, U64 version)
|
||||
////////////////////////////////
|
||||
//~ rjf: String Path Helpers
|
||||
|
||||
internal String8
|
||||
default_exe_name_suffix_from_os(OperatingSystem os)
|
||||
{
|
||||
String8 result = {0};
|
||||
switch(os)
|
||||
{
|
||||
default:{}break;
|
||||
case OperatingSystem_Windows:
|
||||
{
|
||||
result = s(".exe");
|
||||
}break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal String8
|
||||
program_data_folder_prefix_from_os(OperatingSystem os)
|
||||
{
|
||||
|
||||
@@ -323,6 +323,7 @@ g_path_style_map[] =
|
||||
{ str8_lit_comp("system"), PathStyle_SystemAbsolute },
|
||||
};
|
||||
|
||||
internal String8 default_exe_name_suffix_from_os(OperatingSystem os);
|
||||
internal String8 program_data_folder_prefix_from_os(OperatingSystem os);
|
||||
internal String8 program_ext_postfix_from_os(OperatingSystem os);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
TEST(str8_list_substr)
|
||||
Test(str8_list_substr)
|
||||
{
|
||||
String8List zero_list = {0};
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ D_CmdTable: // | | | |
|
||||
|
||||
//- rjf: high-level composite target control operations
|
||||
{RunToLine 1 1 1 0 "" Null null Nil Null 0 0 0 0 0 0 0 Play "run_to_line" "Run To Line" "Runs until a particular source line is hit." "" "$text_pt," }
|
||||
{RunToName 1 1 1 0 "query:procedures" String null Nil Null 0 0 0 0 0 1 1 Play "run_to_name" "Run To Name" "Runs until a particular symbol name is hit." "" "" }
|
||||
{Run 1 1 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 Play "run" "Run" "Runs all targets after starting them if they have not been started yet." "play" "" }
|
||||
{Restart 1 1 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 Redo "restart" "Restart" "Kills all attached processes, then launches all active targets." "restart,retry" "" }
|
||||
{StepInto 1 1 0 0 "" Null null Nil Null 0 0 0 0 0 0 0 StepInto "step_into" "Step Into" "Steps once, possibly into function calls, for either source lines or instructions (whichever is selected)." "" "" }
|
||||
|
||||
@@ -4830,9 +4830,13 @@ d_ctrl_thread__eval_scope_begin(Arena *arena, D_BreakpointList *user_bps, D_Enti
|
||||
U64 eval_modules_count = Max(1, entity_ctx->entity_kind_counts[D_EntityKind_Module]);
|
||||
E_Module *eval_modules = push_array(arena, E_Module, eval_modules_count);
|
||||
E_Module *eval_modules_primary = &e_module_nil;
|
||||
E_String2NumMap *eval_module_from_name_map = push_array(arena, E_String2NumMap, 1);
|
||||
eval_module_from_name_map[0] = e_string2num_map_make(arena, eval_modules_count*2);
|
||||
U64 eval_dbg_infos_count = Max(1, entity_ctx->entity_kind_counts[D_EntityKind_Module]);
|
||||
E_DbgInfo *eval_dbg_infos = push_array(arena, E_DbgInfo, eval_dbg_infos_count);
|
||||
E_DbgInfo *eval_dbg_infos_primary = &e_dbg_info_nil;
|
||||
E_String2NumMap *eval_dbg_info_from_name_map = push_array(arena, E_String2NumMap, 1);
|
||||
eval_dbg_info_from_name_map[0] = e_string2num_map_make(arena, eval_dbg_infos_count*2);
|
||||
{
|
||||
U64 eval_module_idx = 0;
|
||||
U64 eval_dbg_info_idx = 0;
|
||||
@@ -4946,12 +4950,16 @@ d_ctrl_thread__eval_scope_begin(Arena *arena, D_BreakpointList *user_bps, D_Enti
|
||||
}
|
||||
|
||||
//- rjf: fill debug info
|
||||
String8 debug_info_path = d_entity_child_from_kind(mod, D_EntityKind_DebugInfoPath)->string;
|
||||
eval_dbg_infos[eval_dbg_info_idx].dbgi_key = dbgi_key;
|
||||
eval_dbg_infos[eval_dbg_info_idx].rdi = rdi;
|
||||
eval_dbg_infos[eval_dbg_info_idx].name = debug_info_path;
|
||||
if(mod == module)
|
||||
{
|
||||
eval_dbg_infos_primary = &eval_dbg_infos[eval_dbg_info_idx];
|
||||
}
|
||||
e_string2num_map_insert(arena, eval_dbg_info_from_name_map, debug_info_path, eval_dbg_info_idx+1);
|
||||
e_string2num_map_insert(arena, eval_dbg_info_from_name_map, str8_skip_last_slash(debug_info_path), eval_dbg_info_idx+1);
|
||||
eval_dbg_info_idx += 1;
|
||||
|
||||
//- rjf: fill evaluation module info
|
||||
@@ -4960,10 +4968,13 @@ d_ctrl_thread__eval_scope_begin(Arena *arena, D_BreakpointList *user_bps, D_Enti
|
||||
eval_modules[eval_module_idx].vaddr_range = mod->vaddr_range;
|
||||
eval_modules[eval_module_idx].space = e_space_make(D_EvalSpaceKind_Entity);
|
||||
eval_modules[eval_module_idx].space.u64_0 = (U64)process;
|
||||
eval_modules[eval_module_idx].name = mod->string;
|
||||
if(mod == module)
|
||||
{
|
||||
eval_modules_primary = &eval_modules[eval_module_idx];
|
||||
}
|
||||
e_string2num_map_insert(arena, eval_module_from_name_map, mod->string, eval_module_idx+1);
|
||||
e_string2num_map_insert(arena, eval_module_from_name_map, str8_skip_last_slash(mod->string), eval_module_idx+1);
|
||||
eval_module_idx += 1;
|
||||
}
|
||||
}
|
||||
@@ -4994,11 +5005,13 @@ d_ctrl_thread__eval_scope_begin(Arena *arena, D_BreakpointList *user_bps, D_Enti
|
||||
ctx->dbg_infos = eval_dbg_infos;
|
||||
ctx->dbg_infos_count = eval_dbg_infos_count;
|
||||
ctx->primary_dbg_info = eval_dbg_infos_primary;
|
||||
ctx->dbg_info_from_name_map = eval_dbg_info_from_name_map;
|
||||
|
||||
//- rjf: fill modules
|
||||
ctx->modules = eval_modules;
|
||||
ctx->modules_count = eval_modules_count;
|
||||
ctx->primary_module = eval_modules_primary;
|
||||
ctx->module_from_name_map = eval_module_from_name_map;
|
||||
|
||||
//- rjf: fill space hooks
|
||||
ctx->space_gen = d_ctrl_eval_space_gen;
|
||||
|
||||
@@ -2002,6 +2002,13 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
|
||||
}
|
||||
d_cmd(D_CmdKind_Run);
|
||||
}break;
|
||||
case D_CmdKind_RunToName:
|
||||
{
|
||||
run_extra_bps.count = 1;
|
||||
run_extra_bps.v = push_array(scratch.arena, D_Breakpoint, 1);
|
||||
run_extra_bps.v[0].vaddr_expr = str8_copy(scratch.arena, params->string);
|
||||
d_cmd(D_CmdKind_Run);
|
||||
}break;
|
||||
case D_CmdKind_Run:
|
||||
{
|
||||
D_EntityArray processes = d_entity_array_from_kind(D_EntityKind_Process);
|
||||
|
||||
@@ -24,6 +24,7 @@ D_CmdKind_Halt,
|
||||
D_CmdKind_SoftHaltRefresh,
|
||||
D_CmdKind_SetThreadIP,
|
||||
D_CmdKind_RunToLine,
|
||||
D_CmdKind_RunToName,
|
||||
D_CmdKind_Run,
|
||||
D_CmdKind_Restart,
|
||||
D_CmdKind_StepInto,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
SkippedTest(md_tokenizer)
|
||||
SkippedTest(tokenizer)
|
||||
{
|
||||
MD_TokenizeResult result;
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
** stepping, breakpoints, evaluation, cross-module calls.
|
||||
*/
|
||||
|
||||
#define EvalTest(expr, match)
|
||||
|
||||
#if _WIN32 && _DEBUG
|
||||
#pragma comment(linker, "/nodefaultlib:libcmt")
|
||||
#pragma comment(lib, "libcmtd")
|
||||
@@ -492,9 +490,6 @@ type_coverage_eval_tests(void)
|
||||
memory_,
|
||||
6
|
||||
};
|
||||
EvalTest(dynamic[0].i, 100); EvalTest(dynamic[0].f, 1.f);
|
||||
EvalTest(dynamic[1].i, 101); EvalTest(dynamic[1].f, 2.f);
|
||||
EvalTest(dynamic[2].i, 102); EvalTest(dynamic[2].f, 4.f);
|
||||
|
||||
TemplatedDynamicArray<Pair> templated_dynamic = {dynamic.pairs, dynamic.count};
|
||||
TemplatedDynamicArray<Pair> templated_dynamics[] =
|
||||
|
||||
@@ -62,7 +62,7 @@ str8_lit_comp(""),
|
||||
str8_lit_comp(""),
|
||||
};
|
||||
|
||||
RD_VocabInfo rd_vocab_info_table[363] =
|
||||
RD_VocabInfo rd_vocab_info_table[364] =
|
||||
{
|
||||
{str8_lit_comp("type_view"), str8_lit_comp("type_views"), str8_lit_comp("Type View"), str8_lit_comp("Type Views"), RD_IconKind_Binoculars},
|
||||
{str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline},
|
||||
@@ -192,6 +192,7 @@ RD_VocabInfo rd_vocab_info_table[363] =
|
||||
{str8_lit_comp("soft_halt_refresh"), str8_lit_comp(""), str8_lit_comp("Soft Halt Refresh"), str8_lit_comp(""), RD_IconKind_Refresh},
|
||||
{str8_lit_comp("set_thread_ip"), str8_lit_comp(""), str8_lit_comp("Set Thread IP"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
{str8_lit_comp("run_to_line"), str8_lit_comp(""), str8_lit_comp("Run To Line"), str8_lit_comp(""), RD_IconKind_Play},
|
||||
{str8_lit_comp("run_to_name"), str8_lit_comp(""), str8_lit_comp("Run To Name"), str8_lit_comp(""), RD_IconKind_Play},
|
||||
{str8_lit_comp("run"), str8_lit_comp(""), str8_lit_comp("Run"), str8_lit_comp(""), RD_IconKind_Play},
|
||||
{str8_lit_comp("restart"), str8_lit_comp(""), str8_lit_comp("Restart"), str8_lit_comp(""), RD_IconKind_Redo},
|
||||
{str8_lit_comp("step_into"), str8_lit_comp(""), str8_lit_comp("Step Into"), str8_lit_comp(""), RD_IconKind_StepInto},
|
||||
@@ -578,7 +579,7 @@ Rng1U64 rd_reg_slot_range_table[49] =
|
||||
{OffsetOf(RD_Regs, wm_event), OffsetOf(RD_Regs, wm_event) + sizeof(WM_Event *)},
|
||||
};
|
||||
|
||||
RD_CmdKindInfo rd_cmd_kind_info_table[251] =
|
||||
RD_CmdKindInfo rd_cmd_kind_info_table[252] =
|
||||
{
|
||||
{0},
|
||||
{ str8_lit_comp("launch_and_run"), str8_lit_comp("Starts debugging a new instance of a target, then runs."), str8_lit_comp("launch,start,run,target"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*1)|(RD_QueryFlag_Required*1), RD_RegSlot_Cfg, str8_lit_comp("query:targets"), str8_lit_comp(""), D_EntityKind_Null}},
|
||||
@@ -596,6 +597,7 @@ RD_CmdKindInfo rd_cmd_kind_info_table[251] =
|
||||
{ str8_lit_comp("soft_halt_refresh"), str8_lit_comp("Interrupts all attached processes to collect data, and then resumes them."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*0)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), D_EntityKind_Null}},
|
||||
{ str8_lit_comp("set_thread_ip"), str8_lit_comp("Sets the specified thread's instruction pointer at the specified address."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*0)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*1)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*1)|(RD_QueryFlag_Required*1), RD_RegSlot_Vaddr, str8_lit_comp(""), str8_lit_comp(""), D_EntityKind_Null}},
|
||||
{ str8_lit_comp("run_to_line"), str8_lit_comp("Runs until a particular source line is hit."), str8_lit_comp(""), str8_lit_comp("$text_pt,"), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*1)|(RD_CmdKindFlag_ListInTextRng*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), D_EntityKind_Null}},
|
||||
{ str8_lit_comp("run_to_name"), str8_lit_comp("Runs until a particular symbol name is hit."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*1)|(RD_CmdKindFlag_ListInTextRng*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*1)|(RD_QueryFlag_Required*1), RD_RegSlot_String, str8_lit_comp("query:procedures"), str8_lit_comp(""), D_EntityKind_Null}},
|
||||
{ str8_lit_comp("run"), str8_lit_comp("Runs all targets after starting them if they have not been started yet."), str8_lit_comp("play"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), D_EntityKind_Null}},
|
||||
{ str8_lit_comp("restart"), str8_lit_comp("Kills all attached processes, then launches all active targets."), str8_lit_comp("restart,retry"), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), D_EntityKind_Null}},
|
||||
{ str8_lit_comp("step_into"), str8_lit_comp("Steps once, possibly into function calls, for either source lines or instructions (whichever is selected)."), str8_lit_comp(""), str8_lit_comp(""), (RD_CmdKindFlag_ListInUI*1)|(RD_CmdKindFlag_ListInIPCDocs*1)|(RD_CmdKindFlag_ListInTextPt*0)|(RD_CmdKindFlag_ListInTextRng*0), {(RD_QueryFlag_AllowFiles*0)|(RD_QueryFlag_AllowFolders*0)|(RD_QueryFlag_CodeInput*0)|(RD_QueryFlag_KeepOldInput*0)|(RD_QueryFlag_SelectOldInput*0)|(RD_QueryFlag_Floating*0)|(RD_QueryFlag_Required*0), RD_RegSlot_Null, str8_lit_comp(""), str8_lit_comp(""), D_EntityKind_Null}},
|
||||
|
||||
@@ -78,6 +78,7 @@ RD_CmdKind_Halt,
|
||||
RD_CmdKind_SoftHaltRefresh,
|
||||
RD_CmdKind_SetThreadIP,
|
||||
RD_CmdKind_RunToLine,
|
||||
RD_CmdKind_RunToName,
|
||||
RD_CmdKind_Run,
|
||||
RD_CmdKind_Restart,
|
||||
RD_CmdKind_StepInto,
|
||||
@@ -605,7 +606,7 @@ Z(getting_started)\
|
||||
C_LINKAGE_BEGIN
|
||||
extern String8 rd_tab_fast_path_view_name_table[25];
|
||||
extern String8 rd_tab_fast_path_query_name_table[25];
|
||||
extern RD_VocabInfo rd_vocab_info_table[363];
|
||||
extern RD_VocabInfo rd_vocab_info_table[364];
|
||||
extern RD_NameSchemaInfo rd_name_schema_info_table[39];
|
||||
extern String8 rd_reg_slot_code_name_table[49];
|
||||
extern Rng1U64 rd_reg_slot_range_table[49];
|
||||
|
||||
@@ -13,9 +13,7 @@ internal WM_SystemInfo *
|
||||
wm_get_system_info(void)
|
||||
{
|
||||
local_persist WM_SystemInfo g = {0};
|
||||
#if defined(WM_STUB_DEFAULT_REFRESH_RATE)
|
||||
g.default_refresh_rate = WM_STUB_DEFAULT_REFRESH_RATE;
|
||||
#endif
|
||||
g.default_refresh_rate = 60.f;
|
||||
return &g;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user