mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-24 04:34:59 -07:00
converge raddbg to new conversion/raddbgi-make layers
This commit is contained in:
@@ -847,17 +847,6 @@ struct RDIM_BakeIdxRunMap
|
||||
RDI_U32 idx_count;
|
||||
};
|
||||
|
||||
//- rjf: line info
|
||||
|
||||
typedef struct RDIM_LineRec RDIM_LineRec;
|
||||
struct RDIM_LineRec
|
||||
{
|
||||
RDI_U32 file_id;
|
||||
RDI_U32 line_num;
|
||||
RDI_U16 col_first;
|
||||
RDI_U16 col_opl;
|
||||
};
|
||||
|
||||
//- rjf: source info & path tree
|
||||
|
||||
typedef struct RDIM_BakePathNode RDIM_BakePathNode;
|
||||
|
||||
+28
-12
@@ -616,30 +616,46 @@ entry_point(int argc, char **argv)
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
|
||||
//- rjf: parse arguments
|
||||
P2R_Params *params = p2r_params_from_cmd_line(scratch.arena, &cmdln);
|
||||
P2R_ConvertIn *convert_in = p2r_convert_in_from_cmd_line(scratch.arena, &cmdln);
|
||||
|
||||
//- rjf: open output file
|
||||
String8 output_name = push_str8_copy(scratch.arena, params->output_name);
|
||||
String8 output_name = push_str8_copy(scratch.arena, convert_in->output_name);
|
||||
OS_Handle out_file = os_file_open(OS_AccessFlag_Read|OS_AccessFlag_Write, output_name);
|
||||
B32 out_file_is_good = !os_handle_match(out_file, os_handle_zero());
|
||||
|
||||
//- rjf: convert
|
||||
P2R_Out *out = 0;
|
||||
P2R_ConvertOut *convert_out = 0;
|
||||
if(out_file_is_good)
|
||||
{
|
||||
out = p2r_convert(scratch.arena, params);
|
||||
convert_out = p2r_convert(scratch.arena, convert_in);
|
||||
}
|
||||
|
||||
//- rjf: bake file
|
||||
if(out != 0 && params->output_name.size > 0)
|
||||
//- rjf: bake
|
||||
String8List bake_strings = {0};
|
||||
if(convert_out != 0 && convert_in->output_name.size > 0)
|
||||
{
|
||||
String8List baked = {0};
|
||||
rdim_bake_file(scratch.arena, out->root, &baked);
|
||||
U64 off = 0;
|
||||
for(String8Node *node = baked.first; node != 0; node = node->next)
|
||||
RDIM_BakeParams bake_params = {0};
|
||||
{
|
||||
os_file_write(out_file, r1u64(off, off+node->string.size), node->string.str);
|
||||
off += node->string.size;
|
||||
bake_params.top_level_info = convert_out->top_level_info;
|
||||
bake_params.binary_sections = convert_out->binary_sections;
|
||||
bake_params.types = convert_out->types;
|
||||
bake_params.udts = convert_out->udts;
|
||||
bake_params.global_variables = convert_out->global_variables;
|
||||
bake_params.thread_variables = convert_out->thread_variables;
|
||||
bake_params.procedures = convert_out->procedures;
|
||||
bake_params.scopes = convert_out->scopes;
|
||||
}
|
||||
bake_strings = rdim_bake(scratch.arena, &bake_params);
|
||||
}
|
||||
|
||||
//- rjf: write
|
||||
if(out_file_is_good)
|
||||
{
|
||||
U64 off = 0;
|
||||
for(String8Node *n = bake_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
os_file_write(out_file, r1u64(off, off+n->string.size), n->string.str);
|
||||
off += n->string.size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user