Clear addr bit in next_pcs vector
[deliverable/binutils-gdb.git] / gdb / rs6000-aix-tdep.c
index 83e881e6bd6308dcd251f24851a37e07e5655cdd..acd52bbd9548d6600a7246f8d984410bea72fc64 100644 (file)
@@ -1,6 +1,6 @@
 /* Native support code for PPC AIX, for GDB the GNU debugger.
 
-   Copyright (C) 2006-2014 Free Software Foundation, Inc.
+   Copyright (C) 2006-2016 Free Software Foundation, Inc.
 
    Free Software Foundation, Inc.
 
@@ -20,8 +20,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include <string.h>
-#include "gdb_assert.h"
 #include "osabi.h"
 #include "regcache.h"
 #include "regset.h"
@@ -35,7 +33,6 @@
 #include "rs6000-tdep.h"
 #include "ppc-tdep.h"
 #include "rs6000-aix-tdep.h"
-#include "exceptions.h"
 #include "xcoffread.h"
 #include "solib.h"
 #include "solib-aix.h"
@@ -149,25 +146,18 @@ static const struct regset rs6000_aix64_regset =
   rs6000_aix_collect_regset,
 };
 
-/* Return the appropriate register set for the core section identified
-   by SECT_NAME and SECT_SIZE.  */
+/* Iterate over core file register note sections.  */
 
-static const struct regset *
-rs6000_aix_regset_from_core_section (struct gdbarch *gdbarch,
-                                    const char *sect_name, size_t sect_size)
+static void
+rs6000_aix_iterate_over_regset_sections (struct gdbarch *gdbarch,
+                                        iterate_over_regset_sections_cb *cb,
+                                        void *cb_data,
+                                        const struct regcache *regcache)
 {
   if (gdbarch_tdep (gdbarch)->wordsize == 4)
-    {
-      if (strcmp (sect_name, ".reg") == 0 && sect_size >= 592)
-        return &rs6000_aix32_regset;
-    }
+    cb (".reg", 592, &rs6000_aix32_regset, NULL, cb_data);
   else
-    {
-      if (strcmp (sect_name, ".reg") == 0 && sect_size >= 576)
-        return &rs6000_aix64_regset;
-    }
-
-  return NULL;
+    cb (".reg", 576, &rs6000_aix64_regset, NULL, cb_data);
 }
 
 
@@ -300,8 +290,6 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       else
        {
          /* Argument can fit in one register.  No problem.  */
-         int adj = gdbarch_byte_order (gdbarch)
-                   == BFD_ENDIAN_BIG ? reg_size - len : 0;
          gdb_byte word[MAX_REGISTER_SIZE];
 
          memset (word, 0, reg_size);
@@ -582,19 +570,20 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
     {
       CORE_ADDR pc = 0;
       struct obj_section *pc_section;
-      volatile struct gdb_exception e;
 
-      TRY_CATCH (e, RETURN_MASK_ERROR)
+      TRY
         {
           pc = read_memory_unsigned_integer (addr, tdep->wordsize, byte_order);
         }
-      if (e.reason < 0)
+      CATCH (e, RETURN_MASK_ERROR)
         {
           /* An error occured during reading.  Probably a memory error
              due to the section not being loaded yet.  This address
              cannot be a function descriptor.  */
           return addr;
         }
+      END_CATCH
+
       pc_section = find_pc_section (pc);
 
       if (pc_section && (pc_section->the_bfd_section->flags & SEC_CODE))
@@ -992,7 +981,7 @@ rs6000_aix_ld_info_to_xml (struct gdbarch *gdbarch, const gdb_byte *ldi_buf,
 
   obstack_grow_str0 (&obstack, "</library-list-aix>\n");
 
-  buf = obstack_finish (&obstack);
+  buf = (const char *) obstack_finish (&obstack);
   len_avail = strlen (buf);
   if (offset >= len_avail)
     len= 0;
@@ -1027,7 +1016,7 @@ rs6000_aix_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch,
           bfd_errmsg (bfd_get_error ()));
   ldinfo_size = bfd_get_section_size (ldinfo_sec);
 
-  ldinfo_buf = xmalloc (ldinfo_size);
+  ldinfo_buf = (gdb_byte *) xmalloc (ldinfo_size);
   cleanup = make_cleanup (xfree, ldinfo_buf);
 
   if (! bfd_get_section_contents (core_bfd, ldinfo_sec,
@@ -1067,8 +1056,8 @@ rs6000_aix_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
     (gdbarch, rs6000_convert_from_func_ptr_addr);
 
   /* Core file support.  */
-  set_gdbarch_regset_from_core_section
-    (gdbarch, rs6000_aix_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, rs6000_aix_iterate_over_regset_sections);
   set_gdbarch_core_xfer_shared_libraries_aix
     (gdbarch, rs6000_aix_core_xfer_shared_libraries_aix);
 
This page took 0.029915 seconds and 4 git commands to generate.