mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 14:28:40 +00:00
hook up p2r2 to radbin
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ commands =
|
|||||||
{
|
{
|
||||||
//- rjf: [raddbg]
|
//- rjf: [raddbg]
|
||||||
// .f1 = { .win = "raddbg_stable --ipc kill_all && build raddbg telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
// .f1 = { .win = "raddbg_stable --ipc kill_all && build raddbg telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||||
.f1 = { .win = "raddbg_stable --ipc kill_all && build radbin", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
.f1 = { .win = "raddbg_stable --ipc kill_all && build radbin telemetry", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||||
|
|
||||||
//- rjf: [raddbg wsl]
|
//- rjf: [raddbg wsl]
|
||||||
// .f1 = { .win = "wsl ./build.sh raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
// .f1 = { .win = "wsl ./build.sh raddbg", .linux = "", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, .cursor_at_end = false, },
|
||||||
|
|||||||
@@ -672,7 +672,23 @@ rb_entry_point(CmdLine *cmdline)
|
|||||||
convert_params.subset_flags = subset_flags;
|
convert_params.subset_flags = subset_flags;
|
||||||
convert_params.deterministic = cmd_line_has_flag(cmdline, str8_lit("deterministic"));
|
convert_params.deterministic = cmd_line_has_flag(cmdline, str8_lit("deterministic"));
|
||||||
}
|
}
|
||||||
|
if(cmd_line_has_flag(cmdline, str8_lit("p2r2")))
|
||||||
|
{
|
||||||
|
ProfScope("convert (2)")
|
||||||
|
{
|
||||||
|
U64 thread_count = os_get_system_info()->logical_processor_count;
|
||||||
|
Arena **thread_arenas = push_array(arena, Arena *, thread_count);
|
||||||
|
for EachIndex(idx, thread_count)
|
||||||
|
{
|
||||||
|
thread_arenas[idx] = arena_alloc();
|
||||||
|
}
|
||||||
|
bake_params = p2r2_convert(thread_arenas, thread_count, &convert_params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ProfScope("convert") bake_params = p2r_convert(arena, async_root, &convert_params);
|
ProfScope("convert") bake_params = p2r_convert(arena, async_root, &convert_params);
|
||||||
|
}
|
||||||
|
|
||||||
// rjf: no output path? -> pick one based on PDB
|
// rjf: no output path? -> pick one based on PDB
|
||||||
if(output_path.size == 0) switch(output_kind)
|
if(output_path.size == 0) switch(output_kind)
|
||||||
|
|||||||
@@ -239,6 +239,7 @@
|
|||||||
#include "rdi_from_coff/rdi_from_coff.h"
|
#include "rdi_from_coff/rdi_from_coff.h"
|
||||||
#include "rdi_from_elf/rdi_from_elf.h"
|
#include "rdi_from_elf/rdi_from_elf.h"
|
||||||
#include "rdi_from_pdb/rdi_from_pdb.h"
|
#include "rdi_from_pdb/rdi_from_pdb.h"
|
||||||
|
#include "rdi_from_pdb/rdi_from_pdb_2.h"
|
||||||
#include "rdi_from_dwarf/rdi_from_dwarf.h"
|
#include "rdi_from_dwarf/rdi_from_dwarf.h"
|
||||||
#include "rdi_breakpad_from_pdb/rdi_breakpad_from_pdb.h"
|
#include "rdi_breakpad_from_pdb/rdi_breakpad_from_pdb.h"
|
||||||
#include "radbin/radbin.h"
|
#include "radbin/radbin.h"
|
||||||
@@ -289,6 +290,7 @@
|
|||||||
#include "rdi_from_coff/rdi_from_coff.c"
|
#include "rdi_from_coff/rdi_from_coff.c"
|
||||||
#include "rdi_from_elf/rdi_from_elf.c"
|
#include "rdi_from_elf/rdi_from_elf.c"
|
||||||
#include "rdi_from_pdb/rdi_from_pdb.c"
|
#include "rdi_from_pdb/rdi_from_pdb.c"
|
||||||
|
#include "rdi_from_pdb/rdi_from_pdb_2.c"
|
||||||
#include "rdi_from_dwarf/rdi_from_dwarf.c"
|
#include "rdi_from_dwarf/rdi_from_dwarf.c"
|
||||||
#include "rdi_breakpad_from_pdb/rdi_breakpad_from_pdb.c"
|
#include "rdi_breakpad_from_pdb/rdi_breakpad_from_pdb.c"
|
||||||
#include "radbin/radbin.c"
|
#include "radbin/radbin.c"
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ p2r2_convert_thread_entry_point(void *p)
|
|||||||
{
|
{
|
||||||
P2R2_ConvertThreadParams *params = (P2R2_ConvertThreadParams *)p;
|
P2R2_ConvertThreadParams *params = (P2R2_ConvertThreadParams *)p;
|
||||||
Arena *arena = params->arena;
|
Arena *arena = params->arena;
|
||||||
lane_thread(params->lane_idx, params->lane_count);
|
lane_ctx(params->lane_ctx);
|
||||||
|
ThreadNameF("p2r2_convert_thread_%I64u", lane_idx());
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
//- rjf: do top-level MSF/PDB extraction
|
//- rjf: do top-level MSF/PDB extraction
|
||||||
@@ -605,5 +606,39 @@ p2r2_convert_thread_entry_point(void *p)
|
|||||||
}
|
}
|
||||||
RDIM_SrcFileChunkList all_src_files__sequenceless = {0};
|
RDIM_SrcFileChunkList all_src_files__sequenceless = {0};
|
||||||
P2R_SrcFileMap src_file_map = {0};
|
P2R_SrcFileMap src_file_map = {0};
|
||||||
|
}
|
||||||
|
|
||||||
|
internal RDIM_BakeParams
|
||||||
|
p2r2_convert(Arena **thread_arenas, U64 thread_count, P2R_ConvertParams *in)
|
||||||
|
{
|
||||||
|
RDIM_BakeParams result = {0};
|
||||||
|
Temp scratch = scratch_begin(thread_arenas, thread_count);
|
||||||
|
Barrier barrier = barrier_alloc(thread_count);
|
||||||
|
{
|
||||||
|
P2R2_ConvertThreadParams *thread_params = push_array(scratch.arena, P2R2_ConvertThreadParams, thread_count);
|
||||||
|
OS_Handle *threads = push_array(scratch.arena, OS_Handle, thread_count);
|
||||||
|
for EachIndex(idx, thread_count)
|
||||||
|
{
|
||||||
|
thread_params[idx].arena = thread_arenas[idx];
|
||||||
|
thread_params[idx].lane_ctx.lane_idx = idx;
|
||||||
|
thread_params[idx].lane_ctx.lane_count = thread_count;
|
||||||
|
thread_params[idx].lane_ctx.barrier = barrier;
|
||||||
|
thread_params[idx].input_exe_name = in->input_exe_name;
|
||||||
|
thread_params[idx].input_exe_data = in->input_exe_data;
|
||||||
|
thread_params[idx].input_pdb_name = in->input_pdb_name;
|
||||||
|
thread_params[idx].input_pdb_data = in->input_pdb_data;
|
||||||
|
thread_params[idx].deterministic = in->deterministic;
|
||||||
|
}
|
||||||
|
for EachIndex(idx, thread_count)
|
||||||
|
{
|
||||||
|
threads[idx] = os_thread_launch(p2r2_convert_thread_entry_point, &thread_params[idx], 0);
|
||||||
|
}
|
||||||
|
for EachIndex(idx, thread_count)
|
||||||
|
{
|
||||||
|
os_thread_join(threads[idx], max_U64);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
barrier_release(barrier);
|
||||||
|
scratch_end(scratch);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ typedef struct P2R2_ConvertThreadParams P2R2_ConvertThreadParams;
|
|||||||
struct P2R2_ConvertThreadParams
|
struct P2R2_ConvertThreadParams
|
||||||
{
|
{
|
||||||
Arena *arena;
|
Arena *arena;
|
||||||
U64 lane_idx;
|
LaneCtx lane_ctx;
|
||||||
U64 lane_count;
|
|
||||||
String8 input_exe_name;
|
String8 input_exe_name;
|
||||||
String8 input_exe_data;
|
String8 input_exe_data;
|
||||||
String8 input_pdb_name;
|
String8 input_pdb_name;
|
||||||
@@ -56,5 +55,6 @@ struct P2R2_Shared
|
|||||||
global P2R2_Shared *p2r2_shared = 0;
|
global P2R2_Shared *p2r2_shared = 0;
|
||||||
|
|
||||||
internal void p2r2_convert_thread_entry_point(void *p);
|
internal void p2r2_convert_thread_entry_point(void *p);
|
||||||
|
internal RDIM_BakeParams p2r2_convert(Arena **thread_arenas, U64 thread_count, P2R_ConvertParams *in);
|
||||||
|
|
||||||
#endif // RDI_FROM_PDB_2_H
|
#endif // RDI_FROM_PDB_2_H
|
||||||
|
|||||||
Reference in New Issue
Block a user