1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Win32 debugging fixes, more work on custom compile commands

Fixed working dir for 'launch'
Fixed attaching to process - stack trace wasn't updating properly
Fixed more custom compile stuff, and BeefySysLib bin destination
Fixed linking issues related to Bfp* and Bp* exports in both BeefRT and BeefySysLib
Fixed a crash with conditional breakpoints
Fixed release mode IDE issues (related to hot swap breakpoints)
Fixed hotswapping type data with LLVM builds
Fixed 'Pause' state processing Running_ToTempBreakpoint for ScriptManager
Fixed Win32 step out when there's an ESP adjustment at the return site
Made step-out skip over "unimportant" instructions at return site
This commit is contained in:
Brian Fiete 2019-08-29 14:19:07 -07:00
parent 09016c8dc0
commit a367b8165f
60 changed files with 1131 additions and 1065 deletions

View file

@ -1885,13 +1885,13 @@ public:
};
#endif
void BfIRBuilder::CreateTypeDeclaration(BfType* type)
void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDefine)
{
bool wantDIData = DbgHasInfo() && (!type->IsUnspecializedType());
// Types that don't have a proper 'defining module' need to be defined in every module they are used
bool isDefiningModule = (type->GetModule() == mModule) || (type->IsFunction());
bool wantsForwardDecl = !isDefiningModule;
bool wantsForwardDecl = !isDefiningModule && !forceDefine;
if (mModule->mExtensionCount != 0)
wantsForwardDecl = true;
@ -2802,7 +2802,7 @@ void BfIRBuilder::CreateDbgTypeDefinition(BfType* type)
}
}
void BfIRBuilder::CreateTypeDefinition(BfType* type)
void BfIRBuilder::CreateTypeDefinition(BfType* type, bool forceDefine)
{
// This PopulateType is generally NOT needed, but here is a scenario in which it is:
// ClassB derives from ClassA. ClassC uses ClassB. A method inside ClassA gets modified,
@ -2815,7 +2815,7 @@ void BfIRBuilder::CreateTypeDefinition(BfType* type)
bool isDefiningModule = (type->GetModule() == mModule) || (type->IsFunction());
if (mModule->mExtensionCount != 0)
isDefiningModule = false;
// if (mModule->mModuleName == "vdata")
// isDefiningModule = true;
@ -2827,13 +2827,13 @@ void BfIRBuilder::CreateTypeDefinition(BfType* type)
DbgSetTypeSize(DbgGetType(type), BF_ALIGN(type->mSize, type->mAlign) * 8, type->mAlign * 8);
}
bool wantsForwardDecl = !isDefiningModule;
bool wantsForwardDecl = !isDefiningModule && !forceDefine;
bool isPrimEnum = (type->IsEnum()) && (type->IsTypedPrimitive());
auto typeInstance = type->ToTypeInstance();
if (typeInstance == NULL)
return;
return;
auto typeDef = typeInstance->mTypeDef;
if (DbgHasInfo() && (!type->IsUnspecializedType()) && (!wantsForwardDecl))
{
@ -3057,7 +3057,7 @@ void BfIRBuilder::ReplaceDITemporaryTypes()
if (mTypeMap[typeInstance] == BfIRPopulateType_Full)
continue;
CreateTypeDefinition(typeInstance);
CreateTypeDefinition(typeInstance, false);
}
mDITemporaryTypes.Clear();
}
@ -3093,12 +3093,14 @@ void BfIRBuilder::PopulateType(BfType* type, BfIRPopulateType populateType)
if (curPopulateType >= populateType)
return;
if (curPopulateType == BfIRPopulateType_Full)
return;
auto typeInst = type->ToTypeInstance();
if ((curPopulateType < BfIRPopulateType_Declaration) && (populateType >= BfIRPopulateType_Declaration))
{
CreateTypeDeclaration(type);
CreateTypeDeclaration(type, populateType == BfIRPopulateType_Full_ForceDefinition);
mTypeMap[type] = BfIRPopulateType_Declaration;
}
@ -3106,7 +3108,7 @@ void BfIRBuilder::PopulateType(BfType* type, BfIRPopulateType populateType)
if ((curPopulateType < populateType) && (populateType >= BfIRPopulateType_Eventually_Full))
{
mTypeMap[type] = BfIRPopulateType_Eventually_Full;
CreateTypeDefinition(type);
CreateTypeDefinition(type, populateType == BfIRPopulateType_Full_ForceDefinition);
mTypeMap[type] = BfIRPopulateType_Full;
}
}

View file

@ -836,7 +836,8 @@ enum BfIRPopulateType
BfIRPopulateType_Identity,
BfIRPopulateType_Declaration,
BfIRPopulateType_Eventually_Full,
BfIRPopulateType_Full
BfIRPopulateType_Full,
BfIRPopulateType_Full_ForceDefinition
};
class BfIRBuilder : public BfIRConstHolder
@ -934,8 +935,8 @@ public:
BfIRMDNode CreateNamespaceScope(BfType* type, BfIRMDNode fileDIScope);
String GetDebugTypeName(BfTypeInstance* typeInstance, bool includeOuterTypeName);
void CreateDbgTypeDefinition(BfType* type);
void CreateTypeDeclaration(BfType* type);
void CreateTypeDefinition(BfType* type);
void CreateTypeDeclaration(BfType* type, bool forceDefine);
void CreateTypeDefinition(BfType* type, bool forceDefine);
void ReplaceDITemporaryTypes();
void PushDbgLoc(BfTypeInstance* typeInst);
BfIRPopulateType GetPopulateTypeState(BfType* type);

View file

@ -1118,10 +1118,10 @@ void BfModule::EnsureIRBuilder(bool dbgVerifyCodeGen)
// code as we walk the AST
//mBfIRBuilder->mDbgVerifyCodeGen = true;
if (
(mModuleName == "vdata")
|| (mModuleName == "System_Result_PTR_void")
(mModuleName == "-")
//|| (mModuleName == "System_Internal")
//|| (mModuleName == "vdata")
|| (mModuleName == "Hey_Dude_Bro_TestClass")
//|| (mModuleName == "Hey_Dude_Bro_TestClass")
)
mBfIRBuilder->mDbgVerifyCodeGen = true;
@ -4241,7 +4241,13 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
BfTypeInstance* typeInstance = type->ToTypeInstance();
// BfType* typeInstanceType = ResolveTypeDef(mCompiler->mReflectTypeInstanceTypeDef, BfPopulateType_Identity);
// mBfIRBuilder->PopulateType(typeInstanceType, BfIRPopulateType_Full_ForceDefinition);
// PopulateType(typeInstanceType);
BfType* typeInstanceType = ResolveTypeDef(mCompiler->mReflectTypeInstanceTypeDef);
mBfIRBuilder->PopulateType(typeInstanceType, BfIRPopulateType_Full_ForceDefinition);
if (typeInstanceType == NULL)
{
AssertErrorState();
@ -18900,7 +18906,7 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
isValid = true;
}
else if ((genericParamInstance->mTypeConstraint->IsDelegate()) || (genericParamInstance->mTypeConstraint->IsFunction()) ||
((genericParamInstance != NULL) &&
((genericParamInstance != NULL) && (typeInstConstraint != NULL) &&
((typeInstConstraint->mTypeDef == mCompiler->mDelegateTypeDef) || (typeInstConstraint->mTypeDef == mCompiler->mFunctionTypeDef))))
{
mCurMethodInstance->mHadGenericDelegateParams = true;

View file

@ -165,10 +165,10 @@ bool BfModule::BuildGenericParams(BfType* resolvedTypeRef)
else
{
for (int paramIdx = startDefGenericParamIdx; paramIdx < (int)genericTypeInst->mTypeGenericArguments.size(); paramIdx++)
{
auto genericParamDef = typeDef->mGenericParamDefs[paramIdx];
{
auto genericParamInstance = genericTypeInst->mGenericParams[paramIdx];
ResolveGenericParamConstraints(genericParamInstance, typeDef->mGenericParamDefs, paramIdx);
auto genericParamDef = typeDef->mGenericParamDefs[paramIdx];
for (auto nameNode : genericParamDef->mNameNodes)
{

View file

@ -811,7 +811,7 @@ int BfMethodInstance::DbgGetVirtualMethodNum()
vDataIdx += mVirtualTableIdx;
}
if (vDataVal == -1)
vDataVal = vDataIdx * module->mSystem->mPtrSize;
vDataVal = vDataIdx;
}
return vDataVal;
}