From a514b34d6f708ee80c4f0df91fefa9871d87ad39 Mon Sep 17 00:00:00 2001 From: Theofilos Augoustis Date: Mon, 14 Oct 2024 12:10:00 +0200 Subject: Implement online verification of symbolic backend Co-authored-by: Theofilos Augoustis Co-authored-by: Nicola Crivellin --- tools/_qemu_tool.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools/_qemu_tool.py') diff --git a/tools/_qemu_tool.py b/tools/_qemu_tool.py index e3341ad..b365d39 100644 --- a/tools/_qemu_tool.py +++ b/tools/_qemu_tool.py @@ -58,18 +58,23 @@ class GDBProgramState(ReadableProgramState): } def read_register(self, reg: str) -> int: + if reg == 'RFLAGS': + reg = 'EFLAGS' + try: val = self._frame.read_register(reg.lower()) size = val.type.sizeof * 8 # For vector registers, we need to apply architecture-specific # logic because GDB's interface is not consistent. - if size > 64: # Value is a vector + if size >= 128: # Value is a vector if self.arch.archname not in self.read_vector_reg: raise NotImplementedError( f'Reading vector registers is not implemented for' f' architecture {self.arch.archname}.') return self.read_vector_reg[self.arch.archname](val, size) + elif size < 64: + return int(val.cast(gdb.lookup_type('unsigned int'))) # For non-vector values, just return the 64-bit value return int(val.cast(gdb.lookup_type('unsigned long'))) except ValueError as err: -- cgit 1.4.1