This adds support for proper disassembling of generated code on x86-64.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munte...@linux360.ro>
---
 arch/x86/disassemble.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/arch/x86/disassemble.c b/arch/x86/disassemble.c
index bdd068c..3200fca 100644
--- a/arch/x86/disassemble.c
+++ b/arch/x86/disassemble.c
@@ -42,6 +42,10 @@
 #include <dis-asm.h>
 #include <stdarg.h>
 
+#ifdef CONFIG_X86_32
+
+# define JIT_BFD_MACH  bfd_mach_i386_i386
+
 char *regs[] = {
        "eax",
        "ecx",
@@ -53,6 +57,30 @@ char *regs[] = {
        "edi"
 };
 
+#else /* CONFIG_X86_32 */
+
+# define JIT_BFD_MACH  bfd_mach_x86_64
+
+char *regs[] = {
+       "rax",
+       "rcx",
+       "rdx",
+       "rbx",
+       "rsp",
+       "rbp",
+       "rsi",
+       "rdi",
+       "r8",
+       "r9",
+       "r10",
+       "r11",
+       "r12",
+       "r13",
+       "r14",
+       "r15"
+};
+
+#endif /* CONFIG_X86_32 */
 
 /* disassinstr 
*****************************************************************
 
@@ -74,7 +102,7 @@ unsigned char *disassinstr(struct compilation_unit *cu, 
unsigned char *code)
                /* setting the struct members must be done after
                   INIT_DISASSEMBLE_INFO */
 
-               info.mach             = bfd_mach_i386_i386;
+               info.mach             = JIT_BFD_MACH;
                info.read_memory_func = &disass_buffer_read_memory;
 
                disass_initialized = 1;
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to