mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-24 20:54:59 -07:00
begin untangling source file & path tree building in converter/maker/baker; this cannot happen as another implicitly-mutated-context thing that magically happens behing a top-level 'baking' function. instead, this needs to be constructed according to the rules of the user, and passed to baking stages as a batch
This commit is contained in:
+230
-194
@@ -451,6 +451,69 @@ rdim_binary_section_list_push(RDIM_Arena *arena, RDIM_BinarySectionList *list)
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Source File Info Building
|
||||
|
||||
RDI_PROC RDIM_SrcFile *
|
||||
rdim_src_file_chunk_list_push(RDIM_Arena *arena, RDIM_SrcFileChunkList *list, RDI_U64 cap)
|
||||
{
|
||||
RDIM_SrcFileChunkNode *n = list->last;
|
||||
if(n == 0 || n->count >= n->cap)
|
||||
{
|
||||
n = rdim_push_array(arena, RDIM_SrcFileChunkNode, 1);
|
||||
n->cap = cap;
|
||||
n->base_idx = list->total_count;
|
||||
n->v = rdim_push_array(arena, RDIM_SrcFile, n->cap);
|
||||
RDIM_SLLQueuePush(list->first, list->last, n);
|
||||
list->chunk_count += 1;
|
||||
}
|
||||
RDIM_SrcFile *src_file = &n->v[n->count];
|
||||
src_file->chunk = n;
|
||||
n->count += 1;
|
||||
list->total_count += 1;
|
||||
return src_file;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U64
|
||||
rdim_idx_from_src_file(RDIM_SrcFile *src_file)
|
||||
{
|
||||
RDI_U64 idx = 0;
|
||||
if(src_file != 0 && src_file->chunk != 0)
|
||||
{
|
||||
idx = src_file->chunk->base_idx + (src_file - src_file->chunk->v);
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_src_file_chunk_list_concat_in_place(RDIM_SrcFileChunkList *dst, RDIM_SrcFileChunkList *to_push)
|
||||
{
|
||||
for(RDIM_SrcFileChunkNode *n = to_push->first; n != 0; n = n->next)
|
||||
{
|
||||
n->base_idx += dst->total_count;
|
||||
}
|
||||
if(dst->last != 0 && to_push->first != 0)
|
||||
{
|
||||
dst->last->next = to_push->first;
|
||||
dst->last = to_push->last;
|
||||
dst->chunk_count += to_push->chunk_count;
|
||||
dst->total_count += to_push->total_count;
|
||||
}
|
||||
else if(dst->first == 0)
|
||||
{
|
||||
rdim_memcpy_struct(dst, to_push);
|
||||
}
|
||||
rdim_memzero_struct(to_push);
|
||||
}
|
||||
|
||||
RDI_PROC void
|
||||
rdim_src_file_push_line_sequence(RDIM_Arena *arena, RDIM_SrcFileChunkList *src_files, RDIM_SrcFile *src_file, RDIM_LineSequence *seq)
|
||||
{
|
||||
RDIM_SrcFileLineMapFragment *fragment = rdim_push_array(arena, RDIM_SrcFileLineMapFragment, 1);
|
||||
fragment->seq = seq;
|
||||
RDIM_SLLQueuePush(src_file->first_line_map_fragment, src_file->last_line_map_fragment, fragment);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Unit List Building
|
||||
|
||||
@@ -1157,23 +1220,6 @@ rdim_bake_path_node_from_string(RDIM_Arena *arena, RDIM_BakePathTree *tree, RDIM
|
||||
return node;
|
||||
}
|
||||
|
||||
RDI_PROC RDIM_BakeSrcNode *
|
||||
rdim_bake_src_node_from_path_node(RDIM_Arena *arena, RDIM_BakePathTree *tree, RDIM_BakePathNode *path_node)
|
||||
{
|
||||
RDIM_BakeSrcNode *src_node = path_node->src_file;
|
||||
if(src_node == 0)
|
||||
{
|
||||
src_node = rdim_push_array(arena, RDIM_BakeSrcNode, 1);
|
||||
path_node->src_file = src_node;
|
||||
src_node->path_node = path_node;
|
||||
src_node->normal_full_path = rdim_normal_string_from_bake_path_node(arena, path_node);
|
||||
src_node->idx = tree->src_count;
|
||||
tree->src_count += 1;
|
||||
RDIM_SLLQueuePush(tree->src_first, tree->src_last, src_node);
|
||||
}
|
||||
return src_node;
|
||||
}
|
||||
|
||||
RDI_PROC RDI_U32
|
||||
rdim_bake_path(RDIM_Arena *arena, RDIM_BakePathTree *tree, RDIM_String8 string)
|
||||
{
|
||||
@@ -1435,8 +1481,6 @@ rdim_bake_sections_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
|
||||
name_maps[k].slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, name_maps[k].slots_count);
|
||||
}
|
||||
RDIM_BakePathNode *nil_path = rdim_bake_path_node_from_string(arena, &path_tree, rdim_str8_lit("<nil>"));
|
||||
RDIM_BakeSrcNode *nil_src = rdim_bake_src_node_from_path_node(arena, &path_tree, nil_path);
|
||||
(void)nil_src;
|
||||
rdim_bake_string(arena, &strings, rdim_str8_lit(""));
|
||||
rdim_bake_idx_run(arena, &idx_runs, 0, 0);
|
||||
}
|
||||
@@ -1532,14 +1576,12 @@ rdim_bake_sections_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
|
||||
for(RDIM_LineSequenceNode *seq_n = src->line_sequences.first; seq_n != 0; seq_n = seq_n->next)
|
||||
{
|
||||
RDIM_LineSequence *seq = &seq_n->v;
|
||||
RDIM_BakePathNode *src_path = rdim_bake_path_node_from_string(arena, &path_tree, seq->file_name);
|
||||
RDIM_BakeSrcNode *src_file = rdim_bake_src_node_from_path_node(arena, &path_tree, src_path);
|
||||
for(RDI_U64 line_idx = 0; line_idx < seq->line_count; line_idx += 1)
|
||||
{
|
||||
key_ptr->key = seq->voffs[line_idx];
|
||||
key_ptr->val = rec_ptr;
|
||||
key_ptr += 1;
|
||||
rec_ptr->file_id = src_file->idx;
|
||||
rec_ptr->file_id = (RDI_U32)rdim_idx_from_src_file(seq->src_file); // TODO(rjf): @u64_to_u32
|
||||
rec_ptr->line_num = seq->line_nums[line_idx];
|
||||
if(seq->col_nums != 0)
|
||||
{
|
||||
@@ -1551,10 +1593,6 @@ rdim_bake_sections_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
|
||||
key_ptr->key = seq->voffs[seq->line_count];
|
||||
key_ptr->val = 0;
|
||||
key_ptr += 1;
|
||||
|
||||
RDIM_BakeLineMapFragment *fragment = rdim_push_array(arena, RDIM_BakeLineMapFragment, 1);
|
||||
RDIM_SLLQueuePush(src_file->first_fragment, src_file->last_fragment, fragment);
|
||||
fragment->seq = seq;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1635,162 +1673,185 @@ rdim_bake_sections_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: build section for per-source-file line info
|
||||
//- rjf: build per-source-file info sections
|
||||
//
|
||||
RDIM_ProfScope("build section for per-source-file line info")
|
||||
RDIM_ProfScope("build per-source-file info sections")
|
||||
{
|
||||
for(RDIM_BakeSrcNode *src_file_node = path_tree.src_first;
|
||||
src_file_node != 0;
|
||||
src_file_node = src_file_node->next)
|
||||
////////////////////////////
|
||||
//- rjf: iterate all source files, fill serialized version, build sections for line info
|
||||
//
|
||||
RDI_U32 dst_files_count = params->src_files.total_count;
|
||||
RDI_SourceFile *dst_files = rdim_push_array(arena, RDI_SourceFile, dst_files_count);
|
||||
RDI_U32 dst_file_idx = 0;
|
||||
for(RDIM_SrcFileChunkNode *chunk_n = params->src_files.first;
|
||||
chunk_n != 0;
|
||||
chunk_n = chunk_n->next)
|
||||
{
|
||||
//////////////////////////
|
||||
//- rjf: produce combined source file line info
|
||||
//
|
||||
RDI_U32 *src_file_line_nums = 0;
|
||||
RDI_U32 *src_file_line_ranges = 0;
|
||||
RDI_U64 *src_file_voffs = 0;
|
||||
RDI_U32 src_file_line_count = 0;
|
||||
RDI_U32 src_file_voff_count = 0;
|
||||
for(RDI_U64 idx = 0; idx < chunk_n->count; idx += 1, dst_file_idx += 1)
|
||||
{
|
||||
RDIM_Temp scratch = rdim_scratch_begin(&arena, 1);
|
||||
RDIM_SrcFile *src_file = &chunk_n->v[idx];
|
||||
RDI_SourceFile *dst_file = &dst_files[dst_file_idx];
|
||||
|
||||
//- rjf: gather line number map
|
||||
typedef struct RDIM_SrcLineMapVoffBlock RDIM_SrcLineMapVoffBlock;
|
||||
struct RDIM_SrcLineMapVoffBlock
|
||||
////////////////////////
|
||||
//- rjf: fill basics
|
||||
//
|
||||
dst_file->file_path_node_idx = rdim_bake_path_node_from_string(arena, &path_tree, src_file->normal_full_path)->idx;
|
||||
dst_file->normal_full_path_string_idx = rdim_bake_string(arena, &strings, src_file->normal_full_path);
|
||||
|
||||
////////////////////////
|
||||
//- rjf: produce combined source file line info
|
||||
//
|
||||
RDI_U32 *src_file_line_nums = 0;
|
||||
RDI_U32 *src_file_line_ranges = 0;
|
||||
RDI_U64 *src_file_voffs = 0;
|
||||
RDI_U32 src_file_line_count = 0;
|
||||
RDI_U32 src_file_voff_count = 0;
|
||||
{
|
||||
RDIM_SrcLineMapVoffBlock *next;
|
||||
RDI_U64 voff;
|
||||
};
|
||||
typedef struct RDIM_SrcLineMapBucket RDIM_SrcLineMapBucket;
|
||||
struct RDIM_SrcLineMapBucket
|
||||
{
|
||||
RDIM_SrcLineMapBucket *order_next;
|
||||
RDIM_SrcLineMapBucket *hash_next;
|
||||
RDI_U32 line_num;
|
||||
RDIM_SrcLineMapVoffBlock *first_voff_block;
|
||||
RDIM_SrcLineMapVoffBlock *last_voff_block;
|
||||
RDI_U64 voff_count;
|
||||
};
|
||||
RDIM_SrcLineMapBucket *first_bucket = 0;
|
||||
RDIM_SrcLineMapBucket *last_bucket = 0;
|
||||
RDI_U64 line_hash_slots_count = 2048;
|
||||
RDIM_SrcLineMapBucket **line_hash_slots = rdim_push_array(scratch.arena, RDIM_SrcLineMapBucket *, line_hash_slots_count);
|
||||
RDI_U64 line_count = 0;
|
||||
RDI_U64 voff_count = 0;
|
||||
RDI_U64 max_line_num = 0;
|
||||
{
|
||||
for(RDIM_BakeLineMapFragment *map_fragment = src_file_node->first_fragment;
|
||||
map_fragment != 0;
|
||||
map_fragment = map_fragment->next)
|
||||
RDIM_Temp scratch = rdim_scratch_begin(&arena, 1);
|
||||
|
||||
//- rjf: gather line number map
|
||||
typedef struct RDIM_SrcLineMapVoffBlock RDIM_SrcLineMapVoffBlock;
|
||||
struct RDIM_SrcLineMapVoffBlock
|
||||
{
|
||||
RDIM_LineSequence *sequence = map_fragment->seq;
|
||||
RDI_U64 *seq_voffs = sequence->voffs;
|
||||
RDI_U32 *seq_line_nums = sequence->line_nums;
|
||||
RDI_U64 seq_line_count = sequence->line_count;
|
||||
for(RDI_U64 i = 0; i < seq_line_count; i += 1)
|
||||
RDIM_SrcLineMapVoffBlock *next;
|
||||
RDI_U64 voff;
|
||||
};
|
||||
typedef struct RDIM_SrcLineMapBucket RDIM_SrcLineMapBucket;
|
||||
struct RDIM_SrcLineMapBucket
|
||||
{
|
||||
RDIM_SrcLineMapBucket *order_next;
|
||||
RDIM_SrcLineMapBucket *hash_next;
|
||||
RDI_U32 line_num;
|
||||
RDIM_SrcLineMapVoffBlock *first_voff_block;
|
||||
RDIM_SrcLineMapVoffBlock *last_voff_block;
|
||||
RDI_U64 voff_count;
|
||||
};
|
||||
RDIM_SrcLineMapBucket *first_bucket = 0;
|
||||
RDIM_SrcLineMapBucket *last_bucket = 0;
|
||||
RDI_U64 line_hash_slots_count = 2048;
|
||||
RDIM_SrcLineMapBucket **line_hash_slots = rdim_push_array(scratch.arena, RDIM_SrcLineMapBucket *, line_hash_slots_count);
|
||||
RDI_U64 line_count = 0;
|
||||
RDI_U64 voff_count = 0;
|
||||
RDI_U64 max_line_num = 0;
|
||||
{
|
||||
for(RDIM_SrcFileLineMapFragment *map_fragment = src_file->first_line_map_fragment;
|
||||
map_fragment != 0;
|
||||
map_fragment = map_fragment->next)
|
||||
{
|
||||
RDI_U32 line_num = seq_line_nums[i];
|
||||
RDI_U64 voff = seq_voffs[i];
|
||||
RDI_U64 line_hash_slot_idx = line_num%line_hash_slots_count;
|
||||
|
||||
// rjf: update unique voff counter & max line number
|
||||
voff_count += 1;
|
||||
max_line_num = Max(max_line_num, line_num);
|
||||
|
||||
// rjf: find match
|
||||
RDIM_SrcLineMapBucket *match = 0;
|
||||
RDIM_LineSequence *sequence = map_fragment->seq;
|
||||
RDI_U64 *seq_voffs = sequence->voffs;
|
||||
RDI_U32 *seq_line_nums = sequence->line_nums;
|
||||
RDI_U64 seq_line_count = sequence->line_count;
|
||||
for(RDI_U64 i = 0; i < seq_line_count; i += 1)
|
||||
{
|
||||
for(RDIM_SrcLineMapBucket *node = line_hash_slots[line_hash_slot_idx];
|
||||
node != 0;
|
||||
node = node->hash_next)
|
||||
RDI_U32 line_num = seq_line_nums[i];
|
||||
RDI_U64 voff = seq_voffs[i];
|
||||
RDI_U64 line_hash_slot_idx = line_num%line_hash_slots_count;
|
||||
|
||||
// rjf: update unique voff counter & max line number
|
||||
voff_count += 1;
|
||||
max_line_num = Max(max_line_num, line_num);
|
||||
|
||||
// rjf: find match
|
||||
RDIM_SrcLineMapBucket *match = 0;
|
||||
{
|
||||
if(node->line_num == line_num)
|
||||
for(RDIM_SrcLineMapBucket *node = line_hash_slots[line_hash_slot_idx];
|
||||
node != 0;
|
||||
node = node->hash_next)
|
||||
{
|
||||
match = node;
|
||||
break;
|
||||
if(node->line_num == line_num)
|
||||
{
|
||||
match = node;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: introduce new map if no match
|
||||
if(match == 0)
|
||||
{
|
||||
match = rdim_push_array(scratch.arena, RDIM_SrcLineMapBucket, 1);
|
||||
RDIM_SLLQueuePush_N(first_bucket, last_bucket, match, order_next);
|
||||
RDIM_SLLStackPush_N(line_hash_slots[line_hash_slot_idx], match, hash_next);
|
||||
match->line_num = line_num;
|
||||
line_count += 1;
|
||||
}
|
||||
|
||||
// rjf: insert new voff
|
||||
{
|
||||
RDIM_SrcLineMapVoffBlock *block = rdim_push_array(scratch.arena, RDIM_SrcLineMapVoffBlock, 1);
|
||||
RDIM_SLLQueuePush(match->first_voff_block, match->last_voff_block, block);
|
||||
match->voff_count += 1;
|
||||
block->voff = voff;
|
||||
|
||||
// rjf: introduce new map if no match
|
||||
if(match == 0)
|
||||
{
|
||||
match = rdim_push_array(scratch.arena, RDIM_SrcLineMapBucket, 1);
|
||||
RDIM_SLLQueuePush_N(first_bucket, last_bucket, match, order_next);
|
||||
RDIM_SLLStackPush_N(line_hash_slots[line_hash_slot_idx], match, hash_next);
|
||||
match->line_num = line_num;
|
||||
line_count += 1;
|
||||
}
|
||||
|
||||
// rjf: insert new voff
|
||||
{
|
||||
RDIM_SrcLineMapVoffBlock *block = rdim_push_array(scratch.arena, RDIM_SrcLineMapVoffBlock, 1);
|
||||
RDIM_SLLQueuePush(match->first_voff_block, match->last_voff_block, block);
|
||||
match->voff_count += 1;
|
||||
block->voff = voff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: bake sortable keys array
|
||||
RDIM_SortKey *keys = rdim_push_array_no_zero(scratch.arena, RDIM_SortKey, line_count);
|
||||
{
|
||||
RDIM_SortKey *key_ptr = keys;
|
||||
for(RDIM_SrcLineMapBucket *node = first_bucket;
|
||||
node != 0;
|
||||
node = node->order_next, key_ptr += 1){
|
||||
key_ptr->key = node->line_num;
|
||||
key_ptr->val = node;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: sort keys array
|
||||
RDIM_SortKey *sorted_keys = rdim_sort_key_array(scratch.arena, keys, line_count);
|
||||
|
||||
//- rjf: bake result
|
||||
RDI_U32 *line_nums = rdim_push_array_no_zero(arena, RDI_U32, line_count);
|
||||
RDI_U32 *line_ranges = rdim_push_array_no_zero(arena, RDI_U32, line_count + 1);
|
||||
RDI_U64 *voffs = rdim_push_array_no_zero(arena, RDI_U64, voff_count);
|
||||
{
|
||||
RDI_U64 *voff_ptr = voffs;
|
||||
for(RDI_U32 i = 0; i < line_count; i += 1)
|
||||
|
||||
//- rjf: bake sortable keys array
|
||||
RDIM_SortKey *keys = rdim_push_array_no_zero(scratch.arena, RDIM_SortKey, line_count);
|
||||
{
|
||||
line_nums[i] = sorted_keys[i].key;
|
||||
line_ranges[i] = (RDI_U32)(voff_ptr - voffs); // TODO(rjf): @u64_to_u32
|
||||
RDIM_SrcLineMapBucket *bucket = (RDIM_SrcLineMapBucket*)sorted_keys[i].val;
|
||||
for(RDIM_SrcLineMapVoffBlock *node = bucket->first_voff_block; node != 0; node = node->next)
|
||||
{
|
||||
*voff_ptr = node->voff;
|
||||
voff_ptr += 1;
|
||||
RDIM_SortKey *key_ptr = keys;
|
||||
for(RDIM_SrcLineMapBucket *node = first_bucket;
|
||||
node != 0;
|
||||
node = node->order_next, key_ptr += 1){
|
||||
key_ptr->key = node->line_num;
|
||||
key_ptr->val = node;
|
||||
}
|
||||
}
|
||||
line_ranges[line_count] = voff_count;
|
||||
|
||||
//- rjf: sort keys array
|
||||
RDIM_SortKey *sorted_keys = rdim_sort_key_array(scratch.arena, keys, line_count);
|
||||
|
||||
//- rjf: bake result
|
||||
RDI_U32 *line_nums = rdim_push_array_no_zero(arena, RDI_U32, line_count);
|
||||
RDI_U32 *line_ranges = rdim_push_array_no_zero(arena, RDI_U32, line_count + 1);
|
||||
RDI_U64 *voffs = rdim_push_array_no_zero(arena, RDI_U64, voff_count);
|
||||
{
|
||||
RDI_U64 *voff_ptr = voffs;
|
||||
for(RDI_U32 i = 0; i < line_count; i += 1)
|
||||
{
|
||||
line_nums[i] = sorted_keys[i].key;
|
||||
line_ranges[i] = (RDI_U32)(voff_ptr - voffs); // TODO(rjf): @u64_to_u32
|
||||
RDIM_SrcLineMapBucket *bucket = (RDIM_SrcLineMapBucket*)sorted_keys[i].val;
|
||||
for(RDIM_SrcLineMapVoffBlock *node = bucket->first_voff_block; node != 0; node = node->next)
|
||||
{
|
||||
*voff_ptr = node->voff;
|
||||
voff_ptr += 1;
|
||||
}
|
||||
}
|
||||
line_ranges[line_count] = voff_count;
|
||||
}
|
||||
|
||||
//- rjf: fill output
|
||||
src_file_line_nums = line_nums;
|
||||
src_file_line_ranges = line_ranges;
|
||||
src_file_line_count = line_count;
|
||||
src_file_voffs = voffs;
|
||||
src_file_voff_count = voff_count;
|
||||
rdim_scratch_end(scratch);
|
||||
}
|
||||
|
||||
//- rjf: fill output
|
||||
src_file_line_nums = line_nums;
|
||||
src_file_line_ranges = line_ranges;
|
||||
src_file_line_count = line_count;
|
||||
src_file_voffs = voffs;
|
||||
src_file_voff_count = voff_count;
|
||||
rdim_scratch_end(scratch);
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
//- rjf: produce data sections for this source file's line info tables
|
||||
//
|
||||
if(src_file_line_count != 0)
|
||||
{
|
||||
src_file_node->line_map_count = src_file_line_count;
|
||||
src_file_node->line_map_nums_data_idx = (RDI_U32)sections.count; // TODO(rjf): @u64_to_u32
|
||||
src_file_node->line_map_range_data_idx = src_file_node->line_map_nums_data_idx+1;
|
||||
src_file_node->line_map_voff_data_idx = src_file_node->line_map_nums_data_idx+2;
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_line_nums, sizeof(*src_file_line_nums)*src_file_line_count, RDI_DataSectionTag_LineMapNumbers);
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_line_ranges, sizeof(*src_file_line_ranges)*(src_file_line_count + 1), RDI_DataSectionTag_LineMapRanges);
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_voffs, sizeof(*src_file_voffs)*src_file_voff_count, RDI_DataSectionTag_LineMapVoffs);
|
||||
//////////////////////////
|
||||
//- rjf: produce data sections for this source file's line info tables
|
||||
//
|
||||
if(src_file_line_count != 0)
|
||||
{
|
||||
dst_file->line_map_count = src_file_line_count;
|
||||
dst_file->line_map_nums_data_idx = (RDI_U32)sections.count; // TODO(rjf): @u64_to_u32
|
||||
dst_file->line_map_range_data_idx = dst_file->line_map_nums_data_idx+1;
|
||||
dst_file->line_map_voff_data_idx = dst_file->line_map_nums_data_idx+2;
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_line_nums, sizeof(*src_file_line_nums)*src_file_line_count, RDI_DataSectionTag_LineMapNumbers);
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_line_ranges, sizeof(*src_file_line_ranges)*(src_file_line_count + 1), RDI_DataSectionTag_LineMapRanges);
|
||||
rdim_bake_section_list_push_new(arena, §ions, src_file_voffs, sizeof(*src_file_voffs)*src_file_voff_count, RDI_DataSectionTag_LineMapVoffs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: build section for all source files
|
||||
//
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_files, sizeof(RDI_SourceFile)*dst_files_count, RDI_DataSectionTag_SourceFiles);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
@@ -1798,11 +1859,16 @@ rdim_bake_sections_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
|
||||
//
|
||||
RDIM_ProfScope("build section for per-source-file line info")
|
||||
{
|
||||
for(RDIM_BakeSrcNode *src_file_node = path_tree.src_first;
|
||||
src_file_node != 0;
|
||||
src_file_node = src_file_node->next)
|
||||
for(RDIM_SrcFileChunkNode *chunk_n = params->src_files.first;
|
||||
chunk_n != 0;
|
||||
chunk_n = chunk_n->next)
|
||||
{
|
||||
rdim_bake_name_map_push(arena, &name_maps[RDI_NameMapKind_NormalSourcePaths], src_file_node->normal_full_path, src_file_node->idx);
|
||||
for(RDI_U64 idx = 0; idx < chunk_n->count; idx += 1)
|
||||
{
|
||||
RDIM_SrcFile *src_file = &chunk_n->v[idx];
|
||||
RDI_U32 src_file_idx = (RDI_U32)rdim_idx_from_src_file(src_file); // TODO(rjf): @u64_to_u32
|
||||
rdim_bake_name_map_push(arena, &name_maps[RDI_NameMapKind_NormalSourcePaths], src_file->normal_full_path, src_file_idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1969,12 +2035,7 @@ rdim_bake_sections_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
|
||||
|
||||
//- rjf: fill basics
|
||||
dst_udt->self_type_idx = (RDI_U32)rdim_idx_from_type(src_udt->self_type); // TODO(rjf): @u64_to_u32
|
||||
if(src_udt->source_path.size != 0)
|
||||
{
|
||||
RDIM_BakePathNode *path_node = rdim_bake_path_node_from_string(arena, &path_tree, src_udt->source_path);
|
||||
RDIM_BakeSrcNode *src_node = rdim_bake_src_node_from_path_node(arena, &path_tree, path_node);
|
||||
dst_udt->file_idx = src_node->idx;
|
||||
}
|
||||
dst_udt->file_idx = (RDI_U32)rdim_idx_from_src_file(src_udt->src_file); // TODO(rjf): @u64_to_u32
|
||||
dst_udt->line = src_udt->line;
|
||||
dst_udt->col = src_udt->col;
|
||||
|
||||
@@ -2601,31 +2662,6 @@ rdim_bake_sections_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_nodes, sizeof(RDI_FilePathNode)*dst_nodes_count, RDI_DataSectionTag_FilePathNodes);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: build sections for source files
|
||||
//
|
||||
RDIM_ProfScope("build sections for source files")
|
||||
{
|
||||
RDI_U32 dst_files_count = path_tree.src_count;
|
||||
RDI_SourceFile *dst_files = rdim_push_array(arena, RDI_SourceFile, dst_files_count);
|
||||
{
|
||||
RDI_U64 dst_file_idx = 0;
|
||||
for(RDIM_BakeSrcNode *src_node = path_tree.src_first;
|
||||
src_node != 0;
|
||||
src_node = src_node->next, dst_file_idx += 1)
|
||||
{
|
||||
RDI_SourceFile *dst_file = &dst_files[dst_file_idx];
|
||||
dst_file->file_path_node_idx = src_node->path_node->idx;
|
||||
dst_file->normal_full_path_string_idx = rdim_bake_string(arena, &strings, src_node->normal_full_path);
|
||||
dst_file->line_map_nums_data_idx = src_node->line_map_nums_data_idx;
|
||||
dst_file->line_map_range_data_idx = src_node->line_map_range_data_idx;
|
||||
dst_file->line_map_count = src_node->line_map_count;
|
||||
dst_file->line_map_voff_data_idx = src_node->line_map_voff_data_idx;
|
||||
}
|
||||
}
|
||||
rdim_bake_section_list_push_new(arena, §ions, dst_files, sizeof(RDI_SourceFile)*dst_files_count, RDI_DataSectionTag_SourceFiles);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: build sections for strings
|
||||
//
|
||||
|
||||
@@ -448,13 +448,51 @@ struct RDIM_BinarySectionList
|
||||
RDI_U64 count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Source File Info Types
|
||||
|
||||
typedef struct RDIM_SrcFileLineMapFragment RDIM_SrcFileLineMapFragment;
|
||||
struct RDIM_SrcFileLineMapFragment
|
||||
{
|
||||
RDIM_SrcFileLineMapFragment *next;
|
||||
struct RDIM_LineSequence *seq;
|
||||
};
|
||||
|
||||
typedef struct RDIM_SrcFile RDIM_SrcFile;
|
||||
struct RDIM_SrcFile
|
||||
{
|
||||
struct RDIM_SrcFileChunkNode *chunk;
|
||||
RDIM_String8 normal_full_path;
|
||||
RDIM_SrcFileLineMapFragment *first_line_map_fragment;
|
||||
RDIM_SrcFileLineMapFragment *last_line_map_fragment;
|
||||
};
|
||||
|
||||
typedef struct RDIM_SrcFileChunkNode RDIM_SrcFileChunkNode;
|
||||
struct RDIM_SrcFileChunkNode
|
||||
{
|
||||
RDIM_SrcFileChunkNode *next;
|
||||
RDIM_SrcFile *v;
|
||||
RDI_U64 count;
|
||||
RDI_U64 cap;
|
||||
RDI_U64 base_idx;
|
||||
};
|
||||
|
||||
typedef struct RDIM_SrcFileChunkList RDIM_SrcFileChunkList;
|
||||
struct RDIM_SrcFileChunkList
|
||||
{
|
||||
RDIM_SrcFileChunkNode *first;
|
||||
RDIM_SrcFileChunkNode *last;
|
||||
RDI_U64 chunk_count;
|
||||
RDI_U64 total_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Per-Compilation-Unit Info Types
|
||||
|
||||
typedef struct RDIM_LineSequence RDIM_LineSequence;
|
||||
struct RDIM_LineSequence
|
||||
{
|
||||
RDIM_String8 file_name;
|
||||
RDIM_SrcFile *src_file;
|
||||
RDI_U64 *voffs; // [line_count + 1] (sorted)
|
||||
RDI_U32 *line_nums; // [line_count]
|
||||
RDI_U16 *col_nums; // [2*line_count]
|
||||
@@ -586,7 +624,7 @@ struct RDIM_UDT
|
||||
RDIM_UDTEnumVal *last_enum_val;
|
||||
RDI_U32 member_count;
|
||||
RDI_U32 enum_val_count;
|
||||
RDIM_String8 source_path;
|
||||
RDIM_SrcFile *src_file;
|
||||
RDI_U32 line;
|
||||
RDI_U32 col;
|
||||
};
|
||||
@@ -767,6 +805,7 @@ struct RDIM_BakeParams
|
||||
RDIM_UnitChunkList units;
|
||||
RDIM_TypeChunkList types;
|
||||
RDIM_UDTChunkList udts;
|
||||
RDIM_SrcFileChunkList src_files;
|
||||
RDIM_SymbolChunkList global_variables;
|
||||
RDIM_SymbolChunkList thread_variables;
|
||||
RDIM_SymbolChunkList procedures;
|
||||
@@ -1003,6 +1042,14 @@ RDI_PROC void rdim_rng1u64_list_push(RDIM_Arena *arena, RDIM_Rng1U64List *list,
|
||||
|
||||
RDI_PROC RDIM_BinarySection *rdim_binary_section_list_push(RDIM_Arena *arena, RDIM_BinarySectionList *list);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Source File Info Building
|
||||
|
||||
RDI_PROC RDIM_SrcFile *rdim_src_file_chunk_list_push(RDIM_Arena *arena, RDIM_SrcFileChunkList *list, RDI_U64 cap);
|
||||
RDI_PROC RDI_U64 rdim_idx_from_src_file(RDIM_SrcFile *src_file);
|
||||
RDI_PROC void rdim_src_file_chunk_list_concat_in_place(RDIM_SrcFileChunkList *dst, RDIM_SrcFileChunkList *to_push);
|
||||
RDI_PROC void rdim_src_file_push_line_sequence(RDIM_Arena *arena, RDIM_SrcFileChunkList *src_files, RDIM_SrcFile *src_file, RDIM_LineSequence *seq);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Unit Info Building
|
||||
|
||||
@@ -1074,7 +1121,6 @@ RDI_PROC RDI_U32 rdim_bake_idx_run(RDIM_Arena *arena, RDIM_BakeIdxRunMap *map, R
|
||||
//- rjf: interned path/file building
|
||||
RDI_PROC RDIM_String8 rdim_normal_string_from_bake_path_node(RDIM_Arena *arena, RDIM_BakePathNode *node);
|
||||
RDI_PROC RDIM_BakePathNode *rdim_bake_path_node_from_string(RDIM_Arena *arena, RDIM_BakePathTree *tree, RDIM_String8 string);
|
||||
RDI_PROC RDIM_BakeSrcNode *rdim_bake_src_node_from_path_node(RDIM_Arena *arena, RDIM_BakePathTree *tree, RDIM_BakePathNode *path_node);
|
||||
RDI_PROC RDI_U32 rdim_bake_path(RDIM_Arena *arena, RDIM_BakePathTree *tree, RDIM_String8 string);
|
||||
|
||||
//- rjf: name maps
|
||||
|
||||
@@ -642,6 +642,7 @@ entry_point(int argc, char **argv)
|
||||
bake_params.units = convert_out->units;
|
||||
bake_params.types = convert_out->types;
|
||||
bake_params.udts = convert_out->udts;
|
||||
bake_params.src_files = convert_out->src_files;
|
||||
bake_params.global_variables = convert_out->global_variables;
|
||||
bake_params.thread_variables = convert_out->thread_variables;
|
||||
bake_params.procedures = convert_out->procedures;
|
||||
|
||||
@@ -206,7 +206,7 @@ rdi_binary_section_flags_from_coff_section_flags(COFF_SectionFlags flags)
|
||||
//~ rjf: CodeView <-> RADDBGI Canonical Conversions
|
||||
|
||||
internal RDI_Arch
|
||||
rdi_arch_from_cv_arch(CV_Arch cv_arch)
|
||||
p2r_rdi_arch_from_cv_arch(CV_Arch cv_arch)
|
||||
{
|
||||
RDI_Arch result = 0;
|
||||
switch(cv_arch)
|
||||
@@ -276,7 +276,7 @@ rdi_arch_from_cv_arch(CV_Arch cv_arch)
|
||||
}
|
||||
|
||||
internal RDI_RegisterCode
|
||||
rdi_reg_code_from_cv_reg_code(RDI_Arch arch, CV_Reg reg_code)
|
||||
p2r_rdi_reg_code_from_cv_reg_code(RDI_Arch arch, CV_Reg reg_code)
|
||||
{
|
||||
RDI_RegisterCode result = 0;
|
||||
switch(arch)
|
||||
@@ -304,7 +304,7 @@ rdi_reg_code_from_cv_reg_code(RDI_Arch arch, CV_Reg reg_code)
|
||||
}
|
||||
|
||||
internal RDI_Language
|
||||
rdi_language_from_cv_language(CV_Language cv_language)
|
||||
p2r_rdi_language_from_cv_language(CV_Language cv_language)
|
||||
{
|
||||
RDI_Language result = 0;
|
||||
switch(cv_language)
|
||||
@@ -331,7 +331,7 @@ rdi_language_from_cv_language(CV_Language cv_language)
|
||||
}
|
||||
|
||||
internal RDI_TypeKind
|
||||
rdi_type_kind_from_cv_basic_type(CV_BasicType basic_type)
|
||||
p2r_rdi_type_kind_from_cv_basic_type(CV_BasicType basic_type)
|
||||
{
|
||||
RDI_TypeKind result = RDI_TypeKind_NULL;
|
||||
switch(basic_type)
|
||||
@@ -1428,7 +1428,7 @@ p2r_symbol_stream_convert_task__entry_point(Arena *arena, void *p)
|
||||
}
|
||||
|
||||
// rjf: get raddbg register code
|
||||
RDI_RegisterCode register_code = rdi_reg_code_from_cv_reg_code(in->arch, cv_reg);
|
||||
RDI_RegisterCode register_code = p2r_rdi_reg_code_from_cv_reg_code(in->arch, cv_reg);
|
||||
// TODO(rjf): real byte_size & byte_pos from cv_reg goes here
|
||||
U32 byte_size = 8;
|
||||
U32 byte_pos = 0;
|
||||
@@ -1548,7 +1548,7 @@ p2r_symbol_stream_convert_task__entry_point(Arena *arena, void *p)
|
||||
COFF_SectionHeader *range_section = (0 < range->sec && range->sec <= in->coff_sections->count) ? &in->coff_sections->sections[range->sec-1] : 0;
|
||||
CV_LvarAddrGap *gaps = (CV_LvarAddrGap*)(defrange_register+1);
|
||||
U64 gap_count = ((U8*)sym_data_opl - (U8*)gaps) / sizeof(*gaps);
|
||||
RDI_RegisterCode register_code = rdi_reg_code_from_cv_reg_code(in->arch, cv_reg);
|
||||
RDI_RegisterCode register_code = p2r_rdi_reg_code_from_cv_reg_code(in->arch, cv_reg);
|
||||
|
||||
// rjf: build location
|
||||
RDIM_Location *location = rdim_push_location_val_reg(arena, register_code);
|
||||
@@ -1620,7 +1620,7 @@ p2r_symbol_stream_convert_task__entry_point(Arena *arena, void *p)
|
||||
COFF_SectionHeader *range_section = (0 < range->sec && range->sec <= in->coff_sections->count) ? &in->coff_sections->sections[range->sec-1] : 0;
|
||||
CV_LvarAddrGap *gaps = (CV_LvarAddrGap*)(defrange_subfield_register + 1);
|
||||
U64 gap_count = ((U8*)sym_data_opl - (U8*)gaps) / sizeof(*gaps);
|
||||
RDI_RegisterCode register_code = rdi_reg_code_from_cv_reg_code(in->arch, cv_reg);
|
||||
RDI_RegisterCode register_code = p2r_rdi_reg_code_from_cv_reg_code(in->arch, cv_reg);
|
||||
|
||||
// rjf: skip "subfield" location info - currently not supported
|
||||
if(defrange_subfield_register->field_offset != 0)
|
||||
@@ -1689,7 +1689,7 @@ p2r_symbol_stream_convert_task__entry_point(Arena *arena, void *p)
|
||||
// rjf: unpack sym
|
||||
CV_SymDefrangeRegisterRel *defrange_register_rel = (CV_SymDefrangeRegisterRel*)sym_header_struct_base;
|
||||
CV_Reg cv_reg = defrange_register_rel->reg;
|
||||
RDI_RegisterCode register_code = rdi_reg_code_from_cv_reg_code(in->arch, cv_reg);
|
||||
RDI_RegisterCode register_code = p2r_rdi_reg_code_from_cv_reg_code(in->arch, cv_reg);
|
||||
CV_LvarAddrRange *range = &defrange_register_rel->range;
|
||||
COFF_SectionHeader *range_section = (0 < range->sec && range->sec <= in->coff_sections->count) ? &in->coff_sections->sections[range->sec-1] : 0;
|
||||
CV_LvarAddrGap *gaps = (CV_LvarAddrGap*)(defrange_register_rel + 1);
|
||||
@@ -1979,7 +1979,7 @@ p2r_convert(Arena *arena, P2R_ConvertIn *in)
|
||||
{
|
||||
if(sym_for_unit[comp_unit_idx] != 0)
|
||||
{
|
||||
arch = rdi_arch_from_cv_arch(sym_for_unit[comp_unit_idx]->info.arch);
|
||||
arch = p2r_rdi_arch_from_cv_arch(sym_for_unit[comp_unit_idx]->info.arch);
|
||||
if(arch != RDI_Arch_NULL)
|
||||
{
|
||||
break;
|
||||
@@ -2023,12 +2023,16 @@ p2r_convert(Arena *arena, P2R_ConvertIn *in)
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//- rjf: build units
|
||||
//- rjf: build units, initial src file map, & collect unit source files
|
||||
//
|
||||
RDIM_UnitChunkList units = {0};
|
||||
ProfScope("build unit array")
|
||||
P2R_SrcFileMap src_file_map = {0};
|
||||
RDIM_UnitChunkList all_units = {0};
|
||||
RDIM_SrcFileChunkList all_src_files = {0};
|
||||
ProfScope("build units, initial src file map, & collect unit source files")
|
||||
{
|
||||
U64 units_chunk_cap = comp_unit_count;
|
||||
src_file_map.slots_count = 65536;
|
||||
src_file_map.slots = push_array(scratch.arena, P2R_SrcFileNode *, src_file_map.slots_count);
|
||||
|
||||
//- rjf: pass 1: fill basic per-unit info & line info
|
||||
for(U64 comp_unit_idx = 0; comp_unit_idx < comp_unit_count; comp_unit_idx += 1)
|
||||
@@ -2057,12 +2061,12 @@ p2r_convert(Arena *arena, P2R_ConvertIn *in)
|
||||
}
|
||||
|
||||
//- rjf: build unit
|
||||
RDIM_Unit *dst_unit = rdim_unit_chunk_list_push(arena, &units, units_chunk_cap);
|
||||
RDIM_Unit *dst_unit = rdim_unit_chunk_list_push(arena, &all_units, units_chunk_cap);
|
||||
dst_unit->unit_name = unit_name;
|
||||
dst_unit->compiler_name = pdb_unit_sym->info.compiler_name;
|
||||
dst_unit->object_file = obj_name;
|
||||
dst_unit->archive_file = pdb_unit->group_name;
|
||||
dst_unit->language = rdi_language_from_cv_language(sym->info.language);
|
||||
dst_unit->language = p2r_rdi_language_from_cv_language(sym->info.language);
|
||||
|
||||
//- rjf: fill unit line info
|
||||
for(CV_C13SubSectionNode *node = pdb_unit_c13->first_sub_section;
|
||||
@@ -2076,8 +2080,42 @@ p2r_convert(Arena *arena, P2R_ConvertIn *in)
|
||||
lines_n = lines_n->next)
|
||||
{
|
||||
CV_C13LinesParsed *lines = &lines_n->v;
|
||||
|
||||
// rjf: file name -> normalized file path
|
||||
String8 file_path = lines->file_name;
|
||||
String8 file_path_normalized = lower_from_str8(scratch.arena, str8_skip_chop_whitespace(file_path));
|
||||
for(U64 idx = 0; idx < file_path_normalized.size; idx += 1)
|
||||
{
|
||||
if(file_path_normalized.str[idx] == '\\')
|
||||
{
|
||||
file_path_normalized.str[idx] = '/';
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: normalized file path -> source file node
|
||||
U64 file_path_normalized_hash = rdi_hash(file_path_normalized.str, file_path_normalized.size);
|
||||
U64 src_file_slot = file_path_normalized_hash%src_file_map.slots_count;
|
||||
P2R_SrcFileNode *src_file_node = 0;
|
||||
for(P2R_SrcFileNode *n = src_file_map.slots[src_file_slot]; n != 0; n = n->next)
|
||||
{
|
||||
if(str8_match(n->src_file->normal_full_path, file_path_normalized, 0))
|
||||
{
|
||||
src_file_node = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(src_file_node == 0)
|
||||
{
|
||||
src_file_node = push_array(scratch.arena, P2R_SrcFileNode, 1);
|
||||
SLLStackPush(src_file_map.slots[src_file_slot], src_file_node);
|
||||
src_file_node->src_file = rdim_src_file_chunk_list_push(arena, &all_src_files, 4096);
|
||||
src_file_node->src_file->normal_full_path = push_str8_copy(arena, file_path_normalized);
|
||||
}
|
||||
|
||||
// rjf: build sequence
|
||||
RDIM_LineSequence *seq = rdim_line_sequence_list_push(arena, &dst_unit->line_sequences);
|
||||
seq->file_name = lines->file_name;
|
||||
rdim_src_file_push_line_sequence(arena, &all_src_files, src_file_node->src_file, seq);
|
||||
seq->src_file = src_file_node->src_file;
|
||||
seq->voffs = lines->voffs;
|
||||
seq->line_nums = lines->line_nums;
|
||||
seq->col_nums = lines->col_nums;
|
||||
@@ -2094,7 +2132,7 @@ p2r_convert(Arena *arena, P2R_ConvertIn *in)
|
||||
{
|
||||
if(contrib_ptr->mod < comp_unit_count)
|
||||
{
|
||||
RDIM_Unit *unit = &units.first->v[contrib_ptr->mod];
|
||||
RDIM_Unit *unit = &all_units.first->v[contrib_ptr->mod];
|
||||
RDIM_Rng1U64 range = {contrib_ptr->voff_first, contrib_ptr->voff_opl};
|
||||
rdim_rng1u64_list_push(arena, &unit->voff_ranges, range);
|
||||
}
|
||||
@@ -2283,7 +2321,7 @@ p2r_convert(Arena *arena, P2R_ConvertIn *in)
|
||||
RDIM_Type *basic_type = itype_type_ptrs[cv_basic_type_code];
|
||||
if(basic_type == 0)
|
||||
{
|
||||
RDI_TypeKind type_kind = rdi_type_kind_from_cv_basic_type(cv_basic_type_code);
|
||||
RDI_TypeKind type_kind = p2r_rdi_type_kind_from_cv_basic_type(cv_basic_type_code);
|
||||
U32 byte_size = rdi_size_from_basic_type_kind(type_kind);
|
||||
basic_type = dst_type = rdim_type_chunk_list_push(arena, &all_types, (U64)itype_opl);
|
||||
if(byte_size == 0xffffffff)
|
||||
@@ -3321,9 +3359,10 @@ p2r_convert(Arena *arena, P2R_ConvertIn *in)
|
||||
{
|
||||
out->top_level_info = top_level_info;
|
||||
out->binary_sections = binary_sections;
|
||||
out->units = units;
|
||||
out->units = all_units;
|
||||
out->types = all_types;
|
||||
out->udts = all_udts;
|
||||
out->src_files = all_src_files;
|
||||
out->global_variables = all_global_variables;
|
||||
out->thread_variables = all_thread_variables;
|
||||
out->procedures = all_procedures;
|
||||
@@ -3347,6 +3386,7 @@ p2r_bake(Arena *arena, P2R_BakeIn *in)
|
||||
bake_params.units = in->units;
|
||||
bake_params.types = in->types;
|
||||
bake_params.udts = in->udts;
|
||||
bake_params.src_files = in->src_files;
|
||||
bake_params.global_variables = in->global_variables;
|
||||
bake_params.thread_variables = in->thread_variables;
|
||||
bake_params.procedures = in->procedures;
|
||||
|
||||
@@ -47,6 +47,7 @@ struct P2R_ConvertOut
|
||||
RDIM_UnitChunkList units;
|
||||
RDIM_TypeChunkList types;
|
||||
RDIM_UDTChunkList udts;
|
||||
RDIM_SrcFileChunkList src_files;
|
||||
RDIM_SymbolChunkList global_variables;
|
||||
RDIM_SymbolChunkList thread_variables;
|
||||
RDIM_SymbolChunkList procedures;
|
||||
@@ -64,6 +65,7 @@ struct P2R_BakeIn
|
||||
RDIM_UnitChunkList units;
|
||||
RDIM_TypeChunkList types;
|
||||
RDIM_UDTChunkList udts;
|
||||
RDIM_SrcFileChunkList src_files;
|
||||
RDIM_SymbolChunkList global_variables;
|
||||
RDIM_SymbolChunkList thread_variables;
|
||||
RDIM_SymbolChunkList procedures;
|
||||
@@ -164,6 +166,22 @@ struct P2R_LinkNameMap
|
||||
U64 link_name_count;
|
||||
};
|
||||
|
||||
//- rjf: normalized file path -> source file map
|
||||
|
||||
typedef struct P2R_SrcFileNode P2R_SrcFileNode;
|
||||
struct P2R_SrcFileNode
|
||||
{
|
||||
P2R_SrcFileNode *next;
|
||||
RDIM_SrcFile *src_file;
|
||||
};
|
||||
|
||||
typedef struct P2R_SrcFileMap P2R_SrcFileMap;
|
||||
struct P2R_SrcFileMap
|
||||
{
|
||||
P2R_SrcFileNode **slots;
|
||||
U64 slots_count;
|
||||
};
|
||||
|
||||
//- rjf: link name map building tasks
|
||||
|
||||
typedef struct P2R_LinkNameMapBuildIn P2R_LinkNameMapBuildIn;
|
||||
@@ -250,10 +268,10 @@ internal RDI_BinarySectionFlags rdi_binary_section_flags_from_coff_section_flags
|
||||
////////////////////////////////
|
||||
//~ rjf: CodeView => RADDBGI Canonical Conversions
|
||||
|
||||
internal RDI_Arch rdi_arch_from_cv_arch(CV_Arch arch);
|
||||
internal RDI_RegisterCode rdi_reg_code_from_cv_reg_code(RDI_Arch arch, CV_Reg reg_code);
|
||||
internal RDI_Language rdi_language_from_cv_language(CV_Language language);
|
||||
internal RDI_TypeKind rdi_type_kind_from_cv_basic_type(CV_BasicType basic_type);
|
||||
internal RDI_Arch p2r_rdi_arch_from_cv_arch(CV_Arch arch);
|
||||
internal RDI_RegisterCode p2r_rdi_reg_code_from_cv_reg_code(RDI_Arch arch, CV_Reg reg_code);
|
||||
internal RDI_Language p2r_rdi_language_from_cv_language(CV_Language language);
|
||||
internal RDI_TypeKind p2r_rdi_type_kind_from_cv_basic_type(CV_BasicType basic_type);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Location Info Building Helpers
|
||||
|
||||
@@ -92,6 +92,7 @@ main(int argc, char **argv)
|
||||
bake_in.units = convert_out->units;
|
||||
bake_in.types = convert_out->types;
|
||||
bake_in.udts = convert_out->udts;
|
||||
bake_in.src_files = convert_out->src_files;
|
||||
bake_in.global_variables = convert_out->global_variables;
|
||||
bake_in.thread_variables = convert_out->thread_variables;
|
||||
bake_in.procedures = convert_out->procedures;
|
||||
|
||||
Reference in New Issue
Block a user