From da388dd42cdee70facb084b3012214ca33014fa7 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Sat, 26 Aug 2017 22:23:12 -0400 Subject: Adding Function level comment APIs --- function.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index 550691d0..2d8db04c 100644 --- a/function.cpp +++ b/function.cpp @@ -197,6 +197,15 @@ void Function::MarkRecentUse() } +string Function::GetComment() const +{ + char* comment = BNGetFunctionComment(m_object); + string result = comment; + BNFreeString(comment); + return result; +} + + string Function::GetCommentForAddress(uint64_t addr) const { char* comment = BNGetCommentForAddress(m_object, addr); @@ -217,6 +226,12 @@ vector Function::GetCommentedAddresses() const } +void Function::SetComment(const string& comment) +{ + BNSetFunctionComment(m_object, comment.c_str()); +} + + void Function::SetCommentForAddress(uint64_t addr, const string& comment) { BNSetCommentForAddress(m_object, addr, comment.c_str()); -- cgit v1.3.1