Add testcase for PR/24065.
[deliverable/binutils-gdb.git] / gdb / m2-typeprint.c
index 0dd6f19fc7a1b00cd31adae16c732d7768bc3f49..754fb657afda6a4ebb7fd5657c3cfa8eb58d87ef 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for printing Modula 2 types for GDB, the GNU debugger.
-   Copyright (C) 1986-2017 Free Software Foundation, Inc.
+   Copyright (C) 1986-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -439,22 +439,14 @@ m2_long_set (struct type *type, struct ui_file *stream, int show, int level,
 
   if (m2_is_long_set (type))
     {
-      if (TYPE_TAG_NAME (type) != NULL)
-       {
-         fputs_filtered (TYPE_TAG_NAME (type), stream);
-         if (show == 0)
-           return 1;
-       }
-      else if (TYPE_NAME (type) != NULL)
+      if (TYPE_NAME (type) != NULL)
        {
          fputs_filtered (TYPE_NAME (type), stream);
          if (show == 0)
            return 1;
+         fputs_filtered (" = ", stream);
        }
 
-      if (TYPE_TAG_NAME (type) != NULL || TYPE_NAME (type) != NULL)
-       fputs_filtered (" = ", stream);
-
       if (get_long_set_bounds (type, &low, &high))
        {
          fprintf_filtered(stream, "SET OF ");
@@ -537,11 +529,11 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
                  int level, const struct type_print_options *flags)
 {
   /* Print the tag if it exists.  */
-  if (TYPE_TAG_NAME (type) != NULL)
+  if (TYPE_NAME (type) != NULL)
     {
-      if (!startswith (TYPE_TAG_NAME (type), "$$"))
+      if (!startswith (TYPE_NAME (type), "$$"))
        {
-         fputs_filtered (TYPE_TAG_NAME (type), stream);
+         fputs_filtered (TYPE_NAME (type), stream);
          if (show > 0)
            fprintf_filtered (stream, " = ");
        }
@@ -601,10 +593,10 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level)
   if (show < 0)
     {
       /* If we just printed a tag name, no need to print anything else.  */
-      if (TYPE_TAG_NAME (type) == NULL)
+      if (TYPE_NAME (type) == NULL)
        fprintf_filtered (stream, "(...)");
     }
-  else if (show > 0 || TYPE_TAG_NAME (type) == NULL)
+  else if (show > 0 || TYPE_NAME (type) == NULL)
     {
       fprintf_filtered (stream, "(");
       len = TYPE_NFIELDS (type);
This page took 0.024399 seconds and 4 git commands to generate.