summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-10-12 15:47:36 -0400
committerPeter LaFosse <peter@vector35.com>2021-10-12 15:47:36 -0400
commit093d8c73802023895ba02967a739802b4465a6ba (patch)
treef54354964b26c22bf59bc1b81246124c4675c0f0
parentfa1e87229726fbf8f30c09ba53f5be8cece81729 (diff)
Add test for stack adjustment
-rw-r--r--suite/testcommon.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/suite/testcommon.py b/suite/testcommon.py
index 6bf745e4..0106f533 100644
--- a/suite/testcommon.py
+++ b/suite/testcommon.py
@@ -327,13 +327,17 @@ class BinaryViewTestBuilder(Builder):
"""Function stack produced different output"""
funcinfo = []
for func in self.bv.functions:
+ for i, var in enumerate(func.stack_layout):
+ funcinfo.append(f"Function: {func.start:x} Stack position {i}: {var}")
+
+ funcinfo.append(f"Function: {func.start:x} Stack adjustment: {func.stack_adjustment}")
+ funcinfo.append(f"Function: {func.start:x} Register stack adjustment: {func.reg_stack_adjustments}")
+
func.stack_adjustment = func.stack_adjustment
func.reg_stack_adjustments = func.reg_stack_adjustments
func.create_user_stack_var(0, binja.Type.int(4), "testuservar")
func.create_auto_stack_var(4, binja.Type.int(4), "testautovar")
- for i, var in enumerate(func.stack_layout):
- funcinfo.append(f"Function: {func.start:x} Stack position {i}: {var}")
funcinfo.append(f"Function: {func.start:x} Stack content sample: {func.get_stack_contents_at(func.start + 0x10, 0, 0x10)}")
funcinfo.append(f"Function: {func.start:x} Stack content range sample: {func.get_stack_contents_after(func.start + 0x10, 0, 0x10)}")