1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Trimmed some debug memory

This commit is contained in:
Brian Fiete 2020-03-20 09:23:38 -07:00
parent b16ff3048a
commit 13ca5c174d
4 changed files with 41 additions and 71 deletions

View file

@ -955,16 +955,12 @@ void DbgSrcFile::GetHash(String& outStr)
DbgType::DbgType()
{
mTypeIdx = -1;
//mHash = 0;
mTypeIdx = -1;
mIsDeclaration = false;
mParent = NULL;
//mName = NULL;
mParent = NULL;
mTypeName = NULL;
mTypeCode = DbgType_Null;
mSize = 0;
//mArraySize = 0;
mDeclLine = 0;
mSize = 0;
mPtrType = NULL;
mTypeParam = NULL;
mBlockParam = NULL;
@ -1833,6 +1829,7 @@ void DbgType::ToString(StringImpl& str, DbgLanguage language, bool allowDirectBf
str += " ";
mTypeParam->ToString(str, language, allowDirectBfObject, internalName);
}
return;
}
if (mTypeParam == NULL)
{

View file

@ -375,8 +375,7 @@ public:
const char* mName;
const char* mLinkName;
int mTemplateNameIdx;
int mDeclLine;
int mTemplateNameIdx;
int mFrameBaseLen;
int mPrologueSize;
const uint8* mFrameBaseData;
@ -386,15 +385,15 @@ public:
int mStepFilterVersion;
LocalBaseRegKind mParamBaseReg;
LocalBaseRegKind mLocalBaseReg;
bool mHasQualifiedName;
bool mIsStepFiltered;
bool mIsStepFilteredDefault;
bool mVirtual;
bool mHasThis;
bool mNeedLineDataFixup;
HotReplaceKind mHotReplaceKind;
bool mIsOptimized;
bool mHasLineAddrGaps; // There are gaps of addresses which are not covered by lineinfo
bool mHasQualifiedName:1;
bool mIsStepFiltered:1;
bool mIsStepFilteredDefault:1;
bool mVirtual:1;
bool mHasThis:1;
bool mNeedLineDataFixup:1;
bool mIsOptimized:1;
bool mHasLineAddrGaps:1; // There are gaps of addresses which are not covered by lineinfo
HotReplaceKind mHotReplaceKind;
DbgLineInfo* mLineInfo;
DbgInlineeInfo* mInlineeInfo;
DbgType* mParentType;
@ -416,9 +415,7 @@ public:
mHotReplaceKind = HotReplaceKind_None;
mHasLineAddrGaps = false;
mPrologueSize = -1;
mParentType = NULL;
mDeclLine = 0;
//mInlinerData = NULL;
mParentType = NULL;
mInlineeInfo = NULL;
mFrameBaseData = NULL;
mFrameBaseLen = 0;
@ -560,20 +557,18 @@ public:
const char* mTypeName;
intptr mSize; // In bytes
int mTemplateNameIdx;
int mAlign;
int mDeclFileIdx;
int mDeclLine;
int mAlign;
int mTypeIdx;
uint16 mDefinedMembersSize;
uint16 mMethodsWithParamsCount;
bool mIsIncomplete; // Not fully loaded
bool mIsPacked;
bool mNeedsGlobalsPopulated;
bool mHasGlobalsPopulated;
bool mIsDeclaration;
bool mHasStaticMembers;
bool mHasVTable;
bool mFixedName;
bool mIsIncomplete:1; // Not fully loaded
bool mIsPacked:1;
bool mNeedsGlobalsPopulated:1;
bool mHasGlobalsPopulated:1;
bool mIsDeclaration:1;
bool mHasStaticMembers:1;
bool mHasVTable:1;
bool mFixedName:1;
DbgLanguage mLanguage;
DbgExtType mExtType;
DbgTypePriority mPriority; // Is the one stored in the type map

View file

@ -749,8 +749,7 @@ bool DebugTarget::GetAutoLocalsInBlock(Array<String>& outLocals, DbgSubprogram*
continue;
}
if (//(dwLineData->mLine >= variable->mDeclLine) &&
(variable->mName[0] != '$'))
if ((variable->mName[0] != '$'))
_AddLocal(variable->mName);
}
@ -2264,12 +2263,9 @@ bool DebugTarget::GetValueByNameInBlock_Helper(DbgSubprogram* dwSubprogram, DbgB
}
};
//for (auto variable : dwBlock->mVariables)
for (int varIdx = (int)checkVars.size() - 1; varIdx >= 0; varIdx--)
{
auto variable = checkVars[varIdx];
// if (variable->mDeclFileIdx == 0)
// continue;
if (variable->mRangeStart != 0)
{
@ -2339,10 +2335,7 @@ bool DebugTarget::GetValueByNameInBlock_Helper(DbgSubprogram* dwSubprogram, DbgB
if (dwBlock == &dwSubprogram->mBlock)
{
for (auto variable : dwSubprogram->mParams)
{
/*if (variable->mDeclFileIdx == 0)
continue;*/
{
if (variable->mName == NULL)
continue;

View file

@ -10632,11 +10632,8 @@ void WinDebugger::GetCodeAddrInfo(intptr addr, String* outFile, int* outHotIdx,
}
if (dwEndLineData != NULL)
{
if (subProgram->mDeclLine != 0)
*outDefLineStart = subProgram->mDeclLine - 1;
else
*outDefLineStart = dwStartLineData->mLine;
{
*outDefLineStart = dwStartLineData->mLine;
*outDefLineEnd = dwEndLineData->mLine;
}
}
@ -10754,27 +10751,18 @@ String WinDebugger::GetStackFrameInfo(int stackFrameIdx, intptr* addr, String* o
{
WdStackFrame* nextStackFrame = mCallStack[actualStackFrameIdx - 1];
auto subProgram = nextStackFrame->mSubProgram;
// int callFileIdx = subProgram->mDeclFileIdx;
// if (callFileIdx > 0)
// {
// DbgSrcFile* srcFile = subProgram->mCompileUnit->mSrcFileRefs[callFileIdx - 1].mSrcFile;
// _CheckHashSrcFile(*outFile, subProgram->mCompileUnit->mDbgModule, srcFile);
// *outFile = srcFile->GetLocalPath();
// *outLine = subProgram->mDeclLine - 1;
// }
// else
{
FixupLineDataForSubprogram(subProgram->mInlineeInfo->mRootInliner);
DbgSubprogram* parentSubprogram = subProgram->mInlineeInfo->mInlineParent; // Require it be in the inline parent
auto foundLine = parentSubprogram->FindClosestLine(subProgram->mBlock.mLowPC, &parentSubprogram);
if (foundLine != NULL)
{
auto srcFile = parentSubprogram->GetLineSrcFile(*foundLine);
*outFile = srcFile->GetLocalPath();
_CheckHashSrcFile(*outFile, subProgram->mCompileUnit->mDbgModule, srcFile);
*outLine = foundLine->mLine;
}
FixupLineDataForSubprogram(subProgram->mInlineeInfo->mRootInliner);
DbgSubprogram* parentSubprogram = subProgram->mInlineeInfo->mInlineParent; // Require it be in the inline parent
auto foundLine = parentSubprogram->FindClosestLine(subProgram->mBlock.mLowPC, &parentSubprogram);
if (foundLine != NULL)
{
auto srcFile = parentSubprogram->GetLineSrcFile(*foundLine);
*outFile = srcFile->GetLocalPath();
_CheckHashSrcFile(*outFile, subProgram->mCompileUnit->mDbgModule, srcFile);
*outLine = foundLine->mLine;
}
*outLanguage = subProgram->GetLanguage();
*outHotIdx = subProgram->mCompileUnit->mDbgModule->mHotIdx;
*outColumn = -1;
@ -10879,11 +10867,8 @@ String WinDebugger::GetStackFrameInfo(int stackFrameIdx, intptr* addr, String* o
*outLanguage = (int)dwSubprogram->mCompileUnit->mLanguage;
if (dwEndLineData != NULL)
{
if (dwSubprogram->mDeclLine != 0)
*outDefLineStart = dwSubprogram->mDeclLine - 1;
else
*outDefLineStart = dwStartLineData->mLine;
{
*outDefLineStart = dwStartLineData->mLine;
*outDefLineEnd = dwEndLineData->mLine;
}