Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / p-valprint.c
index a383371ec3c63a1a23d27bb15687e7379b33f1e2..92f820fc2c70d4b24d7a0c7e2ec94bb55c32e734 100644 (file)
@@ -1,13 +1,13 @@
 /* Support for printing Pascal values for GDB, the GNU debugger.
 
 /* Support for printing Pascal values for GDB, the GNU debugger.
 
-   Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007
+   Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file is derived from c-valprint.c */
 
 
 /* This file is derived from c-valprint.c */
 
@@ -87,9 +85,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
              print_spaces_filtered (2 + 2 * recurse, stream);
            }
          /* For an array of chars, print with string syntax.  */
              print_spaces_filtered (2 + 2 * recurse, stream);
            }
          /* For an array of chars, print with string syntax.  */
-         if (eltlen == 1 &&
-             ((TYPE_CODE (elttype) == TYPE_CODE_INT)
-              || ((current_language->la_language == language_m2)
+         if (eltlen == 1 
+             && ((TYPE_CODE (elttype) == TYPE_CODE_INT)
+              || ((current_language->la_language == language_pascal)
                   && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
              && (format == 0 || format == 's'))
            {
                   && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
              && (format == 0 || format == 's'))
            {
@@ -166,13 +164,14 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
 
          if (addressprint && format != 's')
            {
 
          if (addressprint && format != 's')
            {
-             deprecated_print_address_numeric (addr, 1, stream);
+             fputs_filtered (paddress (addr), stream);
            }
 
          /* For a pointer to char or unsigned char, also print the string
             pointed to, unless pointer is null.  */
          if (TYPE_LENGTH (elttype) == 1
            }
 
          /* For a pointer to char or unsigned char, also print the string
             pointed to, unless pointer is null.  */
          if (TYPE_LENGTH (elttype) == 1
-             && TYPE_CODE (elttype) == TYPE_CODE_INT
+             && (TYPE_CODE (elttype) == TYPE_CODE_INT
+                 || TYPE_CODE(elttype) == TYPE_CODE_CHAR)
              && (format == 0 || format == 's')
              && addr != 0)
            {
              && (format == 0 || format == 's')
              && addr != 0)
            {
@@ -219,7 +218,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
                  int is_this_fld;
 
                  if (msymbol != NULL)
                  int is_this_fld;
 
                  if (msymbol != NULL)
-                   wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block,
+                   wsym = lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), block,
                                          VAR_DOMAIN, &is_this_fld, NULL);
 
                  if (wsym)
                                          VAR_DOMAIN, &is_this_fld, NULL);
 
                  if (wsym)
@@ -254,10 +253,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
        {
          fprintf_filtered (stream, "@");
          /* Extract the address, assume that it is unsigned.  */
        {
          fprintf_filtered (stream, "@");
          /* Extract the address, assume that it is unsigned.  */
-         deprecated_print_address_numeric
-           (extract_unsigned_integer (valaddr + embedded_offset,
-                                      TARGET_PTR_BIT / HOST_CHAR_BIT),
-            1, stream);
+         fputs_filtered (paddress (
+           extract_unsigned_integer (valaddr + embedded_offset,
+              gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT)), stream);
          if (deref_ref)
            fputs_filtered (": ", stream);
        }
          if (deref_ref)
            fputs_filtered (": ", stream);
        }
@@ -531,14 +529,14 @@ pascal_value_print (struct value *val, struct ui_file *stream, int format,
 
      Object pascal: if it is a member pointer, we will take care
      of that when we print it.  */
 
      Object pascal: if it is a member pointer, we will take care
      of that when we print it.  */
-  if (TYPE_CODE (type) == TYPE_CODE_PTR ||
-      TYPE_CODE (type) == TYPE_CODE_REF)
+  if (TYPE_CODE (type) == TYPE_CODE_PTR
+      || TYPE_CODE (type) == TYPE_CODE_REF)
     {
       /* Hack:  remove (char *) for char strings.  Their
          type is indicated by the quoted string anyway. */
     {
       /* Hack:  remove (char *) for char strings.  Their
          type is indicated by the quoted string anyway. */
-      if (TYPE_CODE (type) == TYPE_CODE_PTR &&
-         TYPE_NAME (type) == NULL &&
-         TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
+      if (TYPE_CODE (type) == TYPE_CODE_PTR 
+         && TYPE_NAME (type) == NULL
+         && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
          && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0)
        {
          /* Print nothing */
          && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0)
        {
          /* Print nothing */
@@ -827,7 +825,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
     {
       int boffset;
       struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
     {
       int boffset;
       struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
-      char *basename = TYPE_NAME (baseclass);
+      char *basename = type_name_no_tag (baseclass);
       const gdb_byte *base_valaddr;
 
       if (BASETYPE_VIA_VIRTUAL (type, i))
       const gdb_byte *base_valaddr;
 
       if (BASETYPE_VIA_VIRTUAL (type, i))
This page took 0.027175 seconds and 4 git commands to generate.