2002-05-14 Radek Doulik <rodo@ximian.com>
authorRadek Doulik <rodo@mono-cvs.ximian.com>
Tue, 14 May 2002 15:51:15 +0000 (15:51 -0000)
committerRadek Doulik <rodo@mono-cvs.ximian.com>
Tue, 14 May 2002 15:51:15 +0000 (15:51 -0000)
* interp.c: introduced new --noptr option to suppres pointer
address printing. I find this useful for comparing trace outputs
while porting to ppc

svn path=/trunk/mono/; revision=4632

mono/interpreter/ChangeLog
mono/interpreter/interp.c

index 916b1d8c59015db772e975d8454ba4176b46d447..6112ba71363cdee6ccf198827f1d16aa55069082 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-14  Radek Doulik  <rodo@ximian.com>
+
+       * interp.c: introduced new --noptr option to suppres pointer
+       address printing. I find this useful for comparing trace outputs
+       while porting to ppc
 
 Tue May 14 16:37:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
 
index 1df0a0327a7e7530119f4ad4fd78ce1323b2afe3..ba69a96f839c59f21288fec7d581f2fa3cca2ee4 100644 (file)
@@ -64,6 +64,7 @@
 
 /* If true, then we output the opcodes as we interpret them */
 static int global_tracing = 0;
+static int global_no_pointers = 0;
 
 static int debug_indent_level = 0;
 
@@ -139,7 +140,10 @@ db_match_method (gpointer data, gpointer user_data)
                debug_indent_level++;   \
                output_indent ();       \
                g_print ("(%d) Entering %s.%s::%s (", GetCurrentThreadId(), klass->name_space, klass->name, frame->method->name);       \
-               if (signature->hasthis) g_print ("%p ", frame->obj);    \
+               if (signature->hasthis) if (global_no_pointers) { \
+                       g_print ("this "); \
+               } else { \
+                       g_print ("%p ", frame->obj); }  \
                g_print ("%s)\n", args);        \
                g_free (args);  \
        }       \
@@ -612,7 +616,12 @@ dump_stack (stackval *stack, stackval *sp)
                case VAL_I32: g_string_sprintfa (str, "[%d] ", s->data.i); break;
                case VAL_I64: g_string_sprintfa (str, "[%lld] ", s->data.l); break;
                case VAL_DOUBLE: g_string_sprintfa (str, "[%0.5f] ", s->data.f); break;
-               case VAL_VALUET: g_string_sprintfa (str, "[vt: %p] ", s->data.vt.vt); break;
+               case VAL_VALUET:
+                       if (!global_no_pointers)
+                               g_string_sprintfa (str, "[vt: %p] ", s->data.vt.vt);
+                       else
+                               g_string_sprintfa (str, "[vt] ");
+                       break;
 #if 0
                case VAL_OBJ: {
                        MonoObject *obj =  s->data.p;
@@ -624,7 +633,12 @@ dump_stack (stackval *stack, stackval *sp)
                        }
                }
 #endif
-               default: g_string_sprintfa (str, "[%p] ", s->data.p); break;
+               default:
+                       if (!global_no_pointers)
+                               g_string_sprintfa (str, "[%p] ", s->data.p);
+                       else
+                               g_string_sprintfa (str, "[ptr] ");
+                       break;
                }
                ++s;
        }
@@ -3903,6 +3917,8 @@ main (int argc, char *argv [])
        for (i = 1; i < argc && argv [i][0] == '-'; i++){
                if (strcmp (argv [i], "--trace") == 0)
                        global_tracing = 1;
+               if (strcmp (argv [i], "--noptr") == 0)
+                       global_no_pointers = 1;
                if (strcmp (argv [i], "--traceops") == 0)
                        global_tracing = 2;
                if (strcmp (argv [i], "--dieonex") == 0)