From dfbf4a48c55fb31819d40dbb46044ad334978aac Mon Sep 17 00:00:00 2001 From: "Mr. eXoDia" Date: Sun, 18 May 2014 15:38:38 +0200 Subject: [PATCH] resolved issue #39 (hardware breakpoints on all threads) --- TitanEngine/TitanEngine.Breakpoints.cpp | 36 +++++++++++++------ .../TitanEngine.Debugger.DebugLoop.cpp | 18 ++++++++++ 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/TitanEngine/TitanEngine.Breakpoints.cpp b/TitanEngine/TitanEngine.Breakpoints.cpp index 4a76cd4..712b68d 100644 --- a/TitanEngine/TitanEngine.Breakpoints.cpp +++ b/TitanEngine/TitanEngine.Breakpoints.cpp @@ -5,6 +5,7 @@ #include "Global.Engine.h" #include "Global.Engine.Threading.h" #include "Global.Engine.Importer.h" +#include "Global.Threader.h" static long engineDefaultBreakPointType = UE_BREAKPOINT_INT3; static BYTE UD2BreakPoint[2] = {0x0F, 0x0B}; @@ -605,8 +606,11 @@ __declspec(dllexport) bool TITCALL SetHardwareBreakPoint(ULONG_PTR bpxAddress, D dr7.HWBP_SIZE[hwbpIndex]=hwbpSize; dr7.HWBP_TYPE[hwbpIndex]=hwbpType; - SetContextData(UE_DR7, dr7uint(&dr7)); //NOTE: MUST SET THIS FIRST FOR X64! - SetContextData(IndexOfRegister, (ULONG_PTR)bpxAddress); + for(int i=0; ichCreateThread != NULL) { @@ -1381,6 +1397,8 @@ __declspec(dllexport) void TITCALL DebugLoop() { break; } + if(!ThreaderGetThreadInfo(0, DBGEvent.dwThreadId)) //switch thread + DBGEvent.dwThreadId=dbgProcessInformation.dwThreadId; } if(!SecondChance) //debugger didn't close with a second chance exception (normal exit)