DBG: do not auto-set breakpoints on module load if their oldbytes don't match + update oldbytes when a breakpoint is enabled.
This commit is contained in:
parent
7171334e1a
commit
8e34d10712
|
|
@ -152,6 +152,13 @@ bool BpEnable(duint Address, BP_TYPE Type, bool Enable)
|
|||
return false;
|
||||
|
||||
bpInfo->enabled = Enable;
|
||||
|
||||
//Re-read oldbytes
|
||||
if (Enable && Type == BPNORMAL)
|
||||
{
|
||||
if (!MemRead(Address, &bpInfo->oldbytes, sizeof(bpInfo->oldbytes)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -522,8 +522,22 @@ bool cbSetModuleBreakpoints(const BREAKPOINT* bp)
|
|||
{
|
||||
case BPNORMAL:
|
||||
{
|
||||
if(!SetBPX(bp->addr, bp->titantype, (void*)cbUserBreakpoint))
|
||||
dprintf("Could not set breakpoint " fhex "! (SetBPX)\n", bp->addr);
|
||||
unsigned short oldbytes;
|
||||
if (MemRead(bp->addr, &oldbytes, sizeof(oldbytes)))
|
||||
{
|
||||
if (oldbytes != bp->oldbytes)
|
||||
{
|
||||
dprintf("Breakpoint " fhex " has been disabled because the bytes don't match! Expected: %02X %02X, Found: %02X %02X\n",
|
||||
bp->addr,
|
||||
((unsigned char*)&bp->oldbytes)[0], ((unsigned char*)&bp->oldbytes)[1],
|
||||
((unsigned char*)&oldbytes)[0], ((unsigned char*)&oldbytes)[1]);
|
||||
BpEnable(bp->addr, BPNORMAL, false);
|
||||
}
|
||||
else if (!SetBPX(bp->addr, bp->titantype, (void*)cbUserBreakpoint))
|
||||
dprintf("Could not set breakpoint " fhex "! (SetBPX)\n", bp->addr);
|
||||
}
|
||||
else
|
||||
dprintf("MemRead failed on breakpoint address" fhex "!\n", bp->addr);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue