| 9888 | } |
| 9889 | |
| 9890 | String WinDebugger::Evaluate(const StringImpl& expr, DwFormatInfo formatInfo, int callStackIdx, int cursorPos, int language, DwEvalExpressionFlags expressionFlags) |
| 9891 | { |
| 9892 | BP_ZONE_F("WinDebugger::Evaluate %s", BP_DYN_STR(expr.c_str())); |
| 9893 | |
| 9894 | AutoCrit autoCrit(mDebugManager->mCritSect); |
| 9895 | |
| 9896 | if ((expressionFlags & DwEvalExpressionFlag_Symbol) != 0) |
| 9897 | { |
| 9898 | DwAutoComplete autoComplete; |
| 9899 | |
| 9900 | String retVal; |
| 9901 | |
| 9902 | retVal += GetAutocompleteOutput(autoComplete); |
| 9903 | return retVal; |
| 9904 | } |
| 9905 | |
| 9906 | UpdateCallStackMethod(callStackIdx); |
| 9907 | |
| 9908 | BfLogDbgExpr("Evaluate %s in thread %d\n", expr.c_str(), (mActiveThread != NULL) ? mActiveThread->mThreadId : 0); |
| 9909 | |
| 9910 | if (language != -1) |
| 9911 | formatInfo.mLanguage = (DbgLanguage)language; |
| 9912 | |
| 9913 | auto activeThread = mActiveThread; |
| 9914 | if ((!IsPaused()) && (mRunState != RunState_NotStarted) && (mRunState != RunState_DebugEval)) |
| 9915 | { |
| 9916 | activeThread = NULL; |
| 9917 | callStackIdx = -1; |
| 9918 | } |
| 9919 | |
| 9920 | if (mDebugPendingExpr != NULL) |
| 9921 | { |
| 9922 | // We already have a pending call |
| 9923 | expressionFlags = (DwEvalExpressionFlags)(expressionFlags & ~DwEvalExpressionFlag_AllowCalls); |
| 9924 | } |
| 9925 | |
| 9926 | if ((expressionFlags & DwEvalExpressionFlag_RawStr) != 0) |
| 9927 | { |
| 9928 | formatInfo.mRawString = true; |
| 9929 | } |
| 9930 | |
| 9931 | if ((expressionFlags & DwEvalExpressionFlag_AllowStringView) != 0) |
| 9932 | { |
| 9933 | formatInfo.mAllowStringView = true; |
| 9934 | } |
| 9935 | |
| 9936 | auto terminatedExpr = expr + ";"; |
| 9937 | |
| 9938 | auto prevActiveThread = mActiveThread; |
| 9939 | bool restoreActiveThread = false; |
| 9940 | defer( |
| 9941 | { |
| 9942 | if (restoreActiveThread) |
| 9943 | SetActiveThread(prevActiveThread->mThreadId); |
| 9944 | }); |
| 9945 | |
| 9946 | bool usedSpecifiedLock = false; |
| 9947 | int stackIdxOverride = -1; |
no test coverage detected