gdb: remove duplicate declaration of 'find_thread_ptid'
[deliverable/binutils-gdb.git] / gdb / m2-valprint.c
index fdccbaf500d30ad62b00d1972b042fe6272e10e0..be21cbb014a036ff88fc7c0d4c551a7f92c64644 100644 (file)
@@ -1,6 +1,6 @@
 /* Support for printing Modula 2 values for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2020 Free Software Foundation, Inc.
+   Copyright (C) 1986-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -42,7 +42,7 @@ m2_print_array_contents (struct value *val,
 
 
 /* get_long_set_bounds - assigns the bounds of the long set to low and
-                         high.  */
+                        high.  */
 
 int
 get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high)
@@ -97,7 +97,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
 
   target = TYPE_TARGET_TYPE (range);
 
-  if (get_discrete_bounds (range, &field_low, &field_high) >= 0)
+  if (get_discrete_bounds (range, &field_low, &field_high))
     {
       for (i = low_bound; i <= high_bound; i++)
        {
@@ -137,7 +137,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
              if (field == len)
                break;
              range = type->field (field).type ()->index_type ();
-             if (get_discrete_bounds (range, &field_low, &field_high) < 0)
+             if (!get_discrete_bounds (range, &field_low, &field_high))
                break;
              target = TYPE_TARGET_TYPE (range);
            }
@@ -186,7 +186,7 @@ print_unpacked_pointer (struct type *type,
                        const struct value_print_options *options,
                        struct ui_file *stream)
 {
-  struct gdbarch *gdbarch = get_type_arch (type);
+  struct gdbarch *gdbarch = type->arch ();
   struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
   int want_space = 0;
 
@@ -228,7 +228,7 @@ print_variable_at_address (struct type *type,
                           int recurse,
                           const struct value_print_options *options)
 {
-  struct gdbarch *gdbarch = get_type_arch (type);
+  struct gdbarch *gdbarch = type->arch ();
   CORE_ADDR addr = unpack_pointer (type, valaddr);
   struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
 
@@ -249,10 +249,10 @@ print_variable_at_address (struct type *type,
 
 
 /* m2_print_array_contents - prints out the contents of an
-                             array up to a max_print values.
-                             It prints arrays of char as a string
-                             and all other data types as comma
-                             separated values.  */
+                            array up to a max_print values.
+                            It prints arrays of char as a string
+                            and all other data types as comma
+                            separated values.  */
 
 static void
 m2_print_array_contents (struct value *val,
@@ -324,7 +324,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
              && (options->format == 0 || options->format == 's'))
            {
              /* If requested, look for the first null char and only print
-                elements up to it.  */
+                elements up to it.  */
              if (options->stop_print_at_null)
                {
                  unsigned int temp_len;
@@ -399,7 +399,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
 
          fputs_filtered ("{", stream);
 
-         i = get_discrete_bounds (range, &low_bound, &high_bound);
+         i = get_discrete_bounds (range, &low_bound, &high_bound) ? 0 : -1;
        maybe_bad_bstring:
          if (i < 0)
            {
This page took 0.027205 seconds and 4 git commands to generate.