1
0
Fork 0

DBG: add breakpointexceptionaddress variable

This commit is contained in:
Duncan Ogilvie 2017-12-28 20:27:23 +01:00
parent 8616ff67a2
commit 7c0d122ee4
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
3 changed files with 8 additions and 1 deletions

View File

@ -791,26 +791,33 @@ static void cbGenericBreakpoint(BP_TYPE bptype, void* ExceptionAddress = nullptr
BREAKPOINT* bpPtr = nullptr;
//NOTE: this locking is very tricky, make sure you understand it before modifying anything
EXCLUSIVE_ACQUIRE(LockBreakpoints);
duint breakpointExceptionAddress = 0;
switch(bptype)
{
case BPNORMAL:
bpPtr = BpInfoFromAddr(BPNORMAL, CIP);
breakpointExceptionAddress = CIP;
break;
case BPHARDWARE:
bpPtr = BpInfoFromAddr(BPHARDWARE, duint(ExceptionAddress));
breakpointExceptionAddress = duint(ExceptionAddress);
break;
case BPMEMORY:
bpPtr = BpInfoFromAddr(BPMEMORY, MemFindBaseAddr(duint(ExceptionAddress), nullptr, true));
breakpointExceptionAddress = duint(ExceptionAddress);
break;
case BPDLL:
bpPtr = BpInfoFromAddr(BPDLL, BpGetDLLBpAddr(reinterpret_cast<const char*>(ExceptionAddress)));
breakpointExceptionAddress = 0; //makes no sense
break;
case BPEXCEPTION:
bpPtr = BpInfoFromAddr(BPEXCEPTION, ((EXCEPTION_DEBUG_INFO*)ExceptionAddress)->ExceptionRecord.ExceptionCode);
breakpointExceptionAddress = (duint)((EXCEPTION_DEBUG_INFO*)ExceptionAddress)->ExceptionRecord.ExceptionAddress;
break;
default:
break;
}
varset("$breakpointexceptionaddress", breakpointExceptionAddress, true);
if(!(bpPtr && bpPtr->enabled)) //invalid / disabled breakpoint hit (most likely a bug)
{
if(bptype != BPDLL || !BpUpdateDllPath(reinterpret_cast<const char*>(ExceptionAddress), &bpPtr))

View File

@ -82,6 +82,7 @@ void varinit()
varnew("$breakpointcounter", 0, VAR_READONLY);
varnew("$breakpointcondition", 0, VAR_SYSTEM);
varnew("$breakpointlogcondition", 0, VAR_READONLY);
varnew("$breakpointexceptionaddress", 0, VAR_READONLY);
// Tracing variables
varnew("$tracecounter", 0, VAR_READONLY);

View File

@ -3285,7 +3285,6 @@ void RegistersView::setRegister(REGISTER_NAME reg, duint value)
if(mFlags.contains(reg))
wRegName = "_" + wRegName;
// we change the value (so highlight it)
mRegisterUpdates.insert(reg);
// tell everything the compiler