With this we also see the actual floating-point value and not just the
hexadecimal representation.

Signed-off-by: Vegard Nossum <vegard.nos...@gmail.com>
---
 jit/trace-jit.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/jit/trace-jit.c b/jit/trace-jit.c
index c9bae17..58ff1ad 100644
--- a/jit/trace-jit.c
+++ b/jit/trace-jit.c
@@ -360,17 +360,34 @@ static void print_arg(enum vm_type arg_type, const 
unsigned long *args,
                      int *arg_index)
 {
        if (arg_type == J_LONG || arg_type == J_DOUBLE) {
-               unsigned long long value;
+               union {
+                       unsigned long long ullvalue;
+                       double dvalue;
+               } value;
 
-               value = *(unsigned long long*)(args + *arg_index);
+               value.ullvalue = *(unsigned long long*)(args + *arg_index);
                (*arg_index) += 2;
 
-               trace_printf("0x%llx", value);
+               trace_printf("0x%llx", value.ullvalue);
+
+               if (arg_type == J_DOUBLE)
+                       trace_printf("(%lf)", value.dvalue);
                return;
        }
 
        trace_printf("0x%lx ", args[*arg_index]);
 
+       if (arg_type == J_FLOAT) {
+               union {
+                       unsigned long ulvalue;
+                       float fvalue;
+               } value;
+
+               value.ulvalue = args[*arg_index];
+
+               trace_printf("(%f)", value.fvalue);
+       }
+
        if (arg_type == J_REFERENCE) {
                struct vm_object *obj;
 
-- 
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