gdbserver/proc-service.c: Change CORE_ADDR cast to uintptr_t
[deliverable/binutils-gdb.git] / gdb / auxv.c
index 02787053f81f69515155a4f05952bd65ea7ec7a1..1f22d8a0ee6408fb653f66beb324de53f83182aa 100644 (file)
@@ -1,6 +1,6 @@
 /* Auxiliary vector support for GDB, the GNU debugger.
 
-   Copyright (C) 2004-2014 Free Software Foundation, Inc.
+   Copyright (C) 2004-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "command.h"
 #include "inferior.h"
 #include "valprint.h"
-#include "gdb_assert.h"
 #include "gdbcore.h"
 #include "observer.h"
 #include "filestuff.h"
+#include "objfiles.h"
 
 #include "auxv.h"
 #include "elf/common.h"
@@ -85,27 +85,27 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
                 ULONGEST offset,
                 ULONGEST len, ULONGEST *xfered_len)
 {
-  struct minimal_symbol *msym;
+  struct bound_minimal_symbol msym;
   CORE_ADDR data_address, pointer_address;
   struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
   size_t ptr_size = TYPE_LENGTH (ptr_type);
   size_t auxv_pair_size = 2 * ptr_size;
-  gdb_byte *ptr_buf = alloca (ptr_size);
+  gdb_byte *ptr_buf = (gdb_byte *) alloca (ptr_size);
   LONGEST retval;
   size_t block;
 
   msym = lookup_minimal_symbol ("_dl_auxv", NULL, NULL);
-  if (msym == NULL)
+  if (msym.minsym == NULL)
     return TARGET_XFER_E_IO;
 
-  if (MSYMBOL_SIZE (msym) != ptr_size)
+  if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
     return TARGET_XFER_E_IO;
 
   /* POINTER_ADDRESS is a location where the `_dl_auxv' variable
      resides.  DATA_ADDRESS is the inferior value present in
      `_dl_auxv', therefore the real inferior AUXV address.  */
 
-  pointer_address = MSYMBOL_VALUE_ADDRESS (msym);
+  pointer_address = BMSYMBOL_VALUE_ADDRESS (msym);
 
   /* The location of the _dl_auxv symbol may no longer be correct if
      ld.so runs at a different address than the one present in the
@@ -286,6 +286,11 @@ int
 target_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
                   gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
 {
+  struct gdbarch *gdbarch = target_gdbarch();
+
+  if (gdbarch_auxv_parse_p (gdbarch))
+    return gdbarch_auxv_parse (gdbarch, readptr, endptr, typep, valp);
+
   return current_target.to_auxv_parse (&current_target, readptr, endptr,
                                       typep, valp);
 }
@@ -315,7 +320,7 @@ auxv_inferior_data_cleanup (struct inferior *inf, void *arg)
 {
   struct auxv_info *info;
 
-  info = inferior_data (inf, auxv_inferior_data);
+  info = (struct auxv_info *) inferior_data (inf, auxv_inferior_data);
   if (info != NULL)
     {
       xfree (info->data);
@@ -350,7 +355,7 @@ get_auxv_inferior_data (struct target_ops *ops)
   struct auxv_info *info;
   struct inferior *inf = current_inferior ();
 
-  info = inferior_data (inf, auxv_inferior_data);
+  info = (struct auxv_info *) inferior_data (inf, auxv_inferior_data);
   if (info == NULL)
     {
       info = XCNEW (struct auxv_info);
This page took 0.028893 seconds and 4 git commands to generate.