about summary refs log tree commit diff stats
path: root/miasm2/arch/x86/jit.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2019-01-14 12:42:04 +0100
committerGitHub <noreply@github.com>2019-01-14 12:42:04 +0100
commit056ef4cd26c98cd8b9c121f2a791c01c5a7052a8 (patch)
tree322b5bfa158bf165b9bae70dd5d2d62cffbf363c /miasm2/arch/x86/jit.py
parente336cf92c44bf87c09a18bdafb716ef398077fda (diff)
parentfcdc5f9e1f48c284c8626112c802868313afaa2e (diff)
downloadmiasm-056ef4cd26c98cd8b9c121f2a791c01c5a7052a8.tar.gz
miasm-056ef4cd26c98cd8b9c121f2a791c01c5a7052a8.zip
Merge pull request #935 from serpilliere/fix_jit_pc_updt
Jitter: fix pc update in trace mode
Diffstat (limited to '')
-rw-r--r--miasm2/arch/x86/jit.py8
1 files changed, 6 insertions, 2 deletions
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