raddbg nil tables, autofill empty tables with 1-sized nils; use element-from-idx wrapper to bounds-check and nilify all out-of-bounds raddbg table accesses

This commit is contained in:
Ryan Fleury
2024-01-31 08:43:33 -08:00
parent a6f42502ec
commit 385014adcb
13 changed files with 174 additions and 166 deletions
+2 -2
View File
@@ -958,7 +958,7 @@ dbgi_parse_thread_entry_point(void *p)
}
//- rjf: parse raddbg info
RADDBG_Parsed raddbg_parsed = {0};
RADDBG_Parsed raddbg_parsed = dbgi_parse_nil.rdbg;
U64 arch_addr_size = 8;
if(do_task)
{
@@ -1146,7 +1146,7 @@ dbgi_fuzzy_thread__entry_point(void *p)
DBGI_FuzzySearchItemChunkList items_list = {0};
if(task_is_good)
{
for(U64 procedure_idx = 1; task_is_good && procedure_idx < rdbg->procedure_count; procedure_idx += 1)
for(U64 procedure_idx = 1; task_is_good && procedure_idx < rdbg->procedures_count; procedure_idx += 1)
{
RADDBG_Procedure *procedure = &rdbg->procedures[procedure_idx];
U64 name_size = 0;
+45 -1
View File
@@ -307,7 +307,51 @@ struct DBGI_Shared
global DBGI_Shared *dbgi_shared = 0;
thread_static DBGI_ThreadCtx *dbgi_tctx = 0;
global DBGI_Parse dbgi_parse_nil = {0};
global DBGI_Parse dbgi_parse_nil =
{
0,
0,
0,
{0},
{0},
0,
{0},
{0},
{
0,
0,
0,
0,
{0},
0,
0,
0,
0,
0,
0,
0,
&raddbg_binary_section_nil, 1,
&raddbg_file_path_node_nil, 1,
&raddbg_source_file_nil, 1,
&raddbg_unit_nil, 1,
&raddbg_vmap_entry_nil, 1,
&raddbg_type_node_nil, 1,
&raddbg_udt_nil, 1,
&raddbg_member_nil, 1,
&raddbg_enum_member_nil, 1,
&raddbg_global_variable_nil, 1,
&raddbg_vmap_entry_nil, 1,
&raddbg_thread_variable_nil, 1,
&raddbg_procedure_nil, 1,
&raddbg_scope_nil, 1,
&raddbg_voff_nil, 1,
&raddbg_vmap_entry_nil, 1,
&raddbg_local_nil, 1,
&raddbg_location_block_nil, 1,
0, 0,
0, 0,
},
};
////////////////////////////////
//~ rjf: Main Layer Initialization