Fix zero_ext documentation
[deliverable/binutils-gdb.git] / gdb / f-valprint.c
index c3d23833173f8ed255e565179a3f46f83425753b..1438fc660aff827a5c69666eb70f6c394e8d16d6 100644 (file)
@@ -1,7 +1,6 @@
 /* Support for printing Fortran values for GDB, the GNU debugger.
 
-   Copyright (C) 1993-1996, 1998-2000, 2003, 2005-2012 Free Software
-   Foundation, Inc.
+   Copyright (C) 1993-2016 Free Software Foundation, Inc.
 
    Contributed by Motorola.  Adapted from the C definitions by Farooq Butt
    (fmbutt@engage.sps.mot.com), additionally worked over by Stan Shebs.
@@ -22,7 +21,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
@@ -35,8 +33,6 @@
 #include "command.h"
 #include "block.h"
 #include "dictionary.h"
-#include "gdb_assert.h"
-#include "exceptions.h"
 
 extern void _initialize_f_valprint (void);
 static void info_common_command (char *, int);
@@ -128,7 +124,7 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream)
 
   tmp_type = type;
 
-  while ((TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY))
+  while (TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY)
     {
       upper = f77_get_upperbound (tmp_type);
       lower = f77_get_lowerbound (tmp_type);
@@ -268,7 +264,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
   CORE_ADDR addr;
   int index;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_STRING:
@@ -352,7 +348,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
          opts.format = (options->format ? options->format
                         : options->output_format);
          val_print_scalar_formatted (type, valaddr, embedded_offset,
-                                     original_value, options, 0, stream);
+                                     original_value, &opts, 0, stream);
        }
       else
        {
@@ -412,7 +408,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 }
 
 static void
-info_common_command_for_block (struct block *block, const char *comname,
+info_common_command_for_block (const struct block *block, const char *comname,
                               int *any_printed)
 {
   struct block_iterator iter;
@@ -425,10 +421,10 @@ info_common_command_for_block (struct block *block, const char *comname,
   ALL_BLOCK_SYMBOLS (block, iter, sym)
     if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
       {
-       struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym);
+       const struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym);
        size_t index;
 
-       gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC);
+       gdb_assert (SYMBOL_CLASS (sym) == LOC_COMMON_BLOCK);
 
        if (comname && (!SYMBOL_LINKAGE_NAME (sym)
                        || strcmp (comname, SYMBOL_LINKAGE_NAME (sym)) != 0))
@@ -447,19 +443,22 @@ info_common_command_for_block (struct block *block, const char *comname,
        for (index = 0; index < common->n_entries; index++)
          {
            struct value *val = NULL;
-           volatile struct gdb_exception except;
 
            printf_filtered ("%s = ",
                             SYMBOL_PRINT_NAME (common->contents[index]));
 
-           TRY_CATCH (except, RETURN_MASK_ERROR)
+           TRY
              {
                val = value_of_variable (common->contents[index], block);
                value_print (val, gdb_stdout, &opts);
              }
 
-           if (except.reason < 0)
-             printf_filtered ("<error reading variable: %s>", except.message);
+           CATCH (except, RETURN_MASK_ERROR)
+             {
+               printf_filtered ("<error reading variable: %s>", except.message);
+             }
+           END_CATCH
+
            putchar_filtered ('\n');
          }
       }
@@ -473,7 +472,7 @@ static void
 info_common_command (char *comname, int from_tty)
 {
   struct frame_info *fi;
-  struct block *block;
+  const struct block *block;
   int values_printed = 0;
 
   /* We have been told to display the contents of F77 COMMON 
@@ -517,7 +516,4 @@ _initialize_f_valprint (void)
 {
   add_info ("common", info_common_command,
            _("Print out the values contained in a Fortran COMMON block."));
-  if (xdb_commands)
-    add_com ("lc", class_info, info_common_command,
-            _("Print out the values contained in a Fortran COMMON block."));
 }
This page took 0.026929 seconds and 4 git commands to generate.