mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed debug variable definition ranges
This commit is contained in:
parent
cb6a6484eb
commit
e508b8ded7
1 changed files with 25 additions and 7 deletions
|
@ -6096,6 +6096,8 @@ void BeMCContext::VRegSetInitialized(BeMCBlock* mcBlock, BeMCInst* inst, const B
|
|||
int insertIdx = FindSafeInstInsertPos(*mInsertInstIdxRef);
|
||||
AllocInst(BeMCInstKind_Def, operand, insertIdx);
|
||||
vregInfo->mDefOnFirstUse = false;
|
||||
if (insertIdx <= *mInsertInstIdxRef)
|
||||
(*mInsertInstIdxRef)++;
|
||||
}
|
||||
|
||||
if (vregInfo->mRelTo)
|
||||
|
@ -6156,6 +6158,11 @@ void BeMCContext::InitializedPassHelper(BeMCBlock* mcBlock, BeVTrackingGenContex
|
|||
|
||||
//OutputDebugStrF("InitializedPassHelper %@\n", vregsInitialized.mList);
|
||||
|
||||
if (mDebugging)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
mActiveBlock = mcBlock;
|
||||
for (int instIdx = 0; instIdx < (int)mcBlock->mInstructions.size(); instIdx++)
|
||||
{
|
||||
|
@ -11701,6 +11708,8 @@ void BeMCContext::DoCodeEmission()
|
|||
int hotJumpLen = 5;
|
||||
int funcCodePos = 0;
|
||||
|
||||
Array<BeDbgVariable*> deferredGapEnds;
|
||||
|
||||
BeVTrackingList* vregsLive = mLivenessContext.AllocEmptyList();
|
||||
BeVTrackingList* vregsInitialized = mVRegInitializedContext.AllocEmptyList();
|
||||
for (auto mcBlock : mBlocks)
|
||||
|
@ -11729,6 +11738,19 @@ void BeMCContext::DoCodeEmission()
|
|||
}
|
||||
}
|
||||
|
||||
while (!deferredGapEnds.IsEmpty())
|
||||
{
|
||||
BeDbgVariable* dbgVar = deferredGapEnds.back();
|
||||
deferredGapEnds.pop_back();
|
||||
|
||||
auto& range = dbgVar->mGaps.back();
|
||||
range.mLength = funcCodePos - range.mOffset;
|
||||
if (range.mLength <= 0)
|
||||
{
|
||||
dbgVar->mGaps.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
if ((inst->mKind == BeMCInstKind_LifetimeEnd) || (inst->mKind == BeMCInstKind_LifetimeExtend))
|
||||
{
|
||||
if (needsInstructionAtDbgLoc)
|
||||
|
@ -11845,11 +11867,7 @@ void BeMCContext::DoCodeEmission()
|
|||
// We have to check for this because it's possible we get multiple adds
|
||||
if (range.mLength == -1)
|
||||
{
|
||||
range.mLength = funcCodePos - range.mOffset;
|
||||
if (range.mLength <= 0)
|
||||
{
|
||||
dbgVar->mGaps.pop_back();
|
||||
}
|
||||
deferredGapEnds.Add(dbgVar);
|
||||
}
|
||||
|
||||
if (mDebugging)
|
||||
|
@ -14691,7 +14709,7 @@ void BeMCContext::Generate(BeFunction* function)
|
|||
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
||||
|
||||
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
||||
//mDebugging = function->mName == "?Unwrap@?$Result@Tint@@@System@bf@@AEAATint@@XZ";
|
||||
//mDebugging = function->mName == "?Hey@Blurg@bf@@SAXXZ";
|
||||
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
||||
//"?Main@Program@bf@@CAHPEAV?$Array1@PEAVString@System@bf@@@System@2@@Z";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue