Reduce line number toggling in debug file
This commit is contained in:
parent
b1fc2e3736
commit
d047152646
|
@ -163,6 +163,7 @@ struct CodeLocation
|
||||||
{
|
{
|
||||||
Location mLocation;
|
Location mLocation;
|
||||||
int mStart, mEnd;
|
int mStart, mEnd;
|
||||||
|
bool mWeak;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4354,8 +4354,16 @@ void NativeCodeInstruction::CopyMode(const NativeCodeInstruction& ins)
|
||||||
|
|
||||||
void NativeCodeInstruction::Assemble(NativeCodeBasicBlock* block)
|
void NativeCodeInstruction::Assemble(NativeCodeBasicBlock* block)
|
||||||
{
|
{
|
||||||
|
bool weak = true;
|
||||||
|
|
||||||
if (mIns)
|
if (mIns)
|
||||||
block->PutLocation(mIns->mLocation);
|
{
|
||||||
|
if (ChangesAddress() && (mMode != ASMIM_ZERO_PAGE || mLinkerObject))
|
||||||
|
weak = false;
|
||||||
|
else if (mType == ASMIT_JSR && !(mFlags & NCIF_RUNTIME))
|
||||||
|
weak = false;
|
||||||
|
block->PutLocation(mIns->mLocation, weak);
|
||||||
|
}
|
||||||
|
|
||||||
if (mType == ASMIT_BYTE)
|
if (mType == ASMIT_BYTE)
|
||||||
block->PutByte(mAddress);
|
block->PutByte(mAddress);
|
||||||
|
@ -4526,23 +4534,33 @@ void NativeCodeInstruction::Assemble(NativeCodeBasicBlock* block)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mIns)
|
if (mIns)
|
||||||
block->PutLocation(mIns->mLocation);
|
block->PutLocation(mIns->mLocation, weak);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeCodeBasicBlock::PutLocation(const Location& location)
|
void NativeCodeBasicBlock::PutLocation(const Location& location, bool weak)
|
||||||
{
|
{
|
||||||
int sz = mCodeLocations.Size();
|
int sz = mCodeLocations.Size();
|
||||||
if (sz > 0 &&
|
if (sz > 0 &&
|
||||||
mCodeLocations[sz - 1].mLocation.mFileName == location.mFileName &&
|
(weak ||
|
||||||
mCodeLocations[sz - 1].mLocation.mLine == location.mLine)
|
(mCodeLocations[sz - 1].mLocation.mFileName == location.mFileName &&
|
||||||
|
mCodeLocations[sz - 1].mLocation.mLine == location.mLine)))
|
||||||
{
|
{
|
||||||
mCodeLocations[sz - 1].mEnd = this->mCode.Size();
|
mCodeLocations[sz - 1].mEnd = this->mCode.Size();
|
||||||
|
if (mCodeLocations[sz - 1].mWeak)
|
||||||
|
mCodeLocations[sz - 1].mWeak = weak;
|
||||||
|
}
|
||||||
|
else if (sz > 0 && mCodeLocations[sz - 1].mWeak)
|
||||||
|
{
|
||||||
|
mCodeLocations[sz - 1].mLocation = location;
|
||||||
|
mCodeLocations[sz - 1].mEnd = this->mCode.Size();
|
||||||
|
mCodeLocations[sz - 1].mWeak = weak;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CodeLocation loc;
|
CodeLocation loc;
|
||||||
loc.mLocation = location;
|
loc.mLocation = location;
|
||||||
loc.mStart = loc.mEnd = this->mCode.Size();
|
loc.mStart = loc.mEnd = this->mCode.Size();
|
||||||
|
loc.mWeak = weak;
|
||||||
mCodeLocations.Push(loc);
|
mCodeLocations.Push(loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38081,7 +38099,7 @@ void NativeCodeBasicBlock::CopyCode(NativeCodeProcedure * proc, uint8* target)
|
||||||
next = mOffset + mSize;
|
next = mOffset + mSize;
|
||||||
|
|
||||||
if (mBranchIns)
|
if (mBranchIns)
|
||||||
PutLocation(mBranchIns->mLocation);
|
PutLocation(mBranchIns->mLocation, false);
|
||||||
|
|
||||||
if (mFalseJump)
|
if (mFalseJump)
|
||||||
{
|
{
|
||||||
|
@ -38111,7 +38129,7 @@ void NativeCodeBasicBlock::CopyCode(NativeCodeProcedure * proc, uint8* target)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mBranchIns)
|
if (mBranchIns)
|
||||||
PutLocation(mBranchIns->mLocation);
|
PutLocation(mBranchIns->mLocation, false);
|
||||||
|
|
||||||
assert(end == next);
|
assert(end == next);
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ public:
|
||||||
NativeCodeBasicBlock* BuildSingleEntry(NativeCodeProcedure* proc, NativeCodeBasicBlock* block);
|
NativeCodeBasicBlock* BuildSingleEntry(NativeCodeProcedure* proc, NativeCodeBasicBlock* block);
|
||||||
NativeCodeBasicBlock* BuildSingleExit(NativeCodeProcedure* proc, NativeCodeBasicBlock* block);
|
NativeCodeBasicBlock* BuildSingleExit(NativeCodeProcedure* proc, NativeCodeBasicBlock* block);
|
||||||
|
|
||||||
void PutLocation(const Location& loc);
|
void PutLocation(const Location& loc, bool weak);
|
||||||
void PutOpcode(short opcode);
|
void PutOpcode(short opcode);
|
||||||
void PutByte(uint8 code);
|
void PutByte(uint8 code);
|
||||||
void PutWord(uint16 code);
|
void PutWord(uint16 code);
|
||||||
|
|
Loading…
Reference in New Issue