summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2025-09-09 19:53:59 -0400
committerGlenn Smith <glenn@vector35.com>2025-09-09 20:52:01 -0400
commit9088469789695122956458778715580014958241 (patch)
tree1daa61982039191553d1eeac2b4a8f3240db1443 /python/mediumlevelil.py
parent2981774781039815538411794666534715667162 (diff)
Python: Update docs for label / transformation functions
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index ba604aae..18e0f718 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -5903,6 +5903,7 @@ class MediumLevelILFunction:
"""
``prepare_to_copy_function`` sets up state in this MLIL function in preparation
of copying instructions from ``src``
+ It enables use of :py:func:`get_label_for_source_instruction` during function transformation.
:param MediumLevelILFunction src: function about to be copied from
"""
@@ -5912,6 +5913,7 @@ class MediumLevelILFunction:
"""
``prepare_to_copy_block`` sets up state when copying a function in preparation
of copying the instructions from the block ``src``
+ It enables use of :py:func:`get_label_for_source_instruction` during function transformation.
:param MediumLevelILBasicBlock src: block about to be copied from
"""
@@ -5919,8 +5921,14 @@ class MediumLevelILFunction:
def get_label_for_source_instruction(self, i: InstructionIndex) -> Optional['MediumLevelILLabel']:
"""
- Get the MediumLevelILLabel for a given source instruction. The returned label is to an internal object with
- the same lifetime as the containing MediumLevelILFunction.
+ Get the MediumLevelILLabel for a given source instruction. The source instruction must be
+ at the start of a basic block in the source function passed to :py:func:`prepare_to_copy_function`.
+ The label will be marked resolved when its source block is passed to :py:func:`prepare_to_copy_block`.
+
+ .. warning:: The instruction index parameter for this pertains to the *source function*
+ passed to `prepare_to_copy_function`, not the current function.
+
+ .. note:: The returned label is to an internal object with the same lifetime as the containing MediumLevelILFunction.
:param i: The source instruction index
:return: The MediumLevelILLabel for the source instruction