1
0
Fork 0

DBG: fix regression related to hardware breakpoint storage

This commit is contained in:
Duncan Ogilvie 2020-04-12 16:49:39 +02:00
parent a2867af839
commit 2bd139d89f
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 6 additions and 5 deletions

View File

@ -734,7 +734,7 @@ void BpToBridge(const BREAKPOINT* Bp, BRIDGEBP* BridgeBp)
BridgeBp->typeEx = ex_all;
break;
default:
__debugbreak();
dprintf_untranslated("Invalid titantype for exception breakpoint %u\n", Bp->titantype);
}
break;
default:
@ -824,7 +824,8 @@ void BpCacheLoad(JSON Root)
breakpoint.addr = (duint)json_hex_value(json_object_get(value, "address"));
breakpoint.enabled = json_boolean_value(json_object_get(value, "enabled"));
breakpoint.titantype = (DWORD)json_hex_value(json_object_get(value, "titantype"));
TITANSETDRX(breakpoint.titantype, UE_DR7); // DR7 is used as a sentinel value to prevent wrongful deletion
if(breakpoint.type == BPHARDWARE)
TITANSETDRX(breakpoint.titantype, UE_DR7); // DR7 is used as a sentinel value to prevent wrongful deletion
// String values
loadStringValue(value, breakpoint.name, "name");

View File

@ -4,12 +4,12 @@
#include "_global.h"
#include "jansson/jansson_x64dbg.h"
#define TITANSETDRX(titantype, drx) titantype &= 0x0FF; titantype |= (((drx - UE_DR0) & 0xF) << 8)
#define TITANSETDRX(titantype, drx) titantype &= 0x0FF, titantype |= (((drx - UE_DR0) & 0xF) << 8)
#define TITANGETDRX(titantype) UE_DR0 + ((titantype >> 8) & 0xF)
#define TITANDRXVALID(titantype) TITANGETDRX(titantype) != UE_DR7
#define TITANSETTYPE(titantype, type) titantype &= 0xF0F; titantype |= ((type & 0xF) << 4)
#define TITANSETTYPE(titantype, type) titantype &= 0xF0F, titantype |= ((type & 0xF) << 4)
#define TITANGETTYPE(titantype) (titantype >> 4) & 0xF
#define TITANSETSIZE(titantype, size) titantype &= 0xFF0; titantype |= (size & 0xF);
#define TITANSETSIZE(titantype, size) titantype &= 0xFF0, titantype |= (size & 0xF);
#define TITANGETSIZE(titantype) titantype & 0xF
enum BP_TYPE