2007-07-02 Markus Deuling <deuling@de.ibm.com>
[deliverable/binutils-gdb.git] / gdb / p-valprint.c
index 8304196f1f62ddf7e144fd560815b835b0274e4a..79519b437a5c9cff3e4f910bc8d65be1fb546ebd 100644 (file)
@@ -1,6 +1,6 @@
 /* Support for printing Pascal values for GDB, the GNU debugger.
 
-   Copyright (C) 2000, 2001, 2003, 2005, 2006
+   Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -256,7 +256,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
          /* Extract the address, assume that it is unsigned.  */
          deprecated_print_address_numeric
            (extract_unsigned_integer (valaddr + embedded_offset,
-                                      TARGET_PTR_BIT / HOST_CHAR_BIT),
+                                      gdbarch_ptr_bit (current_gdbarch)
+                                        / HOST_CHAR_BIT),
             1, stream);
          if (deref_ref)
            fputs_filtered (": ", stream);
@@ -641,7 +642,6 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
                                  int dont_print_statmem)
 {
   int i, len, n_baseclasses;
-  struct obstack tmp_obstack;
   char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
 
   CHECK_TYPEDEF (type);
@@ -660,6 +660,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
     fprintf_filtered (stream, "<No data fields>");
   else
     {
+      struct obstack tmp_obstack = dont_print_statmem_obstack;
       int fields_seen = 0;
 
       if (dont_print_statmem == 0)
@@ -667,7 +668,6 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
          /* If we're at top level, carve out a completely fresh
             chunk of the obstack and use that until this particular
             invocation returns.  */
-         tmp_obstack = dont_print_statmem_obstack;
          obstack_finish (&dont_print_statmem_obstack);
        }
 
@@ -810,9 +810,9 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
                           enum val_prettyprint pretty,
                           struct type **dont_print_vb)
 {
-  struct obstack tmp_obstack;
   struct type **last_dont_print
   = (struct type **) obstack_next_free (&dont_print_vb_obstack);
+  struct obstack tmp_obstack = dont_print_vb_obstack;
   int i, n_baseclasses = TYPE_N_BASECLASSES (type);
 
   if (dont_print_vb == 0)
@@ -820,7 +820,6 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
       /* If we're at top level, carve out a completely fresh
          chunk of the obstack and use that until this particular
          invocation returns.  */
-      tmp_obstack = dont_print_vb_obstack;
       /* Bump up the high-water mark.  Now alpha is omega.  */
       obstack_finish (&dont_print_vb_obstack);
     }
@@ -829,7 +828,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
     {
       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))
This page took 0.024209 seconds and 4 git commands to generate.