DBG: added GetBridgeBp function
This commit is contained in:
parent
65639ff7d5
commit
97b2319371
|
@ -16,6 +16,8 @@
|
||||||
#include "symbolinfo.h"
|
#include "symbolinfo.h"
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "exhandlerinfo.h"
|
#include "exhandlerinfo.h"
|
||||||
|
#include "breakpoint.h"
|
||||||
|
#include "threading.h"
|
||||||
|
|
||||||
static DBGFUNCTIONS _dbgfunctions;
|
static DBGFUNCTIONS _dbgfunctions;
|
||||||
|
|
||||||
|
@ -203,6 +205,32 @@ static bool _valfromstring(const char* string, duint* value)
|
||||||
return valfromstring(string, 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()
|
void dbgfunctionsinit()
|
||||||
{
|
{
|
||||||
_dbgfunctions.AssembleAtEx = _assembleatex;
|
_dbgfunctions.AssembleAtEx = _assembleatex;
|
||||||
|
@ -242,4 +270,5 @@ void dbgfunctionsinit()
|
||||||
_dbgfunctions.GetSourceFromAddr = _getsourcefromaddr;
|
_dbgfunctions.GetSourceFromAddr = _getsourcefromaddr;
|
||||||
_dbgfunctions.ValFromString = _valfromstring;
|
_dbgfunctions.ValFromString = _valfromstring;
|
||||||
_dbgfunctions.PatchGetEx = (PATCHGETEX)PatchGet;
|
_dbgfunctions.PatchGetEx = (PATCHGETEX)PatchGet;
|
||||||
|
_dbgfunctions.GetBridgeBp = _getbridgebp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,8 @@ typedef duint(*VATOFILEOFFSET)(duint va);
|
||||||
typedef duint(*GETADDRFROMLINE)(const char* szSourceFile, int line);
|
typedef duint(*GETADDRFROMLINE)(const char* szSourceFile, int line);
|
||||||
typedef bool (*GETSOURCEFROMADDR)(duint addr, char* szSourceFile, int* line);
|
typedef bool (*GETSOURCEFROMADDR)(duint addr, char* szSourceFile, int* line);
|
||||||
typedef bool (*VALFROMSTRING)(const char* string, duint* value);
|
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_
|
typedef struct DBGFUNCTIONS_
|
||||||
{
|
{
|
||||||
|
@ -122,6 +123,7 @@ typedef struct DBGFUNCTIONS_
|
||||||
GETSOURCEFROMADDR GetSourceFromAddr;
|
GETSOURCEFROMADDR GetSourceFromAddr;
|
||||||
VALFROMSTRING ValFromString;
|
VALFROMSTRING ValFromString;
|
||||||
PATCHGETEX PatchGetEx;
|
PATCHGETEX PatchGetEx;
|
||||||
|
GETBRIDGEBP GetBridgeBp;
|
||||||
} DBGFUNCTIONS;
|
} DBGFUNCTIONS;
|
||||||
|
|
||||||
#ifdef BUILD_DBG
|
#ifdef BUILD_DBG
|
||||||
|
|
|
@ -399,7 +399,7 @@ void BpToBridge(const BREAKPOINT* Bp, BRIDGEBP* BridgeBp)
|
||||||
break;
|
break;
|
||||||
case BPHARDWARE:
|
case BPHARDWARE:
|
||||||
BridgeBp->type = bp_hardware;
|
BridgeBp->type = bp_hardware;
|
||||||
switch(((DWORD)Bp->titantype) >> 8)
|
switch(TITANGETTYPE(Bp->titantype))
|
||||||
{
|
{
|
||||||
case UE_DR0:
|
case UE_DR0:
|
||||||
BridgeBp->slot = 0;
|
BridgeBp->slot = 0;
|
||||||
|
|
Loading…
Reference in New Issue