mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
rdi format - namespaces
This commit is contained in:
@@ -123,13 +123,16 @@ for /f %%i in ('call git describe --always --dirty') do set compile=%compile%
|
|||||||
for /f %%i in ('call git rev-parse HEAD') do set compile=%compile% -DBUILD_GIT_HASH_FULL=\"%%i\"
|
for /f %%i in ('call git rev-parse HEAD') do set compile=%compile% -DBUILD_GIT_HASH_FULL=\"%%i\"
|
||||||
|
|
||||||
:: --- Build & Run Metaprogram ------------------------------------------------
|
:: --- Build & Run Metaprogram ------------------------------------------------
|
||||||
if "%meta%"=="1" (
|
|
||||||
echo [doing metagen]
|
|
||||||
pushd build
|
pushd build
|
||||||
|
if "%meta%"=="1" (
|
||||||
|
echo [building metagen]
|
||||||
%compile_debug% ..\src\metagen\metagen_main.c %compile_link% %out%metagen.exe || exit /b 1
|
%compile_debug% ..\src\metagen\metagen_main.c %compile_link% %out%metagen.exe || exit /b 1
|
||||||
metagen.exe || exit /b 1
|
|
||||||
popd
|
|
||||||
)
|
)
|
||||||
|
if "%no_meta%"=="" (
|
||||||
|
echo [running metagen]
|
||||||
|
metagen.exe || exit /b 1
|
||||||
|
)
|
||||||
|
popd
|
||||||
|
|
||||||
:: --- Build Everything (@build_targets) --------------------------------------
|
:: --- Build Everything (@build_targets) --------------------------------------
|
||||||
pushd build
|
pushd build
|
||||||
|
|||||||
+2
-1
@@ -10,7 +10,7 @@
|
|||||||
#ifndef RDI_C
|
#ifndef RDI_C
|
||||||
#define RDI_C
|
#define RDI_C
|
||||||
|
|
||||||
RDI_U16 rdi_section_element_size_table[44] =
|
RDI_U16 rdi_section_element_size_table[45] =
|
||||||
{
|
{
|
||||||
sizeof(RDI_U8),
|
sizeof(RDI_U8),
|
||||||
sizeof(RDI_TopLevelInfo),
|
sizeof(RDI_TopLevelInfo),
|
||||||
@@ -30,6 +30,7 @@ sizeof(RDI_U32),
|
|||||||
sizeof(RDI_U64),
|
sizeof(RDI_U64),
|
||||||
sizeof(RDI_Unit),
|
sizeof(RDI_Unit),
|
||||||
sizeof(RDI_VMapEntry),
|
sizeof(RDI_VMapEntry),
|
||||||
|
sizeof(RDI_Namespace),
|
||||||
sizeof(RDI_TypeNode),
|
sizeof(RDI_TypeNode),
|
||||||
sizeof(RDI_UDT),
|
sizeof(RDI_UDT),
|
||||||
sizeof(RDI_Member),
|
sizeof(RDI_Member),
|
||||||
|
|||||||
+61
-28
@@ -67,7 +67,7 @@ union RDI_GUID {RDI_U8 u8[16]; RDI_U64 u64[2];};
|
|||||||
|
|
||||||
// "raddbg\0\0"
|
// "raddbg\0\0"
|
||||||
#define RDI_MAGIC_CONSTANT 0x0000676264646172
|
#define RDI_MAGIC_CONSTANT 0x0000676264646172
|
||||||
#define RDI_ENCODING_VERSION 18
|
#define RDI_ENCODING_VERSION 19
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
//~ Format Types & Functions
|
//~ Format Types & Functions
|
||||||
@@ -93,32 +93,33 @@ typedef enum RDI_SectionKindEnum
|
|||||||
RDI_SectionKind_SourceLineMapVOffs = 0x000F,
|
RDI_SectionKind_SourceLineMapVOffs = 0x000F,
|
||||||
RDI_SectionKind_Units = 0x0010,
|
RDI_SectionKind_Units = 0x0010,
|
||||||
RDI_SectionKind_UnitVMap = 0x0011,
|
RDI_SectionKind_UnitVMap = 0x0011,
|
||||||
RDI_SectionKind_TypeNodes = 0x0012,
|
RDI_SectionKind_Namespaces = 0x0012,
|
||||||
RDI_SectionKind_UDTs = 0x0013,
|
RDI_SectionKind_TypeNodes = 0x0013,
|
||||||
RDI_SectionKind_Members = 0x0014,
|
RDI_SectionKind_UDTs = 0x0014,
|
||||||
RDI_SectionKind_EnumMembers = 0x0015,
|
RDI_SectionKind_Members = 0x0015,
|
||||||
RDI_SectionKind_GlobalVariables = 0x0016,
|
RDI_SectionKind_EnumMembers = 0x0016,
|
||||||
RDI_SectionKind_GlobalVMap = 0x0017,
|
RDI_SectionKind_GlobalVariables = 0x0017,
|
||||||
RDI_SectionKind_ThreadVariables = 0x0018,
|
RDI_SectionKind_GlobalVMap = 0x0018,
|
||||||
RDI_SectionKind_Constants = 0x0019,
|
RDI_SectionKind_ThreadVariables = 0x0019,
|
||||||
RDI_SectionKind_Procedures = 0x001A,
|
RDI_SectionKind_Constants = 0x001A,
|
||||||
RDI_SectionKind_Scopes = 0x001B,
|
RDI_SectionKind_Procedures = 0x001B,
|
||||||
RDI_SectionKind_ScopeVOffData = 0x001C,
|
RDI_SectionKind_Scopes = 0x001C,
|
||||||
RDI_SectionKind_ScopeVMap = 0x001D,
|
RDI_SectionKind_ScopeVOffData = 0x001D,
|
||||||
RDI_SectionKind_InlineSites = 0x001E,
|
RDI_SectionKind_ScopeVMap = 0x001E,
|
||||||
RDI_SectionKind_Locals = 0x001F,
|
RDI_SectionKind_InlineSites = 0x001F,
|
||||||
RDI_SectionKind_LocationBlocks = 0x0020,
|
RDI_SectionKind_Locals = 0x0020,
|
||||||
RDI_SectionKind_LocationData = 0x0021,
|
RDI_SectionKind_LocationBlocks = 0x0021,
|
||||||
RDI_SectionKind_ConstantValueData = 0x0022,
|
RDI_SectionKind_LocationData = 0x0022,
|
||||||
RDI_SectionKind_ConstantValueTable = 0x0023,
|
RDI_SectionKind_ConstantValueData = 0x0023,
|
||||||
RDI_SectionKind_MD5Checksums = 0x0024,
|
RDI_SectionKind_ConstantValueTable = 0x0024,
|
||||||
RDI_SectionKind_SHA1Checksums = 0x0025,
|
RDI_SectionKind_MD5Checksums = 0x0025,
|
||||||
RDI_SectionKind_SHA256Checksums = 0x0026,
|
RDI_SectionKind_SHA1Checksums = 0x0026,
|
||||||
RDI_SectionKind_Timestamps = 0x0027,
|
RDI_SectionKind_SHA256Checksums = 0x0027,
|
||||||
RDI_SectionKind_NameMaps = 0x0028,
|
RDI_SectionKind_Timestamps = 0x0028,
|
||||||
RDI_SectionKind_NameMapBuckets = 0x0029,
|
RDI_SectionKind_NameMaps = 0x0029,
|
||||||
RDI_SectionKind_NameMapNodes = 0x002A,
|
RDI_SectionKind_NameMapBuckets = 0x002A,
|
||||||
RDI_SectionKind_COUNT = 0x002B,
|
RDI_SectionKind_NameMapNodes = 0x002B,
|
||||||
|
RDI_SectionKind_COUNT = 0x002C,
|
||||||
} RDI_SectionKindEnum;
|
} RDI_SectionKindEnum;
|
||||||
|
|
||||||
typedef RDI_U32 RDI_SectionEncoding;
|
typedef RDI_U32 RDI_SectionEncoding;
|
||||||
@@ -375,6 +376,21 @@ typedef enum RDI_MemberKindEnum
|
|||||||
RDI_MemberKind_NestedType = 0x0300,
|
RDI_MemberKind_NestedType = 0x0300,
|
||||||
} RDI_MemberKindEnum;
|
} RDI_MemberKindEnum;
|
||||||
|
|
||||||
|
typedef RDI_U8 RDI_ContainerKind;
|
||||||
|
typedef enum RDI_ContainerKindEnum
|
||||||
|
{
|
||||||
|
RDI_ContainerKind_Type = 0x0,
|
||||||
|
RDI_ContainerKind_Scope = 0x1,
|
||||||
|
RDI_ContainerKind_Namespace = 0x2,
|
||||||
|
} RDI_ContainerKindEnum;
|
||||||
|
|
||||||
|
typedef RDI_U32 RDI_ContainerFlags;
|
||||||
|
typedef enum RDI_ContainerFlagsEnum
|
||||||
|
{
|
||||||
|
RDI_ContainerFlag_External = 1<<8,
|
||||||
|
RDI_ContainerFlag_KindMask = 0xff,
|
||||||
|
} RDI_ContainerFlagsEnum;
|
||||||
|
|
||||||
typedef RDI_U32 RDI_LinkFlags;
|
typedef RDI_U32 RDI_LinkFlags;
|
||||||
typedef enum RDI_LinkFlagsEnum
|
typedef enum RDI_LinkFlagsEnum
|
||||||
{
|
{
|
||||||
@@ -524,6 +540,7 @@ X(SourceLineMapRanges, source_line_map_ranges, RDI_U32)\
|
|||||||
X(SourceLineMapVOffs, source_line_map_voffs, RDI_U64)\
|
X(SourceLineMapVOffs, source_line_map_voffs, RDI_U64)\
|
||||||
X(Units, units, RDI_Unit)\
|
X(Units, units, RDI_Unit)\
|
||||||
X(UnitVMap, unit_vmap, RDI_VMapEntry)\
|
X(UnitVMap, unit_vmap, RDI_VMapEntry)\
|
||||||
|
X(Namespaces, namespaces, RDI_Namespace)\
|
||||||
X(TypeNodes, type_nodes, RDI_TypeNode)\
|
X(TypeNodes, type_nodes, RDI_TypeNode)\
|
||||||
X(UDTs, udts, RDI_UDT)\
|
X(UDTs, udts, RDI_UDT)\
|
||||||
X(Members, members, RDI_Member)\
|
X(Members, members, RDI_Member)\
|
||||||
@@ -875,6 +892,11 @@ X(AddrRegPlusU16)\
|
|||||||
X(AddrAddrRegPlusU16)\
|
X(AddrAddrRegPlusU16)\
|
||||||
X(ValReg)\
|
X(ValReg)\
|
||||||
|
|
||||||
|
#define RDI_Namespace_XList \
|
||||||
|
X(RDI_U32, name_string_idx)\
|
||||||
|
X(RDI_ContainerFlags, container_flags)\
|
||||||
|
X(RDI_U32, container_idx)\
|
||||||
|
|
||||||
#define RDI_GlobalVariable_XList \
|
#define RDI_GlobalVariable_XList \
|
||||||
X(RDI_U32, name_string_idx)\
|
X(RDI_U32, name_string_idx)\
|
||||||
X(RDI_LinkFlags, link_flags)\
|
X(RDI_LinkFlags, link_flags)\
|
||||||
@@ -1052,6 +1074,7 @@ typedef struct RDI_U32_SourceLineMapNumbers { RDI_U32 v; } RDI_U32_Source
|
|||||||
typedef struct RDI_U32_SourceLineMapRanges { RDI_U32 v; } RDI_U32_SourceLineMapRanges;
|
typedef struct RDI_U32_SourceLineMapRanges { RDI_U32 v; } RDI_U32_SourceLineMapRanges;
|
||||||
typedef struct RDI_U32_SourceLineMapVOffs { RDI_U32 v; } RDI_U32_SourceLineMapVOffs;
|
typedef struct RDI_U32_SourceLineMapVOffs { RDI_U32 v; } RDI_U32_SourceLineMapVOffs;
|
||||||
typedef struct RDI_U32_Units { RDI_U32 v; } RDI_U32_Units;
|
typedef struct RDI_U32_Units { RDI_U32 v; } RDI_U32_Units;
|
||||||
|
typedef struct RDI_U32_Namespaces { RDI_U32 v; } RDI_U32_Namespaces;
|
||||||
typedef struct RDI_U32_TypeNodes { RDI_U32 v; } RDI_U32_TypeNodes;
|
typedef struct RDI_U32_TypeNodes { RDI_U32 v; } RDI_U32_TypeNodes;
|
||||||
typedef struct RDI_U32_UDTs { RDI_U32 v; } RDI_U32_UDTs;
|
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_Members { RDI_U32 v; } RDI_U32_Members;
|
||||||
@@ -1092,6 +1115,7 @@ typedef RDI_U32_Table RDI_U32_SourceLineMapNumbers;
|
|||||||
typedef RDI_U32_Table RDI_U32_SourceLineMapRanges;
|
typedef RDI_U32_Table RDI_U32_SourceLineMapRanges;
|
||||||
typedef RDI_U32_Table RDI_U32_SourceLineMapVOffs;
|
typedef RDI_U32_Table RDI_U32_SourceLineMapVOffs;
|
||||||
typedef RDI_U32_Table RDI_U32_Units;
|
typedef RDI_U32_Table RDI_U32_Units;
|
||||||
|
typedef RDI_U32_Table RDI_U32_Namespaces;
|
||||||
typedef RDI_U32_Table RDI_U32_TypeNodes;
|
typedef RDI_U32_Table RDI_U32_TypeNodes;
|
||||||
typedef RDI_U32_Table RDI_U32_UDTs;
|
typedef RDI_U32_Table RDI_U32_UDTs;
|
||||||
typedef RDI_U32_Table RDI_U32_Members;
|
typedef RDI_U32_Table RDI_U32_Members;
|
||||||
@@ -1319,6 +1343,14 @@ struct RDI_EnumMember
|
|||||||
RDI_U64 val;
|
RDI_U64 val;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct RDI_Namespace RDI_Namespace;
|
||||||
|
struct RDI_Namespace
|
||||||
|
{
|
||||||
|
RDI_U32 name_string_idx;
|
||||||
|
RDI_ContainerFlags container_flags;
|
||||||
|
RDI_U32 container_idx;
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct RDI_GlobalVariable RDI_GlobalVariable;
|
typedef struct RDI_GlobalVariable RDI_GlobalVariable;
|
||||||
struct RDI_GlobalVariable
|
struct RDI_GlobalVariable
|
||||||
{
|
{
|
||||||
@@ -1464,6 +1496,7 @@ typedef RDI_U32 RDI_SectionElementType_SourceLineMapRan
|
|||||||
typedef RDI_U64 RDI_SectionElementType_SourceLineMapVOffs;
|
typedef RDI_U64 RDI_SectionElementType_SourceLineMapVOffs;
|
||||||
typedef RDI_Unit RDI_SectionElementType_Units;
|
typedef RDI_Unit RDI_SectionElementType_Units;
|
||||||
typedef RDI_VMapEntry RDI_SectionElementType_UnitVMap;
|
typedef RDI_VMapEntry RDI_SectionElementType_UnitVMap;
|
||||||
|
typedef RDI_Namespace RDI_SectionElementType_Namespaces;
|
||||||
typedef RDI_TypeNode RDI_SectionElementType_TypeNodes;
|
typedef RDI_TypeNode RDI_SectionElementType_TypeNodes;
|
||||||
typedef RDI_UDT RDI_SectionElementType_UDTs;
|
typedef RDI_UDT RDI_SectionElementType_UDTs;
|
||||||
typedef RDI_Member RDI_SectionElementType_Members;
|
typedef RDI_Member RDI_SectionElementType_Members;
|
||||||
@@ -1498,7 +1531,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_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);
|
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[44];
|
extern RDI_U16 rdi_section_element_size_table[45];
|
||||||
extern RDI_U16 rdi_eval_op_ctrlbits_table[54];
|
extern RDI_U16 rdi_eval_op_ctrlbits_table[54];
|
||||||
|
|
||||||
#endif // RDI_H
|
#endif // RDI_H
|
||||||
|
|||||||
@@ -806,6 +806,29 @@ rdim_unit_chunk_list_concat_in_place(RDIM_UnitChunkList *dst, RDIM_UnitChunkList
|
|||||||
RDIM_IdxedChunkListConcatInPlace(RDIM_UnitChunkNode, dst, to_push);
|
RDIM_IdxedChunkListConcatInPlace(RDIM_UnitChunkNode, dst, to_push);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: [Building] Namespace Info Building
|
||||||
|
|
||||||
|
RDI_PROC RDIM_Namespace *
|
||||||
|
rdim_namespace_chunk_list_push(RDIM_Arena *arena, RDIM_NamespaceChunkList *list, RDI_U64 cap)
|
||||||
|
{
|
||||||
|
RDIM_IdxedChunkListPush(arena, list, RDIM_NamespaceChunkNode, RDIM_Namespace, cap, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
RDI_PROC RDI_U64
|
||||||
|
rdim_idx_from_namespace(RDIM_Namespace *ns)
|
||||||
|
{
|
||||||
|
RDIM_IdxedChunkListElementGetIdx(ns, idx);
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
RDI_PROC void
|
||||||
|
rdim_namespace_chunk_list_concat_in_place(RDIM_NamespaceChunkList *dst, RDIM_NamespaceChunkList *to_push)
|
||||||
|
{
|
||||||
|
RDIM_IdxedChunkListConcatInPlace(RDIM_NamespaceChunkNode, dst, to_push);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: [Building] Type Info Building
|
//~ rjf: [Building] Type Info Building
|
||||||
|
|
||||||
@@ -2162,6 +2185,7 @@ rdim_serialized_section_bundle_from_bake_results(RDIM_BakeResults *results)
|
|||||||
bundle.sections[RDI_SectionKind_SourceLineMapVOffs] = rdim_serialized_section_make_unpacked_array(results->src_files.source_line_map_voffs, results->src_files.source_line_map_voffs_count);
|
bundle.sections[RDI_SectionKind_SourceLineMapVOffs] = rdim_serialized_section_make_unpacked_array(results->src_files.source_line_map_voffs, results->src_files.source_line_map_voffs_count);
|
||||||
bundle.sections[RDI_SectionKind_Units] = rdim_serialized_section_make_unpacked_array(results->units.units, results->units.units_count);
|
bundle.sections[RDI_SectionKind_Units] = rdim_serialized_section_make_unpacked_array(results->units.units, results->units.units_count);
|
||||||
bundle.sections[RDI_SectionKind_UnitVMap] = rdim_serialized_section_make_unpacked_array(results->unit_vmap.vmap.vmap, results->unit_vmap.vmap.count);
|
bundle.sections[RDI_SectionKind_UnitVMap] = rdim_serialized_section_make_unpacked_array(results->unit_vmap.vmap.vmap, results->unit_vmap.vmap.count);
|
||||||
|
bundle.sections[RDI_SectionKind_Namespaces] = rdim_serialized_section_make_unpacked_array(results->namespaces.namespaces, results->namespaces.namespaces_count);
|
||||||
bundle.sections[RDI_SectionKind_TypeNodes] = rdim_serialized_section_make_unpacked_array(results->type_nodes.type_nodes, results->type_nodes.type_nodes_count);
|
bundle.sections[RDI_SectionKind_TypeNodes] = rdim_serialized_section_make_unpacked_array(results->type_nodes.type_nodes, results->type_nodes.type_nodes_count);
|
||||||
bundle.sections[RDI_SectionKind_UDTs] = rdim_serialized_section_make_unpacked_array(results->udts.udts, results->udts.udts_count);
|
bundle.sections[RDI_SectionKind_UDTs] = rdim_serialized_section_make_unpacked_array(results->udts.udts, results->udts.udts_count);
|
||||||
bundle.sections[RDI_SectionKind_Members] = rdim_serialized_section_make_unpacked_array(results->udts.members, results->udts.members_count);
|
bundle.sections[RDI_SectionKind_Members] = rdim_serialized_section_make_unpacked_array(results->udts.members, results->udts.members_count);
|
||||||
|
|||||||
@@ -665,6 +665,38 @@ struct RDIM_UnitChunkList
|
|||||||
RDI_U64 total_count;
|
RDI_U64 total_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: Namespace Types
|
||||||
|
|
||||||
|
typedef struct RDIM_Namespace RDIM_Namespace;
|
||||||
|
struct RDIM_Namespace
|
||||||
|
{
|
||||||
|
struct RDIM_NamespaceChunkNode *chunk;
|
||||||
|
RDIM_Namespace *parent_namespace;
|
||||||
|
struct RDIM_Scope *parent_scope;
|
||||||
|
struct RDIM_UDT *parent_udt;
|
||||||
|
RDIM_String8 name;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_NamespaceChunkNode RDIM_NamespaceChunkNode;
|
||||||
|
struct RDIM_NamespaceChunkNode
|
||||||
|
{
|
||||||
|
RDIM_NamespaceChunkNode *next;
|
||||||
|
RDIM_Namespace *v;
|
||||||
|
RDI_U64 count;
|
||||||
|
RDI_U64 cap;
|
||||||
|
RDI_U64 base_idx;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_NamespaceChunkList RDIM_NamespaceChunkList;
|
||||||
|
struct RDIM_NamespaceChunkList
|
||||||
|
{
|
||||||
|
RDIM_NamespaceChunkNode *first;
|
||||||
|
RDIM_NamespaceChunkNode *last;
|
||||||
|
RDI_U64 chunk_count;
|
||||||
|
RDI_U64 total_count;
|
||||||
|
};
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Type System Node Types
|
//~ rjf: Type System Node Types
|
||||||
|
|
||||||
@@ -1010,6 +1042,7 @@ struct RDIM_BakeParams
|
|||||||
RDIM_TopLevelInfo top_level_info;
|
RDIM_TopLevelInfo top_level_info;
|
||||||
RDIM_BinarySectionList binary_sections;
|
RDIM_BinarySectionList binary_sections;
|
||||||
RDIM_UnitChunkList units;
|
RDIM_UnitChunkList units;
|
||||||
|
RDIM_NamespaceChunkList namespaces;
|
||||||
RDIM_TypeChunkList types;
|
RDIM_TypeChunkList types;
|
||||||
RDIM_UDTChunkList udts;
|
RDIM_UDTChunkList udts;
|
||||||
RDIM_SrcFileChunkList src_files;
|
RDIM_SrcFileChunkList src_files;
|
||||||
@@ -1349,6 +1382,13 @@ struct RDIM_LineTableBakeResult
|
|||||||
RDI_U64 line_table_columns_count;
|
RDI_U64 line_table_columns_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct RDIM_NamespaceBakeResult RDIM_NamespaceBakeResult;
|
||||||
|
struct RDIM_NamespaceBakeResult
|
||||||
|
{
|
||||||
|
RDI_Namespace *namespaces;
|
||||||
|
RDI_U64 namespaces_count;
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct RDIM_TypeNodeBakeResult RDIM_TypeNodeBakeResult;
|
typedef struct RDIM_TypeNodeBakeResult RDIM_TypeNodeBakeResult;
|
||||||
struct RDIM_TypeNodeBakeResult
|
struct RDIM_TypeNodeBakeResult
|
||||||
{
|
{
|
||||||
@@ -1492,6 +1532,7 @@ struct RDIM_BakeResults
|
|||||||
RDIM_SrcFileBakeResult src_files;
|
RDIM_SrcFileBakeResult src_files;
|
||||||
RDIM_ChecksumBakeResult checksums;
|
RDIM_ChecksumBakeResult checksums;
|
||||||
RDIM_LineTableBakeResult line_tables;
|
RDIM_LineTableBakeResult line_tables;
|
||||||
|
RDIM_NamespaceBakeResult namespaces;
|
||||||
RDIM_TypeNodeBakeResult type_nodes;
|
RDIM_TypeNodeBakeResult type_nodes;
|
||||||
RDIM_UDTBakeResult udts;
|
RDIM_UDTBakeResult udts;
|
||||||
RDIM_GlobalVariableBakeResult global_variables;
|
RDIM_GlobalVariableBakeResult global_variables;
|
||||||
@@ -1626,6 +1667,13 @@ RDI_PROC RDIM_Unit *rdim_unit_chunk_list_push(RDIM_Arena *arena, RDIM_UnitChunkL
|
|||||||
RDI_PROC RDI_U64 rdim_idx_from_unit(RDIM_Unit *unit);
|
RDI_PROC RDI_U64 rdim_idx_from_unit(RDIM_Unit *unit);
|
||||||
RDI_PROC void rdim_unit_chunk_list_concat_in_place(RDIM_UnitChunkList *dst, RDIM_UnitChunkList *to_push);
|
RDI_PROC void rdim_unit_chunk_list_concat_in_place(RDIM_UnitChunkList *dst, RDIM_UnitChunkList *to_push);
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: [Building] Namespace Info Building
|
||||||
|
|
||||||
|
RDI_PROC RDIM_Namespace *rdim_namespace_chunk_list_push(RDIM_Arena *arena, RDIM_NamespaceChunkList *list, RDI_U64 cap);
|
||||||
|
RDI_PROC RDI_U64 rdim_idx_from_namespace(RDIM_Namespace *ns);
|
||||||
|
RDI_PROC void rdim_namespace_chunk_list_concat_in_place(RDIM_NamespaceChunkList *dst, RDIM_NamespaceChunkList *to_push);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: [Building] Type Info & UDT Building
|
//~ rjf: [Building] Type Info & UDT Building
|
||||||
|
|
||||||
@@ -1757,9 +1805,4 @@ RDI_PROC RDIM_SerializedSection rdim_serialized_section_make_unpacked(void *data
|
|||||||
RDI_PROC RDIM_SerializedSectionBundle rdim_serialized_section_bundle_from_bake_results(RDIM_BakeResults *results);
|
RDI_PROC RDIM_SerializedSectionBundle rdim_serialized_section_bundle_from_bake_results(RDIM_BakeResults *results);
|
||||||
RDI_PROC RDIM_String8List rdim_file_blobs_from_section_bundle(RDIM_Arena *arena, RDIM_SerializedSectionBundle *bundle);
|
RDI_PROC RDIM_String8List rdim_file_blobs_from_section_bundle(RDIM_Arena *arena, RDIM_SerializedSectionBundle *bundle);
|
||||||
|
|
||||||
////////////////////////////////
|
|
||||||
//~ rjf: [Serializing] Parsed RDI -> Bake Results
|
|
||||||
|
|
||||||
RDI_PROC RDIM_BakeResults *rdim_bake_results_from_rdi(RDIM_Arena *arena, RDI_Parsed *rdi);
|
|
||||||
|
|
||||||
#endif // RDI_MAKE_H
|
#endif // RDI_MAKE_H
|
||||||
|
|||||||
+71
-27
@@ -77,7 +77,7 @@
|
|||||||
"";
|
"";
|
||||||
"// \"raddbg\\0\\0\"";
|
"// \"raddbg\\0\\0\"";
|
||||||
"#define RDI_MAGIC_CONSTANT 0x0000676264646172";
|
"#define RDI_MAGIC_CONSTANT 0x0000676264646172";
|
||||||
"#define RDI_ENCODING_VERSION 18";
|
"#define RDI_ENCODING_VERSION 19";
|
||||||
"";
|
"";
|
||||||
"////////////////////////////////////////////////////////////////";
|
"////////////////////////////////////////////////////////////////";
|
||||||
"//~ Format Types & Functions";
|
"//~ Format Types & Functions";
|
||||||
@@ -153,32 +153,33 @@ RDI_SectionTable:
|
|||||||
{SourceLineMapVOffs source_line_map_voffs RDI_U64 0x000F U32 ""}
|
{SourceLineMapVOffs source_line_map_voffs RDI_U64 0x000F U32 ""}
|
||||||
{Units units RDI_Unit 0x0010 U32 ""}
|
{Units units RDI_Unit 0x0010 U32 ""}
|
||||||
{UnitVMap unit_vmap RDI_VMapEntry 0x0011 - ""}
|
{UnitVMap unit_vmap RDI_VMapEntry 0x0011 - ""}
|
||||||
{TypeNodes type_nodes RDI_TypeNode 0x0012 U32 ""}
|
{Namespaces namespaces RDI_Namespace 0x0012 U32 ""}
|
||||||
{UDTs udts RDI_UDT 0x0013 U32 ""}
|
{TypeNodes type_nodes RDI_TypeNode 0x0013 U32 ""}
|
||||||
{Members members RDI_Member 0x0014 U32 ""}
|
{UDTs udts RDI_UDT 0x0014 U32 ""}
|
||||||
{EnumMembers enum_members RDI_EnumMember 0x0015 U32 ""}
|
{Members members RDI_Member 0x0015 U32 ""}
|
||||||
{GlobalVariables global_variables RDI_GlobalVariable 0x0016 U32 ""}
|
{EnumMembers enum_members RDI_EnumMember 0x0016 U32 ""}
|
||||||
{GlobalVMap global_vmap RDI_VMapEntry 0x0017 - ""}
|
{GlobalVariables global_variables RDI_GlobalVariable 0x0017 U32 ""}
|
||||||
{ThreadVariables thread_variables RDI_ThreadVariable 0x0018 U32 ""}
|
{GlobalVMap global_vmap RDI_VMapEntry 0x0018 - ""}
|
||||||
{Constants constants RDI_Constant 0x0019 U32 ""}
|
{ThreadVariables thread_variables RDI_ThreadVariable 0x0019 U32 ""}
|
||||||
{Procedures procedures RDI_Procedure 0x001A U32 ""}
|
{Constants constants RDI_Constant 0x001A U32 ""}
|
||||||
{Scopes scopes RDI_Scope 0x001B U32 ""}
|
{Procedures procedures RDI_Procedure 0x001B U32 ""}
|
||||||
{ScopeVOffData scope_voff_data RDI_U64 0x001C U32 ""}
|
{Scopes scopes RDI_Scope 0x001C U32 ""}
|
||||||
{ScopeVMap scope_vmap RDI_VMapEntry 0x001D - ""}
|
{ScopeVOffData scope_voff_data RDI_U64 0x001D U32 ""}
|
||||||
{InlineSites inline_sites RDI_InlineSite 0x001E U32 ""}
|
{ScopeVMap scope_vmap RDI_VMapEntry 0x001E - ""}
|
||||||
{Locals locals RDI_Local 0x001F U32 ""}
|
{InlineSites inline_sites RDI_InlineSite 0x001F U32 ""}
|
||||||
{LocationBlocks location_blocks RDI_LocationBlock 0x0020 U32 ""}
|
{Locals locals RDI_Local 0x0020 U32 ""}
|
||||||
{LocationData location_data RDI_U8 0x0021 U32 ""}
|
{LocationBlocks location_blocks RDI_LocationBlock 0x0021 U32 ""}
|
||||||
{ConstantValueData constant_value_data RDI_U8 0x0022 U32 ""}
|
{LocationData location_data RDI_U8 0x0022 U32 ""}
|
||||||
{ConstantValueTable constant_value_table RDI_U32 0x0023 U32 ""}
|
{ConstantValueData constant_value_data RDI_U8 0x0023 U32 ""}
|
||||||
{MD5Checksums md5_checksums RDI_MD5 0x0024 U32 ""}
|
{ConstantValueTable constant_value_table RDI_U32 0x0024 U32 ""}
|
||||||
{SHA1Checksums sha1_checksums RDI_SHA1 0x0025 U32 ""}
|
{MD5Checksums md5_checksums RDI_MD5 0x0025 U32 ""}
|
||||||
{SHA256Checksums sha256_checksums RDI_SHA256 0x0026 U32 ""}
|
{SHA1Checksums sha1_checksums RDI_SHA1 0x0026 U32 ""}
|
||||||
{Timestamps timestamps RDI_U64 0x0027 U32 ""}
|
{SHA256Checksums sha256_checksums RDI_SHA256 0x0027 U32 ""}
|
||||||
{NameMaps name_maps RDI_NameMap 0x0028 U32 ""}
|
{Timestamps timestamps RDI_U64 0x0028 U32 ""}
|
||||||
{NameMapBuckets name_map_buckets RDI_NameMapBucket 0x0029 U32 ""}
|
{NameMaps name_maps RDI_NameMap 0x0029 U32 ""}
|
||||||
{NameMapNodes name_map_nodes RDI_NameMapNode 0x002A U32 ""}
|
{NameMapBuckets name_map_buckets RDI_NameMapBucket 0x002A U32 ""}
|
||||||
{COUNT count RDI_U8 0x002B - ""}
|
{NameMapNodes name_map_nodes RDI_NameMapNode 0x002B U32 ""}
|
||||||
|
{COUNT count RDI_U8 0x002C - ""}
|
||||||
}
|
}
|
||||||
|
|
||||||
@table(name value)
|
@table(name value)
|
||||||
@@ -943,6 +944,20 @@ RDI_EnumMemberTable:
|
|||||||
|
|
||||||
//- rjf: tables
|
//- rjf: tables
|
||||||
|
|
||||||
|
@table(name value)
|
||||||
|
RDI_ContainerKindTable:
|
||||||
|
{
|
||||||
|
{Type 0x0}
|
||||||
|
{Scope 0x1}
|
||||||
|
{Namespace 0x2}
|
||||||
|
}
|
||||||
|
|
||||||
|
@table(name value)
|
||||||
|
RDI_ContainerFlagTable:
|
||||||
|
{
|
||||||
|
{External `1<<8`}
|
||||||
|
}
|
||||||
|
|
||||||
@table(name value)
|
@table(name value)
|
||||||
RDI_LinkFlagTable:
|
RDI_LinkFlagTable:
|
||||||
{
|
{
|
||||||
@@ -970,6 +985,14 @@ RDI_LocationKindTable:
|
|||||||
{ValReg 0x5}
|
{ValReg 0x5}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@table(name type desc)
|
||||||
|
RDI_NamespaceMemberTable:
|
||||||
|
{
|
||||||
|
{name_string_idx RDI_U32 ""}
|
||||||
|
{container_flags RDI_ContainerFlags ""}
|
||||||
|
{container_idx RDI_U32 ""}
|
||||||
|
}
|
||||||
|
|
||||||
@table(name type desc)
|
@table(name type desc)
|
||||||
RDI_GlobalVariableMemberTable:
|
RDI_GlobalVariableMemberTable:
|
||||||
{
|
{
|
||||||
@@ -1077,6 +1100,17 @@ RDI_LocationRegMemberTable:
|
|||||||
|
|
||||||
//- rjf: enums
|
//- rjf: enums
|
||||||
|
|
||||||
|
@enum(RDI_U8) RDI_ContainerKind:
|
||||||
|
{
|
||||||
|
@expand(RDI_ContainerKindTable a) `$(a.name .. =>20) = $(a.value)`
|
||||||
|
}
|
||||||
|
|
||||||
|
@enum(RDI_U32) RDI_ContainerFlags:
|
||||||
|
{
|
||||||
|
@expand(RDI_ContainerFlagTable a) `$(a.name .. =>20) = $(a.value)`,
|
||||||
|
`KindMask = 0xff`,
|
||||||
|
}
|
||||||
|
|
||||||
@enum(RDI_U32) RDI_LinkFlags:
|
@enum(RDI_U32) RDI_LinkFlags:
|
||||||
{
|
{
|
||||||
@expand(RDI_LinkFlagTable a) `$(a.name .. =>20) = $(a.value)`
|
@expand(RDI_LinkFlagTable a) `$(a.name .. =>20) = $(a.value)`
|
||||||
@@ -1109,6 +1143,11 @@ RDI_LocationRegMemberTable:
|
|||||||
@expand(RDI_LocationKindTable a) `$(a.name != COUNT -> a.name)`;
|
@expand(RDI_LocationKindTable a) `$(a.name != COUNT -> a.name)`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@xlist RDI_Namespace_XList:
|
||||||
|
{
|
||||||
|
@expand(RDI_NamespaceMemberTable a) `$(a.type), $(a.name)`
|
||||||
|
}
|
||||||
|
|
||||||
@xlist RDI_GlobalVariable_XList:
|
@xlist RDI_GlobalVariable_XList:
|
||||||
{
|
{
|
||||||
@expand(RDI_GlobalVariableMemberTable a) `$(a.type), $(a.name)`
|
@expand(RDI_GlobalVariableMemberTable a) `$(a.type), $(a.name)`
|
||||||
@@ -1161,6 +1200,11 @@ RDI_LocationRegMemberTable:
|
|||||||
|
|
||||||
//- rjf: structs
|
//- rjf: structs
|
||||||
|
|
||||||
|
@struct RDI_Namespace:
|
||||||
|
{
|
||||||
|
@expand(RDI_NamespaceMemberTable a) `$(a.type) $(a.name)`
|
||||||
|
}
|
||||||
|
|
||||||
@struct RDI_GlobalVariable:
|
@struct RDI_GlobalVariable:
|
||||||
{
|
{
|
||||||
@expand(RDI_GlobalVariableMemberTable a) `$(a.type) $(a.name)`
|
@expand(RDI_GlobalVariableMemberTable a) `$(a.type) $(a.name)`
|
||||||
|
|||||||
@@ -1110,6 +1110,19 @@ rdim_bake(Arena *arena, RDIM_BakeParams *params)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rjf: push strings from namespaces
|
||||||
|
ProfScope("namespaces")
|
||||||
|
{
|
||||||
|
for EachNode(n, RDIM_NamespaceChunkNode, params->namespaces.first)
|
||||||
|
{
|
||||||
|
Rng1U64 range = lane_range(n->count);
|
||||||
|
for EachInRange(n_idx, range)
|
||||||
|
{
|
||||||
|
rdim_bake_string_map_loose_insert(arena, top, lane_map, 4, n->v[n_idx].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// rjf: push strings from types
|
// rjf: push strings from types
|
||||||
ProfScope("types")
|
ProfScope("types")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user