2003-10-22 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / c-valprint.c
index e7c02cc061d61f13d8def84f166c558ef143a8f7..fd42ae0b908d6fdea2793da908fa2c86a3b5e10b 100644 (file)
@@ -1,7 +1,7 @@
 /* Support for printing C values for GDB, the GNU debugger.
-   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -30,6 +30,7 @@
 #include "language.h"
 #include "c-lang.h"
 #include "cp-abi.h"
+#include "target.h"
 \f
 
 /* Print function pointer with inferior address ADDRESS onto stdio
@@ -38,7 +39,9 @@
 static void
 print_function_pointer_address (CORE_ADDR address, struct ui_file *stream)
 {
-  CORE_ADDR func_addr = CONVERT_FROM_FUNC_PTR_ADDR (address);
+  CORE_ADDR func_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
+                                                           address,
+                                                           &current_target);
 
   /* If the function pointer is represented by a description, print the
      address of the description.  */
@@ -70,7 +73,7 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
             CORE_ADDR address, struct ui_file *stream, int format,
             int deref_ref, int recurse, enum val_prettyprint pretty)
 {
-  register unsigned int i = 0; /* Number of characters printed */
+  unsigned int i = 0;  /* Number of characters printed */
   unsigned len;
   struct type *elttype;
   unsigned eltlen;
@@ -205,7 +208,7 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
                  (vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))
                {
                  fputs_filtered (" <", stream);
-                 fputs_filtered (SYMBOL_SOURCE_NAME (msymbol), stream);
+                 fputs_filtered (SYMBOL_PRINT_NAME (msymbol), stream);
                  fputs_filtered (">", stream);
                }
              if (vt_address && vtblprint)
@@ -213,13 +216,12 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
                  struct value *vt_val;
                  struct symbol *wsym = (struct symbol *) NULL;
                  struct type *wtype;
-                 struct symtab *s;
                  struct block *block = (struct block *) NULL;
                  int is_this_fld;
 
                  if (msymbol != NULL)
-                   wsym = lookup_symbol (SYMBOL_NAME (msymbol), block,
-                                         VAR_NAMESPACE, &is_this_fld, &s);
+                   wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block,
+                                         VAR_DOMAIN, &is_this_fld, NULL);
 
                  if (wsym)
                    {
@@ -593,7 +595,8 @@ c_value_print (struct value *val, struct ui_file *stream, int format,
       /* Otherwise, we end up at the return outside this "if" */
     }
 
-  return val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val),
-                   VALUE_ADDRESS (val),
+  return val_print (type, VALUE_CONTENTS_ALL (val),
+                   VALUE_EMBEDDED_OFFSET (val),
+                   VALUE_ADDRESS (val) + VALUE_OFFSET (val),
                    stream, format, 1, 0, pretty);
 }
This page took 0.024789 seconds and 4 git commands to generate.