return WalkMembers(pValue, pThread, pILFrame, nullptr, cb);
}
+static bool has_prefix(const std::string &s, const std::string &prefix)
+{
+ return prefix.length() <= s.length() && std::equal(prefix.begin(), prefix.end(), s.begin());
+}
+
HRESULT Evaluator::HandleSpecialLocalVar(
const std::string &localName,
ICorDebugValue *pLocalValue,
HRESULT Status;
- if (captureName != localName)
+ if (!has_prefix(localName, captureName))
return S_FALSE;
// Substitute local value with its fields
{
if (is_static)
return S_OK;
- if (captureName == name)
+ if (has_prefix(name, captureName))
return S_OK;
if (!locals.insert(name).second)
return S_OK; // already in the list
- return cb(pILFrame, pValue, name);
+ return cb(pILFrame, pValue, name.empty() ? "this" : name);
}));
return S_OK;
WalkStackVarsCallback cb)
{
static const std::string displayClass = "<>c__DisplayClass";
- static const std::string hideClass = "<>c";
HRESULT Status;
typeName = typeName.substr(start + 1);
- if (hideClass != typeName)
+ if (!has_prefix(typeName, displayClass))
return S_FALSE;
- if (displayClass != typeName)
- return S_OK; // just do not show this value
-
// Substitute this with its fields
IfFailRet(WalkMembers(pThisValue, nullptr, pILFrame, [&](
mdMethodDef,