mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 22:08:41 +00:00
raddump constants
This commit is contained in:
+32
-13
@@ -1360,6 +1360,13 @@ rdi_print_thread_variable(Arena *arena, String8List *out, String8 indent, RDI_Pa
|
|||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
rdi_print_constant(Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_Constant *constant)
|
||||||
|
{
|
||||||
|
rd_printf("name ='%S'", str8_from_rdi_string_idx(rdi, constant->name_string_idx));
|
||||||
|
rd_printf("type_idx ='%u'", constant->type_idx);
|
||||||
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
rdi_print_procedure(Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_Procedure *proc, RDI_Arch arch)
|
rdi_print_procedure(Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_Procedure *proc, RDI_Arch arch)
|
||||||
{
|
{
|
||||||
@@ -1681,6 +1688,18 @@ rdi_print(Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RD_Op
|
|||||||
rd_unindent();
|
rd_unindent();
|
||||||
rd_newline();
|
rd_newline();
|
||||||
}
|
}
|
||||||
|
if (opts & RD_Option_RdiConstants) {
|
||||||
|
U64 constants_count = 0;
|
||||||
|
RDI_Constant *constants_array = rdi_table_from_name(rdi, Constants, &constants_count);
|
||||||
|
rd_printf("# CONSTANTS");
|
||||||
|
rd_indent();
|
||||||
|
for (U64 i = 0; i < constants_count; ++i) {
|
||||||
|
rd_printf("constant[%llu]:", i);
|
||||||
|
rdi_print_constant(arena, out, indent, rdi, &constants_array[i]);
|
||||||
|
}
|
||||||
|
rd_unindent();
|
||||||
|
rd_newline();
|
||||||
|
}
|
||||||
if (opts & RD_Option_RdiProcedures) {
|
if (opts & RD_Option_RdiProcedures) {
|
||||||
U64 proc_count = 0;
|
U64 proc_count = 0;
|
||||||
RDI_Procedure *proc_array = rdi_table_from_name(rdi, Procedures, &proc_count);
|
RDI_Procedure *proc_array = rdi_table_from_name(rdi, Procedures, &proc_count);
|
||||||
@@ -3765,7 +3784,7 @@ dw_print_debug_rnglists(Arena *arena, String8List *out, String8 indent, DW_Input
|
|||||||
internal void
|
internal void
|
||||||
dw_format_string_table(Arena *arena, String8List *out, String8 indent, DW_Input *input, DW_SectionKind sec)
|
dw_format_string_table(Arena *arena, String8List *out, String8 indent, DW_Input *input, DW_SectionKind sec)
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
#if 0
|
#if 0
|
||||||
void *base = dw_base_from_sec(sections, sec);
|
void *base = dw_base_from_sec(sections, sec);
|
||||||
Rng1U64 range = dw_range_from_sec(sections, sec);
|
Rng1U64 range = dw_range_from_sec(sections, sec);
|
||||||
@@ -3839,7 +3858,7 @@ dw_print_debug_pubtypes(Arena *arena, String8List *out, String8 indent, DW_Input
|
|||||||
internal void
|
internal void
|
||||||
dw_print_debug_line_str(Arena *arena, String8List *out, String8 indent, DW_Input *input)
|
dw_print_debug_line_str(Arena *arena, String8List *out, String8 indent, DW_Input *input)
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
#if 0
|
#if 0
|
||||||
void *base = dw_base_from_sec(sections, DW_Section_LineStr);
|
void *base = dw_base_from_sec(sections, DW_Section_LineStr);
|
||||||
Rng1U64 range = dw_range_from_sec(sections, DW_Section_LineStr);
|
Rng1U64 range = dw_range_from_sec(sections, DW_Section_LineStr);
|
||||||
@@ -3869,7 +3888,7 @@ NotImplemented;
|
|||||||
internal void
|
internal void
|
||||||
dw_print_debug_str_offsets(Arena *arena, String8List *out, String8 indent, DW_Input *input)
|
dw_print_debug_str_offsets(Arena *arena, String8List *out, String8 indent, DW_Input *input)
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
#if 0
|
#if 0
|
||||||
void *base = dw_base_from_sec(sections, DW_Section_StrOffsets);
|
void *base = dw_base_from_sec(sections, DW_Section_StrOffsets);
|
||||||
Rng1U64 range = dw_range_from_sec(sections, DW_Section_StrOffsets);
|
Rng1U64 range = dw_range_from_sec(sections, DW_Section_StrOffsets);
|
||||||
@@ -5217,14 +5236,14 @@ cv_print_leaf(Arena *arena, String8List *out, String8 indent, CV_TypeIndex min_i
|
|||||||
rd_printf("Argument Count : %u", lf.arg_count);
|
rd_printf("Argument Count : %u", lf.arg_count);
|
||||||
rd_printf("Argument Type : %S", cv_string_from_itype(scratch.arena, min_itype, lf.arg_itype));
|
rd_printf("Argument Type : %S", cv_string_from_itype(scratch.arena, min_itype, lf.arg_itype));
|
||||||
} break;
|
} break;
|
||||||
#if 0
|
#if 0
|
||||||
case CV_LeafKind_SKIP_16t: {
|
case CV_LeafKind_SKIP_16t: {
|
||||||
CV_LeafSkip_16t lf = {0};
|
CV_LeafSkip_16t lf = {0};
|
||||||
cursor += str8_deserial_read_struct(base, range, cursor, &lf);
|
cursor += str8_deserial_read_struct(base, range, cursor, &lf);
|
||||||
|
|
||||||
rd_printf("Type: %S", cv_string_from_itype(scratch.arena, min_itype, lf.type));
|
rd_printf("Type: %S", cv_string_from_itype(scratch.arena, min_itype, lf.type));
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
case CV_LeafKind_SKIP: {
|
case CV_LeafKind_SKIP: {
|
||||||
// ms-symbol-pdf:
|
// ms-symbol-pdf:
|
||||||
// This is used by incremental compilers to reserve space for indices.
|
// This is used by incremental compilers to reserve space for indices.
|
||||||
@@ -6508,7 +6527,7 @@ coff_print_big_obj(Arena *arena, String8List *out, String8 indent, String8 raw_d
|
|||||||
rd_newline();
|
rd_newline();
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:;
|
exit:;
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6590,7 +6609,7 @@ coff_print_obj(Arena *arena, String8List *out, String8 indent, String8 raw_data,
|
|||||||
dw_format(arena, out, indent, opts, &dwarf_input, arch, Image_CoffPe);
|
dw_format(arena, out, indent, opts, &dwarf_input, arch, Image_CoffPe);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:;
|
exit:;
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6959,7 +6978,7 @@ pe_print_load_config32(Arena *arena, String8List *out, String8 indent, PE_LoadCo
|
|||||||
rd_printf("Cast guard OS determined failure mode: %#x", lc->cast_guard_os_determined_failure_mode);
|
rd_printf("Cast guard OS determined failure mode: %#x", lc->cast_guard_os_determined_failure_mode);
|
||||||
rd_newline();
|
rd_newline();
|
||||||
|
|
||||||
exit:;
|
exit:;
|
||||||
rd_unindent();
|
rd_unindent();
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
@@ -7043,7 +7062,7 @@ pe_print_load_config64(Arena *arena, String8List *out, String8 indent, PE_LoadCo
|
|||||||
rd_printf("Cast guard OS determined failure mode: %#llx", lc->cast_guard_os_determined_failure_mode);
|
rd_printf("Cast guard OS determined failure mode: %#llx", lc->cast_guard_os_determined_failure_mode);
|
||||||
rd_newline();
|
rd_newline();
|
||||||
|
|
||||||
exit:;
|
exit:;
|
||||||
rd_unindent();
|
rd_unindent();
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
@@ -7941,9 +7960,9 @@ pe_print_exceptions_x8664(Arena *arena,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef ExceptionHandlerDataFlag_FuncInfo
|
#undef ExceptionHandlerDataFlag_FuncInfo
|
||||||
#undef ExceptionHandlerDataFlag_ScopeTable
|
#undef ExceptionHandlerDataFlag_ScopeTable
|
||||||
#undef ExceptionHandlerDataFlag_GS
|
#undef ExceptionHandlerDataFlag_GS
|
||||||
}
|
}
|
||||||
|
|
||||||
temp_end(temp);
|
temp_end(temp);
|
||||||
@@ -8280,7 +8299,7 @@ pe_print(Arena *arena, String8List *out, String8 indent, String8 raw_data, RD_Op
|
|||||||
dw_format(arena, out, indent, opts, &dwarf_input, arch, Image_CoffPe);
|
dw_format(arena, out, indent, opts, &dwarf_input, arch, Image_CoffPe);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:;
|
exit:;
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+36
-33
@@ -49,20 +49,20 @@ typedef U64 RD_Option;
|
|||||||
#define RD_Option_DebugLineStr (1ull << 29)
|
#define RD_Option_DebugLineStr (1ull << 29)
|
||||||
#define RD_Option_DebugStrOffsets (1ull << 30)
|
#define RD_Option_DebugStrOffsets (1ull << 30)
|
||||||
#define RD_Option_Dwarf \
|
#define RD_Option_Dwarf \
|
||||||
(RD_Option_DebugInfo | \
|
(RD_Option_DebugInfo | \
|
||||||
RD_Option_DebugAbbrev | \
|
RD_Option_DebugAbbrev | \
|
||||||
RD_Option_DebugLine | \
|
RD_Option_DebugLine | \
|
||||||
RD_Option_DebugStr | \
|
RD_Option_DebugStr | \
|
||||||
RD_Option_DebugLoc | \
|
RD_Option_DebugLoc | \
|
||||||
RD_Option_DebugRanges | \
|
RD_Option_DebugRanges | \
|
||||||
RD_Option_DebugARanges | \
|
RD_Option_DebugARanges | \
|
||||||
RD_Option_DebugAddr | \
|
RD_Option_DebugAddr | \
|
||||||
RD_Option_DebugLocLists | \
|
RD_Option_DebugLocLists | \
|
||||||
RD_Option_DebugRngLists | \
|
RD_Option_DebugRngLists | \
|
||||||
RD_Option_DebugPubNames | \
|
RD_Option_DebugPubNames | \
|
||||||
RD_Option_DebugPubTypes | \
|
RD_Option_DebugPubTypes | \
|
||||||
RD_Option_DebugLineStr | \
|
RD_Option_DebugLineStr | \
|
||||||
RD_Option_DebugStrOffsets)
|
RD_Option_DebugStrOffsets)
|
||||||
#define RD_Option_RelaxDwarfParser (1ull << 31ull)
|
#define RD_Option_RelaxDwarfParser (1ull << 31ull)
|
||||||
// RDI
|
// RDI
|
||||||
#define RD_Option_NoRdi (1ull << 32ull)
|
#define RD_Option_NoRdi (1ull << 32ull)
|
||||||
@@ -80,6 +80,7 @@ typedef U64 RD_Option;
|
|||||||
#define RD_Option_RdiGlobalVars (1ull << 44ull)
|
#define RD_Option_RdiGlobalVars (1ull << 44ull)
|
||||||
#define RD_Option_RdiGlobalVarsVMap (1ull << 45ull)
|
#define RD_Option_RdiGlobalVarsVMap (1ull << 45ull)
|
||||||
#define RD_Option_RdiThreadVars (1ull << 46ull)
|
#define RD_Option_RdiThreadVars (1ull << 46ull)
|
||||||
|
#define RD_Option_RdiConstants (1ull << 47ull)
|
||||||
#define RD_Option_RdiProcedures (1ull << 48ull)
|
#define RD_Option_RdiProcedures (1ull << 48ull)
|
||||||
#define RD_Option_RdiScopes (1ull << 49ull)
|
#define RD_Option_RdiScopes (1ull << 49ull)
|
||||||
#define RD_Option_RdiScopeVMap (1ull << 50ull)
|
#define RD_Option_RdiScopeVMap (1ull << 50ull)
|
||||||
@@ -87,25 +88,26 @@ typedef U64 RD_Option;
|
|||||||
#define RD_Option_RdiNameMaps (1ull << 52ull)
|
#define RD_Option_RdiNameMaps (1ull << 52ull)
|
||||||
#define RD_Option_RdiStrings (1ull << 53ull)
|
#define RD_Option_RdiStrings (1ull << 53ull)
|
||||||
#define RD_Option_RdiAll (RD_Option_RdiDataSections | \
|
#define RD_Option_RdiAll (RD_Option_RdiDataSections | \
|
||||||
RD_Option_RdiTopLevelInfo | \
|
RD_Option_RdiTopLevelInfo | \
|
||||||
RD_Option_RdiBinarySections | \
|
RD_Option_RdiBinarySections | \
|
||||||
RD_Option_RdiFilePaths | \
|
RD_Option_RdiFilePaths | \
|
||||||
RD_Option_RdiSourceFiles | \
|
RD_Option_RdiSourceFiles | \
|
||||||
RD_Option_RdiLineTables | \
|
RD_Option_RdiLineTables | \
|
||||||
RD_Option_RdiSourceLineMaps | \
|
RD_Option_RdiSourceLineMaps | \
|
||||||
RD_Option_RdiUnits | \
|
RD_Option_RdiUnits | \
|
||||||
RD_Option_RdiUnitVMap | \
|
RD_Option_RdiUnitVMap | \
|
||||||
RD_Option_RdiTypeNodes | \
|
RD_Option_RdiTypeNodes | \
|
||||||
RD_Option_RdiUserDefinedTypes | \
|
RD_Option_RdiUserDefinedTypes | \
|
||||||
RD_Option_RdiGlobalVars | \
|
RD_Option_RdiGlobalVars | \
|
||||||
RD_Option_RdiGlobalVarsVMap | \
|
RD_Option_RdiGlobalVarsVMap | \
|
||||||
RD_Option_RdiThreadVars | \
|
RD_Option_RdiThreadVars | \
|
||||||
RD_Option_RdiProcedures | \
|
RD_Option_RdiConstants | \
|
||||||
RD_Option_RdiScopes | \
|
RD_Option_RdiProcedures | \
|
||||||
RD_Option_RdiScopeVMap | \
|
RD_Option_RdiScopes | \
|
||||||
RD_Option_RdiInlineSites | \
|
RD_Option_RdiScopeVMap | \
|
||||||
RD_Option_RdiNameMaps | \
|
RD_Option_RdiInlineSites | \
|
||||||
RD_Option_RdiStrings)
|
RD_Option_RdiNameMaps | \
|
||||||
|
RD_Option_RdiStrings)
|
||||||
|
|
||||||
|
|
||||||
typedef struct RD_Marker
|
typedef struct RD_Marker
|
||||||
@@ -211,6 +213,7 @@ internal void rdi_print_type_node (Arena *arena, String8List *out, String8
|
|||||||
internal void rdi_print_udt (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_UDT *udt);
|
internal void rdi_print_udt (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_UDT *udt);
|
||||||
internal void rdi_print_global_variable(Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_GlobalVariable *gvar);
|
internal void rdi_print_global_variable(Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_GlobalVariable *gvar);
|
||||||
internal void rdi_print_thread_variable(Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_ThreadVariable *tvar);
|
internal void rdi_print_thread_variable(Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_ThreadVariable *tvar);
|
||||||
|
internal void rdi_print_constant (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_Constant *constant);
|
||||||
internal void rdi_print_procedure (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_Procedure *proc, RDI_Arch arch);
|
internal void rdi_print_procedure (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_Procedure *proc, RDI_Arch arch);
|
||||||
internal void rdi_print_scope (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_Scope *scope, RDI_Arch arch);
|
internal void rdi_print_scope (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, RDI_Scope *scope, RDI_Arch arch);
|
||||||
internal void rdi_print_inline_site (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, U64 idx, RDI_InlineSite *inline_site);
|
internal void rdi_print_inline_site (Arena *arena, String8List *out, String8 indent, RDI_Parsed *rdi, U64 idx, RDI_InlineSite *inline_site);
|
||||||
|
|||||||
Reference in New Issue
Block a user