summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2022-06-23 13:57:56 -0400
committerPeter LaFosse <peter@vector35.com>2022-07-03 08:10:29 -0400
commitce335c283f87297855bd9360e7063f3b8ef34afc (patch)
tree7c7849153875187251d1dee02350fd2ab0b4c150 /python/function.py
parent449595e320957a25e136605e04792d4f1237e7ac (diff)
Add some helper routines for getting the IL of callsites
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/python/function.py b/python/function.py
index 4d859683..c43a5868 100644
--- a/python/function.py
+++ b/python/function.py
@@ -3120,7 +3120,7 @@ class Function:
``callers`` returns a list of functions that call this function
Does not point to the actual address where the call occurs, just the start of the function that contains the call.
- :return: List of start addresess for Functions that call this function
+ :return: List of start addresses for Functions that call this function
:rtype: list(int)
"""
functions = []
@@ -3130,6 +3130,17 @@ class Function:
return functions
@property
+ def caller_sites(self) -> Generator['ReferenceSource', None, None]:
+ """
+ ``caller_sites`` returns a list of ReferenceSource objects corresponding to the addresses
+ in functions which reference this function
+
+ :return: List of start ReferenceSource objects of the call sites to this function
+ :rtype: list(int)
+ """
+ return self.view.get_code_refs(self.start)
+
+ @property
def workflow(self):
handle = core.BNGetWorkflowForFunction(self.handle)
if handle is None: