| 1034 | ////////////////////////////////////////////////////////////////////////// |
| 1035 | |
| 1036 | void 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 |
no test coverage detected