Author: rgrjr
Date: Sun May  6 19:46:04 2007
New Revision: 18445

Modified:
   trunk/src/debug.c

Log:
* src/debug.c:
   + (PDB_disassemble_op):  Include the symbolic op name after the
     dispatch arg to an "infix" or "n_infix" op.  This makes it easy to
     figure out what it does, but without hiding the real instruction.


Modified: trunk/src/debug.c
==============================================================================
--- trunk/src/debug.c   (original)
+++ trunk/src/debug.c   Sun May  6 19:46:04 2007
@@ -1447,6 +1447,19 @@
             assert(size + 20 < space);
             sprintf(&dest[size], INTVAL_FMT, i);
             size += strlen(&dest[size]);
+
+            /* If this is a constant dispatch arg to an "infix" op, then show
+               the corresponding symbolic op name. */
+            if (j == 1 && info->types[j-1] == PARROT_ARG_IC
+                && (strcmp(info->name, "infix") == 0
+                    || strcmp(info->name, "n_infix") == 0)) {
+                assert(size + 20 < space);
+                sprintf(&dest[size], " [%s]",
+                        /* [kludge: the "2+" skips the leading underscores.  --
+                           rgr, 6-May-07.] */
+                        2+Parrot_MMD_method_name(interp, op[j]));
+                size += strlen(&dest[size]);
+            }
             break;
         case PARROT_ARG_NC:
             /* Convert the float to a string */

Reply via email to