updated name convention for flag extract macro in CodeView layer

This commit is contained in:
Nikita Smith
2025-01-08 03:26:04 -08:00
parent 42e441541d
commit 2b33978037
6 changed files with 283 additions and 103 deletions
+2 -2
View File
@@ -96,11 +96,11 @@ cv_pick_fp_encoding(CV_SymFrameproc *frameproc, B32 is_local_param)
CV_EncodedFramePtrReg fp_reg = 0; CV_EncodedFramePtrReg fp_reg = 0;
if(is_local_param) if(is_local_param)
{ {
fp_reg = CV_FrameprocFlags_ExtractParamBasePointer(frameproc->flags); fp_reg = CV_FrameprocFlags_Extract_ParamBasePointer(frameproc->flags);
} }
else else
{ {
fp_reg = CV_FrameprocFlags_ExtractLocalBasePointer(frameproc->flags); fp_reg = CV_FrameprocFlags_Extract_LocalBasePointer(frameproc->flags);
} }
return fp_reg; return fp_reg;
} }
+43 -43
View File
@@ -1123,12 +1123,12 @@ struct CV_LocalVarAttr
//- (SymKind: COMPILE) //- (SymKind: COMPILE)
typedef U32 CV_CompileFlags; typedef U32 CV_CompileFlags;
#define CV_CompileFlags_ExtractLanguage(f) (((f) )&0xFF) #define CV_CompileFlags_Extract_Language(f) (((f) )&0xFF)
#define CV_CompileFlags_ExtractFloatPrec(f) (((f)>> 8)&0x03) #define CV_CompileFlags_Extract_FloatPrec(f) (((f)>> 8)&0x03)
#define CV_CompileFlags_ExtractFloatPkg(f) (((f)>>10)&0x03) #define CV_CompileFlags_Extract_FloatPkg(f) (((f)>>10)&0x03)
#define CV_CompileFlags_ExtractAmbientData(f) (((f)>>12)&0x07) #define CV_CompileFlags_Extract_AmbientData(f) (((f)>>12)&0x07)
#define CV_CompileFlags_ExtractAmbientCode(f) (((f)>>15)&0x07) #define CV_CompileFlags_Extract_AmbientCode(f) (((f)>>15)&0x07)
#define CV_CompileFlags_ExtractMode(f) (((f)>>18)&0x01) #define CV_CompileFlags_Extract_Mode(f) (((f)>>18)&0x01)
typedef struct CV_SymCompile CV_SymCompile; typedef struct CV_SymCompile CV_SymCompile;
struct CV_SymCompile struct CV_SymCompile
@@ -1246,8 +1246,8 @@ enum
CV_FrameprocFlag_HasCFG = (1 << 21), CV_FrameprocFlag_HasCFG = (1 << 21),
CV_FrameprocFlag_HasCFW = (1 << 22), CV_FrameprocFlag_HasCFW = (1 << 22),
}; };
#define CV_FrameprocFlags_ExtractLocalBasePointer(f) (((f) >> 14)&3) #define CV_FrameprocFlags_Extract_LocalBasePointer(f) (((f) >> 14)&3)
#define CV_FrameprocFlags_ExtractParamBasePointer(f) (((f) >> 16)&3) #define CV_FrameprocFlags_Extract_ParamBasePointer(f) (((f) >> 16)&3)
typedef struct CV_SymFrameproc CV_SymFrameproc; typedef struct CV_SymFrameproc CV_SymFrameproc;
struct CV_SymFrameproc struct CV_SymFrameproc
@@ -1457,16 +1457,16 @@ struct CV_SymThread32
//- (SymKind: COMPILE2) //- (SymKind: COMPILE2)
typedef U32 CV_Compile2Flags; typedef U32 CV_Compile2Flags;
#define CV_Compile2Flags_ExtractLanguage(f) (((f) )&0xFF) #define CV_Compile2Flags_Extract_Language(f) (((f) )&0xFF)
#define CV_Compile2Flags_ExtractEditAndContinue(f) (((f)>> 8)&0x01) #define CV_Compile2Flags_Extract_EditAndContinue(f) (((f)>> 8)&0x01)
#define CV_Compile2Flags_ExtractNoDbgInfo(f) (((f)>> 9)&0x01) #define CV_Compile2Flags_Extract_NoDbgInfo(f) (((f)>> 9)&0x01)
#define CV_Compile2Flags_ExtractLTCG(f) (((f)>>10)&0x01) #define CV_Compile2Flags_Extract_LTCG(f) (((f)>>10)&0x01)
#define CV_Compile2Flags_ExtractNoDataAlign(f) (((f)>>11)&0x01) #define CV_Compile2Flags_Extract_NoDataAlign(f) (((f)>>11)&0x01)
#define CV_Compile2Flags_ExtractManagedPresent(f) (((f)>>12)&0x01) #define CV_Compile2Flags_Extract_ManagedPresent(f) (((f)>>12)&0x01)
#define CV_Compile2Flags_ExtractSecurityChecks(f) (((f)>>13)&0x01) #define CV_Compile2Flags_Extract_SecurityChecks(f) (((f)>>13)&0x01)
#define CV_Compile2Flags_ExtractHotPatch(f) (((f)>>14)&0x01) #define CV_Compile2Flags_Extract_HotPatch(f) (((f)>>14)&0x01)
#define CV_Compile2Flags_ExtractCVTCIL(f) (((f)>>15)&0x01) #define CV_Compile2Flags_Extract_CVTCIL(f) (((f)>>15)&0x01)
#define CV_Compile2Flags_ExtractMSILModule(f) (((f)>>16)&0x01) #define CV_Compile2Flags_Extract_MSILModule(f) (((f)>>16)&0x01)
typedef struct CV_SymCompile2 CV_SymCompile2; typedef struct CV_SymCompile2 CV_SymCompile2;
struct CV_SymCompile2 struct CV_SymCompile2
@@ -1737,19 +1737,19 @@ enum
}; };
typedef U32 CV_Compile3Flags; typedef U32 CV_Compile3Flags;
#define CV_Compile3Flags_ExtractLanguage(f) (((f) )&0xFF) #define CV_Compile3Flags_Extract_Language(f) (((f) )&0xFF)
#define CV_Compile3Flags_ExtractEditAndContinue(f) (((f)>> 9)&0x01) #define CV_Compile3Flags_Extract_EditAndContinue(f) (((f)>> 9)&0x01)
#define CV_Compile3Flags_ExtractNoDbgInfo(f) (((f)>>10)&0x01) #define CV_Compile3Flags_Extract_NoDbgInfo(f) (((f)>>10)&0x01)
#define CV_Compile3Flags_ExtractLTCG(f) (((f)>>11)&0x01) #define CV_Compile3Flags_Extract_LTCG(f) (((f)>>11)&0x01)
#define CV_Compile3Flags_ExtractNoDataAlign(f) (((f)>>12)&0x01) #define CV_Compile3Flags_Extract_NoDataAlign(f) (((f)>>12)&0x01)
#define CV_Compile3Flags_ExtractManagedPresent(f) (((f)>>13)&0x01) #define CV_Compile3Flags_Extract_ManagedPresent(f) (((f)>>13)&0x01)
#define CV_Compile3Flags_ExtractSecurityChecks(f) (((f)>>14)&0x01) #define CV_Compile3Flags_Extract_SecurityChecks(f) (((f)>>14)&0x01)
#define CV_Compile3Flags_ExtractHotPatch(f) (((f)>>15)&0x01) #define CV_Compile3Flags_Extract_HotPatch(f) (((f)>>15)&0x01)
#define CV_Compile3Flags_ExtractCVTCIL(f) (((f)>>16)&0x01) #define CV_Compile3Flags_Extract_CVTCIL(f) (((f)>>16)&0x01)
#define CV_Compile3Flags_ExtractMSILModule(f) (((f)>>17)&0x01) #define CV_Compile3Flags_Extract_MSILModule(f) (((f)>>17)&0x01)
#define CV_Compile3Flags_ExtractSDL(f) (((f)>>18)&0x01) #define CV_Compile3Flags_Extract_SDL(f) (((f)>>18)&0x01)
#define CV_Compile3Flags_ExtractPGO(f) (((f)>>19)&0x01) #define CV_Compile3Flags_Extract_PGO(f) (((f)>>19)&0x01)
#define CV_Compile3Flags_ExtractEXP(f) (((f)>>20)&0x01) #define CV_Compile3Flags_Extract_EXP(f) (((f)>>20)&0x01)
typedef struct CV_SymCompile3 CV_SymCompile3; typedef struct CV_SymCompile3 CV_SymCompile3;
struct CV_SymCompile3 struct CV_SymCompile3
@@ -1853,7 +1853,7 @@ struct CV_SymDefrangeFramepointerRel
//- (SymKind: DEFRANGE_SUBFIELD_REGISTER) //- (SymKind: DEFRANGE_SUBFIELD_REGISTER)
#define CV_DefrangeSubfieldRegister_ExtractParentOffset(x) ((x) & 0x1FFF) #define CV_DefrangeSubfieldRegister_Extract_ParentOffset(x) ((x) & 0x1FFF)
typedef struct CV_SymDefrangeSubfieldRegister CV_SymDefrangeSubfieldRegister; typedef struct CV_SymDefrangeSubfieldRegister CV_SymDefrangeSubfieldRegister;
struct CV_SymDefrangeSubfieldRegister struct CV_SymDefrangeSubfieldRegister
@@ -1880,7 +1880,7 @@ enum
{ {
CV_DefrangeRegisterRelFlag_SpilledOutUDTMember = (1 << 0), CV_DefrangeRegisterRelFlag_SpilledOutUDTMember = (1 << 0),
}; };
#define CV_DefrangeRegisterRelFlag_ExtractOffsetParent(f) (((f)>>4)&0xFFF) #define CV_DefrangeRegisterRelFlag_Extract_OffsetParent(f) (((f)>>4)&0xFFF)
typedef struct CV_SymDefrangeRegisterRel CV_SymDefrangeRegisterRel; typedef struct CV_SymDefrangeRegisterRel CV_SymDefrangeRegisterRel;
struct CV_SymDefrangeRegisterRel struct CV_SymDefrangeRegisterRel
@@ -2166,8 +2166,8 @@ enum
CV_TypeProp_Intrinsic = (1 << 13), CV_TypeProp_Intrinsic = (1 << 13),
// MOCOM: 14,15 // MOCOM: 14,15
}; };
#define CV_TypeProps_ExtractHFA(f) (((f)>>11)&0x3) #define CV_TypeProps_Extract_HFA(f) (((f)>>11)&0x3)
#define CV_TypeProps_ExtractMOCOM(f) (((f)>>14)&0x3) #define CV_TypeProps_Extract_MOCOM(f) (((f)>>14)&0x3)
typedef U8 CV_PointerKind; typedef U8 CV_PointerKind;
typedef enum CV_PointerKindEnum typedef enum CV_PointerKindEnum
@@ -2259,8 +2259,8 @@ enum
CV_FieldAttrib_CompilerGenated = (1<<8), CV_FieldAttrib_CompilerGenated = (1<<8),
CV_FieldAttrib_Sealed = (1<<9), CV_FieldAttrib_Sealed = (1<<9),
}; };
#define CV_FieldAttribs_ExtractAccess(f) ((f)&0x3) #define CV_FieldAttribs_Extract_Access(f) ((f)&0x3)
#define CV_FieldAttribs_ExtractMethodProp(f) (((f)>>2)&0x7) #define CV_FieldAttribs_Extract_MethodProp(f) (((f)>>2)&0x7)
typedef U16 CV_LabelKind; typedef U16 CV_LabelKind;
typedef enum CV_LabelKindEnum typedef enum CV_LabelKindEnum
@@ -2408,9 +2408,9 @@ enum
CV_PointerAttrib_RRef = (1 << 22) CV_PointerAttrib_RRef = (1 << 22)
}; };
#define CV_PointerAttribs_ExtractKind(a) ((a)&0x1F) #define CV_PointerAttribs_Extract_Kind(a) ((a)&0x1F)
#define CV_PointerAttribs_ExtractMode(a) (((a)>>5)&0x7) #define CV_PointerAttribs_Extract_Mode(a) (((a)>>5)&0x7)
#define CV_PointerAttribs_ExtractSize(a) (((a)>>13)&0x3F) #define CV_PointerAttribs_Extract_Size(a) (((a)>>13)&0x3F)
typedef struct CV_LeafPointer CV_LeafPointer; typedef struct CV_LeafPointer CV_LeafPointer;
struct CV_LeafPointer struct CV_LeafPointer
@@ -2861,9 +2861,9 @@ struct CV_C13File
}; };
typedef U32 CV_C13LineFlags; typedef U32 CV_C13LineFlags;
#define CV_C13LineFlags_ExtractLineNumber(f) ((f)&0xFFFFFF) #define CV_C13LineFlags_Extract_LineNumber(f) ((f)&0xFFFFFF)
#define CV_C13LineFlags_ExtractDeltaToEnd(f) (((f)>>24)&0x7F) #define CV_C13LineFlags_Extract_DeltaToEnd(f) (((f)>>24)&0x7F)
#define CV_C13LineFlags_ExtractStatement(f) (((f)>>31)&0x1) #define CV_C13LineFlags_Extract_Statement(f) (((f)>>31)&0x1)
typedef struct CV_C13Line CV_C13Line; typedef struct CV_C13Line CV_C13Line;
struct CV_C13Line struct CV_C13Line
+222 -42
View File
@@ -29,12 +29,12 @@ cv_string_from_numeric(Arena *arena, CV_NumericParsed num)
{ {
String8 result = str8_zero(); String8 result = str8_zero();
switch (num.kind) { switch (num.kind) {
case CV_NumericKind_FLOAT16: break; // TODO: format float16 case CV_NumericKind_FLOAT16: NotImplemented; break; // TODO: format float16
case CV_NumericKind_FLOAT32: result = push_str8f(arena, "%f", (F64)(*(F32*)num.val)); break; case CV_NumericKind_FLOAT32: result = push_str8f(arena, "%f", (F64)(*(F32*)num.val)); break;
case CV_NumericKind_FLOAT48: break; // TODO: format float48 case CV_NumericKind_FLOAT48: NotImplemented; break; // TODO: format float48
case CV_NumericKind_FLOAT64: result = push_str8f(arena, "%f", *(F64*)num.val); break; case CV_NumericKind_FLOAT64: result = push_str8f(arena, "%f", *(F64*)num.val); break;
case CV_NumericKind_FLOAT80: break; // TODO: format float80 case CV_NumericKind_FLOAT80: NotImplemented; break; // TODO: format float80
case CV_NumericKind_FLOAT128: break; // TODO: format float128 case CV_NumericKind_FLOAT128: NotImplemented; break; // TODO: format float128
case CV_NumericKind_CHAR: result = push_str8f(arena, "%d", *(S8 *)num.val); break; case CV_NumericKind_CHAR: result = push_str8f(arena, "%d", *(S8 *)num.val); break;
case CV_NumericKind_SHORT: result = push_str8f(arena, "%d", *(S16*)num.val); break; case CV_NumericKind_SHORT: result = push_str8f(arena, "%d", *(S16*)num.val); break;
case CV_NumericKind_LONG: result = push_str8f(arena, "%d", *(S32*)num.val); break; case CV_NumericKind_LONG: result = push_str8f(arena, "%d", *(S32*)num.val); break;
@@ -47,25 +47,28 @@ cv_string_from_numeric(Arena *arena, CV_NumericParsed num)
} }
internal String8 internal String8
cv_string_from_reg_id(CV_Arch arch, U32 id) cv_string_from_reg_id(Arena *arena, CV_Arch arch, U32 id)
{ {
String8 result = str8_zero(); String8 result = str8_zero();
switch (arch) { switch (arch) {
case CV_Arch_8086: { case CV_Arch_8086: {
switch (id) { switch (id) {
#define X(_name, _id,...) case _id: str8_lit(Stringify(_name)); break; #define X(_N, _ID, ...) case _ID: result = str8_lit(Stringify(_N)); break;
CV_Reg_X86_XList(X) CV_Reg_X86_XList(X)
#undef X #undef X
} }
} break; } break;
case CV_Arch_X64: { case CV_Arch_X64: {
switch (id) { switch (id) {
#define X(_name, _id,...) case _id: str8_lit(Stringify(_name)); break; #define X(_N, _ID, ...) case _ID: result = str8_lit(Stringify(_N)); break;
CV_Reg_X64_XList(X) CV_Reg_X64_XList(X)
#undef X #undef X
} }
} break; } break;
default: NotImplemented; default: NotImplemented; break;
}
if (result.size == 0) {
result = push_str8f(arena, "%x", id);
} }
return result; return result;
} }
@@ -274,7 +277,7 @@ cv_string_from_pointer_kind(CV_PointerKind x)
case CV_PointerKind_BaseSelf: return str8_lit("BaseSelf"); case CV_PointerKind_BaseSelf: return str8_lit("BaseSelf");
case CV_PointerKind_Near32: return str8_lit("Near32"); case CV_PointerKind_Near32: return str8_lit("Near32");
case CV_PointerKind_Far32: return str8_lit("Far32"); case CV_PointerKind_Far32: return str8_lit("Far32");
case CV_PointerKind_64: return str8_lit("64"); case CV_PointerKind_64: return str8_lit("64Bit");
} }
return str8_zero(); return str8_zero();
} }
@@ -308,7 +311,7 @@ internal String8
cv_string_from_c13_subsection_kind(CV_C13SubSectionKind x) cv_string_from_c13_subsection_kind(CV_C13SubSectionKind x)
{ {
switch (x) { switch (x) {
#define X(_id, _name) case CV_C13SubSectionKind_##_id: return str8_lit(Stringify(_name)); #define X(_N, _ID) case CV_C13SubSectionKind_##_N: return str8_lit(Stringify(_N));
CV_C13SubSectionKindXList(X) CV_C13SubSectionKindXList(X)
#undef X #undef X
} }
@@ -331,37 +334,70 @@ cv_string_from_modifier_flags(Arena *arena, CV_ModifierFlags x)
} }
String8 result = str8_list_join(arena, &list, &(StringJoin){.sep=str8_lit(", ")}); String8 result = str8_list_join(arena, &list, &(StringJoin){.sep=str8_lit(", ")});
scratch_end(scratch); scratch_end(scratch);
return result;
} }
internal String8 internal String8
cv_string_from_pointer_attribs(Arena *arena, CV_PointerAttribs x) cv_string_from_pointer_attribs(Arena *arena, CV_PointerAttribs x)
{ {
Temp scratch = scratch_begin(&arena, 1); Temp scratch = scratch_begin(&arena, 1);
String8List list = {0}; String8List list = {0};
if (x & CV_PointerAttrib_IsFlat) { if (x & CV_PointerAttrib_IsFlat) {
x &= ~CV_PointerAttrib_IsFlat;
str8_list_pushf(scratch.arena, &list, "IsFlat"); str8_list_pushf(scratch.arena, &list, "IsFlat");
} }
if (x & CV_PointerAttrib_Volatile) { if (x & CV_PointerAttrib_Volatile) {
x &= ~CV_PointerAttrib_Volatile;
str8_list_pushf(scratch.arena, &list, "Volatile"); str8_list_pushf(scratch.arena, &list, "Volatile");
} }
if (x & CV_PointerAttrib_Const) { if (x & CV_PointerAttrib_Const) {
x &= ~CV_PointerAttrib_Const;
str8_list_pushf(scratch.arena, &list, "Const"); str8_list_pushf(scratch.arena, &list, "Const");
} }
if (x & CV_PointerAttrib_Unaligned) { if (x & CV_PointerAttrib_Unaligned) {
x &= ~CV_PointerAttrib_Unaligned;
str8_list_pushf(scratch.arena, &list, "Unaligned"); str8_list_pushf(scratch.arena, &list, "Unaligned");
} }
if (x & CV_PointerAttrib_Restricted) { if (x & CV_PointerAttrib_Restricted) {
x &= ~CV_PointerAttrib_Restricted;
str8_list_pushf(scratch.arena, &list, "Restricted"); str8_list_pushf(scratch.arena, &list, "Restricted");
} }
if (x & CV_PointerAttrib_MOCOM) { if (x & CV_PointerAttrib_MOCOM) {
x &= ~CV_PointerAttrib_MOCOM;
str8_list_pushf(scratch.arena, &list, "MOCOM"); str8_list_pushf(scratch.arena, &list, "MOCOM");
} }
if (x & CV_PointerAttrib_LRef) { if (x & CV_PointerAttrib_LRef) {
x &= ~CV_PointerAttrib_LRef;
str8_list_pushf(scratch.arena, &list, "LRef"); str8_list_pushf(scratch.arena, &list, "LRef");
} }
if (x & CV_PointerAttrib_RRef) { if (x & CV_PointerAttrib_RRef) {
x &= ~CV_PointerAttrib_RRef;
str8_list_pushf(scratch.arena, &list, "RRef"); str8_list_pushf(scratch.arena, &list, "RRef");
} }
CV_PointerKind kind = CV_PointerAttribs_Extract_Kind(x);
CV_PointerMode mode = CV_PointerAttribs_Extract_Mode(x);
U64 size = CV_PointerAttribs_Extract_Size(x);
x &= ~(0x1f|(0x7<<5)|(0x3f<<13));
if (kind) {
String8 kind_str = cv_string_from_pointer_kind(kind);
str8_list_pushf(scratch.arena, &list, "Kind=%S", kind_str);
}
if (mode) {
String8 mode_str = cv_string_from_pointer_mode(mode);
str8_list_pushf(scratch.arena, &list, "Mode=%S", mode_str);
}
if (size) {
str8_list_pushf(scratch.arena, &list, "Size=%llu", size);
}
if (x != 0) {
str8_list_pushf(scratch.arena, &list, "Unknown=%x", x);
}
String8 result = str8_list_join(arena, &list, &(StringJoin){.sep=str8_lit(", ")}); String8 result = str8_list_join(arena, &list, &(StringJoin){.sep=str8_lit(", ")});
scratch_end(scratch); scratch_end(scratch);
return result; return result;
@@ -453,7 +489,7 @@ cv_string_from_pub32_flags(Arena *arena, CV_Pub32Flags x)
} }
internal String8 internal String8
cv_string_generic_flags(Arena *arena, CV_GenericFlags x) cv_string_from_generic_flags(Arena *arena, CV_GenericFlags x)
{ {
Temp scratch = scratch_begin(&arena, 1); Temp scratch = scratch_begin(&arena, 1);
String8List list = {0}; String8List list = {0};
@@ -539,51 +575,78 @@ internal String8
cv_string_from_type_props(Arena *arena, CV_TypeProps x) cv_string_from_type_props(Arena *arena, CV_TypeProps x)
{ {
Temp scratch = scratch_begin(&arena, 1); Temp scratch = scratch_begin(&arena, 1);
U32 hfa = CV_TypeProps_Extract_HFA(x); U32 hfa = CV_TypeProps_Extract_HFA(x);
U32 mcom = CV_TypeProps_Extract_MOCOM(x); U32 mcom = CV_TypeProps_Extract_MOCOM(x);
String8 hfa_str = cv_string_from_hfa(hfa);
String8 mcom_str = cv_string_from_mcom(mcom);
String8 flags_str; String8 flags_str;
{ {
String8List list = {0}; String8List list = {0};
if (x & CV_TypeProp_Packed) { if (x & CV_TypeProp_Packed) {
x &= ~CV_TypeProp_Packed;
str8_list_pushf(scratch.arena, &list, "Packed"); str8_list_pushf(scratch.arena, &list, "Packed");
} }
if (x & CV_TypeProp_HasConstructorsDestructors) { if (x & CV_TypeProp_HasConstructorsDestructors) {
x &= ~CV_TypeProp_HasConstructorsDestructors;
str8_list_pushf(scratch.arena, &list, "HasConstructorsDestructors"); str8_list_pushf(scratch.arena, &list, "HasConstructorsDestructors");
} }
if (x & CV_TypeProp_OverloadedOperators) { if (x & CV_TypeProp_OverloadedOperators) {
x &= ~CV_TypeProp_OverloadedOperators;
str8_list_pushf(scratch.arena, &list, "OverloadedOperators"); str8_list_pushf(scratch.arena, &list, "OverloadedOperators");
} }
if (x & CV_TypeProp_IsNested) { if (x & CV_TypeProp_IsNested) {
x &= ~CV_TypeProp_IsNested;
str8_list_pushf(scratch.arena, &list, "IsNested"); str8_list_pushf(scratch.arena, &list, "IsNested");
} }
if (x & CV_TypeProp_ContainsNested) { if (x & CV_TypeProp_ContainsNested) {
x &= ~CV_TypeProp_ContainsNested;
str8_list_pushf(scratch.arena, &list, "ContainsNested"); str8_list_pushf(scratch.arena, &list, "ContainsNested");
} }
if (x & CV_TypeProp_OverloadedAssignment) { if (x & CV_TypeProp_OverloadedAssignment) {
x &= ~CV_TypeProp_OverloadedAssignment;
str8_list_pushf(scratch.arena, &list, "OverloadedAssignment"); str8_list_pushf(scratch.arena, &list, "OverloadedAssignment");
} }
if (x & CV_TypeProp_OverloadedCasting) { if (x & CV_TypeProp_OverloadedCasting) {
x &= ~CV_TypeProp_OverloadedCasting;
str8_list_pushf(scratch.arena, &list, "OverloadedCasting"); str8_list_pushf(scratch.arena, &list, "OverloadedCasting");
} }
if (x & CV_TypeProp_FwdRef) { if (x & CV_TypeProp_FwdRef) {
x &= ~CV_TypeProp_FwdRef;
str8_list_pushf(scratch.arena, &list, "FwdRef"); str8_list_pushf(scratch.arena, &list, "FwdRef");
} }
if (x & CV_TypeProp_Scoped) { if (x & CV_TypeProp_Scoped) {
x &= ~CV_TypeProp_Scoped;
str8_list_pushf(scratch.arena, &list, "Scoped"); str8_list_pushf(scratch.arena, &list, "Scoped");
} }
if (x & CV_TypeProp_HasUniqueName) { if (x & CV_TypeProp_HasUniqueName) {
x &= ~CV_TypeProp_HasUniqueName;
str8_list_pushf(scratch.arena, &list, "HasUniqueName"); str8_list_pushf(scratch.arena, &list, "HasUniqueName");
} }
if (x & CV_TypeProp_Sealed) { if (x & CV_TypeProp_Sealed) {
x &= ~CV_TypeProp_Sealed;
str8_list_pushf(scratch.arena, &list, "Sealed"); str8_list_pushf(scratch.arena, &list, "Sealed");
} }
if (x & CV_TypeProp_Intrinsic) {
x &= ~CV_TypeProp_Intrinsic;
str8_list_pushf(scratch.arena, &list, "Intrinsic");
}
if (x != 0) {
str8_list_pushf(scratch.arena, &list, "%x", x);
}
flags_str = str8_list_join(scratch.arena, &list, &(StringJoin){.sep=str8_lit(", ") }); flags_str = str8_list_join(scratch.arena, &list, &(StringJoin){.sep=str8_lit(", ") });
if (hfa) {
str8_list_pushf(scratch.arena, &list, "HFA = %S", hfa_str);
}
if (mcom) {
str8_list_pushf(scratch.arena, &list, "MCOM = %S", mcom_str);
}
} }
String8 hfa_str = cv_string_from_hfa(hfa); String8 result = push_str8f(arena, "%S", flags_str);
String8 mcom_str = cv_string_from_mcom(mcom);
String8 result = push_str8f(arena, "flags = %S, HFA = %S, MCOM = %S", flags_str, hfa_str, mcom_str);
scratch_end(scratch); scratch_end(scratch);
return result; return result;
@@ -638,30 +701,46 @@ cv_string_from_proc_flags(Arena *arena, CV_ProcFlags x)
Temp scratch = scratch_begin(&arena, 1); Temp scratch = scratch_begin(&arena, 1);
String8List list = {0}; String8List list = {0};
if (x & CV_ProcFlag_NoFPO) { if (x & CV_ProcFlag_NoFPO) {
x &= ~CV_ProcFlag_NoFPO;
str8_list_pushf(scratch.arena, &list, "NoFPO"); str8_list_pushf(scratch.arena, &list, "NoFPO");
} }
if (x & CV_ProcFlag_IntReturn) { if (x & CV_ProcFlag_IntReturn) {
x &= ~CV_ProcFlag_IntReturn;
str8_list_pushf(scratch.arena, &list, "IntReturn"); str8_list_pushf(scratch.arena, &list, "IntReturn");
} }
if (x & CV_ProcFlag_FarReturn) { if (x & CV_ProcFlag_FarReturn) {
x &= ~CV_ProcFlag_FarReturn;
str8_list_pushf(scratch.arena, &list, "FarReturn"); str8_list_pushf(scratch.arena, &list, "FarReturn");
} }
if (x & CV_ProcFlag_NeverReturn) { if (x & CV_ProcFlag_NeverReturn) {
x &= ~CV_ProcFlag_NeverReturn;
str8_list_pushf(scratch.arena, &list, "NeverReturn"); str8_list_pushf(scratch.arena, &list, "NeverReturn");
} }
if (x & CV_ProcFlag_NotReached) { if (x & CV_ProcFlag_NotReached) {
x &= ~CV_ProcFlag_NotReached;
str8_list_pushf(scratch.arena, &list, "NotReached"); str8_list_pushf(scratch.arena, &list, "NotReached");
} }
if (x & CV_ProcFlag_CustomCall) { if (x & CV_ProcFlag_CustomCall) {
x &= ~CV_ProcFlag_CustomCall;
str8_list_pushf(scratch.arena, &list, "CustomCall"); str8_list_pushf(scratch.arena, &list, "CustomCall");
} }
if (x & CV_ProcFlag_NoInline) { if (x & CV_ProcFlag_NoInline) {
x &= ~CV_ProcFlag_NoInline;
str8_list_pushf(scratch.arena, &list, "NoInline"); str8_list_pushf(scratch.arena, &list, "NoInline");
} }
if (x & CV_ProcFlag_OptDbgInfo) { if (x & CV_ProcFlag_OptDbgInfo) {
x &= ~CV_ProcFlag_OptDbgInfo;
str8_list_pushf(scratch.arena, &list, "OptDbgInfo"); str8_list_pushf(scratch.arena, &list, "OptDbgInfo");
} }
String8 result = str8_list_join(arena, &list, &(StringJoin){.sep=str8_lit(", ")}); if (x != 0) {
str8_list_pushf(scratch.arena, &list, "%#x", x);
}
String8 result;
if (list.node_count == 0) {
result = str8_lit("None");
} else {
result = str8_list_join(arena, &list, &(StringJoin){.sep=str8_lit(", ")});
}
temp_end(scratch); temp_end(scratch);
return result; return result;
} }
@@ -691,42 +770,140 @@ cv_string_from_field_attribs(Arena *arena, CV_FieldAttribs attribs)
{ {
Temp scratch = scratch_begin(&arena, 1); Temp scratch = scratch_begin(&arena, 1);
U32 access = CV_FieldAttribs_Extract_ACCESS(attribs); U32 access = CV_FieldAttribs_Extract_Access(attribs);
U32 mprop = CV_FieldAttribs_Extract_MPROP(attribs); U32 mprop = CV_FieldAttribs_Extract_MethodProp(attribs);
attribs &= ~(0x3 | 0x7);
String8 attribs_str;
{
String8List list = {0};
if (attribs & CV_FieldAttrib_Pseudo) {
str8_list_pushf(scratch.arena, &list, "Pseudo");
}
if (attribs & CV_FieldAttrib_NoInherit) {
str8_list_pushf(scratch.arena, &list, "NoInherit");
}
if (attribs & CV_FieldAttrib_NoConstruct) {
str8_list_pushf(scratch.arena, &list, "NoConstruct");
}
if (attribs & CV_FieldAttrib_CompilerGenated) {
str8_list_pushf(scratch.arena, &list, "CompilerGenerated");
}
if (attribs & CV_FieldAttrib_Sealed) {
str8_list_pushf(scratch.arena, &list, "Sealed");
}
attribs_str = str8_list_join(scratch.arena, &list, &(StringJoin){.sep=", " });
}
String8 access_str = cv_string_from_member_access(access); String8 access_str = cv_string_from_member_access(access);
String8 mprop_str = cv_string_from_method_prop(mprop); String8 mprop_str = cv_string_from_method_prop(mprop);
String8 result = push_str8f(arena, "flags = %S, access = %S, method prop = %S", attribs_str, access_str, mprop_str);
String8List list = {0};
{
if (attribs & CV_FieldAttrib_Pseudo) {
attribs &= ~CV_FieldAttrib_Pseudo;
str8_list_pushf(scratch.arena, &list, "Pseudo");
}
if (attribs & CV_FieldAttrib_NoInherit) {
attribs &= ~CV_FieldAttrib_NoInherit;
str8_list_pushf(scratch.arena, &list, "NoInherit");
}
if (attribs & CV_FieldAttrib_NoConstruct) {
attribs &= ~CV_FieldAttrib_NoConstruct;
str8_list_pushf(scratch.arena, &list, "NoConstruct");
}
if (attribs & CV_FieldAttrib_CompilerGenated) {
attribs &= ~CV_FieldAttrib_CompilerGenated;
str8_list_pushf(scratch.arena, &list, "CompilerGenerated");
}
if (attribs & CV_FieldAttrib_Sealed) {
attribs &= ~CV_FieldAttrib_Sealed;
str8_list_pushf(scratch.arena, &list, "Sealed");
}
if (attribs) {
str8_list_pushf(scratch.arena, &list, "Unknown: %x", attribs);
}
}
if (access) {
str8_list_pushf(scratch.arena, &list, "%S", access_str);
}
if (mprop) {
str8_list_pushf(scratch.arena, &list, "%S", mprop_str);
}
String8 result = str8_list_join(scratch.arena, &list, &(StringJoin){.sep=str8_lit(", ")});
scratch_end(scratch); scratch_end(scratch);
return result; return result;
} }
internal String8 internal String8
cv_string_from_itype(Arena *arena, CV_TypeIndex itype) cv_string_from_itype(Arena *arena, CV_TypeIndex min_itype, CV_TypeIndex itype)
{ {
String8 result = push_str8f(arena, "%x", itype); String8 result = str8_zero();
if (itype < min_itype) {
String8 n = cv_type_name_from_basic_type((CV_BasicType)itype);
if (n.size) {
Temp scratch = scratch_begin(&arena, 1);
U64 type = CV_BasicTypeFromTypeId(itype);
char *type_str = "???";
switch (type) {
case CV_BasicType_NOTYPE: type_str = "NOTYPE"; break;
case CV_BasicType_ABS: type_str = "ABS"; break;
case CV_BasicType_SEGMENT: type_str = "SEGMENT"; break;
case CV_BasicType_VOID: type_str = "VOID"; break;
case CV_BasicType_CURRENCY: type_str = "CURRENCY"; break;
case CV_BasicType_NBASICSTR: type_str = "NBASICSTR"; break;
case CV_BasicType_FBASICSTR: type_str = "FBASICSTR"; break;
case CV_BasicType_NOTTRANS: type_str = "NOTTRANS"; break;
case CV_BasicType_HRESULT: type_str = "HRESULT"; break;
case CV_BasicType_CHAR: type_str = "CHAR"; break;
case CV_BasicType_SHORT: type_str = "SHORT"; break;
case CV_BasicType_LONG: type_str = "LONG"; break;
case CV_BasicType_QUAD: type_str = "QUAD"; break;
case CV_BasicType_OCT: type_str = "OCT"; break;
case CV_BasicType_UCHAR: type_str = "UCHAR"; break;
case CV_BasicType_USHORT: type_str = "USHORT"; break;
case CV_BasicType_ULONG: type_str = "ULONG"; break;
case CV_BasicType_UQUAD: type_str = "UQUAD"; break;
case CV_BasicType_UOCT: type_str = "UOCT"; break;
case CV_BasicType_BOOL8: type_str = "BOOL8"; break;
case CV_BasicType_BOOL16: type_str = "BOOL16"; break;
case CV_BasicType_BOOL32: type_str = "BOOL32"; break;
case CV_BasicType_BOOL64: type_str = "BOOL64"; break;
case CV_BasicType_FLOAT32: type_str = "FLOAT32"; break;
case CV_BasicType_FLOAT64: type_str = "FLOAT64"; break;
case CV_BasicType_FLOAT80: type_str = "FLOAT80"; break;
case CV_BasicType_FLOAT128: type_str = "FLOAT128"; break;
case CV_BasicType_FLOAT48: type_str = "FLOAT48"; break;
case CV_BasicType_FLOAT32PP: type_str = "FLOAT32PP"; break;
case CV_BasicType_FLOAT16: type_str = "FLOAT16"; break;
case CV_BasicType_COMPLEX32: type_str = "COMPLEX32"; break;
case CV_BasicType_COMPLEX64: type_str = "COMPLEX64"; break;
case CV_BasicType_COMPLEX80: type_str = "COMPLEX80"; break;
case CV_BasicType_COMPLEX128: type_str = "COMPLEX128"; break;
case CV_BasicType_BIT: type_str = "BIT"; break;
case CV_BasicType_PASCHAR: type_str = "PASCHAR"; break;
case CV_BasicType_BOOL32FF: type_str = "BOOL32FF"; break;
case CV_BasicType_INT8: type_str = "INT8"; break;
case CV_BasicType_UINT8: type_str = "UINT8"; break;
case CV_BasicType_RCHAR: type_str = "RCHAR"; break;
case CV_BasicType_WCHAR: type_str = "WCHAR"; break;
case CV_BasicType_INT16: type_str = "INT16"; break;
case CV_BasicType_UINT16: type_str = "UINT16"; break;
case CV_BasicType_INT32: type_str = "INT32"; break;
case CV_BasicType_UINT32: type_str = "UINT32"; break;
case CV_BasicType_INT64: type_str = "INT64"; break;
case CV_BasicType_UINT64: type_str = "UINT64"; break;
case CV_BasicType_INT128: type_str = "INT128"; break;
case CV_BasicType_UINT128: type_str = "UINT128"; break;
case CV_BasicType_CHAR16: type_str = "CHAR16"; break;
case CV_BasicType_CHAR32: type_str = "CHAR32"; break;
case CV_BasicType_CHAR8: type_str = "CHAR8"; break;
case CV_BasicType_PTR: type_str = "PTR"; break;
}
U64 ptr = CV_BasicPointerKindFromTypeId(itype);
char *ptr_str = "";
switch (ptr) {
case 0x1: ptr_str = "P"; break;
case 0x2: ptr_str = "PF"; break;
case 0x3: ptr_str = "PH"; break;
case 0x4: ptr_str = "32P"; break;
case 0x5: ptr_str = "32PF"; break;
case 0x6: ptr_str = "64P"; break;
}
n = upper_from_str8(scratch.arena, n);
result = push_str8f(arena, "T_%s%s(%x)", ptr_str, type_str, itype);
scratch_end(scratch);
} else {
result = push_str8f(arena, "%x", itype);
}
} else {
result = push_str8f(arena, "%x", itype);
}
return result; return result;
} }
@@ -740,7 +917,10 @@ cv_string_from_itemid(Arena *arena, CV_ItemId itemid)
internal String8 internal String8
cv_string_from_reg_off(Arena *arena, CV_Arch arch, U32 reg, U32 off) cv_string_from_reg_off(Arena *arena, CV_Arch arch, U32 reg, U32 off)
{ {
return push_str8f(arena, "%S+%x", cv_string_from_reg_id(arch, reg), off); Temp scratch = scratch_begin(&arena, 1);
String8 result = push_str8f(arena, "%S+%x", cv_string_from_reg_id(scratch.arena, arch, reg), off);
scratch_end(scratch);
return result;
} }
internal String8 internal String8
+3 -3
View File
@@ -7,7 +7,7 @@
internal String8 cv_string_from_type_index_source(CV_TypeIndexSource ti_source); internal String8 cv_string_from_type_index_source(CV_TypeIndexSource ti_source);
internal String8 cv_string_from_language(CV_Language x); internal String8 cv_string_from_language(CV_Language x);
internal String8 cv_string_from_numeric(Arena *arena, CV_NumericParsed num); internal String8 cv_string_from_numeric(Arena *arena, CV_NumericParsed num);
internal String8 cv_string_from_reg_id(CV_Arch arch, U32 id); internal String8 cv_string_from_reg_id(Arena *arena, CV_Arch arch, U32 id);
internal String8 cv_string_from_member_access(CV_MemberAccess x); internal String8 cv_string_from_member_access(CV_MemberAccess x);
internal String8 cv_string_from_method_prop(CV_MethodProp x); internal String8 cv_string_from_method_prop(CV_MethodProp x);
internal String8 cv_string_from_hfa(CV_HFAKind x); internal String8 cv_string_from_hfa(CV_HFAKind x);
@@ -30,7 +30,7 @@ internal String8 cv_string_from_function_attribs(Arena *arena, CV_FunctionAttrib
internal String8 cv_string_from_export_flags(Arena *arena, CV_ExportFlags x); internal String8 cv_string_from_export_flags(Arena *arena, CV_ExportFlags x);
internal String8 cv_string_from_sepcode(Arena *arena, CV_SepcodeFlags x); internal String8 cv_string_from_sepcode(Arena *arena, CV_SepcodeFlags x);
internal String8 cv_string_from_pub32_flags(Arena *arena, CV_Pub32Flags x); internal String8 cv_string_from_pub32_flags(Arena *arena, CV_Pub32Flags x);
internal String8 cv_string_generic_flags(Arena *arena, CV_GenericFlags x); internal String8 cv_string_from_generic_flags(Arena *arena, CV_GenericFlags x);
internal String8 cv_string_from_frame_proc_flags(Arena *arena, CV_FrameprocFlags x); internal String8 cv_string_from_frame_proc_flags(Arena *arena, CV_FrameprocFlags x);
internal String8 cv_string_from_type_props(Arena *arena, CV_TypeProps x); internal String8 cv_string_from_type_props(Arena *arena, CV_TypeProps x);
internal String8 cv_string_from_local_flags(Arena *arena, CV_LocalFlags x); internal String8 cv_string_from_local_flags(Arena *arena, CV_LocalFlags x);
@@ -38,7 +38,7 @@ internal String8 cv_string_from_proc_flags(Arena *arena, CV_ProcFlags x);
internal String8 cv_string_from_range_attribs(Arena *arena, CV_RangeAttribs x); internal String8 cv_string_from_range_attribs(Arena *arena, CV_RangeAttribs x);
internal String8 cv_string_from_defrange_register_rel_flags(Arena *arena, CV_DefrangeRegisterRelFlags x); internal String8 cv_string_from_defrange_register_rel_flags(Arena *arena, CV_DefrangeRegisterRelFlags x);
internal String8 cv_string_from_field_attribs(Arena *arena, CV_FieldAttribs attribs); internal String8 cv_string_from_field_attribs(Arena *arena, CV_FieldAttribs attribs);
internal String8 cv_string_from_itype(Arena *arena, CV_TypeIndex itype); internal String8 cv_string_from_itype(Arena *arena, CV_TypeIndex min_itype, CV_TypeIndex itype);
internal String8 cv_string_from_itemid(Arena *arena, CV_ItemId itemid); internal String8 cv_string_from_itemid(Arena *arena, CV_ItemId itemid);
internal String8 cv_string_from_reg_off(Arena *arena, CV_Arch arch, U32 reg, U32 off); internal String8 cv_string_from_reg_off(Arena *arena, CV_Arch arch, U32 reg, U32 off);
internal String8 cv_string_from_symbol_type(Arena *arena, CV_SymKind symbol_type); internal String8 cv_string_from_symbol_type(Arena *arena, CV_SymKind symbol_type);
+8 -8
View File
@@ -475,12 +475,12 @@ cv_get_leaf_type_index_offsets(Arena *arena, CV_LeafKind leaf_kind, String8 data
case CV_LeafKind_POINTER: { case CV_LeafKind_POINTER: {
cv_symbol_type_index_info_push(arena, &list, CV_TypeIndexSource_TPI, OffsetOf(CV_LeafPointer, itype)); cv_symbol_type_index_info_push(arena, &list, CV_TypeIndexSource_TPI, OffsetOf(CV_LeafPointer, itype));
CV_LeafPointer *ptr = (CV_LeafPointer *)data.str; CV_LeafPointer *ptr = (CV_LeafPointer *)data.str;
CV_PointerKind ptr_kind = CV_PointerAttribs_ExtractKind(ptr->attribs); CV_PointerKind ptr_kind = CV_PointerAttribs_Extract_Kind(ptr->attribs);
if (ptr_kind == CV_PointerKind_BaseType) { if (ptr_kind == CV_PointerKind_BaseType) {
// TODO: add CV_LeafPointerBaseType // TODO: add CV_LeafPointerBaseType
cv_symbol_type_index_info_push(arena, &list, CV_TypeIndexSource_TPI, sizeof(CV_LeafPointer) + 0); cv_symbol_type_index_info_push(arena, &list, CV_TypeIndexSource_TPI, sizeof(CV_LeafPointer) + 0);
} else { } else {
CV_PointerMode ptr_mode = CV_PointerAttribs_ExtractMode(ptr->attribs); CV_PointerMode ptr_mode = CV_PointerAttribs_Extract_Mode(ptr->attribs);
if (ptr_mode == CV_PointerMode_PtrMem || ptr_mode == CV_PointerMode_PtrMethod) { if (ptr_mode == CV_PointerMode_PtrMem || ptr_mode == CV_PointerMode_PtrMethod) {
// TODO: add type for the CvLeafPointerMember to syms_cv.mc // TODO: add type for the CvLeafPointerMember to syms_cv.mc
cv_symbol_type_index_info_push(arena, &list, CV_TypeIndexSource_TPI, sizeof(CV_LeafPointer) + 0); cv_symbol_type_index_info_push(arena, &list, CV_TypeIndexSource_TPI, sizeof(CV_LeafPointer) + 0);
@@ -631,7 +631,7 @@ cv_get_leaf_type_index_offsets(Arena *arena, CV_LeafKind leaf_kind, String8 data
CV_LeafOneMethod onemethod; CV_LeafOneMethod onemethod;
cursor += str8_deserial_read_struct(data, cursor, &onemethod); cursor += str8_deserial_read_struct(data, cursor, &onemethod);
CV_MethodProp prop = CV_FieldAttribs_ExtractMethodProp(onemethod.attribs); CV_MethodProp prop = CV_FieldAttribs_Extract_MethodProp(onemethod.attribs);
if(prop == CV_MethodProp_PureIntro || prop == CV_MethodProp_Intro) if(prop == CV_MethodProp_PureIntro || prop == CV_MethodProp_Intro)
{ {
cursor += sizeof(U32); // virtoff cursor += sizeof(U32); // virtoff
@@ -711,7 +711,7 @@ cv_get_leaf_type_index_offsets(Arena *arena, CV_LeafKind leaf_kind, String8 data
cv_symbol_type_index_info_push(arena, &list, CV_TypeIndexSource_TPI, cursor + OffsetOf(CV_LeafMethodListMember, itype)); cv_symbol_type_index_info_push(arena, &list, CV_TypeIndexSource_TPI, cursor + OffsetOf(CV_LeafMethodListMember, itype));
// take into account intro virtual offset // take into account intro virtual offset
CV_MethodProp mprop = CV_FieldAttribs_ExtractMethodProp(method.attribs); CV_MethodProp mprop = CV_FieldAttribs_Extract_MethodProp(method.attribs);
if (mprop == CV_MethodProp_Intro || mprop == CV_MethodProp_PureIntro) { if (mprop == CV_MethodProp_Intro || mprop == CV_MethodProp_PureIntro) {
read_size += sizeof(U32); read_size += sizeof(U32);
} }
@@ -1100,7 +1100,7 @@ cv_sym_from_data(Arena *arena, String8 sym_data, U64 sym_align)
CV_SymCompile *compile = (CV_SymCompile*)first; CV_SymCompile *compile = (CV_SymCompile*)first;
String8 ver_str = str8_cstring_capped((char*)(compile + 1), (char *)(first + cap)); String8 ver_str = str8_cstring_capped((char*)(compile + 1), (char *)(first + cap));
result->info.arch = compile->machine; result->info.arch = compile->machine;
result->info.language = CV_CompileFlags_ExtractLanguage(compile->flags);; result->info.language = CV_CompileFlags_Extract_Language(compile->flags);;
result->info.compiler_name = ver_str; result->info.compiler_name = ver_str;
}break; }break;
case CV_SymKind_COMPILE2: case CV_SymKind_COMPILE2:
@@ -1114,7 +1114,7 @@ cv_sym_from_data(Arena *arena, String8 sym_data, U64 sym_align)
compile2->ver_minor, compile2->ver_minor,
compile2->ver_build); compile2->ver_build);
result->info.arch = compile2->machine; result->info.arch = compile2->machine;
result->info.language = CV_Compile2Flags_ExtractLanguage(compile2->flags);; result->info.language = CV_Compile2Flags_Extract_Language(compile2->flags);;
result->info.compiler_name = compiler_name; result->info.compiler_name = compiler_name;
}break; }break;
case CV_SymKind_COMPILE3: case CV_SymKind_COMPILE3:
@@ -1128,7 +1128,7 @@ cv_sym_from_data(Arena *arena, String8 sym_data, U64 sym_align)
compile3->ver_minor, compile3->ver_minor,
compile3->ver_build); compile3->ver_build);
result->info.arch = compile3->machine; result->info.arch = compile3->machine;
result->info.language = CV_Compile3Flags_ExtractLanguage(compile3->flags);; result->info.language = CV_Compile3Flags_Extract_Language(compile3->flags);;
result->info.compiler_name = compiler_name; result->info.compiler_name = compiler_name;
}break; }break;
} }
@@ -1295,7 +1295,7 @@ cv_c13_parsed_from_data(Arena *arena, String8 c13_data, String8 strtbl, COFF_Sec
U32 i = 0; U32 i = 0;
for (; line_ptr < line_opl; line_ptr += 1, i += 1){ for (; line_ptr < line_opl; line_ptr += 1, i += 1){
voffs[i] = line_ptr->off + secrel_off + sec_base_off; voffs[i] = line_ptr->off + secrel_off + sec_base_off;
line_nums[i] = CV_C13LineFlags_ExtractLineNumber(line_ptr->flags); line_nums[i] = CV_C13LineFlags_Extract_LineNumber(line_ptr->flags);
} }
voffs[i] = secrel_opl + sec_base_off; voffs[i] = secrel_opl + sec_base_off;
} }
+5 -5
View File
@@ -1792,7 +1792,7 @@ ASYNC_WORK_DEF(p2r_udt_convert_work)
method_read_ptr = next_method_read_ptr) method_read_ptr = next_method_read_ptr)
{ {
CV_LeafMethodListMember *method = (CV_LeafMethodListMember*)method_read_ptr; CV_LeafMethodListMember *method = (CV_LeafMethodListMember*)method_read_ptr;
CV_MethodProp prop = CV_FieldAttribs_ExtractMethodProp(method->attribs); CV_MethodProp prop = CV_FieldAttribs_Extract_MethodProp(method->attribs);
RDIM_Type *method_type = p2r_type_ptr_from_itype(method->itype); RDIM_Type *method_type = p2r_type_ptr_from_itype(method->itype);
next_method_read_ptr = (U8 *)(method+1); next_method_read_ptr = (U8 *)(method+1);
@@ -1867,7 +1867,7 @@ ASYNC_WORK_DEF(p2r_udt_convert_work)
// rjf: unpack leaf // rjf: unpack leaf
CV_LeafOneMethod *lf = (CV_LeafOneMethod *)field_leaf_first; CV_LeafOneMethod *lf = (CV_LeafOneMethod *)field_leaf_first;
CV_MethodProp prop = CV_FieldAttribs_ExtractMethodProp(lf->attribs); CV_MethodProp prop = CV_FieldAttribs_Extract_MethodProp(lf->attribs);
U8 *vbaseoff_ptr = (U8 *)(lf+1); U8 *vbaseoff_ptr = (U8 *)(lf+1);
U8 *vbaseoff_opl_ptr = vbaseoff_ptr; U8 *vbaseoff_opl_ptr = vbaseoff_ptr;
U32 vbaseoff = 0; U32 vbaseoff = 0;
@@ -3694,9 +3694,9 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
// rjf: unpack leaf // rjf: unpack leaf
CV_LeafPointer *lf = (CV_LeafPointer *)itype_leaf_first; CV_LeafPointer *lf = (CV_LeafPointer *)itype_leaf_first;
RDIM_Type *direct_type = p2r_type_ptr_from_itype(lf->itype); RDIM_Type *direct_type = p2r_type_ptr_from_itype(lf->itype);
CV_PointerKind ptr_kind = CV_PointerAttribs_ExtractKind(lf->attribs); CV_PointerKind ptr_kind = CV_PointerAttribs_Extract_Kind(lf->attribs);
CV_PointerMode ptr_mode = CV_PointerAttribs_ExtractMode(lf->attribs); CV_PointerMode ptr_mode = CV_PointerAttribs_Extract_Mode(lf->attribs);
U32 ptr_size = CV_PointerAttribs_ExtractSize(lf->attribs); U32 ptr_size = CV_PointerAttribs_Extract_Size(lf->attribs);
// rjf: cv -> rdi modifier flags // rjf: cv -> rdi modifier flags
RDI_TypeModifierFlags modifier_flags = 0; RDI_TypeModifierFlags modifier_flags = 0;