1
0
Fork 0

DBG+GUI: workaround for slow dbghelp functions (see #747)

This commit is contained in:
mrexodia 2017-04-09 02:40:44 +02:00
parent 701ab86942
commit 449d04eec6
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 6 additions and 8 deletions

View File

@ -12,6 +12,7 @@
#include "module.h" #include "module.h"
#include "taskthread.h" #include "taskthread.h"
#include "value.h" #include "value.h"
#include "comment.h"
#define PAGE_SHIFT (12) #define PAGE_SHIFT (12)
//#define PAGE_SIZE (4096) //#define PAGE_SIZE (4096)
@ -237,10 +238,13 @@ void MemUpdateMap()
EXCLUSIVE_ACQUIRE(LockMemoryPages); EXCLUSIVE_ACQUIRE(LockMemoryPages);
memoryPages.clear(); memoryPages.clear();
char comment[MAX_COMMENT_SIZE] = "";
for(auto & page : pageVector) for(auto & page : pageVector)
{ {
duint start = (duint)page.mbi.BaseAddress; duint start = (duint)page.mbi.BaseAddress;
duint size = (duint)page.mbi.RegionSize; duint size = (duint)page.mbi.RegionSize;
if(CommentGet(start, comment)) //user comments override info
strncpy_s(page.info, comment, _TRUNCATE);
memoryPages.insert(std::make_pair(std::make_pair(start, start + size - 1), page)); memoryPages.insert(std::make_pair(std::make_pair(start, start + size - 1), page));
} }
} }

View File

@ -351,14 +351,8 @@ void MemoryMapView::refreshMap()
wS = QString((wMemMapStruct.page)[wI].info); wS = QString((wMemMapStruct.page)[wI].info);
setCellContent(wI, 2, wS); setCellContent(wI, 2, wS);
// Content // Content TODO: proper section content analysis in dbg/memory.cpp:MemUpdateMap
char comment_text[MAX_COMMENT_SIZE]; if(wS.contains(".bss"))
comment_text[0] = '\0';
if(DbgGetCommentAt((duint)wMbi.BaseAddress, comment_text) && comment_text[0] != '\1') // user comment present
{
wS = QString::fromUtf8(comment_text);
}
else if(wS.contains(".bss"))
wS = tr("Uninitialized data"); wS = tr("Uninitialized data");
else if(wS.contains(".data")) else if(wS.contains(".data"))
wS = tr("Initialized data"); wS = tr("Initialized data");