1
0
Fork 0

Implemented DbgClearLabelRange, DbgClearCommentRange, DbgClearBookmarkRange for manual entries

This commit is contained in:
RaMMicHaeL 2016-02-26 15:51:36 +02:00
parent 2001885537
commit 8170f99b3c
12 changed files with 57 additions and 18 deletions

View File

@ -345,6 +345,11 @@ BRIDGE_IMPEXP bool DbgSetLabelAt(duint addr, const char* text)
return true;
}
BRIDGE_IMPEXP void DbgClearLabelRange(duint start, duint end)
{
_dbg_sendmessage(DBG_DELETE_LABEL_RANGE, (void*)start, (void*)end);
}
// FIXME required size of arg _text_?
BRIDGE_IMPEXP bool DbgGetCommentAt(duint addr, char* text) //comment (not live)
{
@ -372,6 +377,11 @@ BRIDGE_IMPEXP bool DbgSetCommentAt(duint addr, const char* text)
return true;
}
BRIDGE_IMPEXP void DbgClearCommentRange(duint start, duint end)
{
_dbg_sendmessage(DBG_DELETE_COMMENT_RANGE, (void*)start, (void*)end);
}
// FIXME required size of arg _text_?
BRIDGE_IMPEXP bool DbgGetModuleAt(duint addr, char* text)
{
@ -409,6 +419,11 @@ BRIDGE_IMPEXP bool DbgSetBookmarkAt(duint addr, bool isbookmark)
return _dbg_addrinfoset(addr, &info);
}
BRIDGE_IMPEXP void DbgClearBookmarkRange(duint start, duint end)
{
_dbg_sendmessage(DBG_DELETE_BOOKMARK_RANGE, (void*)start, (void*)end);
}
// FIXME return on success?
BRIDGE_IMPEXP const char* DbgInit()
{

View File

@ -183,6 +183,9 @@ typedef enum
DBG_DEINITIALIZE_LOCKS, // param1=unused, param2=unused
DBG_GET_TIME_WASTED_COUNTER, // param1=unused, param2=unused
DBG_SYMBOL_ENUM_FROMCACHE, // param1=SYMBOLCBINFO* cbInfo, param2=unused
DBG_DELETE_COMMENT_RANGE, // param1=duint start, param2=duint end
DBG_DELETE_LABEL_RANGE, // param1=duint start, param2=duint end
DBG_DELETE_BOOKMARK_RANGE, // param1=duint start, param2=duint end
} DBGMSG;
typedef enum
@ -649,10 +652,13 @@ BRIDGE_IMPEXP bool DbgIsDebugging();
BRIDGE_IMPEXP bool DbgIsJumpGoingToExecute(duint addr);
BRIDGE_IMPEXP bool DbgGetLabelAt(duint addr, SEGMENTREG segment, char* text);
BRIDGE_IMPEXP bool DbgSetLabelAt(duint addr, const char* text);
BRIDGE_IMPEXP void DbgClearLabelRange(duint start, duint end);
BRIDGE_IMPEXP bool DbgGetCommentAt(duint addr, char* text);
BRIDGE_IMPEXP bool DbgSetCommentAt(duint addr, const char* text);
BRIDGE_IMPEXP void DbgClearCommentRange(duint start, duint end);
BRIDGE_IMPEXP bool DbgGetBookmarkAt(duint addr);
BRIDGE_IMPEXP bool DbgSetBookmarkAt(duint addr, bool isbookmark);
BRIDGE_IMPEXP void DbgClearBookmarkRange(duint start, duint end);
BRIDGE_IMPEXP bool DbgGetModuleAt(duint addr, char* text);
BRIDGE_IMPEXP BPXTYPE DbgGetBpxTypeAt(duint addr);
BRIDGE_IMPEXP duint DbgValFromString(const char* string);

View File

@ -955,7 +955,7 @@ extern "C" DLL_EXPORT duint _dbg_sendmessage(DBGMSG type, void* param1, void* pa
case DBG_DELETE_AUTO_COMMENT_RANGE:
{
CommentDelRange((duint)param1, (duint)param2);
CommentDelRange((duint)param1, (duint)param2, false);
}
break;
@ -967,7 +967,7 @@ extern "C" DLL_EXPORT duint _dbg_sendmessage(DBGMSG type, void* param1, void* pa
case DBG_DELETE_AUTO_LABEL_RANGE:
{
LabelDelRange((duint)param1, (duint)param2);
LabelDelRange((duint)param1, (duint)param2, false);
}
break;
@ -979,7 +979,7 @@ extern "C" DLL_EXPORT duint _dbg_sendmessage(DBGMSG type, void* param1, void* pa
case DBG_DELETE_AUTO_BOOKMARK_RANGE:
{
BookmarkDelRange((duint)param1, (duint)param2);
BookmarkDelRange((duint)param1, (duint)param2, false);
}
break;
@ -1043,6 +1043,24 @@ extern "C" DLL_EXPORT duint _dbg_sendmessage(DBGMSG type, void* param1, void* pa
case DBG_GET_TIME_WASTED_COUNTER:
return dbggettimewastedcounter();
case DBG_DELETE_COMMENT_RANGE:
{
CommentDelRange((duint)param1, (duint)param2, true);
}
break;
case DBG_DELETE_LABEL_RANGE:
{
LabelDelRange((duint)param1, (duint)param2, true);
}
break;
case DBG_DELETE_BOOKMARK_RANGE:
{
BookmarkDelRange((duint)param1, (duint)param2, true);
}
break;
}
return 0;
}

View File

@ -43,7 +43,7 @@ SCRIPT_EXPORT bool Script::Bookmark::Delete(duint addr)
SCRIPT_EXPORT void Script::Bookmark::DeleteRange(duint start, duint end)
{
BookmarkDelRange(start, end);
BookmarkDelRange(start, end, false);
}
SCRIPT_EXPORT void Script::Bookmark::Clear()

View File

@ -44,7 +44,7 @@ SCRIPT_EXPORT bool Script::Comment::Delete(duint addr)
SCRIPT_EXPORT void Script::Comment::DeleteRange(duint start, duint end)
{
CommentDelRange(start, end);
CommentDelRange(start, end, false);
}
SCRIPT_EXPORT void Script::Comment::Clear()

View File

@ -49,7 +49,7 @@ SCRIPT_EXPORT bool Script::Label::Delete(duint addr)
SCRIPT_EXPORT void Script::Label::DeleteRange(duint start, duint end)
{
LabelDelRange(start, end);
LabelDelRange(start, end, false);
}
SCRIPT_EXPORT void Script::Label::Clear()

View File

@ -46,7 +46,7 @@ bool BookmarkDelete(duint Address)
return (bookmarks.erase(ModHashFromAddr(Address)) > 0);
}
void BookmarkDelRange(duint Start, duint End)
void BookmarkDelRange(duint Start, duint End, bool Manual)
{
ASSERT_DEBUGGING("Export call");
@ -73,8 +73,8 @@ void BookmarkDelRange(duint Start, duint End)
{
const auto & currentBookmark = itr->second;
// Ignore manually set entries
if(currentBookmark.manual)
// Ignore non-matching entries
if(Manual ? !currentBookmark.manual : currentBookmark.manual)
{
++itr;
continue;

View File

@ -13,7 +13,7 @@ struct BOOKMARKSINFO
bool BookmarkSet(duint Address, bool Manual);
bool BookmarkGet(duint Address);
bool BookmarkDelete(duint Address);
void BookmarkDelRange(duint Start, duint End);
void BookmarkDelRange(duint Start, duint End, bool Manual);
void BookmarkCacheSave(JSON Root);
void BookmarkCacheLoad(JSON Root);
bool BookmarkEnum(BOOKMARKSINFO* List, size_t* Size);

View File

@ -72,7 +72,7 @@ bool CommentDelete(duint Address)
return (comments.erase(ModHashFromAddr(Address)) > 0);
}
void CommentDelRange(duint Start, duint End)
void CommentDelRange(duint Start, duint End, bool Manual)
{
ASSERT_DEBUGGING("Export call");
@ -98,8 +98,8 @@ void CommentDelRange(duint Start, duint End)
for(auto itr = comments.begin(); itr != comments.end();)
{
const auto & currentComment = itr->second;
// Ignore manually set entries
if(currentComment.manual)
// Ignore non-matching entries
if(Manual ? !currentComment.manual : currentComment.manual)
{
++itr;
continue;

View File

@ -14,7 +14,7 @@ struct COMMENTSINFO
bool CommentSet(duint Address, const char* Text, bool Manual);
bool CommentGet(duint Address, char* Text);
bool CommentDelete(duint Address);
void CommentDelRange(duint Start, duint End);
void CommentDelRange(duint Start, duint End, bool Manual);
void CommentCacheSave(JSON Root);
void CommentCacheLoad(JSON Root);
bool CommentEnum(COMMENTSINFO* List, size_t* Size);

View File

@ -90,7 +90,7 @@ bool LabelDelete(duint Address)
return (labels.erase(ModHashFromAddr(Address)) > 0);
}
void LabelDelRange(duint Start, duint End)
void LabelDelRange(duint Start, duint End, bool Manual)
{
ASSERT_DEBUGGING("Export call");
@ -112,8 +112,8 @@ void LabelDelRange(duint Start, duint End)
for(auto itr = labels.begin(); itr != labels.end();)
{
const auto & currentLabel = itr->second;
// Ignore manually set entries
if(currentLabel.manual)
// Ignore non-matching entries
if(Manual ? !currentLabel.manual : currentLabel.manual)
{
++itr;
continue;

View File

@ -15,7 +15,7 @@ bool LabelSet(duint Address, const char* Text, bool Manual);
bool LabelFromString(const char* Text, duint* Address);
bool LabelGet(duint Address, char* Text);
bool LabelDelete(duint Address);
void LabelDelRange(duint Start, duint End);
void LabelDelRange(duint Start, duint End, bool Manual);
void LabelCacheSave(JSON root);
void LabelCacheLoad(JSON root);
bool LabelEnum(LABELSINFO* List, size_t* Size);