mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-24 23:02:20 -08:00
WIP PDB Writer Thread
This commit is contained in:
1 parent
a73e3e0790
commit
c96c9620d0
6 files changed
+343
-21
No files matched your search
@@ -3418,31 +3418,64 @@ pdb_build_gsi_psi(TP_Context *tp, PDB_Context *pdb)
|
||||
}
|
||||
|
||||
internal void
|
||||
pdb_build(TP_Context *tp, TP_Arena *pool_temp, PDB_Context *pdb, CV_StringHashTable string_ht, B32 build_gsi, B32 is_stripped)
|
||||
pdb_build_types(TP_Context *tp, PDB_Context *pdb, PDB_BuildHooks *hooks)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
|
||||
|
||||
PDB_InfoContext *info = pdb->info;
|
||||
PDB_StringTable *strtab = &info->strtab;
|
||||
PDB_DbiContext *dbi = pdb->dbi;
|
||||
PDB_TypeServer *tpi = pdb->type_servers[CV_TypeIndexSource_TPI];
|
||||
PDB_TypeServer *ipi = pdb->type_servers[CV_TypeIndexSource_IPI];
|
||||
|
||||
|
||||
pdb_type_server_build(tp, tpi, strtab, pdb->msf, PDB_FixedStream_Tpi);
|
||||
if (hooks && hooks->stream_finalize) {
|
||||
hooks->stream_finalize(hooks->user_data, pdb->msf, PDB_FixedStream_Tpi);
|
||||
hooks->stream_finalize(hooks->user_data, pdb->msf, tpi->hash_sn);
|
||||
}
|
||||
if (info->flags & PDB_FeatureFlag_HAS_ID_STREAM) {
|
||||
pdb_type_server_build(tp, ipi, strtab, pdb->msf, PDB_FixedStream_Ipi);
|
||||
if (hooks && hooks->stream_finalize) {
|
||||
hooks->stream_finalize(hooks->user_data, pdb->msf, PDB_FixedStream_Ipi);
|
||||
hooks->stream_finalize(hooks->user_data, pdb->msf, ipi->hash_sn);
|
||||
}
|
||||
}
|
||||
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
internal void
|
||||
pdb_build_dbi_info(TP_Context *tp, PDB_Context *pdb, CV_StringHashTable string_ht, B32 build_gsi, B32 is_stripped, PDB_BuildHooks *hooks)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
|
||||
if (build_gsi) {
|
||||
pdb_build_gsi_psi(tp, pdb);
|
||||
}
|
||||
|
||||
dbi_build(tp, pdb->dbi, pdb->msf, PDB_FixedStream_Dbi, string_ht, is_stripped);
|
||||
if (hooks && hooks->stream_finalize) {
|
||||
hooks->stream_finalize(hooks->user_data, pdb->msf, PDB_FixedStream_Dbi);
|
||||
for EachElement(i, pdb->dbi->dbg_streams) {
|
||||
hooks->stream_finalize(hooks->user_data, pdb->msf, pdb->dbi->dbg_streams[i]);
|
||||
}
|
||||
}
|
||||
pdb_info_build(pdb->info, pdb->msf, PDB_FixedStream_Info);
|
||||
if (hooks && hooks->stream_finalize) {
|
||||
hooks->stream_finalize(hooks->user_data, pdb->msf, PDB_FixedStream_Info);
|
||||
}
|
||||
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
internal void
|
||||
pdb_build(TP_Context *tp, TP_Arena *pool_temp, PDB_Context *pdb, CV_StringHashTable string_ht, B32 build_gsi, B32 is_stripped, PDB_BuildHooks *hooks)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
pdb_build_types(tp, pdb, hooks);
|
||||
pdb_build_dbi_info(tp, pdb, string_ht, build_gsi, is_stripped, hooks);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
internal String8
|
||||
|
||||
@@ -310,6 +310,13 @@ typedef struct PDB_Context
|
||||
PDB_TypeServer *type_servers[CV_TypeIndexSource_COUNT];
|
||||
} PDB_Context;
|
||||
|
||||
typedef void PDB_StreamFinalizeFunc(void *user_data, MSF_Context *msf, MSF_StreamNumber sn);
|
||||
typedef struct PDB_BuildHooks
|
||||
{
|
||||
PDB_StreamFinalizeFunc *stream_finalize;
|
||||
void *user_data;
|
||||
} PDB_BuildHooks;
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
typedef struct
|
||||
@@ -334,7 +341,9 @@ typedef struct
|
||||
|
||||
internal PDB_Context * pdb_alloc(U64 page_size, COFF_MachineType machine, COFF_TimeStamp time_stamp, U32 age, Guid guid);
|
||||
internal void pdb_release(PDB_Context *pdb);
|
||||
internal void pdb_build(TP_Context *tp, TP_Arena *pool_temp, PDB_Context *pdb, CV_StringHashTable string_ht, B32 build_gsi, B32 is_stripped);
|
||||
internal void pdb_build_types(TP_Context *tp, PDB_Context *pdb, PDB_BuildHooks *hooks);
|
||||
internal void pdb_build_dbi_info(TP_Context *tp, PDB_Context *pdb, CV_StringHashTable string_ht, B32 build_gsi, B32 is_stripped, PDB_BuildHooks *hooks);
|
||||
internal void pdb_build(TP_Context *tp, TP_Arena *pool_temp, PDB_Context *pdb, CV_StringHashTable string_ht, B32 build_gsi, B32 is_stripped, PDB_BuildHooks *hooks);
|
||||
internal void pdb_set_machine(PDB_Context *pdb, COFF_MachineType machine);
|
||||
internal void pdb_set_guid(PDB_Context *pdb, Guid guid);
|
||||
internal void pdb_set_time_stamp(PDB_Context *pdb, COFF_TimeStamp time_stamp);
|
||||
@@ -461,5 +470,3 @@ internal PDB_TypeHashStreamInfo pdb_type_hash_stream_build(TP_Context *tp, PDB_
|
||||
// Enum -> String
|
||||
|
||||
internal String8 pdb_string_from_src_error(PDB_SrcError error);
|
||||
|
||||
|
||||
Reference in new issue
Block a user