diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2020-06-19 13:58:50 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2020-06-19 13:58:50 -0400 |
| commit | 409d3f7e976ed1ab67afc7d7d04b87ce82bba143 (patch) | |
| tree | 4b2d21e29c10c3a5b95ee88db6669d11df427dc9 /python | |
| parent | abb6966add9a013f0bbe52c84a5da30ca568932e (diff) | |
add callers/callees documentation, fixes #1687
Diffstat (limited to 'python')
| -rw-r--r-- | python/function.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/python/function.py b/python/function.py index 114881cf..15f67b35 100644 --- a/python/function.py +++ b/python/function.py @@ -2429,9 +2429,9 @@ class Function(object): @property def call_sites(self): """ - ``call_sites`` returns a list of possible call sites. + ``call_sites`` returns a list of possible call sites contained in this function. This includes ordinary calls, tail calls, and indirect jumps. Not all of the returned call sites - may be true call sites; some may simply be unresolved indirect jumps. + are necessarily true call sites; some may simply be unresolved indirect jumps, for example. :return: List of References that represent the sources of possible calls in this function :rtype: list(ReferenceSource) @@ -2455,6 +2455,13 @@ class Function(object): @property def callees(self): + """ + ``callees`` returns a list of functions that this function calls + This does not include the address of those calls, rather just the function objects themselves. Use :py:meth:`call_sites` to identify the location of these calls. + + :return: List of Functions that this function calls + :rtype: list(Function) + """ called = [] for callee_addr in self.callee_addresses: func = self.view.get_function_at(callee_addr, self.platform) @@ -2464,6 +2471,13 @@ class Function(object): @property def callee_addresses(self): + """ + ``callee_addressses`` returns a list of start addresses for 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 reference. + + :return: List of start addresess for Functions that call this function + :rtype: list(int) + """ result = [] for ref in self.call_sites: result.extend(self.view.get_callees(ref.address, ref.function, ref.arch)) @@ -2471,6 +2485,13 @@ class Function(object): @property def callers(self): + """ + ``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 + :rtype: list(int) + """ functions = [] for ref in self.view.get_code_refs(self.start): if ref.function is not None: |
