1
0
Fork 0

DBG: small performance improvements with reading settings

This commit is contained in:
Mr. eXoDia 2014-09-30 12:31:11 +02:00
parent 6eab29e9f1
commit 3b4b9e2ab9
6 changed files with 14 additions and 35 deletions

View File

@ -107,7 +107,7 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, ADDR
pSymbol->MaxNameLen = MAX_LABEL_SIZE;
if(SymFromAddr(fdProcessInfo->hProcess, (DWORD64)addr, &displacement, pSymbol) and !displacement)
{
if(settingboolget("Engine", "UndecorateSymbolNames") or !UnDecorateSymbolName(pSymbol->Name, addrinfo->label, MAX_LABEL_SIZE, UNDNAME_COMPLETE))
if(bUndecorateSymbolNames or !UnDecorateSymbolName(pSymbol->Name, addrinfo->label, MAX_LABEL_SIZE, UNDNAME_COMPLETE))
strcpy_s(addrinfo->label, pSymbol->Name);
retval = true;
}
@ -122,7 +122,7 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, ADDR
{
if(SymFromAddr(fdProcessInfo->hProcess, (DWORD64)val, &displacement, pSymbol) and !displacement)
{
if(settingboolget("Engine", "UndecorateSymbolNames") or !UnDecorateSymbolName(pSymbol->Name, addrinfo->label, MAX_LABEL_SIZE, UNDNAME_COMPLETE))
if(bUndecorateSymbolNames or !UnDecorateSymbolName(pSymbol->Name, addrinfo->label, MAX_LABEL_SIZE, UNDNAME_COMPLETE))
sprintf_s(addrinfo->label, "JMP.&%s", pSymbol->Name);
retval = true;
}
@ -629,19 +629,13 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par
case DBG_SETTINGS_UPDATED:
{
valuesetsignedcalc(!settingboolget("Engine", "CalculationType")); //0:signed, 1:unsigned
SetEngineVariable(UE_ENGINE_SET_DEBUG_PRIVILEGE, settingboolget("Engine", "EnableDebugPrivilege"));
bOnlyCipAutoComments = settingboolget("Disassembler", "OnlyCipAutoComments");
bListAllPages = settingboolget("Engine", "ListAllPages");
bUndecorateSymbolNames = settingboolget("Engine", "UndecorateSymbolNames");
uint setting;
if(BridgeSettingGetUint("Engine", "CalculationType", &setting))
{
switch(setting)
{
case 0: //calc_signed
valuesetsignedcalc(true);
break;
case 1: //calc_unsigned
valuesetsignedcalc(false);
break;
}
}
if(BridgeSettingGetUint("Engine", "BreakpointType", &setting))
{
switch(setting)
@ -657,13 +651,7 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par
break;
}
}
if(BridgeSettingGetUint("Engine", "EnableDebugPrivilege", &setting))
{
if(setting)
SetEngineVariable(UE_ENGINE_SET_DEBUG_PRIVILEGE, true);
else
SetEngineVariable(UE_ENGINE_SET_DEBUG_PRIVILEGE, false);
}
char exceptionRange[MAX_SETTING_SIZE] = "";
dbgclearignoredexceptions();
if(BridgeSettingGet("Exceptions", "IgnoreRange", exceptionRange))
@ -683,13 +671,6 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par
entry = strtok(0, ",");
}
}
if(BridgeSettingGetUint("Disassembler", "OnlyCipAutoComments", &setting))
{
if(setting)
bOnlyCipAutoComments = true;
else
bOnlyCipAutoComments = false;
}
}
break;

View File

@ -34,6 +34,7 @@ char szSymbolCachePath[MAX_PATH] = "";
char sqlitedb[deflen] = "";
PROCESS_INFORMATION* fdProcessInfo = &g_pi;
HANDLE hActiveThread;
bool bUndecorateSymbolNames = true;
static DWORD WINAPI memMapThread(void* ptr)
{

View File

@ -13,7 +13,6 @@
#define JIT_ENTRY_MAX_SIZE 512
#define JIT_REG_KEY TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug")
typedef enum
{
ERROR_RW = 0,
@ -129,5 +128,6 @@ extern PROCESS_INFORMATION* fdProcessInfo;
extern HANDLE hActiveThread;
extern char szFileName[MAX_PATH];
extern char szSymbolCachePath[MAX_PATH];
extern bool bUndecorateSymbolNames;
#endif // _DEBUGGER_H

View File

@ -5,6 +5,7 @@
#include "threading.h"
MemoryMap memoryPages;
bool bListAllPages = false;
void memupdatemap(HANDLE hProcess)
{
@ -14,11 +15,6 @@ void memupdatemap(HANDLE hProcess)
uint MyAddress = 0, newAddress = 0;
uint curAllocationBase = 0;
uint setting = 0;
bool bListAllPages = false;
if(BridgeSettingGetUint("Engine", "ListAllPages", &setting) && setting)
bListAllPages = true;
std::vector<MEMPAGE> pageVector;
do
{

View File

@ -7,6 +7,7 @@
typedef std::map<Range, MEMPAGE, RangeCompare> MemoryMap;
extern MemoryMap memoryPages;
extern bool bListAllPages;
struct PATTERNNIBBLE
{

View File

@ -155,7 +155,7 @@ const char* symgetsymbolicname(uint addr)
pSymbol->MaxNameLen = MAX_LABEL_SIZE;
if(SymFromAddr(fdProcessInfo->hProcess, (DWORD64)addr, &displacement, pSymbol) and !displacement)
{
if(!settingboolget("Engine", "UndecorateSymbolNames") or !UnDecorateSymbolName(pSymbol->Name, label, MAX_SYM_NAME, UNDNAME_COMPLETE))
if(!bUndecorateSymbolNames or !UnDecorateSymbolName(pSymbol->Name, label, MAX_SYM_NAME, UNDNAME_COMPLETE))
strcpy_s(label, pSymbol->Name);
retval = true;
}