1
0
Fork 0

DBG: shit with label

This commit is contained in:
mrexodia 2016-01-11 23:43:38 +01:00
parent 4d1245c046
commit fcbdf27c55
3 changed files with 24 additions and 1 deletions

View File

@ -16,6 +16,7 @@
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <unordered_map>
#include <tlhelp32.h>
#include "..\dbg_types.h"

View File

@ -289,3 +289,24 @@ bool LabelGetInfo(duint Address, LABELSINFO* info)
return true;
}
void LabelEnumCb(std::function<void(const LABELSINFO & info)> cbEnum, const char* module)
{
SHARED_ACQUIRE(LockLabels);
for(auto i = labels.begin(); i != labels.end();)
{
auto j = i;
++i; // Increment here, because the callback might remove the current entry
if(module && module[0] != '\0')
{
if(strcmp(j->second.mod, module) != 0)
continue;
}
SHARED_RELEASE();
cbEnum(j->second);
SHARED_REACQUIRE();
}
}

View File

@ -20,4 +20,5 @@ void LabelCacheLoad(JSON root);
bool LabelEnum(LABELSINFO* List, size_t* Size);
void LabelClear();
void LabelGetList(std::vector<LABELSINFO> & list);
bool LabelGetInfo(duint Address, LABELSINFO* info);
bool LabelGetInfo(duint Address, LABELSINFO* info);
void LabelEnumCb(std::function<void(const LABELSINFO & info)> cbEnum, const char* module = nullptr);