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

Method Evaluate

IDEHelper/WinDebugger.cpp:9890–10327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9888}
9889
9890String 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;

Callers 1

Debugger_EvaluateFunction · 0.45

Calls 15

PdbTestFunction · 0.85
PdbTestFileFunction · 0.85
BfVisitorPosClass · 0.85
SubstringMethod · 0.80
FindSymbolAtMethod · 0.80
CreateExpressionMethod · 0.80
FailAtMethod · 0.80
c_strMethod · 0.45
StartsWithMethod · 0.45
IndexOfMethod · 0.45
TrimMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected