Fix printing for GNAT stuff for types that do not have descr. types
authorPierre-Marie de Rodat <derodat@adacore.com>
Fri, 24 Apr 2015 14:13:19 +0000 (16:13 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 24 Apr 2015 14:14:17 +0000 (16:14 +0200)
gdb/ChangeLog:
2015-04-24  Pierre-Marie de Rodat  <derodat@adacore.com>

* gdbtypes.c (print_gnat_stuff): Do not recurse on the
descriptive type when there is none.

gdb/ChangeLog
gdb/gdbtypes.c

index f518c6c797d9f210b4e2b52d9bb3a16b51eb3d96..ff2e2463fda02aee7e64a1ba8215732593710246 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-24  Pierre-Marie de Rodat  <derodat@adacore.com>
+
+       * gdbtypes.c (print_gnat_stuff): Do not recurse on the
+       descriptive type when there is none.
+
 2015-04-23  Patrick Palka  <patrick@parcs.ath.cx>
 
        * tui/tui-win.c (tui_async_resize_screen): Call
index 217ec7007e7e69ef1082d0b144fe271fccdabf00..103b4e22eaad73596530862b5598ceb773367c11 100644 (file)
@@ -3888,7 +3888,13 @@ print_gnat_stuff (struct type *type, int spaces)
 {
   struct type *descriptive_type = TYPE_DESCRIPTIVE_TYPE (type);
 
-  recursive_dump_type (descriptive_type, spaces + 2);
+  if (descriptive_type == NULL)
+    printfi_filtered (spaces + 2, "no descriptive type\n");
+  else
+    {
+      printfi_filtered (spaces + 2, "descriptive type\n");
+      recursive_dump_type (descriptive_type, spaces + 4);
+    }
 }
 
 static struct obstack dont_print_type_obstack;