1
0
Fork 0

DBG: added GetBridgeBp function

This commit is contained in:
mrexodia 2016-05-22 23:53:17 +02:00
parent 65639ff7d5
commit 97b2319371
3 changed files with 33 additions and 2 deletions

View File

@ -16,6 +16,8 @@
#include "symbolinfo.h"
#include "module.h"
#include "exhandlerinfo.h"
#include "breakpoint.h"
#include "threading.h"
static DBGFUNCTIONS _dbgfunctions;
@ -203,6 +205,32 @@ static bool _valfromstring(const char* string, duint* value)
return valfromstring(string, value);
}
static bool _getbridgebp(BPXTYPE type, duint addr, BRIDGEBP* bp)
{
BP_TYPE bptype;
switch(type)
{
case bp_normal:
bptype = BPNORMAL;
break;
case bp_hardware:
bptype = BPHARDWARE;
break;
case bp_memory:
bptype = BPMEMORY;
break;
default:
return false;
}
SHARED_ACQUIRE(LockBreakpoints);
auto bpInfo = BpInfoFromAddr(bptype, addr);
if(!bpInfo)
return false;
if(bp)
BpToBridge(bpInfo, bp);
return true;
}
void dbgfunctionsinit()
{
_dbgfunctions.AssembleAtEx = _assembleatex;
@ -242,4 +270,5 @@ void dbgfunctionsinit()
_dbgfunctions.GetSourceFromAddr = _getsourcefromaddr;
_dbgfunctions.ValFromString = _valfromstring;
_dbgfunctions.PatchGetEx = (PATCHGETEX)PatchGet;
_dbgfunctions.GetBridgeBp = _getbridgebp;
}

View File

@ -81,7 +81,8 @@ typedef duint(*VATOFILEOFFSET)(duint va);
typedef duint(*GETADDRFROMLINE)(const char* szSourceFile, int line);
typedef bool (*GETSOURCEFROMADDR)(duint addr, char* szSourceFile, int* line);
typedef bool (*VALFROMSTRING)(const char* string, duint* value);
typedef bool(*PATCHGETEX)(duint addr, DBGPATCHINFO* info);
typedef bool (*PATCHGETEX)(duint addr, DBGPATCHINFO* info);
typedef bool(*GETBRIDGEBP)(BPXTYPE type, duint addr, BRIDGEBP* bp);
typedef struct DBGFUNCTIONS_
{
@ -122,6 +123,7 @@ typedef struct DBGFUNCTIONS_
GETSOURCEFROMADDR GetSourceFromAddr;
VALFROMSTRING ValFromString;
PATCHGETEX PatchGetEx;
GETBRIDGEBP GetBridgeBp;
} DBGFUNCTIONS;
#ifdef BUILD_DBG

View File

@ -399,7 +399,7 @@ void BpToBridge(const BREAKPOINT* Bp, BRIDGEBP* BridgeBp)
break;
case BPHARDWARE:
BridgeBp->type = bp_hardware;
switch(((DWORD)Bp->titantype) >> 8)
switch(TITANGETTYPE(Bp->titantype))
{
case UE_DR0:
BridgeBp->slot = 0;