mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 06:18:42 +00:00
checkpoint in implementing pdb hash adjustment table parsing & application
This commit is contained in:
@@ -2935,7 +2935,7 @@ str8_list_pushf(arena, &out->errors, fmt, __VA_ARGS__);\
|
|||||||
if (tpi != 0) ProfScope("parse tpi hash"){
|
if (tpi != 0) ProfScope("parse tpi hash"){
|
||||||
String8 hash_data = msf_data_from_stream(msf, tpi->hash_sn);
|
String8 hash_data = msf_data_from_stream(msf, tpi->hash_sn);
|
||||||
String8 aux_data = msf_data_from_stream(msf, tpi->hash_sn_aux);
|
String8 aux_data = msf_data_from_stream(msf, tpi->hash_sn_aux);
|
||||||
tpi_hash = pdb_tpi_hash_from_data(arena, tpi, hash_data, aux_data);
|
tpi_hash = pdb_tpi_hash_from_data(arena, strtbl, tpi, hash_data, aux_data);
|
||||||
|
|
||||||
PARSE_CHECK_ERROR(tpi_hash, "TPI hash table");
|
PARSE_CHECK_ERROR(tpi_hash, "TPI hash table");
|
||||||
}
|
}
|
||||||
@@ -2954,7 +2954,7 @@ str8_list_pushf(arena, &out->errors, fmt, __VA_ARGS__);\
|
|||||||
if (ipi != 0) ProfScope("parse ipi hash"){
|
if (ipi != 0) ProfScope("parse ipi hash"){
|
||||||
String8 hash_data = msf_data_from_stream(msf, ipi->hash_sn);
|
String8 hash_data = msf_data_from_stream(msf, ipi->hash_sn);
|
||||||
String8 aux_data = msf_data_from_stream(msf, ipi->hash_sn_aux);
|
String8 aux_data = msf_data_from_stream(msf, ipi->hash_sn_aux);
|
||||||
ipi_hash = pdb_tpi_hash_from_data(arena, ipi, hash_data, aux_data);
|
ipi_hash = pdb_tpi_hash_from_data(arena, strtbl, ipi, hash_data, aux_data);
|
||||||
|
|
||||||
PARSE_CHECK_ERROR(tpi_hash, "IPI hash table");
|
PARSE_CHECK_ERROR(tpi_hash, "IPI hash table");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ pdb_tpi_from_data(Arena *arena, String8 data){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PDB_TpiHashParsed*
|
static PDB_TpiHashParsed*
|
||||||
pdb_tpi_hash_from_data(Arena *arena, PDB_TpiParsed *tpi, String8 data, String8 aux_data){
|
pdb_tpi_hash_from_data(Arena *arena, PDB_Strtbl *strtbl, PDB_TpiParsed *tpi, String8 data, String8 aux_data){
|
||||||
ProfBegin("pdb_tpi_hash_from_data");
|
ProfBegin("pdb_tpi_hash_from_data");
|
||||||
|
|
||||||
PDB_TpiHashParsed *result = 0;
|
PDB_TpiHashParsed *result = 0;
|
||||||
@@ -344,6 +344,47 @@ pdb_tpi_hash_from_data(Arena *arena, PDB_TpiParsed *tpi, String8 data, String8 a
|
|||||||
itype += 1;
|
itype += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- rjf: apply hash adjustments, to pull correct type IDs to the front of
|
||||||
|
// the chains
|
||||||
|
#if 0
|
||||||
|
if(tpi->hash_adj_off != 0)
|
||||||
|
{
|
||||||
|
// NOTE(rjf): this table is laid out in the following format:
|
||||||
|
//
|
||||||
|
// pair_count: U32 -> # of name_index/type_index pairs
|
||||||
|
// slot_count: U32 -> # of slots in this hash table
|
||||||
|
// present_bit_array_count: U32 -> count for next array
|
||||||
|
// present_bit_array: U32[present_bit_array_count] -> 1 bit per slot, "is present"
|
||||||
|
// deleted_bit_array_count: U32 -> count for next array
|
||||||
|
// deleted_bit_array: U32[deleted_bit_array_count] -> 1 bit per slot, "is deleted"
|
||||||
|
// (U32, U32)[pair_count] -> array of name_index/type_index pairs
|
||||||
|
//
|
||||||
|
U8 *adjs = data.str + tpi->hash_adj_off;
|
||||||
|
U8 *adjs_opl = adjs + tpi->hash_adj_size;
|
||||||
|
U8 *adjs_cursor = adjs;
|
||||||
|
U32 pair_count = *(U32 *)adjs_cursor;
|
||||||
|
adjs_cursor += sizeof(U32);
|
||||||
|
U32 slot_count = *(U32 *)adjs_cursor;
|
||||||
|
adjs_cursor += sizeof(U32);
|
||||||
|
U32 present_bit_array_count = *(U32 *)adjs_cursor; // skip present_bit_array
|
||||||
|
adjs_cursor += sizeof(U32);
|
||||||
|
adjs_cursor += present_bit_array_count*sizeof(U32);
|
||||||
|
U32 deleted_bit_array_count = *(U32 *)adjs_cursor; // skip deleted_bit_array
|
||||||
|
adjs_cursor += sizeof(U32);
|
||||||
|
adjs_cursor += deleted_bit_array_count*sizeof(U32);
|
||||||
|
U32 adjs_stride = sizeof(U32)*2;
|
||||||
|
U32 pair_idx = 0;
|
||||||
|
for(;adjs_cursor < adjs_opl && pair_idx < pair_count;
|
||||||
|
adjs_cursor += adjs_stride, pair_idx += 1)
|
||||||
|
{
|
||||||
|
U32 name_index = ((U32 *)adjs_cursor)[0];
|
||||||
|
U32 type_index = ((U32 *)adjs_cursor)[1];
|
||||||
|
String8 string = pdb_strtbl_string_from_off(strtbl, name_index);
|
||||||
|
int x = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// fill result
|
// fill result
|
||||||
result = push_array(arena, PDB_TpiHashParsed, 1);
|
result = push_array(arena, PDB_TpiHashParsed, 1);
|
||||||
result->data = data;
|
result->data = data;
|
||||||
|
|||||||
@@ -407,6 +407,7 @@ static PDB_Strtbl* pdb_strtbl_from_data(Arena *arena, String8 strtbl_da
|
|||||||
static PDB_DbiParsed* pdb_dbi_from_data(Arena *arena, String8 dbi_data);
|
static PDB_DbiParsed* pdb_dbi_from_data(Arena *arena, String8 dbi_data);
|
||||||
static PDB_TpiParsed* pdb_tpi_from_data(Arena *arena, String8 tpi_data);
|
static PDB_TpiParsed* pdb_tpi_from_data(Arena *arena, String8 tpi_data);
|
||||||
static PDB_TpiHashParsed* pdb_tpi_hash_from_data(Arena *arena,
|
static PDB_TpiHashParsed* pdb_tpi_hash_from_data(Arena *arena,
|
||||||
|
PDB_Strtbl *strtbl,
|
||||||
PDB_TpiParsed *tpi,
|
PDB_TpiParsed *tpi,
|
||||||
String8 tpi_hash_data,
|
String8 tpi_hash_data,
|
||||||
String8 tpi_hash_aux_data);
|
String8 tpi_hash_aux_data);
|
||||||
|
|||||||
Reference in New Issue
Block a user