mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 09:18:09 +00:00
build fixes
This commit is contained in:
@@ -615,7 +615,7 @@ e_push_member_map_from_rdi_voff(Arena *arena, RDI_Parsed *rdi, U64 voff)
|
|||||||
RDI_Symbol *procedure = rdi_element_from_name_idx(rdi, Procedures, proc_idx);
|
RDI_Symbol *procedure = rdi_element_from_name_idx(rdi, Procedures, proc_idx);
|
||||||
|
|
||||||
//- rjf: procedure -> udt
|
//- rjf: procedure -> udt
|
||||||
U32 udt_idx = procedure->container_flags & RDI_ContainerFlag_KindMask == RDI_ContainerKind_Type ? procedure->container_idx : 0;
|
U32 udt_idx = (procedure->container_flags & RDI_ContainerFlag_KindMask) == RDI_ContainerKind_Type ? procedure->container_idx : 0;
|
||||||
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, udt_idx);
|
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, udt_idx);
|
||||||
|
|
||||||
//- rjf: build blank map
|
//- rjf: build blank map
|
||||||
|
|||||||
+1
-1
@@ -2408,7 +2408,7 @@ e_push_irtree_and_type_from_expr(Arena *arena, E_IRTreeAndType *root_parent, E_I
|
|||||||
U64 vtable_voff = vtable_vaddr - module_base;
|
U64 vtable_voff = vtable_vaddr - module_base;
|
||||||
U64 global_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_GlobalVMap, vtable_voff);
|
U64 global_idx = rdi_vmap_idx_from_section_kind_voff(rdi, RDI_SectionKind_GlobalVMap, vtable_voff);
|
||||||
RDI_Symbol *global_var = rdi_element_from_name_idx(rdi, GlobalVariables, global_idx);
|
RDI_Symbol *global_var = rdi_element_from_name_idx(rdi, GlobalVariables, global_idx);
|
||||||
if(global_var->container_flags & RDI_ContainerFlag_KindMask == RDI_ContainerKind_Type)
|
if((global_var->container_flags & RDI_ContainerFlag_KindMask) == RDI_ContainerKind_Type)
|
||||||
{
|
{
|
||||||
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, global_var->container_idx);
|
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, global_var->container_idx);
|
||||||
RDI_TypeNode *type = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx);
|
RDI_TypeNode *type = rdi_element_from_name_idx(rdi, TypeNodes, udt->self_type_idx);
|
||||||
|
|||||||
+2
-14
@@ -769,25 +769,13 @@ rdi_root_scope_from_procedure(RDI_Parsed *rdi, RDI_Symbol *procedure)
|
|||||||
RDI_PROC RDI_UDT *
|
RDI_PROC RDI_UDT *
|
||||||
rdi_container_udt_from_procedure(RDI_Parsed *rdi, RDI_Symbol *procedure)
|
rdi_container_udt_from_procedure(RDI_Parsed *rdi, RDI_Symbol *procedure)
|
||||||
{
|
{
|
||||||
RDI_U64 idx = 0;
|
return 0;
|
||||||
if(procedure->container_flags & RDI_ContainerFlag_KindMask == RDI_ContainerKind_Type)
|
|
||||||
{
|
|
||||||
idx = procedure->container_idx;
|
|
||||||
}
|
|
||||||
RDI_UDT *udt = rdi_element_from_name_idx(rdi, UDTs, idx);
|
|
||||||
return udt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RDI_PROC RDI_Scope *
|
RDI_PROC RDI_Scope *
|
||||||
rdi_container_scope_from_procedure(RDI_Parsed *rdi, RDI_Symbol *procedure)
|
rdi_container_scope_from_procedure(RDI_Parsed *rdi, RDI_Symbol *procedure)
|
||||||
{
|
{
|
||||||
RDI_U64 idx = 0;
|
return 0;
|
||||||
if(procedure->container_flags & RDI_ContainerFlag_KindMask == RDI_ContainerKind_Scope)
|
|
||||||
{
|
|
||||||
idx = procedure->container_idx;
|
|
||||||
}
|
|
||||||
RDI_Scope *container_scope = rdi_element_from_name_idx(rdi, Scopes, idx);
|
|
||||||
return container_scope;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RDI_PROC RDI_U64
|
RDI_PROC RDI_U64
|
||||||
|
|||||||
@@ -4001,7 +4001,6 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
|
|
||||||
// push new node
|
// push new node
|
||||||
RDIB_Variable *gvar = rdib_variable_chunk_list_push(arena, var_chunk_list, task->symbol_chunk_cap);
|
RDIB_Variable *gvar = rdib_variable_chunk_list_push(arena, var_chunk_list, task->symbol_chunk_cap);
|
||||||
gvar->link_flags = symbol.kind == CV_SymKind_GDATA32 ? RDI_LinkFlag_External : 0;
|
|
||||||
gvar->name = name;
|
gvar->name = name;
|
||||||
gvar->link_name = link_name;
|
gvar->link_name = link_name;
|
||||||
gvar->type = type;
|
gvar->type = type;
|
||||||
@@ -4035,7 +4034,6 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
RDIB_Variable *tvar = rdib_variable_chunk_list_push(arena, tvar_list, task->symbol_chunk_cap);
|
RDIB_Variable *tvar = rdib_variable_chunk_list_push(arena, tvar_list, task->symbol_chunk_cap);
|
||||||
|
|
||||||
// fill out thread variable
|
// fill out thread variable
|
||||||
tvar->link_flags = symbol.kind == CV_SymKind_GTHREAD32 ? RDI_LinkFlag_External : 0;
|
|
||||||
tvar->name = name;
|
tvar->name = name;
|
||||||
tvar->link_name = str8(0,0);
|
tvar->link_name = str8(0,0);
|
||||||
tvar->type = type;
|
tvar->type = type;
|
||||||
@@ -4110,7 +4108,6 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
rng1u64_list_push(arena, &root_scope->ranges, virt_range);
|
rng1u64_list_push(arena, &root_scope->ranges, virt_range);
|
||||||
|
|
||||||
// fill out procedure
|
// fill out procedure
|
||||||
proc->link_flags = symbol.kind == CV_SymKind_GPROC32 ? RDI_LinkFlag_External : 0;
|
|
||||||
proc->name = name;
|
proc->name = name;
|
||||||
proc->link_name = link_name;
|
proc->link_name = link_name;
|
||||||
proc->type = type;
|
proc->type = type;
|
||||||
@@ -4213,10 +4210,8 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
String8 name = str8_cstring_capped(regrel32 + 1, symbol.data.str + symbol.data.size);
|
String8 name = str8_cstring_capped(regrel32 + 1, symbol.data.str + symbol.data.size);
|
||||||
RDIB_Type *type = lnk_type_from_itype(regrel32->itype, task->tpi_itype_range, task->tpi_itype_map, obj, symbol.kind, symbol.offset);
|
RDIB_Type *type = lnk_type_from_itype(regrel32->itype, task->tpi_itype_range, task->tpi_itype_map, obj, symbol.kind, symbol.offset);
|
||||||
|
|
||||||
RDI_LocalKind local_kind = RDI_LocalKind_Variable;
|
|
||||||
B32 is_ref = 0;
|
B32 is_ref = 0;
|
||||||
if (scope_stack->regrel32_idx < scope_stack->param_count) {
|
if (scope_stack->regrel32_idx < scope_stack->param_count) {
|
||||||
local_kind = RDI_LocalKind_Parameter;
|
|
||||||
if (type != 0) {
|
if (type != 0) {
|
||||||
U64 byte_size = rdib_size_from_type(type);
|
U64 byte_size = rdib_size_from_type(type);
|
||||||
switch (comp_info.arch) {
|
switch (comp_info.arch) {
|
||||||
@@ -4233,9 +4228,7 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
++scope_stack->scope->local_count;
|
++scope_stack->scope->local_count;
|
||||||
|
|
||||||
// fill out local
|
// fill out local
|
||||||
local->link_flags = 0;
|
|
||||||
local->name = name;
|
local->name = name;
|
||||||
local->kind = local_kind;
|
|
||||||
local->type = type;
|
local->type = type;
|
||||||
|
|
||||||
// encode location
|
// encode location
|
||||||
@@ -4268,8 +4261,6 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
++scope_stack->scope->local_count;
|
++scope_stack->scope->local_count;
|
||||||
|
|
||||||
// fill out local
|
// fill out local
|
||||||
local->link_flags = 0;
|
|
||||||
local->kind = sym_local->flags & CV_LocalFlag_Param ? RDI_LocalKind_Parameter : RDI_LocalKind_Variable;
|
|
||||||
local->name = name;
|
local->name = name;
|
||||||
local->type = type;
|
local->type = type;
|
||||||
|
|
||||||
@@ -4286,8 +4277,6 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
++scope_stack->scope->local_count;
|
++scope_stack->scope->local_count;
|
||||||
|
|
||||||
// fill out local
|
// fill out local
|
||||||
local->link_flags = 0;
|
|
||||||
local->kind = RDI_LocalKind_Variable;
|
|
||||||
local->name = name;
|
local->name = name;
|
||||||
local->type = type;
|
local->type = type;
|
||||||
|
|
||||||
@@ -4325,7 +4314,7 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
CV_LvarAddrGap *gaps = (CV_LvarAddrGap *) (defrange_fprel + 1);
|
CV_LvarAddrGap *gaps = (CV_LvarAddrGap *) (defrange_fprel + 1);
|
||||||
U64 gap_count = (symbol.data.size - sizeof(*defrange_fprel)) / sizeof(gaps[0]);
|
U64 gap_count = (symbol.data.size - sizeof(*defrange_fprel)) / sizeof(gaps[0]);
|
||||||
|
|
||||||
B32 is_local_param = scope_stack->defrange_target->kind == RDI_LocalKind_Parameter;
|
B32 is_local_param = 0;
|
||||||
CV_EncodedFramePtrReg encoded_fp_reg = cv_pick_fp_encoding(scope_stack->frameproc, is_local_param);
|
CV_EncodedFramePtrReg encoded_fp_reg = cv_pick_fp_encoding(scope_stack->frameproc, is_local_param);
|
||||||
CV_Reg fp_reg = cv_decode_fp_reg(comp_info.arch, encoded_fp_reg);
|
CV_Reg fp_reg = cv_decode_fp_reg(comp_info.arch, encoded_fp_reg);
|
||||||
RDI_RegCode fp_reg_rdi = rdi_reg_code_from_cv(comp_info.arch, fp_reg);
|
RDI_RegCode fp_reg_rdi = rdi_reg_code_from_cv(comp_info.arch, fp_reg);
|
||||||
@@ -4364,7 +4353,7 @@ THREAD_POOL_TASK_FUNC(lnk_convert_symbols_to_rdi_task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CV_SymDefrangeFramepointerRelFullScope *defrange_fprelfs = (CV_SymDefrangeFramepointerRelFullScope *) symbol.data.str;
|
CV_SymDefrangeFramepointerRelFullScope *defrange_fprelfs = (CV_SymDefrangeFramepointerRelFullScope *) symbol.data.str;
|
||||||
B32 is_local_param = scope_stack->defrange_target->kind == RDI_LocalKind_Parameter;
|
B32 is_local_param = 0; //scope_stack->defrange_target->kind == RDI_LocalKind_Parameter;
|
||||||
CV_EncodedFramePtrReg encoded_fp_reg = cv_pick_fp_encoding(scope_stack->frameproc, is_local_param);
|
CV_EncodedFramePtrReg encoded_fp_reg = cv_pick_fp_encoding(scope_stack->frameproc, is_local_param);
|
||||||
CV_Reg fp_reg = cv_decode_fp_reg(comp_info.arch, encoded_fp_reg);
|
CV_Reg fp_reg = cv_decode_fp_reg(comp_info.arch, encoded_fp_reg);
|
||||||
RDI_RegCode fp_reg_rdi = rdi_reg_code_from_cv(comp_info.arch, fp_reg);
|
RDI_RegCode fp_reg_rdi = rdi_reg_code_from_cv(comp_info.arch, fp_reg);
|
||||||
|
|||||||
@@ -3866,11 +3866,11 @@ THREAD_POOL_TASK_FUNC(rdib_build_var_section_task)
|
|||||||
|
|
||||||
for (U64 chunk_idx = task->ranges[task_id].min; chunk_idx < task->ranges[task_id].max; ++chunk_idx) {
|
for (U64 chunk_idx = task->ranges[task_id].min; chunk_idx < task->ranges[task_id].max; ++chunk_idx) {
|
||||||
RDIB_VariableChunk *chunk = task->gvars_rdib[chunk_idx];
|
RDIB_VariableChunk *chunk = task->gvars_rdib[chunk_idx];
|
||||||
RDI_GlobalVariable *vars = push_array_no_zero(arena, RDI_GlobalVariable, chunk->count);
|
RDI_Symbol *vars = push_array_no_zero(arena, RDI_Symbol, chunk->count);
|
||||||
|
|
||||||
for (U64 i = 0; i < chunk->count; ++i) {
|
for (U64 i = 0; i < chunk->count; ++i) {
|
||||||
RDIB_Variable *src = &chunk->v[i];
|
RDIB_Variable *src = &chunk->v[i];
|
||||||
RDI_GlobalVariable *dst = &vars[i];
|
RDI_Symbol *dst = &vars[i];
|
||||||
|
|
||||||
// TODO: temporary hack while we don't have bytecode eval in RDI_GlobalVariable
|
// TODO: temporary hack while we don't have bytecode eval in RDI_GlobalVariable
|
||||||
U64 voff = 0;
|
U64 voff = 0;
|
||||||
@@ -3881,18 +3881,14 @@ THREAD_POOL_TASK_FUNC(rdib_build_var_section_task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dst->name_string_idx = rdib_idx_from_string_map(task->string_map, src->name);
|
dst->name_string_idx = rdib_idx_from_string_map(task->string_map, src->name);
|
||||||
dst->voff = voff;
|
|
||||||
dst->type_idx = rdib_idx_from_type(src->type);
|
dst->type_idx = rdib_idx_from_type(src->type);
|
||||||
dst->link_flags = src->link_flags;
|
|
||||||
|
|
||||||
if (src->container_type != 0) {
|
if (src->container_type != 0) {
|
||||||
Assert(!src->container_proc);
|
Assert(!src->container_proc);
|
||||||
dst->link_flags |= RDI_LinkFlag_TypeScoped;
|
|
||||||
dst->container_idx = rdib_idx_from_udt_type(src->container_type);
|
dst->container_idx = rdib_idx_from_udt_type(src->container_type);
|
||||||
}
|
}
|
||||||
if (src->container_proc != 0) {
|
if (src->container_proc != 0) {
|
||||||
Assert(!src->container_type);
|
Assert(!src->container_type);
|
||||||
dst->link_flags |= RDI_LinkFlag_ProcScoped;
|
|
||||||
dst->container_idx = rdib_idx_from_procedure(src->container_proc);
|
dst->container_idx = rdib_idx_from_procedure(src->container_proc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3940,11 +3936,11 @@ THREAD_POOL_TASK_FUNC(rdib_build_tvar_section_task)
|
|||||||
|
|
||||||
for (U64 chunk_idx = task->ranges[task_id].min; chunk_idx < task->ranges[task_id].max; ++chunk_idx) {
|
for (U64 chunk_idx = task->ranges[task_id].min; chunk_idx < task->ranges[task_id].max; ++chunk_idx) {
|
||||||
RDIB_VariableChunk *chunk = task->tvars_rdib[chunk_idx];
|
RDIB_VariableChunk *chunk = task->tvars_rdib[chunk_idx];
|
||||||
RDI_ThreadVariable *vars = push_array_no_zero(arena, RDI_ThreadVariable, chunk->count);
|
RDI_Symbol *vars = push_array_no_zero(arena, RDI_Symbol, chunk->count);
|
||||||
|
|
||||||
for (U64 i = 0; i < chunk->count; ++i) {
|
for (U64 i = 0; i < chunk->count; ++i) {
|
||||||
RDIB_Variable *src = &chunk->v[i];
|
RDIB_Variable *src = &chunk->v[i];
|
||||||
RDI_ThreadVariable *dst = &vars[i];
|
RDI_Symbol *dst = &vars[i];
|
||||||
|
|
||||||
U32 tls_off = 0;
|
U32 tls_off = 0;
|
||||||
if (src->locations.first != 0) {
|
if (src->locations.first != 0) {
|
||||||
@@ -3954,17 +3950,14 @@ THREAD_POOL_TASK_FUNC(rdib_build_tvar_section_task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dst->name_string_idx = rdib_idx_from_string_map(task->string_map, src->name);
|
dst->name_string_idx = rdib_idx_from_string_map(task->string_map, src->name);
|
||||||
dst->tls_off = tls_off;
|
|
||||||
dst->type_idx = rdib_idx_from_type(src->type);
|
dst->type_idx = rdib_idx_from_type(src->type);
|
||||||
|
|
||||||
if (src->container_type != 0) {
|
if (src->container_type != 0) {
|
||||||
Assert(!src->container_proc);
|
Assert(!src->container_proc);
|
||||||
dst->link_flags |= RDI_LinkFlag_TypeScoped;
|
|
||||||
dst->container_idx = rdib_idx_from_udt_type(src->container_type);
|
dst->container_idx = rdib_idx_from_udt_type(src->container_type);
|
||||||
}
|
}
|
||||||
if (src->container_proc != 0) {
|
if (src->container_proc != 0) {
|
||||||
Assert(!src->container_type);
|
Assert(!src->container_type);
|
||||||
dst->link_flags |= RDI_LinkFlag_ProcScoped;
|
|
||||||
dst->container_idx = rdib_idx_from_procedure(src->container_proc);
|
dst->container_idx = rdib_idx_from_procedure(src->container_proc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4012,27 +4005,24 @@ THREAD_POOL_TASK_FUNC(rdib_build_procs_section_task)
|
|||||||
|
|
||||||
for (U64 chunk_idx = task->ranges[task_id].min; chunk_idx < task->ranges[task_id].max; ++chunk_idx) {
|
for (U64 chunk_idx = task->ranges[task_id].min; chunk_idx < task->ranges[task_id].max; ++chunk_idx) {
|
||||||
RDIB_ProcedureChunk *chunk = task->procs_rdib[chunk_idx];
|
RDIB_ProcedureChunk *chunk = task->procs_rdib[chunk_idx];
|
||||||
RDI_Procedure *procs = push_array_no_zero(arena, RDI_Procedure, chunk->count);
|
RDI_Symbol *procs = push_array_no_zero(arena, RDI_Symbol, chunk->count);
|
||||||
|
|
||||||
for (U64 i = 0; i < chunk->count; ++i) {
|
for (U64 i = 0; i < chunk->count; ++i) {
|
||||||
RDIB_Procedure *src = &chunk->v[i];
|
RDIB_Procedure *src = &chunk->v[i];
|
||||||
RDI_Procedure *dst = &procs[i];
|
RDI_Symbol *dst = &procs[i];
|
||||||
|
|
||||||
dst->name_string_idx = rdib_idx_from_string_map(task->string_map, src->name);
|
dst->name_string_idx = rdib_idx_from_string_map(task->string_map, src->name);
|
||||||
dst->link_name_string_idx = rdib_idx_from_string_map(task->string_map, src->link_name);
|
dst->link_name_string_idx = rdib_idx_from_string_map(task->string_map, src->link_name);
|
||||||
dst->link_flags = src->link_flags;
|
|
||||||
dst->type_idx = rdib_idx_from_type(src->type);
|
dst->type_idx = rdib_idx_from_type(src->type);
|
||||||
dst->root_scope_idx = rdib_idx_from_scope(src->scope);
|
dst->root_scope_idx = rdib_idx_from_scope(src->scope);
|
||||||
|
|
||||||
if (src->container_type != 0) {
|
if (src->container_type != 0) {
|
||||||
AssertAlways(!src->container_proc);
|
AssertAlways(!src->container_proc);
|
||||||
dst->link_flags |= RDI_LinkFlag_TypeScoped;
|
|
||||||
dst->container_idx = rdib_idx_from_udt_type(src->container_type);
|
dst->container_idx = rdib_idx_from_udt_type(src->container_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src->container_proc != 0) {
|
if (src->container_proc != 0) {
|
||||||
AssertAlways(!src->container_type);
|
AssertAlways(!src->container_type);
|
||||||
dst->link_flags |= RDI_LinkFlag_ProcScoped;
|
|
||||||
dst->container_idx = rdib_idx_from_procedure(0); Assert(!"TODO"); // src->container_proc
|
dst->container_idx = rdib_idx_from_procedure(0); Assert(!"TODO"); // src->container_proc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4094,11 +4084,11 @@ THREAD_POOL_TASK_FUNC(rdib_count_scopes_task)
|
|||||||
task->loc_data_sizes[task_id] += loc_n->v.bytecode.size + /* stream ender: */ 1;
|
task->loc_data_sizes[task_id] += loc_n->v.bytecode.size + /* stream ender: */ 1;
|
||||||
} break;
|
} break;
|
||||||
case RDI_LocationKind_ValReg: {
|
case RDI_LocationKind_ValReg: {
|
||||||
task->loc_data_sizes[task_id] += sizeof(RDI_LocationReg);
|
//task->loc_data_sizes[task_id] += sizeof(RDI_LocationReg);
|
||||||
} break;
|
} break;
|
||||||
case RDI_LocationKind_AddrRegPlusU16:
|
case RDI_LocationKind_AddrRegPlusU16:
|
||||||
case RDI_LocationKind_AddrAddrRegPlusU16: {
|
case RDI_LocationKind_AddrAddrRegPlusU16: {
|
||||||
task->loc_data_sizes[task_id] += sizeof(RDI_LocationRegPlusU16);
|
//task->loc_data_sizes[task_id] += sizeof(RDI_LocationRegPlusU16);
|
||||||
} break;
|
} break;
|
||||||
default: InvalidPath;
|
default: InvalidPath;
|
||||||
}
|
}
|
||||||
@@ -4115,6 +4105,7 @@ THREAD_POOL_TASK_FUNC(rdib_count_scopes_task)
|
|||||||
internal
|
internal
|
||||||
THREAD_POOL_TASK_FUNC(rdib_build_scopes_task)
|
THREAD_POOL_TASK_FUNC(rdib_build_scopes_task)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
RDIB_BuildSymbolSectionTask *task = raw_task;
|
RDIB_BuildSymbolSectionTask *task = raw_task;
|
||||||
ProfBeginDynamic("Scopes [Chunk Count: %llu]", task->ranges[task_id].max - task->ranges[task_id].min);
|
ProfBeginDynamic("Scopes [Chunk Count: %llu]", task->ranges[task_id].max - task->ranges[task_id].min);
|
||||||
|
|
||||||
@@ -4126,7 +4117,7 @@ THREAD_POOL_TASK_FUNC(rdib_build_scopes_task)
|
|||||||
// local fill info
|
// local fill info
|
||||||
U64 local_cursor = task->local_offsets[task_id];
|
U64 local_cursor = task->local_offsets[task_id];
|
||||||
U64 local_max = task->local_offsets[task_id] + task->local_counts[task_id];
|
U64 local_max = task->local_offsets[task_id] + task->local_counts[task_id];
|
||||||
RDI_Local *locals = task->locals_rdi;
|
RDI_Symbol *locals = task->locals_rdi;
|
||||||
|
|
||||||
// location data fill info
|
// location data fill info
|
||||||
U64 loc_data_max = task->loc_data_offsets[task_id] + task->loc_data_sizes[task_id];
|
U64 loc_data_max = task->loc_data_offsets[task_id] + task->loc_data_sizes[task_id];
|
||||||
@@ -4136,7 +4127,7 @@ THREAD_POOL_TASK_FUNC(rdib_build_scopes_task)
|
|||||||
// location block fill info
|
// location block fill info
|
||||||
U64 loc_block_cursor = task->loc_block_offsets[task_id];
|
U64 loc_block_cursor = task->loc_block_offsets[task_id];
|
||||||
U64 loc_block_max = task->loc_block_offsets[task_id] + task->loc_block_counts[task_id];
|
U64 loc_block_max = task->loc_block_offsets[task_id] + task->loc_block_counts[task_id];
|
||||||
RDI_LocationBlock *loc_blocks = task->loc_blocks_rdi;
|
void *loc_blocks = task->loc_blocks_rdi;
|
||||||
|
|
||||||
for (U64 ichunk = task->ranges[task_id].min; ichunk < task->ranges[task_id].max; ++ichunk) {
|
for (U64 ichunk = task->ranges[task_id].min; ichunk < task->ranges[task_id].max; ++ichunk) {
|
||||||
RDIB_ScopeChunk *chunk = task->scopes_rdib[ichunk];
|
RDIB_ScopeChunk *chunk = task->scopes_rdib[ichunk];
|
||||||
@@ -4258,6 +4249,7 @@ THREAD_POOL_TASK_FUNC(rdib_build_scopes_task)
|
|||||||
Assert(loc_data_cursor == loc_data_max);
|
Assert(loc_data_cursor == loc_data_max);
|
||||||
|
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
@@ -4299,8 +4291,8 @@ rdib_data_sections_from_scopes(TP_Context *tp,
|
|||||||
ProfBegin("Push");
|
ProfBegin("Push");
|
||||||
task.scope_voffs_rdi = push_array_no_zero(arena->v[0], U64, total_scope_voff_count);
|
task.scope_voffs_rdi = push_array_no_zero(arena->v[0], U64, total_scope_voff_count);
|
||||||
task.scopes_rdi = push_array_no_zero(arena->v[0], RDI_Scope, total_scope_count );
|
task.scopes_rdi = push_array_no_zero(arena->v[0], RDI_Scope, total_scope_count );
|
||||||
task.locals_rdi = push_array_no_zero(arena->v[0], RDI_Local, total_local_count );
|
//task.locals_rdi = push_array_no_zero(arena->v[0], RDI_Local, total_local_count );
|
||||||
task.loc_blocks_rdi = push_array_no_zero(arena->v[0], RDI_LocationBlock, total_loc_block_count );
|
//task.loc_blocks_rdi = push_array_no_zero(arena->v[0], RDI_LocationBlock, total_loc_block_count );
|
||||||
task.loc_data_rdi = push_array_no_zero(arena->v[0], U8, total_loc_data_size );
|
task.loc_data_rdi = push_array_no_zero(arena->v[0], U8, total_loc_data_size );
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
|
|
||||||
@@ -4309,14 +4301,14 @@ rdib_data_sections_from_scopes(TP_Context *tp,
|
|||||||
|
|
||||||
RDIB_DataSection scopes_sect = { .tag = RDI_SectionKind_Scopes };
|
RDIB_DataSection scopes_sect = { .tag = RDI_SectionKind_Scopes };
|
||||||
RDIB_DataSection scope_voffs_sect = { .tag = RDI_SectionKind_ScopeVOffData };
|
RDIB_DataSection scope_voffs_sect = { .tag = RDI_SectionKind_ScopeVOffData };
|
||||||
RDIB_DataSection locals_sect = { .tag = RDI_SectionKind_Locals };
|
RDIB_DataSection locals_sect = { .tag = RDI_SectionKind_NULL };
|
||||||
RDIB_DataSection loc_blocks_sect = { .tag = RDI_SectionKind_LocationBlocks };
|
RDIB_DataSection loc_blocks_sect = { .tag = RDI_SectionKind_NULL };
|
||||||
RDIB_DataSection loc_data_sect = { .tag = RDI_SectionKind_LocationData };
|
RDIB_DataSection loc_data_sect = { .tag = RDI_SectionKind_NULL };
|
||||||
|
|
||||||
str8_list_push(arena->v[0], &scopes_sect.data, str8_array(task.scopes_rdi, total_scope_count ));
|
str8_list_push(arena->v[0], &scopes_sect.data, str8_array(task.scopes_rdi, total_scope_count ));
|
||||||
str8_list_push(arena->v[0], &scope_voffs_sect.data, str8_array(task.scope_voffs_rdi, total_scope_voff_count));
|
str8_list_push(arena->v[0], &scope_voffs_sect.data, str8_array(task.scope_voffs_rdi, total_scope_voff_count));
|
||||||
str8_list_push(arena->v[0], &locals_sect.data, str8_array(task.locals_rdi, total_local_count ));
|
str8_list_push(arena->v[0], &locals_sect.data, str8_array(task.locals_rdi, total_local_count ));
|
||||||
str8_list_push(arena->v[0], &loc_blocks_sect.data, str8_array(task.loc_blocks_rdi, total_loc_block_count ));
|
//str8_list_push(arena->v[0], &loc_blocks_sect.data, str8_array(task.loc_blocks_rdi, total_loc_block_count ));
|
||||||
str8_list_push(arena->v[0], &loc_data_sect.data, str8_array(task.loc_data_rdi, total_loc_data_size ));
|
str8_list_push(arena->v[0], &loc_data_sect.data, str8_array(task.loc_data_rdi, total_loc_data_size ));
|
||||||
|
|
||||||
rdib_data_section_list_push(arena->v[0], sect_list, scopes_sect );
|
rdib_data_section_list_push(arena->v[0], sect_list, scopes_sect );
|
||||||
@@ -4998,12 +4990,10 @@ rdib_init_input(Arena *arena)
|
|||||||
null_proc->scope = null_scope;
|
null_proc->scope = null_scope;
|
||||||
|
|
||||||
// Global Var
|
// Global Var
|
||||||
null_gvar->link_flags = RDI_LinkFlag_External;
|
|
||||||
null_gvar->type = null_type;
|
null_gvar->type = null_type;
|
||||||
null_gvar->locations = null_loc_list;
|
null_gvar->locations = null_loc_list;
|
||||||
|
|
||||||
// Thread Var
|
// Thread Var
|
||||||
null_tvar->link_flags = RDI_LinkFlag_External;
|
|
||||||
null_tvar->type = null_type;
|
null_tvar->type = null_type;
|
||||||
null_tvar->locations = null_loc_list;
|
null_tvar->locations = null_loc_list;
|
||||||
|
|
||||||
|
|||||||
@@ -78,10 +78,8 @@ typedef struct RDIB_LocationList
|
|||||||
|
|
||||||
typedef struct RDIB_Variable
|
typedef struct RDIB_Variable
|
||||||
{
|
{
|
||||||
RDI_LinkFlags link_flags;
|
|
||||||
String8 name;
|
String8 name;
|
||||||
String8 link_name;
|
String8 link_name;
|
||||||
RDI_LocalKind kind;
|
|
||||||
struct RDIB_Type *type;
|
struct RDIB_Type *type;
|
||||||
struct RDIB_Type *container_type;
|
struct RDIB_Type *container_type;
|
||||||
struct RDIB_Procedure *container_proc;
|
struct RDIB_Procedure *container_proc;
|
||||||
@@ -211,7 +209,6 @@ typedef struct RDIB_SourceFileChunkList
|
|||||||
|
|
||||||
typedef struct RDIB_Procedure
|
typedef struct RDIB_Procedure
|
||||||
{
|
{
|
||||||
RDI_LinkFlags link_flags;
|
|
||||||
String8 name;
|
String8 name;
|
||||||
String8 link_name;
|
String8 link_name;
|
||||||
struct RDIB_Type *type;
|
struct RDIB_Type *type;
|
||||||
@@ -896,8 +893,8 @@ typedef struct
|
|||||||
U64 *loc_data_offsets;
|
U64 *loc_data_offsets;
|
||||||
U64 *scope_voffs_rdi;
|
U64 *scope_voffs_rdi;
|
||||||
RDI_Scope *scopes_rdi;
|
RDI_Scope *scopes_rdi;
|
||||||
RDI_Local *locals_rdi;
|
RDI_Symbol *locals_rdi;
|
||||||
RDI_LocationBlock *loc_blocks_rdi;
|
void *loc_blocks_rdi;
|
||||||
U8 *loc_data_rdi;
|
U8 *loc_data_rdi;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -468,9 +468,8 @@ TEST(d2r_general)
|
|||||||
|
|
||||||
RDI_Parsed *rdi = d2r_rdi_from_dwarf_writer(arena, writer);
|
RDI_Parsed *rdi = d2r_rdi_from_dwarf_writer(arena, writer);
|
||||||
|
|
||||||
RDI_Procedure *proc = rdi_procedure_from_name_cstr(rdi, "FooBar");
|
RDI_Symbol *proc = rdi_procedure_from_name_cstr(rdi, "FooBar");
|
||||||
T_Ok(proc);
|
T_Ok(proc);
|
||||||
T_Ok(proc->link_flags == RDI_LinkFlag_External);
|
|
||||||
String8 proc_name = str8_from_rdi_string_idx(rdi, proc->name_string_idx);
|
String8 proc_name = str8_from_rdi_string_idx(rdi, proc->name_string_idx);
|
||||||
T_Ok(str8_match(proc_name, str8_lit("FooBar"), 0));
|
T_Ok(str8_match(proc_name, str8_lit("FooBar"), 0));
|
||||||
|
|
||||||
@@ -478,9 +477,9 @@ TEST(d2r_general)
|
|||||||
T_Ok(root_scope);
|
T_Ok(root_scope);
|
||||||
T_Ok(root_scope->local_count == 1);
|
T_Ok(root_scope->local_count == 1);
|
||||||
|
|
||||||
RDI_Local *test_local = rdi_element_from_name_idx(rdi, Locals, root_scope->local_first + 0);
|
RDI_Symbol *test_local = rdi_element_from_name_idx(rdi, LocalVariables, root_scope->local_first + 0);
|
||||||
T_Ok(test_local);
|
T_Ok(test_local);
|
||||||
T_Ok(test_local->kind == RDI_LocalKind_Variable);
|
T_Ok(test_local->symbol_flags & RDI_SymbolFlag_IsParam);
|
||||||
String8 test_local_name = str8_from_rdi_string_idx(rdi, test_local->name_string_idx);
|
String8 test_local_name = str8_from_rdi_string_idx(rdi, test_local->name_string_idx);
|
||||||
T_Ok(str8_match(test_local_name, str8_lit("TestLocal"), 0));
|
T_Ok(str8_match(test_local_name, str8_lit("TestLocal"), 0));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user