get debugger onto new location info & symbol format

This commit is contained in:
Ryan Fleury
2026-04-20 09:57:33 -07:00
parent 6764e1281e
commit 881e19c842
29 changed files with 352 additions and 1653 deletions
+24 -238
View File
@@ -67,7 +67,7 @@ union RDI_GUID {RDI_U8 u8[16]; RDI_U64 u64[2];};
// "raddbg\0\0"
#define RDI_MAGIC_CONSTANT 0x0000676264646172
#define RDI_ENCODING_VERSION 21
#define RDI_ENCODING_VERSION 22
////////////////////////////////////////////////////////////////
//~ Format Types & Functions
@@ -98,36 +98,27 @@ RDI_SectionKind_TypeNodes = 0x0013,
RDI_SectionKind_UDTs = 0x0014,
RDI_SectionKind_Members = 0x0015,
RDI_SectionKind_EnumMembers = 0x0016,
RDI_SectionKind_GlobalVariables = 0x0017,
RDI_SectionKind_ThreadVariables = 0x0018,
RDI_SectionKind_Constants = 0x0019,
RDI_SectionKind_Procedures = 0x001A,
RDI_SectionKind_Locals = 0x001B,
RDI_SectionKind_Scopes = 0x001C,
RDI_SectionKind_ScopeVOffData = 0x001D,
RDI_SectionKind_ScopeVMap = 0x001E,
RDI_SectionKind_InlineSites = 0x001F,
RDI_SectionKind_LocationBlocks = 0x0020,
RDI_SectionKind_LocationData = 0x0021,
RDI_SectionKind_GlobalVariableSymbols = 0x0022,
RDI_SectionKind_GlobalVMap = 0x0023,
RDI_SectionKind_ThreadVariableSymbols = 0x0024,
RDI_SectionKind_ConstantSymbols = 0x0025,
RDI_SectionKind_ProcedureSymbols = 0x0026,
RDI_SectionKind_LocalVariableSymbols = 0x0027,
RDI_SectionKind_LocationsBytecodeData = 0x0028,
RDI_SectionKind_LocationsConstantData = 0x0029,
RDI_SectionKind_LocationsSetElements = 0x002A,
RDI_SectionKind_ConstantValueData = 0x002B,
RDI_SectionKind_ConstantValueTable = 0x002C,
RDI_SectionKind_MD5Checksums = 0x002D,
RDI_SectionKind_SHA1Checksums = 0x002E,
RDI_SectionKind_SHA256Checksums = 0x002F,
RDI_SectionKind_Timestamps = 0x0030,
RDI_SectionKind_NameMaps = 0x0031,
RDI_SectionKind_NameMapBuckets = 0x0032,
RDI_SectionKind_NameMapNodes = 0x0033,
RDI_SectionKind_COUNT = 0x0034,
RDI_SectionKind_Scopes = 0x0017,
RDI_SectionKind_ScopeVOffData = 0x0018,
RDI_SectionKind_ScopeVMap = 0x0019,
RDI_SectionKind_InlineSites = 0x001A,
RDI_SectionKind_GlobalVariableSymbols = 0x001B,
RDI_SectionKind_GlobalVMap = 0x001C,
RDI_SectionKind_ThreadVariableSymbols = 0x001D,
RDI_SectionKind_ConstantSymbols = 0x001E,
RDI_SectionKind_ProcedureSymbols = 0x001F,
RDI_SectionKind_LocalVariableSymbols = 0x0020,
RDI_SectionKind_LocationsBytecodeData = 0x0021,
RDI_SectionKind_LocationsConstantData = 0x0022,
RDI_SectionKind_LocationsSetElements = 0x0023,
RDI_SectionKind_MD5Checksums = 0x0024,
RDI_SectionKind_SHA1Checksums = 0x0025,
RDI_SectionKind_SHA256Checksums = 0x0026,
RDI_SectionKind_Timestamps = 0x0027,
RDI_SectionKind_NameMaps = 0x0028,
RDI_SectionKind_NameMapBuckets = 0x0029,
RDI_SectionKind_NameMapNodes = 0x002A,
RDI_SectionKind_COUNT = 0x002B,
} RDI_SectionKindEnum;
typedef RDI_U32 RDI_SectionEncoding;
@@ -400,22 +391,6 @@ RDI_ContainerFlag_External = 1u<<7,
RDI_ContainerFlag_KindMask = 0x7f,
} RDI_ContainerFlagsEnum;
typedef RDI_U32 RDI_LinkFlags;
typedef enum RDI_LinkFlagsEnum
{
RDI_LinkFlag_External = 1<<0,
RDI_LinkFlag_TypeScoped = 1<<1,
RDI_LinkFlag_ProcScoped = 1<<2,
} RDI_LinkFlagsEnum;
typedef RDI_U32 RDI_LocalKind;
typedef enum RDI_LocalKindEnum
{
RDI_LocalKind_NULL = 0x0,
RDI_LocalKind_Parameter = 0x1,
RDI_LocalKind_Variable = 0x2,
} RDI_LocalKindEnum;
typedef RDI_U8 RDI_SymbolFlags;
typedef enum RDI_SymbolFlagsEnum
{
@@ -564,17 +539,10 @@ X(TypeNodes, type_nodes, RDI_TypeNode)\
X(UDTs, udts, RDI_UDT)\
X(Members, members, RDI_Member)\
X(EnumMembers, enum_members, RDI_EnumMember)\
X(GlobalVariables, global_variables, RDI_GlobalVariable)\
X(ThreadVariables, thread_variables, RDI_ThreadVariable)\
X(Constants, constants, RDI_Constant)\
X(Procedures, procedures, RDI_Procedure)\
X(Locals, locals, RDI_Local)\
X(Scopes, scopes, RDI_Scope)\
X(ScopeVOffData, scope_voff_data, RDI_U64)\
X(ScopeVMap, scope_vmap, RDI_VMapEntry)\
X(InlineSites, inline_sites, RDI_InlineSite)\
X(LocationBlocks, location_blocks, RDI_LocationBlock)\
X(LocationData, location_data, RDI_U8)\
X(GlobalVariableSymbols, global_variable_symbols, RDI_Symbol)\
X(GlobalVMap, global_vmap, RDI_VMapEntry)\
X(ThreadVariableSymbols, thread_variable_symbols, RDI_Symbol)\
@@ -584,8 +552,6 @@ X(LocalVariableSymbols, local_variable_symbols, RDI_Symbol)\
X(LocationsBytecodeData, locations_bytecode_data, RDI_U8)\
X(LocationsConstantData, locations_constant_data, RDI_U8)\
X(LocationsSetElements, locations_set_elements, RDI_LocationSetElement)\
X(ConstantValueData, constant_value_data, RDI_U8)\
X(ConstantValueTable, constant_value_table, RDI_U32)\
X(MD5Checksums, md5_checksums, RDI_MD5)\
X(SHA1Checksums, sha1_checksums, RDI_SHA1)\
X(SHA256Checksums, sha256_checksums, RDI_SHA256)\
@@ -913,14 +879,7 @@ X(RDI_U32, pad)\
X(RDI_U64, val)\
#define RDI_LinkFlags_XList \
X(External)\
X(TypeScoped)\
X(ProcScoped)\
#define RDI_LocalKind_XList \
X(NULL)\
X(Parameter)\
X(Variable)\
X($(a.name != COUNT -> a.name))\
#define RDI_LocationKind_XList \
X(NULL)\
@@ -950,30 +909,6 @@ X(RDI_U32, type_idx)\
X(RDI_U32, root_scope_idx)\
X(RDI_U32, link_name_string_idx)\
#define RDI_GlobalVariable_XList \
X(RDI_U32, name_string_idx)\
X(RDI_LinkFlags, link_flags)\
X(RDI_U64, voff)\
X(RDI_U32, type_idx)\
X(RDI_U32, container_idx)\
#define RDI_ThreadVariable_XList \
X(type, name_string_idx)\
X(type, link_flags)\
X(type, tls_off)\
X(type, type_idx)\
X(type, container_idx)\
#define RDI_Procedure_XList \
X(RDI_U32, name_string_idx)\
X(RDI_U32, link_name_string_idx)\
X(RDI_LinkFlags, link_flags)\
X(RDI_U32, type_idx)\
X(RDI_U32, root_scope_idx)\
X(RDI_U32, container_idx)\
X(RDI_U32, frame_base_location_first)\
X(RDI_U32, frame_base_location_opl)\
#define RDI_Scope_XList \
X(RDI_U32, proc_idx)\
X(RDI_U32, parent_scope_idx)\
@@ -991,40 +926,6 @@ X(RDI_U32, type_idx)\
X(RDI_U32, owner_type_idx)\
X(RDI_U32, line_table_idx)\
#define RDI_Local_XList \
X(RDI_LocalKind, kind)\
X(RDI_U32, name_string_idx)\
X(RDI_U32, type_idx)\
X(RDI_U32, pad)\
X(RDI_U32, location_first)\
X(RDI_U32, location_opl)\
#define RDI_LocationBlock_XList \
X(RDI_U32, scope_off_first)\
X(RDI_U32, scope_off_opl)\
X(RDI_U32, location_data_off)\
#define RDI_LocationBytecodeStream_XList \
X(RDI_LocationKind, kind)\
#define RDI_LocationRegPlusU16_XList \
X(RDI_LocationKind, kind)\
X(RDI_RegCode, reg_code)\
X(RDI_U16, offset)\
#define RDI_LocationReg_XList \
X(RDI_LocationKind, kind)\
X(RDI_RegCode, reg_code)\
#define RDI_RegAndOffsetU16_XList \
X(RDI_RegCode, reg_code)\
X(RDI_U16, offset)\
#define RDI_LocationSetElement_XList \
X(RDI_U64, voff_first)\
X(RDI_U64, voff_opl)\
X(RDI_Location, location)\
#define RDI_EvalOp_XList \
X(Stop)\
X(Noop)\
@@ -1141,16 +1042,9 @@ typedef struct RDI_U32_TypeNodes { RDI_U32 v; } RDI_U32_TypeNo
typedef struct RDI_U32_UDTs { RDI_U32 v; } RDI_U32_UDTs;
typedef struct RDI_U32_Members { RDI_U32 v; } RDI_U32_Members;
typedef struct RDI_U32_EnumMembers { RDI_U32 v; } RDI_U32_EnumMembers;
typedef struct RDI_U32_GlobalVariables { RDI_U32 v; } RDI_U32_GlobalVariables;
typedef struct RDI_U32_ThreadVariables { RDI_U32 v; } RDI_U32_ThreadVariables;
typedef struct RDI_U32_Constants { RDI_U32 v; } RDI_U32_Constants;
typedef struct RDI_U32_Procedures { RDI_U32 v; } RDI_U32_Procedures;
typedef struct RDI_U32_Locals { RDI_U32 v; } RDI_U32_Locals;
typedef struct RDI_U32_Scopes { RDI_U32 v; } RDI_U32_Scopes;
typedef struct RDI_U32_ScopeVOffData { RDI_U32 v; } RDI_U32_ScopeVOffData;
typedef struct RDI_U32_InlineSites { RDI_U32 v; } RDI_U32_InlineSites;
typedef struct RDI_U32_LocationBlocks { RDI_U32 v; } RDI_U32_LocationBlocks;
typedef struct RDI_U32_LocationData { RDI_U32 v; } RDI_U32_LocationData;
typedef struct RDI_U32_GlobalVariableSymbols { RDI_U32 v; } RDI_U32_GlobalVariableSymbols;
typedef struct RDI_U32_ThreadVariableSymbols { RDI_U32 v; } RDI_U32_ThreadVariableSymbols;
typedef struct RDI_U32_ConstantSymbols { RDI_U32 v; } RDI_U32_ConstantSymbols;
@@ -1159,8 +1053,6 @@ typedef struct RDI_U32_LocalVariableSymbols { RDI_U32 v; } RDI_U32_LocalV
typedef struct RDI_U32_LocationsBytecodeData { RDI_U32 v; } RDI_U32_LocationsBytecodeData;
typedef struct RDI_U32_LocationsConstantData { RDI_U32 v; } RDI_U32_LocationsConstantData;
typedef struct RDI_U32_LocationsSetElements { RDI_U32 v; } RDI_U32_LocationsSetElements;
typedef struct RDI_U32_ConstantValueData { RDI_U32 v; } RDI_U32_ConstantValueData;
typedef struct RDI_U32_ConstantValueTable { RDI_U32 v; } RDI_U32_ConstantValueTable;
typedef struct RDI_U32_MD5Checksums { RDI_U32 v; } RDI_U32_MD5Checksums;
typedef struct RDI_U32_SHA1Checksums { RDI_U32 v; } RDI_U32_SHA1Checksums;
typedef struct RDI_U32_SHA256Checksums { RDI_U32 v; } RDI_U32_SHA256Checksums;
@@ -1190,16 +1082,9 @@ typedef RDI_U32_Table RDI_U32_TypeNodes;
typedef RDI_U32_Table RDI_U32_UDTs;
typedef RDI_U32_Table RDI_U32_Members;
typedef RDI_U32_Table RDI_U32_EnumMembers;
typedef RDI_U32_Table RDI_U32_GlobalVariables;
typedef RDI_U32_Table RDI_U32_ThreadVariables;
typedef RDI_U32_Table RDI_U32_Constants;
typedef RDI_U32_Table RDI_U32_Procedures;
typedef RDI_U32_Table RDI_U32_Locals;
typedef RDI_U32_Table RDI_U32_Scopes;
typedef RDI_U32_Table RDI_U32_ScopeVOffData;
typedef RDI_U32_Table RDI_U32_InlineSites;
typedef RDI_U32_Table RDI_U32_LocationBlocks;
typedef RDI_U32_Table RDI_U32_LocationData;
typedef RDI_U32_Table RDI_U32_GlobalVariableSymbols;
typedef RDI_U32_Table RDI_U32_ThreadVariableSymbols;
typedef RDI_U32_Table RDI_U32_ConstantSymbols;
@@ -1208,8 +1093,6 @@ typedef RDI_U32_Table RDI_U32_LocalVariableSymbols;
typedef RDI_U32_Table RDI_U32_LocationsBytecodeData;
typedef RDI_U32_Table RDI_U32_LocationsConstantData;
typedef RDI_U32_Table RDI_U32_LocationsSetElements;
typedef RDI_U32_Table RDI_U32_ConstantValueData;
typedef RDI_U32_Table RDI_U32_ConstantValueTable;
typedef RDI_U32_Table RDI_U32_MD5Checksums;
typedef RDI_U32_Table RDI_U32_SHA1Checksums;
typedef RDI_U32_Table RDI_U32_SHA256Checksums;
@@ -1481,47 +1364,6 @@ RDI_U32 root_scope_idx;
RDI_U32 link_name_string_idx;
};
typedef struct RDI_GlobalVariable RDI_GlobalVariable;
struct RDI_GlobalVariable
{
RDI_U32 name_string_idx;
RDI_LinkFlags link_flags;
RDI_U64 voff;
RDI_U32 type_idx;
RDI_U32 container_idx;
};
typedef struct RDI_ThreadVariable RDI_ThreadVariable;
struct RDI_ThreadVariable
{
RDI_U32 name_string_idx;
RDI_LinkFlags link_flags;
RDI_U32 tls_off;
RDI_U32 type_idx;
RDI_U32 container_idx;
};
typedef struct RDI_Constant RDI_Constant;
struct RDI_Constant
{
RDI_U32 name_string_idx;
RDI_U32 type_idx;
RDI_U32 constant_value_idx;
};
typedef struct RDI_Procedure RDI_Procedure;
struct RDI_Procedure
{
RDI_U32 name_string_idx;
RDI_U32 link_name_string_idx;
RDI_LinkFlags link_flags;
RDI_U32 type_idx;
RDI_U32 root_scope_idx;
RDI_U32 container_idx;
RDI_U32 frame_base_location_first;
RDI_U32 frame_base_location_opl;
};
typedef struct RDI_Scope RDI_Scope;
struct RDI_Scope
{
@@ -1545,53 +1387,6 @@ RDI_U32 owner_type_idx;
RDI_U32 line_table_idx;
};
typedef struct RDI_Local RDI_Local;
struct RDI_Local
{
RDI_LocalKind kind;
RDI_U32 name_string_idx;
RDI_U32 type_idx;
RDI_U32 pad;
RDI_U32 location_first;
RDI_U32 location_opl;
};
typedef struct RDI_LocationBlock RDI_LocationBlock;
struct RDI_LocationBlock
{
RDI_U32 scope_off_first;
RDI_U32 scope_off_opl;
RDI_U32 location_data_off;
};
typedef struct RDI_LocationBytecodeStream RDI_LocationBytecodeStream;
struct RDI_LocationBytecodeStream
{
RDI_LocationKind kind;
};
typedef struct RDI_LocationRegPlusU16 RDI_LocationRegPlusU16;
struct RDI_LocationRegPlusU16
{
RDI_LocationKind kind;
RDI_RegCode reg_code;
RDI_U16 offset;
};
typedef struct RDI_LocationReg RDI_LocationReg;
struct RDI_LocationReg
{
RDI_LocationKind kind;
RDI_RegCode reg_code;
};
typedef struct RDI_RegAndOffsetU16 RDI_RegAndOffsetU16;
struct RDI_RegAndOffsetU16
{
RDI_RegCode reg_code;
RDI_U16 offset;
};
typedef struct RDI_LocationSetElement RDI_LocationSetElement;
struct RDI_LocationSetElement
{
@@ -1646,17 +1441,10 @@ typedef RDI_TypeNode RDI_SectionElementType_TypeNodes;
typedef RDI_UDT RDI_SectionElementType_UDTs;
typedef RDI_Member RDI_SectionElementType_Members;
typedef RDI_EnumMember RDI_SectionElementType_EnumMembers;
typedef RDI_GlobalVariable RDI_SectionElementType_GlobalVariables;
typedef RDI_ThreadVariable RDI_SectionElementType_ThreadVariables;
typedef RDI_Constant RDI_SectionElementType_Constants;
typedef RDI_Procedure RDI_SectionElementType_Procedures;
typedef RDI_Local RDI_SectionElementType_Locals;
typedef RDI_Scope RDI_SectionElementType_Scopes;
typedef RDI_U64 RDI_SectionElementType_ScopeVOffData;
typedef RDI_VMapEntry RDI_SectionElementType_ScopeVMap;
typedef RDI_InlineSite RDI_SectionElementType_InlineSites;
typedef RDI_LocationBlock RDI_SectionElementType_LocationBlocks;
typedef RDI_U8 RDI_SectionElementType_LocationData;
typedef RDI_Symbol RDI_SectionElementType_GlobalVariableSymbols;
typedef RDI_VMapEntry RDI_SectionElementType_GlobalVMap;
typedef RDI_Symbol RDI_SectionElementType_ThreadVariableSymbols;
@@ -1666,8 +1454,6 @@ typedef RDI_Symbol RDI_SectionElementType_LocalVariableSym
typedef RDI_U8 RDI_SectionElementType_LocationsBytecodeData;
typedef RDI_U8 RDI_SectionElementType_LocationsConstantData;
typedef RDI_LocationSetElement RDI_SectionElementType_LocationsSetElements;
typedef RDI_U8 RDI_SectionElementType_ConstantValueData;
typedef RDI_U32 RDI_SectionElementType_ConstantValueTable;
typedef RDI_MD5 RDI_SectionElementType_MD5Checksums;
typedef RDI_SHA1 RDI_SectionElementType_SHA1Checksums;
typedef RDI_SHA256 RDI_SectionElementType_SHA256Checksums;
@@ -1684,7 +1470,7 @@ RDI_PROC RDI_EvalConversionKind rdi_eval_conversion_kind_from_typegroups(RDI_Eva
RDI_PROC RDI_S32 rdi_eval_op_typegroup_are_compatible(RDI_EvalOp op, RDI_EvalTypeGroup group);
RDI_PROC RDI_U8 *rdi_explanation_string_from_eval_conversion_kind(RDI_EvalConversionKind kind, RDI_U64 *size_out);
extern RDI_U16 rdi_section_element_size_table[53];
extern RDI_U16 rdi_section_element_size_table[44];
extern RDI_U16 rdi_eval_op_ctrlbits_table[54];
#endif // RDI_H