|
@@ -2766,7 +2766,7 @@ DbgTypedValue DbgExprEvaluator::DoLookupField(BfAstNode* targetSrc, DbgTypedValu
|
|
for (int pass = 0; pass < 2; pass++)
|
|
for (int pass = 0; pass < 2; pass++)
|
|
{
|
|
{
|
|
for (auto method : curCheckType->mMethodList)
|
|
for (auto method : curCheckType->mMethodList)
|
|
- {
|
|
|
|
|
|
+ {
|
|
if (method->mName != NULL)
|
|
if (method->mName != NULL)
|
|
{
|
|
{
|
|
if (((method->mName[0] == 'g') || (method->mName[0] == 's')) &&
|
|
if (((method->mName[0] == 'g') || (method->mName[0] == 's')) &&
|
|
@@ -2788,15 +2788,17 @@ DbgTypedValue DbgExprEvaluator::DoLookupField(BfAstNode* targetSrc, DbgTypedValu
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
- if (((!method->mHasThis) && (wantsStatic)) ||
|
|
|
|
|
|
+ DbgSubprogram*& subprogramRef = isGetter ? mPropGet : mPropSet;
|
|
|
|
+
|
|
|
|
+ if ((subprogramRef == NULL) ||
|
|
|
|
+ ((!method->mHasThis) && (wantsStatic)) ||
|
|
((method->mHasThis) && (!wantsStatic || allowImplicitThis)))
|
|
((method->mHasThis) && (!wantsStatic || allowImplicitThis)))
|
|
{
|
|
{
|
|
if ((method->mHasThis) && (allowImplicitThis) && (!target))
|
|
if ((method->mHasThis) && (allowImplicitThis) && (!target))
|
|
{
|
|
{
|
|
target = GetThis();
|
|
target = GetThis();
|
|
}
|
|
}
|
|
-
|
|
|
|
- DbgSubprogram*& subprogramRef = isGetter ? mPropGet : mPropSet;
|
|
|
|
|
|
+
|
|
if (subprogramRef == NULL)
|
|
if (subprogramRef == NULL)
|
|
subprogramRef = method;
|
|
subprogramRef = method;
|
|
else if ((method->mVTableLoc != -1) || (subprogramRef->mVTableLoc == -1))
|
|
else if ((method->mVTableLoc != -1) || (subprogramRef->mVTableLoc == -1))
|
|
@@ -6918,19 +6920,27 @@ DbgTypedValue DbgExprEvaluator::CreateCall(BfAstNode* targetSrc, DbgTypedValue t
|
|
argPushQueue.push_back(methodArg);
|
|
argPushQueue.push_back(methodArg);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ bool thisByValue = false;
|
|
int methodParamCount = method->mParams.Size();
|
|
int methodParamCount = method->mParams.Size();
|
|
|
|
+ if (methodParamCount > 0)
|
|
|
|
+ {
|
|
|
|
+ method->mParams;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (method->mHasThis)
|
|
if (method->mHasThis)
|
|
{
|
|
{
|
|
auto param = method->mParams[paramIdx];
|
|
auto param = method->mParams[paramIdx];
|
|
|
|
+ if ((param->mType != NULL) && (param->mType->IsValueType()))
|
|
|
|
+ thisByValue = true;
|
|
|
|
|
|
if (!target)
|
|
if (!target)
|
|
{
|
|
{
|
|
Fail(StrFormat("An object reference is required to invoke the non-static method '%s'", method->ToString().c_str()), targetSrc);
|
|
Fail(StrFormat("An object reference is required to invoke the non-static method '%s'", method->ToString().c_str()), targetSrc);
|
|
return DbgTypedValue();
|
|
return DbgTypedValue();
|
|
}
|
|
}
|
|
-
|
|
|
|
- _PushArg(target, param);
|
|
|
|
- methodParamCount--;
|
|
|
|
|
|
+
|
|
|
|
+ _PushArg(target, param);
|
|
|
|
+ methodParamCount--;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -7143,7 +7153,7 @@ DbgTypedValue DbgExprEvaluator::CreateCall(BfAstNode* targetSrc, DbgTypedValue t
|
|
paramIdx++;
|
|
paramIdx++;
|
|
}
|
|
}
|
|
argIdx++;
|
|
argIdx++;
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
return CreateCall(method, argPushQueue, bypassVirtual);
|
|
return CreateCall(method, argPushQueue, bypassVirtual);
|
|
}
|
|
}
|
|
@@ -7173,6 +7183,14 @@ DbgTypedValue DbgExprEvaluator::CreateCall(DbgSubprogram* method, SizedArrayImpl
|
|
if (method->mHasThis)
|
|
if (method->mHasThis)
|
|
paramIdx--;
|
|
paramIdx--;
|
|
|
|
|
|
|
|
+ bool thisByValue = false;
|
|
|
|
+ if ((method->mHasThis) && (!method->mParams.IsEmpty()))
|
|
|
|
+ {
|
|
|
|
+ auto param = method->mParams[0];
|
|
|
|
+ if ((param->mType != NULL) && (param->mType->IsValueType()))
|
|
|
|
+ thisByValue = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
DbgTypedValue compositeRetVal;
|
|
DbgTypedValue compositeRetVal;
|
|
if (mDebugger->CheckNeedsSRetArgument(method->mReturnType))
|
|
if (mDebugger->CheckNeedsSRetArgument(method->mReturnType))
|
|
{
|
|
{
|
|
@@ -7211,7 +7229,7 @@ DbgTypedValue DbgExprEvaluator::CreateCall(DbgSubprogram* method, SizedArrayImpl
|
|
|
|
|
|
if (compositeRetVal.mSrcAddress != 0)
|
|
if (compositeRetVal.mSrcAddress != 0)
|
|
{
|
|
{
|
|
- mDebugger->AddParamValue(0, method->mHasThis, ®isters, compositeRetVal);
|
|
|
|
|
|
+ mDebugger->AddParamValue(0, method->mHasThis && !thisByValue, ®isters, compositeRetVal);
|
|
paramIdx++;
|
|
paramIdx++;
|
|
}
|
|
}
|
|
|
|
|