DBG: Attempt at fixing issue #284
This commit is contained in:
parent
fd845c97ac
commit
250827ec8c
|
@ -48,7 +48,8 @@ extern "C" DLL_EXPORT bool _dbg_memwrite(duint addr, const unsigned char* src, d
|
|||
|
||||
extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
|
||||
{
|
||||
CriticalSectionLocker locker(LockMemoryPages);
|
||||
SHARED_ACQUIRE(LockMemoryPages);
|
||||
|
||||
int pagecount = (int)memoryPages.size();
|
||||
memset(memmap, 0, sizeof(MEMMAP));
|
||||
memmap->count = pagecount;
|
||||
|
|
|
@ -236,9 +236,15 @@ bool BpEnumAll(BPENUMCALLBACK EnumCallback, const char* Module)
|
|||
bpInfo.addr += ModBaseFromName(bpInfo.mod);
|
||||
bpInfo.active = MemIsValidReadPtr(bpInfo.addr);
|
||||
|
||||
// Lock must be released due to callback sub-locks
|
||||
SHARED_RELEASE()
|
||||
|
||||
// Execute the callback
|
||||
if(!EnumCallback(&bpInfo))
|
||||
callbackStatus = false;
|
||||
|
||||
// Restore the breakpoint map lock
|
||||
SHARED_REACQUIRE(LockBreakpoints);
|
||||
}
|
||||
|
||||
return callbackStatus;
|
||||
|
|
|
@ -32,7 +32,7 @@ bool CommentSet(uint Address, const char* Text, bool Manual)
|
|||
comment.manual = Manual;
|
||||
comment.addr = Address - ModBaseFromAddr(Address);
|
||||
|
||||
// Insert into list
|
||||
// Key generated from module hash
|
||||
const uint key = ModHashFromAddr(Address);
|
||||
|
||||
EXCLUSIVE_ACQUIRE(LockComments);
|
||||
|
|
|
@ -22,7 +22,7 @@ bool bListAllPages = false;
|
|||
|
||||
void MemUpdateMap(HANDLE hProcess)
|
||||
{
|
||||
CriticalSectionLocker locker(LockMemoryPages);
|
||||
EXCLUSIVE_ACQUIRE(LockMemoryPages);
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
SIZE_T numBytes;
|
||||
uint MyAddress = 0, newAddress = 0;
|
||||
|
|
|
@ -29,6 +29,7 @@ bool waitislocked(WAIT_ID id);
|
|||
#define EXCLUSIVE_RELEASE() __ThreadLock.Unlock();
|
||||
|
||||
#define SHARED_ACQUIRE(Index) SectionLocker<SectionLock::##Index, true> __SThreadLock;
|
||||
#define SHARED_REACQUIRE(Index) __SThreadLock.Lock();
|
||||
#define SHARED_RELEASE() __SThreadLock.Unlock();
|
||||
|
||||
enum SectionLock
|
||||
|
|
Loading…
Reference in New Issue