switched to using base Arch enum for converting DWARF registers,

simplified top level building path
This commit is contained in:
Nikita Smith
2025-03-27 13:47:46 -07:00
parent dc967f5274
commit 53c889e5d3
10 changed files with 87 additions and 90 deletions
+33
View File
@@ -37,6 +37,39 @@ rdim_infer_data_model(OperatingSystem os, RDI_Arch arch)
return data_model;
}
////////////////////////////////
internal RDIM_TopLevelInfo
rdim_make_top_level_info(String8 image_name, Arch arch, U64 exe_hash, RDIM_BinarySectionList sections)
{
// convert arch
RDI_Arch arch_rdi;
switch (arch) {
case Arch_Null: arch_rdi = RDI_Arch_NULL; break;
case Arch_x64: arch_rdi = RDI_Arch_X64; break;
case Arch_x86: arch_rdi = RDI_Arch_X86; break;
default: NotImplemented; break;
}
// find max VOFF
U64 exe_voff_max = 0;
for (RDIM_BinarySectionNode *sect_n = sections.first; sect_n != 0 ; sect_n = sect_n->next) {
exe_voff_max = Max(exe_voff_max, sect_n->v.voff_opl);
}
// fill out top level info
RDIM_TopLevelInfo top_level_info = {0};
top_level_info.arch = arch_rdi;
top_level_info.exe_hash = exe_hash;
top_level_info.voff_max = exe_voff_max;
top_level_info.producer_name = str8_lit(BUILD_TITLE_STRING_LITERAL);
return top_level_info;
}
////////////////////////////////
//~ rjf: Baking Stage Tasks
+5
View File
@@ -384,6 +384,11 @@ global RDIM_LocalState *rdim_local_state = 0;
////////////////////////////////
internal RDIM_DataModel rdim_infer_data_model(OperatingSystem os, RDI_Arch arch);
internal RDIM_TopLevelInfo rdim_make_top_level_info(String8 image_name, Arch arch, U64 exe_hash, RDIM_BinarySectionList sections);
////////////////////////////////
internal RDIM_LocalState * rdim_local_init(void);
internal RDIM_BakeResults rdim_bake(RDIM_LocalState *state, RDIM_BakeParams *in);
internal RDIM_SerializedSectionBundle rdim_compress(Arena *arena, RDIM_SerializedSectionBundle *in);