1
0
Fork 0

DBG+GUI: no longer override the section name in memory map with user comments

This commit is contained in:
mrexodia 2017-04-11 00:19:37 +02:00
parent 8afcb52e36
commit 598fc65ea0
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
4 changed files with 9 additions and 6 deletions

View File

@ -27,6 +27,7 @@
#include "watch.h"
#include "animate.h"
#include "thread.h"
#include "comment.h"
static DBGFUNCTIONS _dbgfunctions;
@ -382,4 +383,5 @@ void dbgfunctionsinit()
_dbgfunctions.ThreadGetName = ThreadGetName;
_dbgfunctions.IsDepEnabled = dbgisdepenabled;
_dbgfunctions.GetCallStackEx = _getcallstackex;
_dbgfunctions.GetUserComment = CommentGet;
}

View File

@ -175,6 +175,7 @@ typedef bool(*HANDLESENUMHEAPS)(ListOf(HEAPINFO) heaps);
typedef bool(*THREADGETNAME)(DWORD tid, char* name);
typedef bool(*ISDEPENABLED)();
typedef void(*GETCALLSTACKEX)(DBGCALLSTACK* callstack, bool cache);
typedef bool(*GETUSERCOMMENT)(duint addr, char* comment);
//The list of all the DbgFunctions() return value.
//WARNING: This list is append only. Do not insert things in the middle or plugins would break.
@ -240,6 +241,7 @@ typedef struct DBGFUNCTIONS_
THREADGETNAME ThreadGetName;
ISDEPENABLED IsDepEnabled;
GETCALLSTACKEX GetCallStackEx;
GETUSERCOMMENT GetUserComment;
} DBGFUNCTIONS;
#ifdef BUILD_DBG

View File

@ -12,7 +12,6 @@
#include "module.h"
#include "taskthread.h"
#include "value.h"
#include "comment.h"
#define PAGE_SHIFT (12)
//#define PAGE_SIZE (4096)
@ -238,13 +237,10 @@ void MemUpdateMap()
EXCLUSIVE_ACQUIRE(LockMemoryPages);
memoryPages.clear();
char comment[MAX_COMMENT_SIZE] = "";
for(auto & page : pageVector)
{
duint start = (duint)page.mbi.BaseAddress;
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));
}
}

View File

@ -351,8 +351,11 @@ void MemoryMapView::refreshMap()
wS = QString((wMemMapStruct.page)[wI].info);
setCellContent(wI, 2, wS);
// Content TODO: proper section content analysis in dbg/memory.cpp:MemUpdateMap
if(wS.contains(".bss"))
// Content, TODO: proper section content analysis in dbg/memory.cpp:MemUpdateMap
char comment_text[MAX_COMMENT_SIZE];
if(DbgFunctions()->GetUserComment((duint)wMbi.BaseAddress, comment_text)) // user comment present
wS = comment_text;
else if(wS.contains(".bss"))
wS = tr("Uninitialized data");
else if(wS.contains(".data"))
wS = tr("Initialized data");