eliminate all old conversion/baking code

This commit is contained in:
Ryan Fleury
2025-09-05 17:02:56 -07:00
parent 78530fb10d
commit 51ef166e60
17 changed files with 3149 additions and 10431 deletions
File diff suppressed because it is too large Load Diff
+87 -254
View File
@@ -19,88 +19,7 @@ struct P2R_ConvertParams
};
////////////////////////////////
//~ rjf: Initial PDB Information Extraction & Conversion Preparation Task Types
//- rjf: tpi hash parsing
typedef struct P2R_TPIHashParseIn P2R_TPIHashParseIn;
struct P2R_TPIHashParseIn
{
PDB_Strtbl *strtbl;
PDB_TpiParsed *tpi;
String8 hash_data;
String8 aux_data;
};
//- rjf: tpi leaves parsing
typedef struct P2R_TPILeafParseIn P2R_TPILeafParseIn;
struct P2R_TPILeafParseIn
{
String8 leaf_data;
CV_TypeId itype_first;
};
//- rjf: exe hashing
typedef struct P2R_EXEHashIn P2R_EXEHashIn;
struct P2R_EXEHashIn
{
String8 exe_data;
};
//- rjf: symbol stream parsing
typedef struct P2R_SymbolStreamParseIn P2R_SymbolStreamParseIn;
struct P2R_SymbolStreamParseIn
{
String8 data;
};
//- rjf: c13 line info stream parsing
typedef struct P2R_C13StreamParseIn P2R_C13StreamParseIn;
struct P2R_C13StreamParseIn
{
String8 data;
String8 strtbl;
COFF_SectionHeaderArray coff_sections;
};
//- rjf: comp unit parsing
typedef struct P2R_CompUnitParseIn P2R_CompUnitParseIn;
struct P2R_CompUnitParseIn
{
String8 data;
};
//- rjf: comp unit contribution table parsing
typedef struct P2R_CompUnitContributionsParseIn P2R_CompUnitContributionsParseIn;
struct P2R_CompUnitContributionsParseIn
{
String8 data;
COFF_SectionHeaderArray coff_sections;
};
//- rjf: comp unit contribution table bucketing by unit
typedef struct P2R_CompUnitContributionsBucketIn P2R_CompUnitContributionsBucketIn;
struct P2R_CompUnitContributionsBucketIn
{
U64 comp_unit_count;
PDB_CompUnitContributionArray contributions;
};
typedef struct P2R_CompUnitContributionsBucketOut P2R_CompUnitContributionsBucketOut;
struct P2R_CompUnitContributionsBucketOut
{
RDIM_Rng1U64ChunkList *unit_ranges;
};
////////////////////////////////
//~ rjf: Conversion Data Structure & Task Types
//~ rjf: Shared Conversion State
//- rjf: link name map (voff -> string)
@@ -137,79 +56,7 @@ struct P2R_SrcFileMap
U64 slots_count;
};
//- rjf: per-unit source files conversion tasks
typedef struct P2R_GatherUnitSrcFilesIn P2R_GatherUnitSrcFilesIn;
struct P2R_GatherUnitSrcFilesIn
{
PDB_Strtbl *pdb_strtbl;
COFF_SectionHeaderArray coff_sections;
PDB_CompUnit *comp_unit;
CV_SymParsed *comp_unit_syms;
CV_C13Parsed *comp_unit_c13s;
};
typedef struct P2R_GatherUnitSrcFilesOut P2R_GatherUnitSrcFilesOut;
struct P2R_GatherUnitSrcFilesOut
{
String8Array src_file_paths;
};
//- rjf: unit conversion tasks
typedef struct P2R_UnitConvertIn P2R_UnitConvertIn;
struct P2R_UnitConvertIn
{
U64 comp_unit_idx;
PDB_Strtbl *pdb_strtbl;
COFF_SectionHeaderArray coff_sections;
PDB_CompUnit *comp_unit;
RDIM_Rng1U64ChunkList comp_unit_ranges;
CV_SymParsed *comp_unit_syms;
CV_C13Parsed *comp_unit_c13s;
P2R_SrcFileMap *src_file_map;
};
typedef struct P2R_UnitConvertOut P2R_UnitConvertOut;
struct P2R_UnitConvertOut
{
RDIM_UnitChunkList units;
RDIM_LineTableChunkList line_tables;
RDIM_LineTable *unit_first_inline_site_line_table;
};
//- rjf: src file sequence equipping task
typedef struct P2R_SrcFileSeqEquipIn P2R_SrcFileSeqEquipIn;
struct P2R_SrcFileSeqEquipIn
{
RDIM_SrcFileChunkList src_files;
RDIM_LineTableChunkList line_tables;
};
//- rjf: link name map building tasks
typedef struct P2R_LinkNameMapBuildIn P2R_LinkNameMapBuildIn;
struct P2R_LinkNameMapBuildIn
{
CV_SymParsed *sym;
COFF_SectionHeaderArray coff_sections;
P2R_LinkNameMap *link_name_map;
};
//- rjf: type forward resolution map build
typedef struct P2R_ITypeFwdMapFillIn P2R_ITypeFwdMapFillIn;
struct P2R_ITypeFwdMapFillIn
{
PDB_TpiHashParsed *tpi_hash;
CV_LeafParsed *tpi_leaf;
CV_TypeId itype_first;
CV_TypeId itype_opl;
CV_TypeId *itype_fwd_map;
};
//- rjf: itype chain build
//- rjf: itype chains
typedef struct P2R_TypeIdChain P2R_TypeIdChain;
struct P2R_TypeIdChain
@@ -218,64 +65,101 @@ struct P2R_TypeIdChain
CV_TypeId itype;
};
typedef struct P2R_ITypeChainBuildIn P2R_ITypeChainBuildIn;
struct P2R_ITypeChainBuildIn
//- rjf: main state bundle
typedef struct P2R2_Shared P2R2_Shared;
struct P2R2_Shared
{
CV_LeafParsed *tpi_leaf;
CV_TypeId itype_first;
CV_TypeId itype_opl;
CV_TypeId *itype_fwd_map;
P2R_TypeIdChain **itype_chains;
};
//- rjf: udt conversion
typedef struct P2R_UDTConvertIn P2R_UDTConvertIn;
struct P2R_UDTConvertIn
{
CV_LeafParsed *tpi_leaf;
CV_TypeId itype_first;
CV_TypeId itype_opl;
CV_TypeId *itype_fwd_map;
RDIM_Type **itype_type_ptrs;
};
//- rjf: symbol stream conversion
typedef struct P2R_SymbolStreamConvertIn P2R_SymbolStreamConvertIn;
struct P2R_SymbolStreamConvertIn
{
B32 parsing_global_stream;
RDI_Arch arch;
MSF_RawStreamTable *msf_raw_stream_table;
U64 msf_stream_lane_counter;
MSF_Parsed *msf;
PDB_Info *pdb_info;
PDB_NamedStreamTable *named_streams;
PDB_Strtbl *strtbl;
String8 raw_strtbl;
PDB_DbiParsed *dbi;
PDB_TpiParsed *tpi;
PDB_TpiParsed *ipi;
COFF_SectionHeaderArray coff_sections;
PDB_GsiParsed *gsi;
PDB_GsiParsed *psi_gsi_part;
U64 exe_hash;
PDB_TpiHashParsed *tpi_hash;
CV_LeafParsed *tpi_leaf;
PDB_TpiHashParsed *ipi_hash;
CV_LeafParsed *ipi_leaf;
CV_SymParsed *sym;
U64 sym_ranges_first;
U64 sym_ranges_opl;
PDB_CompUnitArray *comp_units;
PDB_CompUnitContributionArray *comp_unit_contributions;
RDIM_Rng1U64ChunkList *unit_ranges;
U64 sym_c13_unit_lane_counter;
U64 all_syms_count;
CV_SymParsed **all_syms; // [0] -> global; rest are unit nums
CV_C13Parsed **all_c13s; // [0] -> blank (global); rest are unit nums
U64 exe_voff_max;
RDI_Arch arch;
U64 symbol_count_prediction;
P2R_LinkNameMap link_name_map;
U64 sym_lane_take_counter;
String8Array *unit_file_paths;
U64Array *unit_file_paths_hashes;
U64 total_path_count;
RDIM_SrcFileChunkList all_src_files__sequenceless;
P2R_SrcFileMap src_file_map;
RDIM_UnitChunkList all_units;
RDIM_LineTableChunkList *units_line_tables;
RDIM_LineTable **units_first_inline_site_line_tables;
RDIM_LineTableChunkList all_line_tables;
CV_TypeId *itype_fwd_map;
CV_TypeId itype_first;
CV_TypeId itype_opl;
P2R_TypeIdChain **itype_chains;
RDIM_Type **itype_type_ptrs;
P2R_LinkNameMap *link_name_map;
RDIM_LineTable *first_inline_site_line_table;
};
typedef struct P2R_SymbolStreamConvertOut P2R_SymbolStreamConvertOut;
struct P2R_SymbolStreamConvertOut
{
RDIM_SymbolChunkList procedures;
RDIM_SymbolChunkList global_variables;
RDIM_SymbolChunkList thread_variables;
RDIM_SymbolChunkList constants;
RDIM_ScopeChunkList scopes;
RDIM_InlineSiteChunkList inline_sites;
RDIM_TypeChunkList typedefs;
RDIM_Type **basic_type_ptrs;
RDIM_TypeChunkList all_types__pre_typedefs;
RDIM_UDTChunkList *lanes_udts;
RDIM_UDTChunkList all_udts;
RDIM_LocationChunkList *syms_locations;
RDIM_SymbolChunkList *syms_procedures;
RDIM_SymbolChunkList *syms_global_variables;
RDIM_SymbolChunkList *syms_thread_variables;
RDIM_SymbolChunkList *syms_constants;
RDIM_ScopeChunkList *syms_scopes;
RDIM_InlineSiteChunkList *syms_inline_sites;
RDIM_TypeChunkList *syms_typedefs;
RDIM_LocationChunkList all_locations;
RDIM_SymbolChunkList all_procedures;
RDIM_SymbolChunkList all_global_variables;
RDIM_SymbolChunkList all_thread_variables;
RDIM_SymbolChunkList all_constants;
RDIM_ScopeChunkList all_scopes;
RDIM_InlineSiteChunkList all_inline_sites;
RDIM_TypeChunkList all_types;
};
////////////////////////////////
//~ rjf: Globals
global ASYNC_Root *p2r_async_root = 0;
global P2R2_Shared *p2r2_shared = 0;
////////////////////////////////
//~ rjf: Basic Helpers
@@ -299,64 +183,13 @@ internal RDI_TypeKind p2r_rdi_type_kind_from_cv_basic_type(CV_BasicType basic_ty
////////////////////////////////
//~ rjf: Location Info Building Helpers
internal RDIM_Location *p2r_location_from_addr_reg_off(Arena *arena, RDI_Arch arch, RDI_RegCode reg_code, U32 reg_byte_size, U32 reg_byte_pos, S64 offset, B32 extra_indirection);
internal RDI_RegCode p2r_reg_code_from_arch_encoded_fp_reg(RDI_Arch arch, CV_EncodedFramePtrReg encoded_reg);
internal void p2r_location_over_lvar_addr_range(Arena *arena, RDIM_ScopeChunkList *scopes, RDIM_LocationSet *locset, RDIM_Location *location, CV_LvarAddrRange *range, COFF_SectionHeader *section, CV_LvarAddrGap *gaps, U64 gap_count);
internal RDIM_LocationInfo p2r2_location_info_from_addr_reg_off(Arena *arena, RDI_Arch arch, RDI_RegCode reg_code, U32 reg_byte_size, U32 reg_byte_pos, S64 offset, B32 extra_indirection);
internal void p2r2_local_push_location_cases_over_lvar_addr_range(Arena *arena, RDIM_ScopeChunkList *scopes, RDIM_Local *local, RDIM_Location2 *loc, CV_LvarAddrRange *range, COFF_SectionHeader *section, CV_LvarAddrGap *gaps, U64 gap_count);
////////////////////////////////
//~ rjf: Initial Parsing & Preparation Pass Tasks
ASYNC_WORK_DEF(p2r_exe_hash_work);
ASYNC_WORK_DEF(p2r_tpi_hash_parse_work);
ASYNC_WORK_DEF(p2r_tpi_leaf_work);
ASYNC_WORK_DEF(p2r_symbol_stream_parse_work);
ASYNC_WORK_DEF(p2r_c13_stream_parse_work);
ASYNC_WORK_DEF(p2r_comp_unit_parse_work);
ASYNC_WORK_DEF(p2r_comp_unit_contributions_parse_work);
ASYNC_WORK_DEF(p2r_comp_unit_contributions_bucket_work);
////////////////////////////////
//~ rjf: Unit Source File Gathering Tasks
ASYNC_WORK_DEF(p2r_gather_unit_src_file_work);
////////////////////////////////
//~ rjf: Unit Conversion Tasks
ASYNC_WORK_DEF(p2r_unit_convert_work);
////////////////////////////////
//~ rjf: Source File Sequence Equipping Task
ASYNC_WORK_DEF(p2r_src_file_seq_equip_work);
////////////////////////////////
//~ rjf: Link Name Map Building Tasks
ASYNC_WORK_DEF(p2r_link_name_map_build_work);
////////////////////////////////
//~ rjf: Type Parsing/Conversion Tasks
ASYNC_WORK_DEF(p2r_itype_fwd_map_fill_work);
ASYNC_WORK_DEF(p2r_itype_chain_build_work);
////////////////////////////////
//~ rjf: UDT Conversion Tasks
ASYNC_WORK_DEF(p2r_udt_convert_work);
////////////////////////////////
//~ rjf: Symbol Stream Conversion Tasks
ASYNC_WORK_DEF(p2r_symbol_stream_convert_work);
internal void p2r2_local_push_location_cases_over_lvar_addr_range(Arena *arena, RDIM_ScopeChunkList *scopes, RDIM_Local *local, RDIM_Location *loc, CV_LvarAddrRange *range, COFF_SectionHeader *section, CV_LvarAddrGap *gaps, U64 gap_count);
////////////////////////////////
//~ rjf: Top-Level Conversion Entry Point
internal RDIM_BakeParams p2r2_convert(Arena *arena, P2R_ConvertParams *params);
internal RDIM_BakeParams p2r_convert(Arena *arena, P2R_ConvertParams *params);
#endif // RDI_FROM_PDB_H
-2
View File
@@ -1,2 +0,0 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
-111
View File
@@ -1,111 +0,0 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef RDI_FROM_PDB_2_H
#define RDI_FROM_PDB_2_H
typedef struct P2R2_ConvertThreadParams P2R2_ConvertThreadParams;
struct P2R2_ConvertThreadParams
{
Arena *arena;
LaneCtx lane_ctx;
String8 input_exe_name;
String8 input_exe_data;
String8 input_pdb_name;
String8 input_pdb_data;
B32 deterministic;
RDIM_BakeParams *out_bake_params;
};
typedef struct P2R2_Shared P2R2_Shared;
struct P2R2_Shared
{
MSF_RawStreamTable *msf_raw_stream_table;
U64 msf_stream_lane_counter;
MSF_Parsed *msf;
PDB_Info *pdb_info;
PDB_NamedStreamTable *named_streams;
PDB_Strtbl *strtbl;
String8 raw_strtbl;
PDB_DbiParsed *dbi;
PDB_TpiParsed *tpi;
PDB_TpiParsed *ipi;
COFF_SectionHeaderArray coff_sections;
PDB_GsiParsed *gsi;
PDB_GsiParsed *psi_gsi_part;
U64 exe_hash;
PDB_TpiHashParsed *tpi_hash;
CV_LeafParsed *tpi_leaf;
PDB_TpiHashParsed *ipi_hash;
CV_LeafParsed *ipi_leaf;
PDB_CompUnitArray *comp_units;
PDB_CompUnitContributionArray *comp_unit_contributions;
RDIM_Rng1U64ChunkList *unit_ranges;
U64 sym_c13_unit_lane_counter;
U64 all_syms_count;
CV_SymParsed **all_syms; // [0] -> global; rest are unit nums
CV_C13Parsed **all_c13s; // [0] -> blank (global); rest are unit nums
U64 exe_voff_max;
RDI_Arch arch;
U64 symbol_count_prediction;
P2R_LinkNameMap link_name_map;
U64 sym_lane_take_counter;
String8Array *unit_file_paths;
U64Array *unit_file_paths_hashes;
U64 total_path_count;
RDIM_SrcFileChunkList all_src_files__sequenceless;
P2R_SrcFileMap src_file_map;
RDIM_UnitChunkList all_units;
RDIM_LineTableChunkList *units_line_tables;
RDIM_LineTable **units_first_inline_site_line_tables;
RDIM_LineTableChunkList all_line_tables;
CV_TypeId *itype_fwd_map;
CV_TypeId itype_first;
CV_TypeId itype_opl;
P2R_TypeIdChain **itype_chains;
RDIM_Type **itype_type_ptrs;
RDIM_Type **basic_type_ptrs;
RDIM_TypeChunkList all_types__pre_typedefs;
RDIM_UDTChunkList *lanes_udts;
RDIM_UDTChunkList all_udts;
RDIM_LocationChunkList *syms_locations;
RDIM_SymbolChunkList *syms_procedures;
RDIM_SymbolChunkList *syms_global_variables;
RDIM_SymbolChunkList *syms_thread_variables;
RDIM_SymbolChunkList *syms_constants;
RDIM_ScopeChunkList *syms_scopes;
RDIM_InlineSiteChunkList *syms_inline_sites;
RDIM_TypeChunkList *syms_typedefs;
RDIM_LocationChunkList all_locations;
RDIM_SymbolChunkList all_procedures;
RDIM_SymbolChunkList all_global_variables;
RDIM_SymbolChunkList all_thread_variables;
RDIM_SymbolChunkList all_constants;
RDIM_ScopeChunkList all_scopes;
RDIM_InlineSiteChunkList all_inline_sites;
RDIM_TypeChunkList all_types;
};
global P2R2_Shared *p2r2_shared = 0;
#endif // RDI_FROM_PDB_2_H