summaryrefslogtreecommitdiff
path: root/function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'function.cpp')
-rw-r--r--function.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/function.cpp b/function.cpp
index 66fd870c..752d0bd1 100644
--- a/function.cpp
+++ b/function.cpp
@@ -246,6 +246,27 @@ void Function::SetCommentForAddress(uint64_t addr, const string& comment)
}
+vector<ReferenceSource> Function::GetCallSites() const
+{
+ size_t count;
+ BNReferenceSource* refs = BNGetFunctionCallSites(m_object, &count);
+
+ vector<ReferenceSource> result;
+ result.reserve(count);
+ for (size_t i = 0; i < count; i++)
+ {
+ ReferenceSource src;
+ src.func = new Function(BNNewFunctionReference(refs[i].func));
+ src.arch = new CoreArchitecture(refs[i].arch);
+ src.addr = refs[i].addr;
+ result.push_back(src);
+ }
+
+ BNFreeCodeReferences(refs, count);
+ return result;
+}
+
+
void Function::AddUserCodeReference(Architecture* fromArch, uint64_t fromAddr, uint64_t toAddr)
{
BNAddUserCodeReference(m_object, fromArch->GetObject(), fromAddr, toAddr);