mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 14:28:40 +00:00
merged rdim_help.c into rdim_local.c
This commit is contained in:
+4
-4
@@ -362,12 +362,12 @@ rc_run(Arena *arena, RC_Context *rc)
|
|||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
|
|
||||||
ProfBegin("Convert");
|
ProfBegin("Convert");
|
||||||
RDIM_HelpState *help_state = rdim_help_init();
|
RDIM_LocalState *local_state = rdim_local_init();
|
||||||
RDIM_BakeParams *convert2bake = 0;
|
RDIM_BakeParams *convert2bake = 0;
|
||||||
switch (rc->driver) {
|
switch (rc->driver) {
|
||||||
case RC_Driver_Null: break;
|
case RC_Driver_Null: break;
|
||||||
case RC_Driver_Dwarf: convert2bake = d2r_convert(scratch.arena, help_state, rc); break;
|
case RC_Driver_Dwarf: convert2bake = d2r_convert(scratch.arena, local_state, rc); break;
|
||||||
case RC_Driver_Pdb: convert2bake = p2r_convert(scratch.arena, help_state, rc); break;
|
case RC_Driver_Pdb: convert2bake = p2r_convert(scratch.arena, local_state, rc); break;
|
||||||
}
|
}
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
|
|
||||||
@@ -376,7 +376,7 @@ rc_run(Arena *arena, RC_Context *rc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProfBegin("Bake");
|
ProfBegin("Bake");
|
||||||
RDIM_BakeResults bake2srlz = rdim_bake(help_state, convert2bake);
|
RDIM_BakeResults bake2srlz = rdim_bake(local_state, convert2bake);
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
|
|
||||||
ProfBegin("Serialize Bake");
|
ProfBegin("Serialize Bake");
|
||||||
|
|||||||
@@ -787,7 +787,7 @@ d2r_push_scope(Arena *arena, RDIM_ScopeChunkList *scopes, U64 scope_chunk_cap, D
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal RDIM_BakeParams *
|
internal RDIM_BakeParams *
|
||||||
d2r_convert(Arena *arena, RDIM_HelpState *help_state, RC_Context *in)
|
d2r_convert(Arena *arena, RDIM_LocalState *local_state, RC_Context *in)
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
|
|
||||||
@@ -1799,7 +1799,7 @@ d2r_convert(Arena *arena, RDIM_HelpState *help_state, RC_Context *in)
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal RDIM_BakeResults
|
internal RDIM_BakeResults
|
||||||
d2r_bake(RDIM_HelpState *state, RDIM_BakeParams *in_params)
|
d2r_bake(RDIM_LocalState *state, RDIM_BakeParams *in_params)
|
||||||
{
|
{
|
||||||
return rdim_bake(state, in_params);
|
return rdim_bake(state, in_params);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ typedef struct D2R_CompUnitContribMap
|
|||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
||||||
internal RDIM_BakeParams * d2r_convert(Arena *arena, RDIM_HelpState *help_state, RC_Context *in);
|
internal RDIM_BakeParams * d2r_convert(Arena *arena, RDIM_LocalState *local_state, RC_Context *in);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#include "async/async.h"
|
#include "async/async.h"
|
||||||
#include "path/path.h"
|
#include "path/path.h"
|
||||||
#include "rdi_make/rdi_make_local.h"
|
#include "rdi_make/rdi_make_local.h"
|
||||||
#include "rdi_make/rdi_make_help.h"
|
|
||||||
#include "linker/hash_table.h"
|
#include "linker/hash_table.h"
|
||||||
#include "coff/coff.h"
|
#include "coff/coff.h"
|
||||||
#include "coff/coff_parse.h"
|
#include "coff/coff_parse.h"
|
||||||
@@ -62,7 +61,6 @@
|
|||||||
#include "async/async.c"
|
#include "async/async.c"
|
||||||
#include "path/path.c"
|
#include "path/path.c"
|
||||||
#include "rdi_make/rdi_make_local.c"
|
#include "rdi_make/rdi_make_local.c"
|
||||||
#include "rdi_make/rdi_make_help.c"
|
|
||||||
#include "linker/hash_table.c"
|
#include "linker/hash_table.c"
|
||||||
#include "coff/coff.c"
|
#include "coff/coff.c"
|
||||||
#include "coff/coff_parse.c"
|
#include "coff/coff_parse.c"
|
||||||
|
|||||||
+14
-14
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
// (search for != 0 instances, inserted to prevent prior crashes)
|
// (search for != 0 instances, inserted to prevent prior crashes)
|
||||||
|
|
||||||
global RDIM_HelpState *g_p2r_help_state = 0;
|
global RDIM_LocalState *g_p2r_local_state = 0;
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Basic Helpers
|
//~ rjf: Basic Helpers
|
||||||
@@ -116,7 +116,7 @@ p2r_location_over_lvar_addr_range(Arena *arena, RDIM_ScopeChunkList *scopes, RDI
|
|||||||
ASYNC_WORK_DEF(p2r_exe_hash_work)
|
ASYNC_WORK_DEF(p2r_exe_hash_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_EXEHashIn *in = (P2R_EXEHashIn *)input;
|
P2R_EXEHashIn *in = (P2R_EXEHashIn *)input;
|
||||||
U64 *out = push_array(arena, U64, 1);
|
U64 *out = push_array(arena, U64, 1);
|
||||||
ProfScope("hash exe") *out = rdi_hash(in->exe_data.str, in->exe_data.size);
|
ProfScope("hash exe") *out = rdi_hash(in->exe_data.str, in->exe_data.size);
|
||||||
@@ -127,7 +127,7 @@ ASYNC_WORK_DEF(p2r_exe_hash_work)
|
|||||||
ASYNC_WORK_DEF(p2r_tpi_hash_parse_work)
|
ASYNC_WORK_DEF(p2r_tpi_hash_parse_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_TPIHashParseIn *in = (P2R_TPIHashParseIn *)input;
|
P2R_TPIHashParseIn *in = (P2R_TPIHashParseIn *)input;
|
||||||
void *out = 0;
|
void *out = 0;
|
||||||
ProfScope("parse tpi hash") out = pdb_tpi_hash_from_data(arena, in->strtbl, in->tpi, in->hash_data, in->aux_data);
|
ProfScope("parse tpi hash") out = pdb_tpi_hash_from_data(arena, in->strtbl, in->tpi, in->hash_data, in->aux_data);
|
||||||
@@ -138,7 +138,7 @@ ASYNC_WORK_DEF(p2r_tpi_hash_parse_work)
|
|||||||
ASYNC_WORK_DEF(p2r_tpi_leaf_parse_work)
|
ASYNC_WORK_DEF(p2r_tpi_leaf_parse_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_TPILeafParseIn *in = (P2R_TPILeafParseIn *)input;
|
P2R_TPILeafParseIn *in = (P2R_TPILeafParseIn *)input;
|
||||||
void *out = 0;
|
void *out = 0;
|
||||||
ProfScope("parse tpi leaf") out = cv_leaf_from_data(arena, in->leaf_data, in->itype_first);
|
ProfScope("parse tpi leaf") out = cv_leaf_from_data(arena, in->leaf_data, in->itype_first);
|
||||||
@@ -149,7 +149,7 @@ ASYNC_WORK_DEF(p2r_tpi_leaf_parse_work)
|
|||||||
ASYNC_WORK_DEF(p2r_symbol_stream_parse_work)
|
ASYNC_WORK_DEF(p2r_symbol_stream_parse_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_SymbolStreamParseIn *in = (P2R_SymbolStreamParseIn *)input;
|
P2R_SymbolStreamParseIn *in = (P2R_SymbolStreamParseIn *)input;
|
||||||
void *out = 0;
|
void *out = 0;
|
||||||
ProfScope("parse symbol stream") out = cv_sym_from_data(arena, in->data, 4);
|
ProfScope("parse symbol stream") out = cv_sym_from_data(arena, in->data, 4);
|
||||||
@@ -160,7 +160,7 @@ ASYNC_WORK_DEF(p2r_symbol_stream_parse_work)
|
|||||||
ASYNC_WORK_DEF(p2r_c13_stream_parse_work)
|
ASYNC_WORK_DEF(p2r_c13_stream_parse_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_C13StreamParseIn *in = (P2R_C13StreamParseIn *)input;
|
P2R_C13StreamParseIn *in = (P2R_C13StreamParseIn *)input;
|
||||||
void *out = 0;
|
void *out = 0;
|
||||||
ProfScope("parse c13 stream") out = cv_c13_parsed_from_data(arena, in->data, in->strtbl, in->coff_sections);
|
ProfScope("parse c13 stream") out = cv_c13_parsed_from_data(arena, in->data, in->strtbl, in->coff_sections);
|
||||||
@@ -171,7 +171,7 @@ ASYNC_WORK_DEF(p2r_c13_stream_parse_work)
|
|||||||
ASYNC_WORK_DEF(p2r_comp_unit_parse_work)
|
ASYNC_WORK_DEF(p2r_comp_unit_parse_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_CompUnitParseIn *in = (P2R_CompUnitParseIn *)input;
|
P2R_CompUnitParseIn *in = (P2R_CompUnitParseIn *)input;
|
||||||
void *out = 0;
|
void *out = 0;
|
||||||
ProfScope("parse comp units") out = pdb_comp_unit_array_from_data(arena, in->data);
|
ProfScope("parse comp units") out = pdb_comp_unit_array_from_data(arena, in->data);
|
||||||
@@ -182,7 +182,7 @@ ASYNC_WORK_DEF(p2r_comp_unit_parse_work)
|
|||||||
ASYNC_WORK_DEF(p2r_comp_unit_contributions_parse_work)
|
ASYNC_WORK_DEF(p2r_comp_unit_contributions_parse_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_CompUnitContributionsParseIn *in = (P2R_CompUnitContributionsParseIn *)input;
|
P2R_CompUnitContributionsParseIn *in = (P2R_CompUnitContributionsParseIn *)input;
|
||||||
void *out = 0;
|
void *out = 0;
|
||||||
ProfScope("parse comp unit contributions") out = pdb_comp_unit_contribution_array_from_data(arena, in->data, in->coff_sections);
|
ProfScope("parse comp unit contributions") out = pdb_comp_unit_contribution_array_from_data(arena, in->data, in->coff_sections);
|
||||||
@@ -196,7 +196,7 @@ ASYNC_WORK_DEF(p2r_comp_unit_contributions_parse_work)
|
|||||||
ASYNC_WORK_DEF(p2r_units_convert_work)
|
ASYNC_WORK_DEF(p2r_units_convert_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
P2R_UnitConvertIn *in = (P2R_UnitConvertIn *)input;
|
P2R_UnitConvertIn *in = (P2R_UnitConvertIn *)input;
|
||||||
P2R_UnitConvertOut *out = push_array(arena, P2R_UnitConvertOut, 1);
|
P2R_UnitConvertOut *out = push_array(arena, P2R_UnitConvertOut, 1);
|
||||||
@@ -555,7 +555,7 @@ ASYNC_WORK_DEF(p2r_units_convert_work)
|
|||||||
ASYNC_WORK_DEF(p2r_link_name_map_build_work)
|
ASYNC_WORK_DEF(p2r_link_name_map_build_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_LinkNameMapBuildIn *in = (P2R_LinkNameMapBuildIn *)input;
|
P2R_LinkNameMapBuildIn *in = (P2R_LinkNameMapBuildIn *)input;
|
||||||
CV_RecRange *rec_ranges_first = in->sym->sym_ranges.ranges;
|
CV_RecRange *rec_ranges_first = in->sym->sym_ranges.ranges;
|
||||||
CV_RecRange *rec_ranges_opl = rec_ranges_first + in->sym->sym_ranges.count;
|
CV_RecRange *rec_ranges_opl = rec_ranges_first + in->sym->sym_ranges.count;
|
||||||
@@ -613,7 +613,7 @@ ASYNC_WORK_DEF(p2r_link_name_map_build_work)
|
|||||||
ASYNC_WORK_DEF(p2r_udt_convert_work)
|
ASYNC_WORK_DEF(p2r_udt_convert_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
P2R_UDTConvertIn *in = (P2R_UDTConvertIn *)input;
|
P2R_UDTConvertIn *in = (P2R_UDTConvertIn *)input;
|
||||||
#define p2r_type_ptr_from_itype(itype) ((in->itype_type_ptrs && (itype) < in->tpi_leaf->itype_opl) ? (in->itype_type_ptrs[itype]) : 0)
|
#define p2r_type_ptr_from_itype(itype) ((in->itype_type_ptrs && (itype) < in->tpi_leaf->itype_opl) ? (in->itype_type_ptrs[itype]) : 0)
|
||||||
RDIM_UDTChunkList *udts = push_array(arena, RDIM_UDTChunkList, 1);
|
RDIM_UDTChunkList *udts = push_array(arena, RDIM_UDTChunkList, 1);
|
||||||
@@ -1250,7 +1250,7 @@ ASYNC_WORK_DEF(p2r_udt_convert_work)
|
|||||||
ASYNC_WORK_DEF(p2r_symbol_stream_convert_work)
|
ASYNC_WORK_DEF(p2r_symbol_stream_convert_work)
|
||||||
{
|
{
|
||||||
ProfBeginFunction();
|
ProfBeginFunction();
|
||||||
Arena *arena = g_p2r_help_state->work_thread_arenas[thread_idx];
|
Arena *arena = g_p2r_local_state->work_thread_arenas[thread_idx];
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
P2R_SymbolStreamConvertIn *in = (P2R_SymbolStreamConvertIn *)input;
|
P2R_SymbolStreamConvertIn *in = (P2R_SymbolStreamConvertIn *)input;
|
||||||
#define p2r_type_ptr_from_itype(itype) ((in->itype_type_ptrs && (itype) < in->tpi_leaf->itype_opl) ? (in->itype_type_ptrs[itype]) : 0)
|
#define p2r_type_ptr_from_itype(itype) ((in->itype_type_ptrs && (itype) < in->tpi_leaf->itype_opl) ? (in->itype_type_ptrs[itype]) : 0)
|
||||||
@@ -2125,11 +2125,11 @@ ASYNC_WORK_DEF(p2r_symbol_stream_convert_work)
|
|||||||
//~ rjf: Top-Level Conversion Entry Point
|
//~ rjf: Top-Level Conversion Entry Point
|
||||||
|
|
||||||
internal RDIM_BakeParams *
|
internal RDIM_BakeParams *
|
||||||
p2r_convert(Arena *arena, RDIM_HelpState *help_state, RC_Context *in)
|
p2r_convert(Arena *arena, RDIM_LocalState *local_state, RC_Context *in)
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
|
|
||||||
g_p2r_help_state = help_state;
|
g_p2r_local_state = local_state;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
//- rjf: parse MSF structure
|
//- rjf: parse MSF structure
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ ASYNC_WORK_DEF(p2r_symbol_stream_convert_work);
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Top-Level Conversion Entry Point
|
//~ rjf: Top-Level Conversion Entry Point
|
||||||
|
|
||||||
internal RDIM_BakeParams *p2r_convert(Arena *arena, RDIM_HelpState *help_state, RC_Context *in);
|
internal RDIM_BakeParams *p2r_convert(Arena *arena, RDIM_LocalState *local_state, RC_Context *in);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -396,7 +396,6 @@
|
|||||||
#include "async/async.h"
|
#include "async/async.h"
|
||||||
#include "rdi_format/rdi_format_local.h"
|
#include "rdi_format/rdi_format_local.h"
|
||||||
#include "rdi_make/rdi_make_local.h"
|
#include "rdi_make/rdi_make_local.h"
|
||||||
#include "rdi_make/rdi_make_help.h"
|
|
||||||
#include "mdesk/mdesk.h"
|
#include "mdesk/mdesk.h"
|
||||||
#include "hash_store/hash_store.h"
|
#include "hash_store/hash_store.h"
|
||||||
#include "file_stream/file_stream.h"
|
#include "file_stream/file_stream.h"
|
||||||
@@ -439,7 +438,6 @@
|
|||||||
#include "async/async.c"
|
#include "async/async.c"
|
||||||
#include "rdi_format/rdi_format_local.c"
|
#include "rdi_format/rdi_format_local.c"
|
||||||
#include "rdi_make/rdi_make_local.c"
|
#include "rdi_make/rdi_make_local.c"
|
||||||
#include "rdi_make/rdi_make_help.c"
|
|
||||||
#include "mdesk/mdesk.c"
|
#include "mdesk/mdesk.c"
|
||||||
#include "hash_store/hash_store.c"
|
#include "hash_store/hash_store.c"
|
||||||
#include "file_stream/file_stream.c"
|
#include "file_stream/file_stream.c"
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
#include "async/async.h"
|
#include "async/async.h"
|
||||||
#include "rdi_format/rdi_format_local.h"
|
#include "rdi_format/rdi_format_local.h"
|
||||||
#include "rdi_make/rdi_make_local.h"
|
#include "rdi_make/rdi_make_local.h"
|
||||||
#include "rdi_make/rdi_make_help.h"
|
|
||||||
#include "path/path.h"
|
#include "path/path.h"
|
||||||
#include "linker/hash_table.h"
|
#include "linker/hash_table.h"
|
||||||
#include "coff/coff.h"
|
#include "coff/coff.h"
|
||||||
@@ -66,7 +65,6 @@
|
|||||||
#include "async/async.c"
|
#include "async/async.c"
|
||||||
#include "rdi_format/rdi_format_local.c"
|
#include "rdi_format/rdi_format_local.c"
|
||||||
#include "rdi_make/rdi_make_local.c"
|
#include "rdi_make/rdi_make_local.c"
|
||||||
#include "rdi_make/rdi_make_help.c"
|
|
||||||
#include "path/path.c"
|
#include "path/path.c"
|
||||||
#include "linker/hash_table.c"
|
#include "linker/hash_table.c"
|
||||||
#include "coff/coff.c"
|
#include "coff/coff.c"
|
||||||
|
|||||||
@@ -1838,7 +1838,7 @@ d2r_convert(Arena *arena, D2R_User2Convert *in)
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal RDIM_BakeResults
|
internal RDIM_BakeResults
|
||||||
d2r_bake(RDIM_HelpState *state, RDIM_BakeParams *in_params)
|
d2r_bake(RDIM_LocalState *state, RDIM_BakeParams *in_params)
|
||||||
{
|
{
|
||||||
return rdim_bake(state, in_params);
|
return rdim_bake(state, in_params);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ internal D2R_User2Convert * d2r_user2convert_from_cmdln(Arena *arena, CmdLine *c
|
|||||||
// Top-Level Conversion Entry Point
|
// Top-Level Conversion Entry Point
|
||||||
|
|
||||||
internal RDIM_BakeParams * d2r_convert (Arena *arena, D2R_User2Convert *in);
|
internal RDIM_BakeParams * d2r_convert (Arena *arena, D2R_User2Convert *in);
|
||||||
internal RDIM_BakeResults d2r_bake (RDIM_HelpState *state, RDIM_BakeParams *in);
|
internal RDIM_BakeResults d2r_bake (RDIM_LocalState *state, RDIM_BakeParams *in);
|
||||||
internal RDIM_SerializedSectionBundle d2r_compress(Arena *arena, RDIM_SerializedSectionBundle in);
|
internal RDIM_SerializedSectionBundle d2r_compress(Arena *arena, RDIM_SerializedSectionBundle in);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
#include "os/os_inc.h"
|
#include "os/os_inc.h"
|
||||||
#include "async/async.h"
|
#include "async/async.h"
|
||||||
#include "rdi_make/rdi_make_local.h"
|
#include "rdi_make/rdi_make_local.h"
|
||||||
#include "rdi_make/rdi_make_help.h"
|
|
||||||
#include "linker/path_ext/path.h"
|
#include "linker/path_ext/path.h"
|
||||||
#include "linker/hash_table.h"
|
#include "linker/hash_table.h"
|
||||||
#include "coff/coff.h"
|
#include "coff/coff.h"
|
||||||
@@ -44,7 +43,6 @@
|
|||||||
#include "coff/coff_parse.c"
|
#include "coff/coff_parse.c"
|
||||||
#include "pe/pe.c"
|
#include "pe/pe.c"
|
||||||
#include "rdi_make/rdi_make_local.c"
|
#include "rdi_make/rdi_make_local.c"
|
||||||
#include "rdi_make/rdi_make_help.c"
|
|
||||||
#include "linker/rdi/rdi_coff.c"
|
#include "linker/rdi/rdi_coff.c"
|
||||||
#include "linker/path_ext/path.c"
|
#include "linker/path_ext/path.c"
|
||||||
#include "linker/hash_table.c"
|
#include "linker/hash_table.c"
|
||||||
@@ -89,14 +87,14 @@ entry_point(CmdLine *cmdline)
|
|||||||
os_abort(0);
|
os_abort(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
RDIM_HelpState *rdim_help_state = rdim_help_init();
|
RDIM_LocalState *rdim_local_state = rdim_local_init();
|
||||||
|
|
||||||
ProfBegin("convert");
|
ProfBegin("convert");
|
||||||
RDIM_BakeParams *convert2bake = d2r_convert(arena, user2convert);
|
RDIM_BakeParams *convert2bake = d2r_convert(arena, user2convert);
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
|
|
||||||
ProfBegin("bake");
|
ProfBegin("bake");
|
||||||
RDIM_BakeResults bake2srlz = d2r_bake(rdim_help_state, convert2bake);
|
RDIM_BakeResults bake2srlz = d2r_bake(rdim_local_state, convert2bake);
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
|
|
||||||
ProfBegin("serialize bake");
|
ProfBegin("serialize bake");
|
||||||
|
|||||||
@@ -787,6 +787,7 @@ ASYNC_WORK_DEF(p2r_units_convert_work)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rjf: build line table, fill with parsed binary annotations
|
// rjf: build line table, fill with parsed binary annotations
|
||||||
|
|
||||||
if(inlinee_lines_parsed != 0)
|
if(inlinee_lines_parsed != 0)
|
||||||
{
|
{
|
||||||
// rjf: grab checksums sub-section
|
// rjf: grab checksums sub-section
|
||||||
@@ -3571,13 +3572,13 @@ p2r_init(void)
|
|||||||
internal P2R_Bake2Serialize *
|
internal P2R_Bake2Serialize *
|
||||||
p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
p2r_bake(Arena *arena, P2R_Convert2Bake *in)
|
||||||
{
|
{
|
||||||
RDIM_HelpState help_state = {0};
|
RDIM_LocalState local_state = {0};
|
||||||
help_state.arena = p2r_state->arena;
|
local_state.arena = p2r_state->arena;
|
||||||
help_state.work_thread_arenas_count = p2r_state->work_thread_arenas_count;
|
local_state.work_thread_arenas_count = p2r_state->work_thread_arenas_count;
|
||||||
help_state.work_thread_arenas = p2r_state->work_thread_arenas;
|
local_state.work_thread_arenas = p2r_state->work_thread_arenas;
|
||||||
|
|
||||||
P2R_Bake2Serialize *result = push_array(arena, P2R_Bake2Serialize, 1);
|
P2R_Bake2Serialize *result = push_array(arena, P2R_Bake2Serialize, 1);
|
||||||
result->bake_results = rdim_bake(&help_state, &in->bake_params);
|
result->bake_results = rdim_bake(&local_state, &in->bake_params);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include "os/os_inc.h"
|
#include "os/os_inc.h"
|
||||||
#include "async/async.h"
|
#include "async/async.h"
|
||||||
#include "rdi_make/rdi_make_local.h"
|
#include "rdi_make/rdi_make_local.h"
|
||||||
#include "rdi_make/rdi_make_help.h"
|
|
||||||
#include "coff/coff.h"
|
#include "coff/coff.h"
|
||||||
#include "coff/coff_parse.h"
|
#include "coff/coff_parse.h"
|
||||||
#include "codeview/codeview.h"
|
#include "codeview/codeview.h"
|
||||||
@@ -41,7 +40,6 @@
|
|||||||
#include "os/os_inc.c"
|
#include "os/os_inc.c"
|
||||||
#include "async/async.c"
|
#include "async/async.c"
|
||||||
#include "rdi_make/rdi_make_local.c"
|
#include "rdi_make/rdi_make_local.c"
|
||||||
#include "rdi_make/rdi_make_help.c"
|
|
||||||
#include "coff/coff.c"
|
#include "coff/coff.c"
|
||||||
#include "coff/coff_parse.c"
|
#include "coff/coff_parse.c"
|
||||||
#include "codeview/codeview.c"
|
#include "codeview/codeview.c"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,346 +0,0 @@
|
|||||||
// Copyright (c) 2024 Epic Games Tools
|
|
||||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
|
||||||
|
|
||||||
#ifndef RDIM_MAKE_HELP
|
|
||||||
#define RDIM_MAKE_HELP
|
|
||||||
|
|
||||||
//- rjf: line table baking task types
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeLineTablesIn RDIM_BakeLineTablesIn;
|
|
||||||
struct RDIM_BakeLineTablesIn
|
|
||||||
{
|
|
||||||
RDIM_LineTableChunkList *line_tables;
|
|
||||||
};
|
|
||||||
|
|
||||||
//- rjf: string map baking task types
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeSrcFilesStringsIn RDIM_BakeSrcFilesStringsIn;
|
|
||||||
struct RDIM_BakeSrcFilesStringsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose **maps;
|
|
||||||
RDIM_SrcFileChunkList *list;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeUnitsStringsIn RDIM_BakeUnitsStringsIn;
|
|
||||||
struct RDIM_BakeUnitsStringsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose **maps;
|
|
||||||
RDIM_UnitChunkList *list;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeUDTsStringsInNode RDIM_BakeUDTsStringsInNode;
|
|
||||||
struct RDIM_BakeUDTsStringsInNode
|
|
||||||
{
|
|
||||||
RDIM_BakeUDTsStringsInNode *next;
|
|
||||||
RDIM_UDT *v;
|
|
||||||
RDI_U64 count;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeTypesStringsInNode RDIM_BakeTypesStringsInNode;
|
|
||||||
struct RDIM_BakeTypesStringsInNode
|
|
||||||
{
|
|
||||||
RDIM_BakeTypesStringsInNode *next;
|
|
||||||
RDIM_Type *v;
|
|
||||||
RDI_U64 count;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeTypesStringsIn RDIM_BakeTypesStringsIn;
|
|
||||||
struct RDIM_BakeTypesStringsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose **maps;
|
|
||||||
RDIM_BakeTypesStringsInNode *first;
|
|
||||||
RDIM_BakeTypesStringsInNode *last;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeUDTsStringsIn RDIM_BakeUDTsStringsIn;
|
|
||||||
struct RDIM_BakeUDTsStringsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose **maps;
|
|
||||||
RDIM_BakeUDTsStringsInNode *first;
|
|
||||||
RDIM_BakeUDTsStringsInNode *last;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeSymbolsStringsInNode RDIM_BakeSymbolsStringsInNode;
|
|
||||||
struct RDIM_BakeSymbolsStringsInNode
|
|
||||||
{
|
|
||||||
RDIM_BakeSymbolsStringsInNode *next;
|
|
||||||
RDIM_Symbol *v;
|
|
||||||
RDI_U64 count;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeSymbolsStringsIn RDIM_BakeSymbolsStringsIn;
|
|
||||||
struct RDIM_BakeSymbolsStringsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose **maps;
|
|
||||||
RDIM_BakeSymbolsStringsInNode *first;
|
|
||||||
RDIM_BakeSymbolsStringsInNode *last;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeInlineSiteStringsInNode RDIM_BakeInlineSiteStringsInNode;
|
|
||||||
struct RDIM_BakeInlineSiteStringsInNode
|
|
||||||
{
|
|
||||||
RDIM_BakeInlineSiteStringsInNode *next;
|
|
||||||
RDIM_InlineSite *v;
|
|
||||||
RDI_U64 count;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeInlineSiteStringsIn RDIM_BakeInlineSiteStringsIn;
|
|
||||||
struct RDIM_BakeInlineSiteStringsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose **maps;
|
|
||||||
RDIM_BakeInlineSiteStringsInNode *first;
|
|
||||||
RDIM_BakeInlineSiteStringsInNode *last;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeScopesStringsInNode RDIM_BakeScopesStringsInNode;
|
|
||||||
struct RDIM_BakeScopesStringsInNode
|
|
||||||
{
|
|
||||||
RDIM_BakeScopesStringsInNode *next;
|
|
||||||
RDIM_Scope *v;
|
|
||||||
RDI_U64 count;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeScopesStringsIn RDIM_BakeScopesStringsIn;
|
|
||||||
struct RDIM_BakeScopesStringsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose **maps;
|
|
||||||
RDIM_BakeScopesStringsInNode *first;
|
|
||||||
RDIM_BakeScopesStringsInNode *last;
|
|
||||||
};
|
|
||||||
|
|
||||||
//- rjf: OLD string map baking types
|
|
||||||
|
|
||||||
typedef struct RDIM_BuildBakeStringMapIn RDIM_BuildBakeStringMapIn;
|
|
||||||
struct RDIM_BuildBakeStringMapIn
|
|
||||||
{
|
|
||||||
RDIM_BakePathTree *path_tree;
|
|
||||||
RDIM_BakeParams *params;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BuildBakeNameMapIn RDIM_BuildBakeNameMapIn;
|
|
||||||
struct RDIM_BuildBakeNameMapIn
|
|
||||||
{
|
|
||||||
RDI_NameMapKind k;
|
|
||||||
RDI_U64 *type_indices;
|
|
||||||
RDIM_BakeParams *params;
|
|
||||||
};
|
|
||||||
|
|
||||||
//- rjf: string map joining task types
|
|
||||||
|
|
||||||
typedef struct RDIM_JoinBakeStringMapSlotsIn RDIM_JoinBakeStringMapSlotsIn;
|
|
||||||
struct RDIM_JoinBakeStringMapSlotsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose **src_maps;
|
|
||||||
U64 src_maps_count;
|
|
||||||
RDIM_BakeStringMapLoose *dst_map;
|
|
||||||
Rng1U64 slot_idx_range;
|
|
||||||
};
|
|
||||||
|
|
||||||
//- rjf: string map sorting task types
|
|
||||||
|
|
||||||
typedef struct RDIM_SortBakeStringMapSlotsIn RDIM_SortBakeStringMapSlotsIn;
|
|
||||||
struct RDIM_SortBakeStringMapSlotsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTopology *top;
|
|
||||||
RDIM_BakeStringMapLoose *src_map;
|
|
||||||
RDIM_BakeStringMapLoose *dst_map;
|
|
||||||
U64 slot_idx;
|
|
||||||
U64 slot_count;
|
|
||||||
};
|
|
||||||
|
|
||||||
//- rjf: debug info baking task types
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeUnitsIn RDIM_BakeUnitsIn;
|
|
||||||
struct RDIM_BakeUnitsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_BakePathTree *path_tree;
|
|
||||||
RDIM_UnitChunkList *units;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeUnitVMapIn RDIM_BakeUnitVMapIn;
|
|
||||||
struct RDIM_BakeUnitVMapIn
|
|
||||||
{
|
|
||||||
RDIM_UnitChunkList *units;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeSrcFilesIn RDIM_BakeSrcFilesIn;
|
|
||||||
struct RDIM_BakeSrcFilesIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_BakePathTree *path_tree;
|
|
||||||
RDIM_SrcFileChunkList *src_files;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeUDTsIn RDIM_BakeUDTsIn;
|
|
||||||
struct RDIM_BakeUDTsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_UDTChunkList *udts;
|
|
||||||
RDI_U64 *type_indices;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeGlobalVariablesIn RDIM_BakeGlobalVariablesIn;
|
|
||||||
struct RDIM_BakeGlobalVariablesIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_SymbolChunkList *global_variables;
|
|
||||||
RDI_U64 *type_indices;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeGlobalVMapIn RDIM_BakeGlobalVMapIn;
|
|
||||||
struct RDIM_BakeGlobalVMapIn
|
|
||||||
{
|
|
||||||
RDIM_SymbolChunkList *global_variables;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeThreadVariablesIn RDIM_BakeThreadVariablesIn;
|
|
||||||
struct RDIM_BakeThreadVariablesIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_SymbolChunkList *thread_variables;
|
|
||||||
RDI_U64 *type_indices;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeProceduresIn RDIM_BakeProceduresIn;
|
|
||||||
struct RDIM_BakeProceduresIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_SymbolChunkList *procedures;
|
|
||||||
RDI_U64 *type_indices;
|
|
||||||
RDIM_String8List *location_blocks;
|
|
||||||
RDIM_String8List *location_data_blobs;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeScopesIn RDIM_BakeScopesIn;
|
|
||||||
struct RDIM_BakeScopesIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_ScopeChunkList *scopes;
|
|
||||||
RDI_U64 *type_indices;
|
|
||||||
RDIM_String8List *location_blocks;
|
|
||||||
RDIM_String8List *location_data_blobs;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeScopeVMapIn RDIM_BakeScopeVMapIn;
|
|
||||||
struct RDIM_BakeScopeVMapIn
|
|
||||||
{
|
|
||||||
RDIM_ScopeChunkList *scopes;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeInlineSitesIn RDIM_BakeInlineSitesIn;
|
|
||||||
struct RDIM_BakeInlineSitesIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_InlineSiteChunkList *inline_sites;
|
|
||||||
RDI_U64 *type_indices;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeFilePathsIn RDIM_BakeFilePathsIn;
|
|
||||||
struct RDIM_BakeFilePathsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_BakePathTree *path_tree;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeStringsIn RDIM_BakeStringsIn;
|
|
||||||
struct RDIM_BakeStringsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeTypeNodesIn RDIM_BakeTypeNodesIn;
|
|
||||||
struct RDIM_BakeTypeNodesIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_BakeIdxRunMap *idx_runs;
|
|
||||||
RDIM_TypeChunkList *types;
|
|
||||||
RDI_U64 *type_indices;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeNameMapIn RDIM_BakeNameMapIn;
|
|
||||||
struct RDIM_BakeNameMapIn
|
|
||||||
{
|
|
||||||
RDIM_BakeStringMapTight *strings;
|
|
||||||
RDIM_BakeIdxRunMap *idx_runs;
|
|
||||||
RDIM_BakeNameMap *map;
|
|
||||||
RDI_NameMapKind kind;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDIM_BakeIdxRunsIn RDIM_BakeIdxRunsIn;
|
|
||||||
struct RDIM_BakeIdxRunsIn
|
|
||||||
{
|
|
||||||
RDIM_BakeIdxRunMap *idx_runs;
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////
|
|
||||||
|
|
||||||
internal RDIM_DataModel rdim_infer_data_model(OperatingSystem os, RDI_Arch arch);
|
|
||||||
|
|
||||||
////////////////////////////////
|
|
||||||
//~ rjf: Baking Stage Tasks
|
|
||||||
|
|
||||||
//- rjf: unsorted bake string map building
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_src_files_strings_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_units_strings_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_types_strings_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_udts_strings_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_symbols_strings_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_scopes_strings_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_line_tables_work);
|
|
||||||
|
|
||||||
//- rjf: bake string map joining
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_string_map_join_work);
|
|
||||||
|
|
||||||
//- rjf: bake string map sorting
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_string_map_sort_work);
|
|
||||||
|
|
||||||
//- rjf: pass 1: interner/deduper map builds
|
|
||||||
ASYNC_WORK_DEF(p2r_build_bake_name_map_work);
|
|
||||||
|
|
||||||
//- rjf: pass 2: string-map-dependent debug info stream builds
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_units_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_unit_vmap_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_src_files_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_udts_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_global_variables_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_global_vmap_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_thread_variables_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_procedures_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_scopes_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_scope_vmap_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_file_paths_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_strings_work);
|
|
||||||
|
|
||||||
//- rjf: pass 3: idx-run-map-dependent debug info stream builds
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_type_nodes_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_name_map_work);
|
|
||||||
ASYNC_WORK_DEF(p2r_bake_idx_runs_work);
|
|
||||||
|
|
||||||
typedef struct RDIM_HelpState RDIM_HelpState;
|
|
||||||
struct RDIM_HelpState
|
|
||||||
{
|
|
||||||
Arena *arena;
|
|
||||||
U64 work_thread_arenas_count;
|
|
||||||
Arena **work_thread_arenas;
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////
|
|
||||||
|
|
||||||
global RDIM_HelpState *rdim_help_state = 0;
|
|
||||||
|
|
||||||
////////////////////////////////
|
|
||||||
|
|
||||||
internal RDIM_HelpState * rdim_help_init(void);
|
|
||||||
internal RDIM_BakeResults rdim_bake(RDIM_HelpState *state, RDIM_BakeParams *in);
|
|
||||||
internal RDIM_SerializedSectionBundle rdim_compress(Arena *arena, RDIM_SerializedSectionBundle *in);
|
|
||||||
|
|
||||||
#endif // RDIM_MAKE_HELP
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
|||||||
// Copyright (c) 2024 Epic Games Tools
|
// Copyright (c) 2024 Epic Games Tools
|
||||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||||
|
|
||||||
#ifndef RDI_CONS_LOCAL_H
|
#ifndef RDI_MAKE_LOCAL_H
|
||||||
#define RDI_CONS_LOCAL_H
|
#define RDI_MAKE_LOCAL_H
|
||||||
|
|
||||||
// rjf: base layer memory ops
|
// rjf: base layer memory ops
|
||||||
#define RDIM_MEMSET_OVERRIDE
|
#define RDIM_MEMSET_OVERRIDE
|
||||||
@@ -47,4 +47,345 @@
|
|||||||
|
|
||||||
#include "lib_rdi_make/rdi_make.h"
|
#include "lib_rdi_make/rdi_make.h"
|
||||||
|
|
||||||
#endif // RDI_CONS_LOCAL_H
|
////////////////////////////////
|
||||||
|
|
||||||
|
//- rjf: line table baking task types
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeLineTablesIn RDIM_BakeLineTablesIn;
|
||||||
|
struct RDIM_BakeLineTablesIn
|
||||||
|
{
|
||||||
|
RDIM_LineTableChunkList *line_tables;
|
||||||
|
};
|
||||||
|
|
||||||
|
//- rjf: string map baking task types
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeSrcFilesStringsIn RDIM_BakeSrcFilesStringsIn;
|
||||||
|
struct RDIM_BakeSrcFilesStringsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose **maps;
|
||||||
|
RDIM_SrcFileChunkList *list;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeUnitsStringsIn RDIM_BakeUnitsStringsIn;
|
||||||
|
struct RDIM_BakeUnitsStringsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose **maps;
|
||||||
|
RDIM_UnitChunkList *list;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeUDTsStringsInNode RDIM_BakeUDTsStringsInNode;
|
||||||
|
struct RDIM_BakeUDTsStringsInNode
|
||||||
|
{
|
||||||
|
RDIM_BakeUDTsStringsInNode *next;
|
||||||
|
RDIM_UDT *v;
|
||||||
|
RDI_U64 count;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeTypesStringsInNode RDIM_BakeTypesStringsInNode;
|
||||||
|
struct RDIM_BakeTypesStringsInNode
|
||||||
|
{
|
||||||
|
RDIM_BakeTypesStringsInNode *next;
|
||||||
|
RDIM_Type *v;
|
||||||
|
RDI_U64 count;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeTypesStringsIn RDIM_BakeTypesStringsIn;
|
||||||
|
struct RDIM_BakeTypesStringsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose **maps;
|
||||||
|
RDIM_BakeTypesStringsInNode *first;
|
||||||
|
RDIM_BakeTypesStringsInNode *last;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeUDTsStringsIn RDIM_BakeUDTsStringsIn;
|
||||||
|
struct RDIM_BakeUDTsStringsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose **maps;
|
||||||
|
RDIM_BakeUDTsStringsInNode *first;
|
||||||
|
RDIM_BakeUDTsStringsInNode *last;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeSymbolsStringsInNode RDIM_BakeSymbolsStringsInNode;
|
||||||
|
struct RDIM_BakeSymbolsStringsInNode
|
||||||
|
{
|
||||||
|
RDIM_BakeSymbolsStringsInNode *next;
|
||||||
|
RDIM_Symbol *v;
|
||||||
|
RDI_U64 count;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeSymbolsStringsIn RDIM_BakeSymbolsStringsIn;
|
||||||
|
struct RDIM_BakeSymbolsStringsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose **maps;
|
||||||
|
RDIM_BakeSymbolsStringsInNode *first;
|
||||||
|
RDIM_BakeSymbolsStringsInNode *last;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeInlineSiteStringsInNode RDIM_BakeInlineSiteStringsInNode;
|
||||||
|
struct RDIM_BakeInlineSiteStringsInNode
|
||||||
|
{
|
||||||
|
RDIM_BakeInlineSiteStringsInNode *next;
|
||||||
|
RDIM_InlineSite *v;
|
||||||
|
RDI_U64 count;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeInlineSiteStringsIn RDIM_BakeInlineSiteStringsIn;
|
||||||
|
struct RDIM_BakeInlineSiteStringsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose **maps;
|
||||||
|
RDIM_BakeInlineSiteStringsInNode *first;
|
||||||
|
RDIM_BakeInlineSiteStringsInNode *last;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeScopesStringsInNode RDIM_BakeScopesStringsInNode;
|
||||||
|
struct RDIM_BakeScopesStringsInNode
|
||||||
|
{
|
||||||
|
RDIM_BakeScopesStringsInNode *next;
|
||||||
|
RDIM_Scope *v;
|
||||||
|
RDI_U64 count;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeScopesStringsIn RDIM_BakeScopesStringsIn;
|
||||||
|
struct RDIM_BakeScopesStringsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose **maps;
|
||||||
|
RDIM_BakeScopesStringsInNode *first;
|
||||||
|
RDIM_BakeScopesStringsInNode *last;
|
||||||
|
};
|
||||||
|
|
||||||
|
//- rjf: OLD string map baking types
|
||||||
|
|
||||||
|
typedef struct RDIM_BuildBakeStringMapIn RDIM_BuildBakeStringMapIn;
|
||||||
|
struct RDIM_BuildBakeStringMapIn
|
||||||
|
{
|
||||||
|
RDIM_BakePathTree *path_tree;
|
||||||
|
RDIM_BakeParams *params;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BuildBakeNameMapIn RDIM_BuildBakeNameMapIn;
|
||||||
|
struct RDIM_BuildBakeNameMapIn
|
||||||
|
{
|
||||||
|
RDI_NameMapKind k;
|
||||||
|
RDI_U64 *type_indices;
|
||||||
|
RDIM_BakeParams *params;
|
||||||
|
};
|
||||||
|
|
||||||
|
//- rjf: string map joining task types
|
||||||
|
|
||||||
|
typedef struct RDIM_JoinBakeStringMapSlotsIn RDIM_JoinBakeStringMapSlotsIn;
|
||||||
|
struct RDIM_JoinBakeStringMapSlotsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose **src_maps;
|
||||||
|
U64 src_maps_count;
|
||||||
|
RDIM_BakeStringMapLoose *dst_map;
|
||||||
|
Rng1U64 slot_idx_range;
|
||||||
|
};
|
||||||
|
|
||||||
|
//- rjf: string map sorting task types
|
||||||
|
|
||||||
|
typedef struct RDIM_SortBakeStringMapSlotsIn RDIM_SortBakeStringMapSlotsIn;
|
||||||
|
struct RDIM_SortBakeStringMapSlotsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTopology *top;
|
||||||
|
RDIM_BakeStringMapLoose *src_map;
|
||||||
|
RDIM_BakeStringMapLoose *dst_map;
|
||||||
|
U64 slot_idx;
|
||||||
|
U64 slot_count;
|
||||||
|
};
|
||||||
|
|
||||||
|
//- rjf: debug info baking task types
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeUnitsIn RDIM_BakeUnitsIn;
|
||||||
|
struct RDIM_BakeUnitsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_BakePathTree *path_tree;
|
||||||
|
RDIM_UnitChunkList *units;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeUnitVMapIn RDIM_BakeUnitVMapIn;
|
||||||
|
struct RDIM_BakeUnitVMapIn
|
||||||
|
{
|
||||||
|
RDIM_UnitChunkList *units;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeSrcFilesIn RDIM_BakeSrcFilesIn;
|
||||||
|
struct RDIM_BakeSrcFilesIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_BakePathTree *path_tree;
|
||||||
|
RDIM_SrcFileChunkList *src_files;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeUDTsIn RDIM_BakeUDTsIn;
|
||||||
|
struct RDIM_BakeUDTsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_UDTChunkList *udts;
|
||||||
|
RDI_U64 *type_indices;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeGlobalVariablesIn RDIM_BakeGlobalVariablesIn;
|
||||||
|
struct RDIM_BakeGlobalVariablesIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_SymbolChunkList *global_variables;
|
||||||
|
RDI_U64 *type_indices;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeGlobalVMapIn RDIM_BakeGlobalVMapIn;
|
||||||
|
struct RDIM_BakeGlobalVMapIn
|
||||||
|
{
|
||||||
|
RDIM_SymbolChunkList *global_variables;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeThreadVariablesIn RDIM_BakeThreadVariablesIn;
|
||||||
|
struct RDIM_BakeThreadVariablesIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_SymbolChunkList *thread_variables;
|
||||||
|
RDI_U64 *type_indices;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeProceduresIn RDIM_BakeProceduresIn;
|
||||||
|
struct RDIM_BakeProceduresIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_SymbolChunkList *procedures;
|
||||||
|
RDI_U64 *type_indices;
|
||||||
|
RDIM_String8List *location_blocks;
|
||||||
|
RDIM_String8List *location_data_blobs;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeScopesIn RDIM_BakeScopesIn;
|
||||||
|
struct RDIM_BakeScopesIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_ScopeChunkList *scopes;
|
||||||
|
RDI_U64 *type_indices;
|
||||||
|
RDIM_String8List *location_blocks;
|
||||||
|
RDIM_String8List *location_data_blobs;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeScopeVMapIn RDIM_BakeScopeVMapIn;
|
||||||
|
struct RDIM_BakeScopeVMapIn
|
||||||
|
{
|
||||||
|
RDIM_ScopeChunkList *scopes;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeInlineSitesIn RDIM_BakeInlineSitesIn;
|
||||||
|
struct RDIM_BakeInlineSitesIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_InlineSiteChunkList *inline_sites;
|
||||||
|
RDI_U64 *type_indices;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeFilePathsIn RDIM_BakeFilePathsIn;
|
||||||
|
struct RDIM_BakeFilePathsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_BakePathTree *path_tree;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeStringsIn RDIM_BakeStringsIn;
|
||||||
|
struct RDIM_BakeStringsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeTypeNodesIn RDIM_BakeTypeNodesIn;
|
||||||
|
struct RDIM_BakeTypeNodesIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_BakeIdxRunMap *idx_runs;
|
||||||
|
RDIM_TypeChunkList *types;
|
||||||
|
RDI_U64 *type_indices;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeNameMapIn RDIM_BakeNameMapIn;
|
||||||
|
struct RDIM_BakeNameMapIn
|
||||||
|
{
|
||||||
|
RDIM_BakeStringMapTight *strings;
|
||||||
|
RDIM_BakeIdxRunMap *idx_runs;
|
||||||
|
RDIM_BakeNameMap *map;
|
||||||
|
RDI_NameMapKind kind;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_BakeIdxRunsIn RDIM_BakeIdxRunsIn;
|
||||||
|
struct RDIM_BakeIdxRunsIn
|
||||||
|
{
|
||||||
|
RDIM_BakeIdxRunMap *idx_runs;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
internal RDIM_DataModel rdim_infer_data_model(OperatingSystem os, RDI_Arch arch);
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: Baking Stage Tasks
|
||||||
|
|
||||||
|
//- rjf: unsorted bake string map building
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_src_files_strings_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_units_strings_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_types_strings_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_udts_strings_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_symbols_strings_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_scopes_strings_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_line_tables_work);
|
||||||
|
|
||||||
|
//- rjf: bake string map joining
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_string_map_join_work);
|
||||||
|
|
||||||
|
//- rjf: bake string map sorting
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_string_map_sort_work);
|
||||||
|
|
||||||
|
//- rjf: pass 1: interner/deduper map builds
|
||||||
|
ASYNC_WORK_DEF(rdim_build_bake_name_map_work);
|
||||||
|
|
||||||
|
//- rjf: pass 2: string-map-dependent debug info stream builds
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_units_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_unit_vmap_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_src_files_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_udts_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_global_variables_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_global_vmap_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_thread_variables_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_procedures_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_scopes_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_scope_vmap_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_file_paths_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_strings_work);
|
||||||
|
|
||||||
|
//- rjf: pass 3: idx-run-map-dependent debug info stream builds
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_type_nodes_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_name_map_work);
|
||||||
|
ASYNC_WORK_DEF(rdim_bake_idx_runs_work);
|
||||||
|
|
||||||
|
typedef struct RDIM_LocalState RDIM_LocalState;
|
||||||
|
struct RDIM_LocalState
|
||||||
|
{
|
||||||
|
Arena *arena;
|
||||||
|
U64 work_thread_arenas_count;
|
||||||
|
Arena **work_thread_arenas;
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
global RDIM_LocalState *rdim_local_state = 0;
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
#endif // RDI_MAKE_LOCAL_H
|
||||||
|
|||||||
Reference in New Issue
Block a user