DBG: fixed a bug with database storing on entries with empty modules
This commit is contained in:
parent
c801811184
commit
abe53d3492
|
@ -66,7 +66,8 @@ bool ArgumentAdd(duint Start, duint End, bool Manual, duint InstructionCount)
|
|||
return false;
|
||||
|
||||
ARGUMENTSINFO argument;
|
||||
ModNameFromAddr(Start, argument.mod, true);
|
||||
if(!ModNameFromAddr(Start, argument.mod, true))
|
||||
*argument.mod = '\0';
|
||||
argument.start = Start - moduleBase;
|
||||
argument.end = End - moduleBase;
|
||||
argument.manual = Manual;
|
||||
|
|
|
@ -49,7 +49,8 @@ bool BookmarkSet(duint Address, bool Manual)
|
|||
return false;
|
||||
|
||||
BOOKMARKSINFO bookmark;
|
||||
ModNameFromAddr(Address, bookmark.mod, true);
|
||||
if(!ModNameFromAddr(Address, bookmark.mod, true))
|
||||
*bookmark.mod = '\0';
|
||||
bookmark.addr = Address - ModBaseFromAddr(Address);
|
||||
bookmark.manual = Manual;
|
||||
|
||||
|
|
|
@ -65,7 +65,8 @@ bool CommentSet(duint Address, const char* Text, bool Manual)
|
|||
// Fill out the structure
|
||||
COMMENTSINFO comment;
|
||||
strcpy_s(comment.text, Text);
|
||||
ModNameFromAddr(Address, comment.mod, true);
|
||||
if(!ModNameFromAddr(Address, comment.mod, true))
|
||||
*comment.mod = '\0';
|
||||
|
||||
comment.manual = Manual;
|
||||
comment.addr = Address - ModBaseFromAddr(Address);
|
||||
|
|
|
@ -68,7 +68,8 @@ bool FunctionAdd(duint Start, duint End, bool Manual, duint InstructionCount)
|
|||
return false;
|
||||
|
||||
FUNCTIONSINFO function;
|
||||
ModNameFromAddr(Start, function.mod, true);
|
||||
if(!ModNameFromAddr(Start, function.mod, true))
|
||||
*function.mod = '\0';
|
||||
function.start = Start - moduleBase;
|
||||
function.end = End - moduleBase;
|
||||
function.manual = Manual;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "threading.h"
|
||||
#include "module.h"
|
||||
#include "memory.h"
|
||||
#include "console.h"
|
||||
|
||||
struct CommentSerializer : JSONWrapper<LABELSINFO>
|
||||
{
|
||||
|
@ -71,7 +72,8 @@ bool LabelSet(duint Address, const char* Text, bool Manual)
|
|||
labelInfo.manual = Manual;
|
||||
labelInfo.addr = Address - ModBaseFromAddr(Address);
|
||||
strcpy_s(labelInfo.text, Text);
|
||||
ModNameFromAddr(Address, labelInfo.mod, true);
|
||||
if(!ModNameFromAddr(Address, labelInfo.mod, true))
|
||||
*labelInfo.mod = '\0';
|
||||
|
||||
return labels.Add(labelInfo);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,10 @@ protected:
|
|||
template<size_t TSize>
|
||||
bool getString(const char* key, char(&_Dest)[TSize]) const
|
||||
{
|
||||
auto str = json_string_value(json_object_get(mJson, key));
|
||||
auto jsonValue = get(key);
|
||||
if(!jsonValue)
|
||||
return false;
|
||||
auto str = json_string_value(jsonValue);
|
||||
if(str && strlen(str) < TSize)
|
||||
{
|
||||
strcpy_s(_Dest, str);
|
||||
|
|
|
@ -104,7 +104,8 @@ bool XrefAdd(duint Address, duint From)
|
|||
if(found == mapData.end())
|
||||
{
|
||||
XREFSINFO info;
|
||||
ModNameFromAddr(Address, info.mod, true);
|
||||
if(!ModNameFromAddr(Address, info.mod, true))
|
||||
*info.mod = '\0';
|
||||
info.address = Address - moduleBase;
|
||||
info.type = xrefRecord.type;
|
||||
info.references.insert({ xrefRecord.addr, xrefRecord });
|
||||
|
|
Loading…
Reference in New Issue