OSDN Git Service

Approved by Jim Blandy:
authorFred Fish <fnf@specifix.com>
Wed, 12 Dec 2001 02:07:12 +0000 (02:07 +0000)
committerFred Fish <fnf@specifix.com>
Wed, 12 Dec 2001 02:07:12 +0000 (02:07 +0000)
2001-12-11  Fred Fish  <fnf@redhat.com>

* gdbtypes.c (print_bound_type): New function.
(recursive_dump_type): Print type struct code values
TYPE_CODE_BITSTRING, TYPE_CODE_COMPLEX, TYPE_CODE_TEMPLATE,
and TYPE_CODE_TEMPLATE_ARG.
(recursive_dump_type): Print type struct members
upper_bound_type, lower_bound_type, cv_type, and as_type.
Also always print the tagname member, even when it is NULL.

* testsuite/gdb.base/maint.exp: Update to match changes in
type dumping code.

gdb/ChangeLog
gdb/gdbtypes.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/maint.exp

index 3568f10..ee86924 100644 (file)
@@ -1,3 +1,13 @@
+2001-12-11  Fred Fish  <fnf@redhat.com>
+
+       * gdbtypes.c (print_bound_type): New function.
+       (recursive_dump_type): Print type struct code values
+       TYPE_CODE_BITSTRING, TYPE_CODE_COMPLEX, TYPE_CODE_TEMPLATE,
+       and TYPE_CODE_TEMPLATE_ARG.
+       (recursive_dump_type): Print type struct members
+       upper_bound_type, lower_bound_type, cv_type, and as_type.
+       Also always print the tagname member, even when it is NULL.
+
 2001-12-11  Michael Snyder  <msnyder@redhat.com>
 
        * d10v-tdep.c (d10v_register_virtual_size): Delete.
index 9a276d3..a46f9ce 100644 (file)
@@ -2711,6 +2711,35 @@ print_cplus_stuff (struct type *type, int spaces)
     }
 }
 
+static void
+print_bound_type (int bt)
+{
+  switch (bt)
+    {
+    case BOUND_CANNOT_BE_DETERMINED:
+      printf_filtered ("(BOUND_CANNOT_BE_DETERMINED)");
+      break;
+    case BOUND_BY_REF_ON_STACK:
+      printf_filtered ("(BOUND_BY_REF_ON_STACK)");
+      break;
+    case BOUND_BY_VALUE_ON_STACK:
+      printf_filtered ("(BOUND_BY_VALUE_ON_STACK)");
+      break;
+    case BOUND_BY_REF_IN_REG:
+      printf_filtered ("(BOUND_BY_REF_IN_REG)");
+      break;
+    case BOUND_BY_VALUE_IN_REG:
+      printf_filtered ("(BOUND_BY_VALUE_IN_REG)");
+      break;
+    case BOUND_SIMPLE:
+      printf_filtered ("(BOUND_SIMPLE)");
+      break;
+    default:
+      printf_filtered ("(unknown bound type)");
+      break;
+    }
+}
+
 static struct obstack dont_print_type_obstack;
 
 void
@@ -2751,13 +2780,10 @@ recursive_dump_type (struct type *type, int spaces)
                    TYPE_NAME (type) ? TYPE_NAME (type) : "<NULL>");
   gdb_print_host_address (TYPE_NAME (type), gdb_stdout);
   printf_filtered (")\n");
-  if (TYPE_TAG_NAME (type) != NULL)
-    {
-      printfi_filtered (spaces, "tagname '%s' (",
-                       TYPE_TAG_NAME (type));
-      gdb_print_host_address (TYPE_TAG_NAME (type), gdb_stdout);
-      printf_filtered (")\n");
-    }
+  printfi_filtered (spaces, "tagname '%s' (",
+                   TYPE_TAG_NAME (type) ? TYPE_TAG_NAME (type) : "<NULL>");
+  gdb_print_host_address (TYPE_TAG_NAME (type), gdb_stdout);
+  printf_filtered (")\n");
   printfi_filtered (spaces, "code 0x%x ", TYPE_CODE (type));
   switch (TYPE_CODE (type))
     {
@@ -2800,6 +2826,9 @@ recursive_dump_type (struct type *type, int spaces)
     case TYPE_CODE_STRING:
       printf_filtered ("(TYPE_CODE_STRING)");
       break;
+    case TYPE_CODE_BITSTRING:
+      printf_filtered ("(TYPE_CODE_BITSTRING)");
+      break;
     case TYPE_CODE_ERROR:
       printf_filtered ("(TYPE_CODE_ERROR)");
       break;
@@ -2818,15 +2847,32 @@ recursive_dump_type (struct type *type, int spaces)
     case TYPE_CODE_BOOL:
       printf_filtered ("(TYPE_CODE_BOOL)");
       break;
+    case TYPE_CODE_COMPLEX:
+      printf_filtered ("(TYPE_CODE_COMPLEX)");
+      break;
     case TYPE_CODE_TYPEDEF:
       printf_filtered ("(TYPE_CODE_TYPEDEF)");
       break;
+    case TYPE_CODE_TEMPLATE:
+      printf_filtered ("(TYPE_CODE_TEMPLATE)");
+      break;
+    case TYPE_CODE_TEMPLATE_ARG:
+      printf_filtered ("(TYPE_CODE_TEMPLATE_ARG)");
+      break;
     default:
       printf_filtered ("(UNKNOWN TYPE CODE)");
       break;
     }
   puts_filtered ("\n");
   printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
+  printfi_filtered (spaces, "upper_bound_type 0x%x ",
+                   TYPE_ARRAY_UPPER_BOUND_TYPE (type));
+  print_bound_type (TYPE_ARRAY_UPPER_BOUND_TYPE (type));
+  puts_filtered ("\n");
+  printfi_filtered (spaces, "lower_bound_type 0x%x ",
+                   TYPE_ARRAY_LOWER_BOUND_TYPE (type));
+  print_bound_type (TYPE_ARRAY_LOWER_BOUND_TYPE (type));
+  puts_filtered ("\n");
   printfi_filtered (spaces, "objfile ");
   gdb_print_host_address (TYPE_OBJFILE (type), gdb_stdout);
   printf_filtered ("\n");
@@ -2843,6 +2889,12 @@ recursive_dump_type (struct type *type, int spaces)
   printfi_filtered (spaces, "reference_type ");
   gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
   printf_filtered ("\n");
+  printfi_filtered (spaces, "cv_type ");
+  gdb_print_host_address (TYPE_CV_TYPE (type), gdb_stdout);
+  printf_filtered ("\n");
+  printfi_filtered (spaces, "as_type ");
+  gdb_print_host_address (TYPE_AS_TYPE (type), gdb_stdout);
+  printf_filtered ("\n");
   printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
   if (TYPE_UNSIGNED (type))
     {
index 6b1e367..3606b56 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-10  Fred Fish  <fnf@redhat.com>
+
+       * gdb.base/maint.exp: Update to match changes in type dumping code.
+
 2001-12-10  Jim Blandy  <jimb@redhat.com>
 
        * gdb.asm/asm-source.exp (info symbol): Anchor the pattern
index a4bafe5..145f71d 100644 (file)
@@ -345,7 +345,7 @@ set timeout $old_timeout
 
 send_gdb "maint print type argc\n"
 gdb_expect  {
-        -re "type node $hex\r\nname .int. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\
+        -re "type node $hex\r\nname .int. \\($hex\\)\r\ntagname .<NULL>. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nupper_bound_type $hex \\(BOUND_SIMPLE\\)\r\nlower_bound_type $hex \\(BOUND_SIMPLE\\)\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ncv_type $hex\r\nas_type $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\
                         { pass "maint print type" }
         -re ".*$gdb_prompt $"       { fail "maint print type" }
         timeout         { fail "(timeout) maint print type" }