mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 13:28:40 +00:00
inline site info extraction
This commit is contained in:
@@ -98,7 +98,7 @@ if not "%no_meta%"=="1" (
|
|||||||
|
|
||||||
:: --- Build Everything (@build_targets) --------------------------------------
|
:: --- Build Everything (@build_targets) --------------------------------------
|
||||||
pushd build
|
pushd build
|
||||||
if "%raddbg%"=="1" %compile% %gfx% ..\src\raddbg\raddbg_main.c %compile_link% %out%raddbg.exe || exit /b 1
|
if "%raddbg%"=="1" %compile% ..\src\raddbg\raddbg_main.c %compile_link% %out%raddbg.exe || exit /b 1
|
||||||
if "%rdi_from_pdb%"=="1" %compile% ..\src\rdi_from_pdb\rdi_from_pdb_main.c %compile_link% %out%rdi_from_pdb.exe || exit /b 1
|
if "%rdi_from_pdb%"=="1" %compile% ..\src\rdi_from_pdb\rdi_from_pdb_main.c %compile_link% %out%rdi_from_pdb.exe || exit /b 1
|
||||||
if "%rdi_from_dwarf%"=="1" %compile% ..\src\rdi_from_dwarf\rdi_from_dwarf.c %compile_link% %out%rdi_from_dwarf.exe || exit /b 1
|
if "%rdi_from_dwarf%"=="1" %compile% ..\src\rdi_from_dwarf\rdi_from_dwarf.c %compile_link% %out%rdi_from_dwarf.exe || exit /b 1
|
||||||
if "%rdi_dump%"=="1" %compile% ..\src\rdi_dump\rdi_dump_main.c %compile_link% %out%rdi_dump.exe || exit /b 1
|
if "%rdi_dump%"=="1" %compile% ..\src\rdi_dump\rdi_dump_main.c %compile_link% %out%rdi_dump.exe || exit /b 1
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ commands =
|
|||||||
},
|
},
|
||||||
.rjf_f2 =
|
.rjf_f2 =
|
||||||
{
|
{
|
||||||
.win = "build rdi_from_pdb rdi_dump && pushd build && rdi_from_pdb --pdb:mule_main.pdb --out:mule_main_1.rdi && rdi_dump mule_main_1.rdi > mule_main_1.dump && rdi_from_pdb --pdb:mule_main.pdb --out:mule_main_2.rdi && rdi_dump mule_main_2.rdi > mule_main_2.dump && diff mule_main_1.dump mule_main_2.dump && popd",
|
.win = "build rdi_from_pdb rdi_dump && pushd build && rdi_from_pdb --pdb:mule_main.pdb --out:mule_main.rdi && rdi_dump mule_main.rdi > mule_main.dump",
|
||||||
.linux = "",
|
.linux = "",
|
||||||
.out = "*compilation*",
|
.out = "*compilation*",
|
||||||
.footer_panel = true,
|
.footer_panel = true,
|
||||||
|
|||||||
@@ -2502,8 +2502,46 @@ internal TS_TASK_FUNCTION_DEF(p2r_symbol_stream_convert_task__entry_point)
|
|||||||
//- rjf: INLINESITE
|
//- rjf: INLINESITE
|
||||||
case CV_SymKind_INLINESITE:
|
case CV_SymKind_INLINESITE:
|
||||||
{
|
{
|
||||||
|
// rjf: unpack sym
|
||||||
|
CV_SymInlineSite *sym = (CV_SymInlineSite *)sym_header_struct_base;
|
||||||
|
String8 binary_annots = str8((U8 *)(sym+1), rec_range->hdr.size - sizeof(rec_range->hdr.kind) - sizeof(*sym));
|
||||||
|
|
||||||
|
// rjf: extract external info about inline site
|
||||||
|
String8 name = str8_zero();
|
||||||
|
RDIM_Type *type = 0;
|
||||||
|
RDIM_Type *owner = 0;
|
||||||
|
if(in->ipi_leaf != 0 && in->ipi_leaf->itype_first <= sym->inlinee && sym->inlinee < in->ipi_leaf->itype_opl)
|
||||||
|
{
|
||||||
|
CV_RecRange rec_range = in->ipi_leaf->leaf_ranges.ranges[sym->inlinee - in->ipi_leaf->itype_first];
|
||||||
|
String8 rec_data = str8_substr(in->ipi_leaf->data, rng_1u64(rec_range.off, rec_range.off + rec_range.hdr.size));
|
||||||
|
void *raw_leaf = rec_data.str + sizeof(U16);
|
||||||
|
|
||||||
|
// rjf: extract method inline info
|
||||||
|
if(rec_range.hdr.kind == CV_LeafIDKind_MFUNC_ID &&
|
||||||
|
rec_range.hdr.size >= sizeof(CV_LeafMFuncId))
|
||||||
|
{
|
||||||
|
CV_LeafMFuncId *mfunc_id = (CV_LeafMFuncId*)raw_leaf;
|
||||||
|
name = str8_cstring_capped(mfunc_id + 1, rec_data.str + rec_data.size);
|
||||||
|
type = p2r_type_ptr_from_itype(mfunc_id->itype);
|
||||||
|
owner = mfunc_id->owner_itype != 0 ? p2r_type_ptr_from_itype(mfunc_id->owner_itype) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// rjf: extract non-method function inline info
|
||||||
|
else if(rec_range.hdr.kind == CV_LeafIDKind_FUNC_ID &&
|
||||||
|
rec_range.hdr.size >= sizeof(CV_LeafFuncId))
|
||||||
|
{
|
||||||
|
CV_LeafFuncId *func_id = (CV_LeafFuncId*)raw_leaf;
|
||||||
|
name = str8_cstring_capped(func_id + 1, rec_data.str + rec_data.size);
|
||||||
|
type = p2r_type_ptr_from_itype(func_id->itype);
|
||||||
|
owner = func_id->scope_string_id != 0 ? p2r_type_ptr_from_itype(func_id->scope_string_id) : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// rjf: build inline site
|
// rjf: build inline site
|
||||||
RDIM_InlineSite *inline_site = rdim_inline_site_chunk_list_push(arena, &sym_inline_sites, sym_inline_sites_chunk_cap);
|
RDIM_InlineSite *inline_site = rdim_inline_site_chunk_list_push(arena, &sym_inline_sites, sym_inline_sites_chunk_cap);
|
||||||
|
inline_site->name = name;
|
||||||
|
inline_site->type = type;
|
||||||
|
inline_site->owner= owner;
|
||||||
|
|
||||||
// rjf: build scope
|
// rjf: build scope
|
||||||
RDIM_Scope *scope = rdim_scope_chunk_list_push(arena, &sym_scopes, sym_scopes_chunk_cap);
|
RDIM_Scope *scope = rdim_scope_chunk_list_push(arena, &sym_scopes, sym_scopes_chunk_cap);
|
||||||
@@ -3523,6 +3561,7 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
|
|||||||
tasks_inputs[idx].coff_sections = coff_sections;
|
tasks_inputs[idx].coff_sections = coff_sections;
|
||||||
tasks_inputs[idx].tpi_hash = tpi_hash;
|
tasks_inputs[idx].tpi_hash = tpi_hash;
|
||||||
tasks_inputs[idx].tpi_leaf = tpi_leaf;
|
tasks_inputs[idx].tpi_leaf = tpi_leaf;
|
||||||
|
tasks_inputs[idx].ipi_leaf = ipi_leaf;
|
||||||
tasks_inputs[idx].itype_fwd_map = itype_fwd_map;
|
tasks_inputs[idx].itype_fwd_map = itype_fwd_map;
|
||||||
tasks_inputs[idx].itype_type_ptrs = itype_type_ptrs;
|
tasks_inputs[idx].itype_type_ptrs = itype_type_ptrs;
|
||||||
tasks_inputs[idx].link_name_map = link_name_map;
|
tasks_inputs[idx].link_name_map = link_name_map;
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ struct P2R_SymbolStreamConvertIn
|
|||||||
PDB_CoffSectionArray *coff_sections;
|
PDB_CoffSectionArray *coff_sections;
|
||||||
PDB_TpiHashParsed *tpi_hash;
|
PDB_TpiHashParsed *tpi_hash;
|
||||||
CV_LeafParsed *tpi_leaf;
|
CV_LeafParsed *tpi_leaf;
|
||||||
|
CV_LeafParsed *ipi_leaf;
|
||||||
CV_SymParsed *sym;
|
CV_SymParsed *sym;
|
||||||
U64 sym_ranges_first;
|
U64 sym_ranges_first;
|
||||||
U64 sym_ranges_opl;
|
U64 sym_ranges_opl;
|
||||||
|
|||||||
Reference in New Issue
Block a user