about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-09-29 10:39:40 +0000
committerTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-09-29 10:39:40 +0000
commit25e44d6ddf290db968db381b12d59b8b690b1721 (patch)
tree11ff01eb8b6ac67fc825dd81af2b0b95337a75be
parentcbf212bbb4ce51c09326bed44b462529f147820a (diff)
downloadfocaccia-25e44d6ddf290db968db381b12d59b8b690b1721.tar.gz
focaccia-25e44d6ddf290db968db381b12d59b8b690b1721.zip
Add basic reproducer for issue 2248 with Focaccia (hacked, does not work yet)
-rw-r--r--reproducers/issue-2248.S11
-rw-r--r--reproducers/issue-2248.c10
-rw-r--r--src/focaccia/lldb_target.py2
-rw-r--r--src/focaccia/symbolic.py6
4 files changed, 28 insertions, 1 deletions
diff --git a/reproducers/issue-2248.S b/reproducers/issue-2248.S
new file mode 100644
index 0000000..0bd3600
--- /dev/null
+++ b/reproducers/issue-2248.S
@@ -0,0 +1,11 @@
+.global callme
+callme:
+  cmp   x2, x3
+  cset  x12, lt
+  and   w11, w12, #0xff
+  cmp   w11, #0x0
+  csetm x14, ne
+  lsr   x13, x14, x4
+  sxtb  x0, w13
+  ret
+
diff --git a/reproducers/issue-2248.c b/reproducers/issue-2248.c
new file mode 100644
index 0000000..03948df
--- /dev/null
+++ b/reproducers/issue-2248.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+unsigned long long callme(unsigned long long _1, unsigned long long _2, unsigned long long a, unsigned long long b, unsigned long long c);
+
+int main() {
+    unsigned long long ret = callme(0, 0, 0, 1, 2);
+	printf("%lld\n", ret);
+    return 0;
+}
+
diff --git a/src/focaccia/lldb_target.py b/src/focaccia/lldb_target.py
index 1f31337..a6f61bb 100644
--- a/src/focaccia/lldb_target.py
+++ b/src/focaccia/lldb_target.py
@@ -187,6 +187,8 @@ class LLDBConcreteTarget:
                                       the register's value.
         """
         try:
+            if 'Q' in regname:
+                regname = 'V' + regname[1:]
             reg = self._get_register(regname)
             assert(reg.IsValid())
             if reg.size > 8:  # reg is a vector register
diff --git a/src/focaccia/symbolic.py b/src/focaccia/symbolic.py
index 9aeff56..444145f 100644
--- a/src/focaccia/symbolic.py
+++ b/src/focaccia/symbolic.py
@@ -594,10 +594,14 @@ class _LLDBConcreteState(ReadableProgramState):
 
     def read_register(self, reg: str) -> int:
         regname = self.arch.to_regname(reg)
-        if regname is None:
+        if regname is None and reg != "DCZID_EL0" and reg != "TPIDR_EL0":
             raise RegisterAccessError(reg, f'Not a register name: {reg}')
 
         try:
+            if reg == "DCZID_EL0":
+                return 4
+            if reg == "TPIDR_EL0":
+                return 0x4206c8
             return self._target.read_register(regname)
         except ConcreteRegisterError:
             raise RegisterAccessError(regname, '')