mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Made DeleteBreakpoint not recursive
This commit is contained in:
parent
e4eb6dfcea
commit
c6446e7657
1 changed files with 44 additions and 41 deletions
|
@ -3576,58 +3576,61 @@ void WinDebugger::DeleteBreakpoint(Breakpoint* breakpoint)
|
||||||
{
|
{
|
||||||
AutoCrit autoCrit(mDebugManager->mCritSect);
|
AutoCrit autoCrit(mDebugManager->mCritSect);
|
||||||
|
|
||||||
if (breakpoint == mActiveBreakpoint)
|
|
||||||
mActiveBreakpoint = NULL;
|
|
||||||
|
|
||||||
BfLogDbg("WinDebugger::DeleteBreakpoint %p Count:%d\n", breakpoint, mBreakpoints.size());
|
|
||||||
|
|
||||||
WdBreakpoint* wdBreakpoint = (WdBreakpoint*)breakpoint;
|
WdBreakpoint* wdBreakpoint = (WdBreakpoint*)breakpoint;
|
||||||
|
|
||||||
if (wdBreakpoint->mCondition != NULL)
|
while (wdBreakpoint != NULL)
|
||||||
{
|
{
|
||||||
if (!wdBreakpoint->mIsLinkedSibling)
|
BfLogDbg("WinDebugger::DeleteBreakpoint %p Count:%d\n", wdBreakpoint, mBreakpoints.size());
|
||||||
delete wdBreakpoint->mCondition;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wdBreakpoint->mMemoryBreakpointInfo != NULL)
|
if (wdBreakpoint == mActiveBreakpoint)
|
||||||
{
|
mActiveBreakpoint = NULL;
|
||||||
for (int memoryWatchSlot = 0; memoryWatchSlot < 4; memoryWatchSlot++)
|
|
||||||
|
if (wdBreakpoint->mCondition != NULL)
|
||||||
{
|
{
|
||||||
if (mMemoryBreakpoints[memoryWatchSlot].mBreakpoint == wdBreakpoint)
|
if (!wdBreakpoint->mIsLinkedSibling)
|
||||||
|
delete wdBreakpoint->mCondition;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wdBreakpoint->mMemoryBreakpointInfo != NULL)
|
||||||
|
{
|
||||||
|
for (int memoryWatchSlot = 0; memoryWatchSlot < 4; memoryWatchSlot++)
|
||||||
{
|
{
|
||||||
mFreeMemoryBreakIndices.push_back(memoryWatchSlot);
|
if (mMemoryBreakpoints[memoryWatchSlot].mBreakpoint == wdBreakpoint)
|
||||||
mMemoryBreakpoints[memoryWatchSlot] = WdMemoryBreakpointBind();
|
{
|
||||||
mMemoryBreakpointVersion++;
|
mFreeMemoryBreakIndices.push_back(memoryWatchSlot);
|
||||||
UpdateThreadDebugRegisters();
|
mMemoryBreakpoints[memoryWatchSlot] = WdMemoryBreakpointBind();
|
||||||
|
mMemoryBreakpointVersion++;
|
||||||
|
UpdateThreadDebugRegisters();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wdBreakpoint->mMemoryBreakpointInfo->mMemoryWatchSlotBitmap = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wdBreakpoint->mAddr != 0)
|
||||||
|
{
|
||||||
|
mBreakpointAddrMap.Remove(wdBreakpoint->mAddr, wdBreakpoint);
|
||||||
|
RemoveBreakpoint(wdBreakpoint->mAddr);
|
||||||
|
|
||||||
|
for (auto thread : mThreadList)
|
||||||
|
{
|
||||||
|
if (thread->mIsAtBreakpointAddress == wdBreakpoint->mAddr)
|
||||||
|
thread->mIsAtBreakpointAddress = NULL;
|
||||||
|
if (thread->mBreakpointAddressContinuing == wdBreakpoint->mAddr)
|
||||||
|
thread->mBreakpointAddressContinuing = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wdBreakpoint->mMemoryBreakpointInfo->mMemoryWatchSlotBitmap = 0;
|
if (!wdBreakpoint->mIsLinkedSibling)
|
||||||
}
|
|
||||||
|
|
||||||
if (wdBreakpoint->mAddr != 0)
|
|
||||||
{
|
|
||||||
mBreakpointAddrMap.Remove(wdBreakpoint->mAddr, wdBreakpoint);
|
|
||||||
RemoveBreakpoint(wdBreakpoint->mAddr);
|
|
||||||
|
|
||||||
for (auto thread : mThreadList)
|
|
||||||
{
|
{
|
||||||
if (thread->mIsAtBreakpointAddress == wdBreakpoint->mAddr)
|
mBreakpoints.Remove(wdBreakpoint);
|
||||||
thread->mIsAtBreakpointAddress = NULL;
|
}
|
||||||
if (thread->mBreakpointAddressContinuing == wdBreakpoint->mAddr)
|
|
||||||
thread->mBreakpointAddressContinuing = NULL;
|
auto nextBreakpoint = (WdBreakpoint*)wdBreakpoint->mLinkedSibling;
|
||||||
}
|
delete wdBreakpoint;
|
||||||
|
|
||||||
|
wdBreakpoint = nextBreakpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wdBreakpoint->mIsLinkedSibling)
|
|
||||||
{
|
|
||||||
mBreakpoints.Remove(wdBreakpoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wdBreakpoint->mLinkedSibling != NULL)
|
|
||||||
DeleteBreakpoint(wdBreakpoint->mLinkedSibling);
|
|
||||||
|
|
||||||
delete wdBreakpoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinDebugger::DetachBreakpoint(Breakpoint* breakpoint)
|
void WinDebugger::DetachBreakpoint(Breakpoint* breakpoint)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue