2007-09-12 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gdb / jv-valprint.c
index 5ca94b5f30be681ab1cf05154e9bec776e67aa63..7de93f364b2822c62d33abeae7fbf1a124eb9f6c 100644 (file)
@@ -1,13 +1,13 @@
 /* Support for printing Java values for GDB, the GNU debugger.
 
-   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free
-   Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+   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,
@@ -16,9 +16,7 @@
    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., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -72,7 +70,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
   if (TYPE_CODE (type) == TYPE_CODE_STRUCT && name != NULL
       && (i = strlen (name), name[i - 1] == ']'))
     {
-      char buf4[4];
+      gdb_byte buf4[4];
       long length;
       unsigned int things_printed = 0;
       int reps;
@@ -93,9 +91,9 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
 
          while (i < length && things_printed < print_max)
            {
-             char *buf;
+             gdb_byte *buf;
 
-             buf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
+             buf = alloca (gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT);
              fputs_filtered (", ", stream);
              wrap_here (n_spaces (2));
 
@@ -104,7 +102,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
              else
                {
                  read_memory (address, buf, sizeof (buf));
-                 address += TARGET_PTR_BIT / HOST_CHAR_BIT;
+                 address += gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT;
                  /* FIXME: cagney/2003-05-24: Bogus or what.  It
                      pulls a host sized pointer out of the target and
                      then extracts that as an address (while assuming
@@ -115,7 +113,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
              for (reps = 1; i + reps < length; reps++)
                {
                  read_memory (address, buf, sizeof (buf));
-                 address += TARGET_PTR_BIT / HOST_CHAR_BIT;
+                 address += gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT;
                  /* FIXME: cagney/2003-05-24: Bogus or what.  It
                      pulls a host sized pointer out of the target and
                      then extracts that as an address (while assuming
@@ -244,7 +242,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
    should not print, or zero if called from top level.  */
 
 static void
-java_print_value_fields (struct type *type, const bfd_byte *valaddr,
+java_print_value_fields (struct type *type, const gdb_byte *valaddr,
                         CORE_ADDR address, struct ui_file *stream,
                         int format, int recurse, enum val_prettyprint pretty)
 {
@@ -265,7 +263,7 @@ java_print_value_fields (struct type *type, const bfd_byte *valaddr,
          int boffset;
          struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
          char *basename = TYPE_NAME (baseclass);
-         const bfd_byte *base_valaddr;
+         const gdb_byte *base_valaddr;
 
          if (BASETYPE_VIA_VIRTUAL (type, i))
            continue;
@@ -441,7 +439,7 @@ java_print_value_fields (struct type *type, const bfd_byte *valaddr,
    The PRETTY parameter controls prettyprinting.  */
 
 int
-java_val_print (struct type *type, const bfd_byte *valaddr,
+java_val_print (struct type *type, const gdb_byte *valaddr,
                int embedded_offset, CORE_ADDR address,
                struct ui_file *stream, int format, int deref_ref,
                int recurse, enum val_prettyprint pretty)
This page took 0.025265 seconds and 4 git commands to generate.