gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 1 Feb 2011 18:56:34 +0000 (18:56 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 1 Feb 2011 18:56:34 +0000 (18:56 +0000)
Fix debug printing of TYPE_INSTANCE.
* expprint.c (print_subexp_standard) <TYPE_INSTANCE>: New.
(dump_subexp_body_standard) <TYPE_INSTANCE>: New.

gdb/ChangeLog
gdb/expprint.c

index f68051c..84013cb 100644 (file)
@@ -1,5 +1,11 @@
 2011-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
+       Fix debug printing of TYPE_INSTANCE.
+       * expprint.c (print_subexp_standard) <TYPE_INSTANCE>: New.
+       (dump_subexp_body_standard) <TYPE_INSTANCE>: New.
+
+2011-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
        Fix debug printing of BINOP_IN, OP_OBJC_MSGCALL,
        OP_F77_UNDETERMINED_ARGLIST, OP_COMPLEX, OP_OBJC_SELECTOR, OP_NAME,
        OP_OBJC_NSSTRING, OP_F90_RANGE and OP_DECFLOAT.
index 1d2ce85..a6c13f9 100644 (file)
@@ -534,6 +534,27 @@ print_subexp_standard (struct expression *exp, int *pos,
       fprintf_unfiltered (stream, ")");
       return;
 
+    case TYPE_INSTANCE:
+      {
+       LONGEST count = exp->elts[pc + 1].longconst;
+
+       /* The COUNT.  */
+       (*pos)++;
+       fputs_unfiltered ("TypesInstance(", stream);
+       while (count-- > 0)
+         {
+           type_print (exp->elts[(*pos)++].type, "", stream, 0);
+           if (count > 0)
+             fputs_unfiltered (",", stream);
+         }
+       fputs_unfiltered (",", stream);
+       /* Ending COUNT and ending TYPE_INSTANCE.  */
+       (*pos) += 2;
+       print_subexp (exp, pos, stream, PREC_PREFIX);
+       fputs_unfiltered (")", stream);
+       return;
+      }
+
       /* Default ops */
 
     default:
@@ -937,6 +958,29 @@ dump_subexp_body_standard (struct expression *exp,
        elt += 4 + BYTES_TO_EXP_ELEM (len + 1);
       }
       break;
+    case TYPE_INSTANCE:
+      {
+       char *elem_name;
+       LONGEST len;
+
+       len = exp->elts[elt++].longconst;
+       fprintf_filtered (stream, "%s TypeInstance: ", plongest (len));
+       while (len-- > 0)
+         {
+           fprintf_filtered (stream, "Type @");
+           gdb_print_host_address (exp->elts[elt].type, stream);
+           fprintf_filtered (stream, " (");
+           type_print (exp->elts[elt].type, NULL, stream, 0);
+           fprintf_filtered (stream, ")");
+           elt++;
+           if (len > 0)
+             fputs_filtered (", ", stream);
+         }
+       /* Ending LEN and ending TYPE_INSTANCE.  */
+       elt += 2;
+       elt = dump_subexp (exp, stream, elt);
+      }
+      break;
     default:
     case OP_NULL:
     case MULTI_SUBSCRIPT: