MCPcopy Create free account
hub / github.com/beefytech/Beef / ToString

Method ToString

IDEHelper/Backend/BeModule.cpp:1036–1603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1034//////////////////////////////////////////////////////////////////////////
1035
1036void BeDumpContext::ToString(StringImpl& str, BeValue* value, bool showType, bool mdDrillDown, bool checkStack)
1037{
1038 if (checkStack)
1039 {
1040 BP_ZONE("CreateValueFromExpression:CheckStack");
1041
1042 StackHelper stackHelper;
1043 if (!stackHelper.CanStackExpand(64 * 1024))
1044 {
1045 if (!stackHelper.Execute([&]()
1046 {
1047 ToString(str, value, showType, mdDrillDown, false);
1048 }))
1049 {
1050 //Fail("Expression too complex to compile", expr);
1051 str += "!!!FAILED!!!";
1052 }
1053 return;
1054 }
1055 }
1056
1057 if (value == NULL)
1058 {
1059 str += "<null>";
1060 return;
1061 }
1062
1063 if (auto mdNode = BeValueDynCast<BeMDNode>(value))
1064 {
1065 if (auto dbgInlinedScope = BeValueDynCast<BeDbgInlinedScope>(mdNode))
1066 {
1067 str += "Inlined:";
1068 ToString(str, dbgInlinedScope->mScope);
1069 return;
1070 }
1071
1072 if (auto dbgType = BeValueDynCast<BeDbgTypeId>(mdNode))
1073 {
1074 str += StrFormat("DbgTypeId: %d", dbgType->mTypeId);
1075 return;
1076 }
1077
1078 if (auto dbgVar = BeValueDynCast<BeDbgVariable>(mdNode))
1079 {
1080 ToString(str, dbgVar->mType);
1081 str += " ";
1082 str += dbgVar->mName;
1083 return;
1084 }
1085
1086 if (auto dbgVar = BeValueDynCast<BeDbgVariable>(mdNode))
1087 {
1088 ToString(str, dbgVar->mType);
1089 str += " ";
1090 str += dbgVar->mName;
1091 return;
1092 }
1093

Callers 6

bpvFunction · 0.45
PrintValueMethod · 0.45
HashContentMethod · 0.45
FatalErrorMethod · 0.45
ProcessMethod · 0.45
HandleNextCmdMethod · 0.45

Calls 15

CanStackExpandMethod · 0.80
GetFuncTypeMethod · 0.80
TryGetValueMethod · 0.80
CountMethod · 0.80
CanBeReferencedMethod · 0.80
GetDbgFileMethod · 0.80
ToStringFunction · 0.50
ExecuteMethod · 0.45
GetTypeMethod · 0.45
sizeMethod · 0.45
IsEmptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected