about summary refs log tree commit diff stats
path: root/miasm2/arch
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/arch')
-rw-r--r--miasm2/arch/mep/jit.py4
-rw-r--r--miasm2/arch/x86/jit.py8
2 files changed, 8 insertions, 4 deletions
diff --git a/miasm2/arch/mep/jit.py b/miasm2/arch/mep/jit.py
index 913d508f..6c0e6ff5 100644
--- a/miasm2/arch/mep/jit.py
+++ b/miasm2/arch/mep/jit.py
@@ -43,11 +43,11 @@ class mep_CGen(CGen):
 
         return out
 
-    def gen_post_code(self, attrib):
+    def gen_post_code(self, attrib, pc_value):
         """Generate C code inserted after the current bloc"""
 
         # Call the base class method
-        out = super(mep_CGen, self).gen_post_code(attrib)
+        out = super(mep_CGen, self).gen_post_code(attrib, pc_value)
 
         # Implement the *REPEAT instructions logics
         tmp = r"""
diff --git a/miasm2/arch/x86/jit.py b/miasm2/arch/x86/jit.py
index d775cff5..f0a9875e 100644
--- a/miasm2/arch/x86/jit.py
+++ b/miasm2/arch/x86/jit.py
@@ -20,16 +20,20 @@ class x86_32_CGen(CGen):
         self.translator = TranslatorC(self.ir_arch.loc_db)
         self.init_arch_C()
 
-    def gen_post_code(self, attrib):
+    def gen_post_code(self, attrib, pc_value):
         out = []
         if attrib.log_regs:
+            # Update PC for dump_gpregs
+            out.append("%s = %s;" % (self.C_PC, pc_value))
             out.append('dump_gpregs_32(jitcpu->cpu);')
         return out
 
 class x86_64_CGen(x86_32_CGen):
-    def gen_post_code(self, attrib):
+    def gen_post_code(self, attrib, pc_value):
         out = []
         if attrib.log_regs:
+            # Update PC for dump_gpregs
+            out.append("%s = %s;" % (self.C_PC, pc_value))
             out.append('dump_gpregs_64(jitcpu->cpu);')
         return out