ld: don't use ia64 register name in expression of pr16322 test
[deliverable/binutils-gdb.git] / gdb / hppa-hpux-tdep.c
index 31b557dc1b583b181f702e710e8c2217b5ef889d..0c8575d597b73e1dc7af472b47443cbecae8f376 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for HP-UX on PA-RISC.
 
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -34,9 +34,6 @@
 #include "solib-pa64.h"
 #include "regset.h"
 #include "regcache.h"
-#include "exceptions.h"
-
-#include <string.h>
 
 #define IS_32BIT_TARGET(_gdbarch) \
        ((gdbarch_tdep (_gdbarch))->bytes_per_address == 4)
@@ -460,7 +457,7 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
          (curr_inst == 0xeaa0d002))
        {
          struct bound_minimal_symbol stubsym;
-         struct minimal_symbol *libsym;
+         struct bound_minimal_symbol libsym;
 
          stubsym = lookup_minimal_symbol_by_pc (loc);
          if (stubsym.minsym == NULL)
@@ -471,14 +468,14 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
 
          libsym = lookup_minimal_symbol (MSYMBOL_LINKAGE_NAME (stubsym.minsym),
                                          NULL, NULL);
-         if (libsym == NULL)
+         if (libsym.minsym == NULL)
            {
              warning (_("Unable to find library symbol for %s."),
                       MSYMBOL_PRINT_NAME (stubsym.minsym));
              return orig_pc == pc ? 0 : pc & ~0x3;
            }
 
-         return MSYMBOL_VALUE (libsym);
+         return MSYMBOL_VALUE (libsym.minsym);
        }
 
       /* Does it look like bl X,%rp or bl X,%r0?  Another way to do a
@@ -973,7 +970,7 @@ hppa64_hpux_search_dummy_call_sequence (struct gdbarch *gdbarch, CORE_ADDR pc,
       gdb_byte buf[2 * HPPA_INSN_SIZE];
       int offset;
 
-      find_pc_partial_function (MSYMBOL_VALUE_ADDRESS (msym), &name,
+      find_pc_partial_function (MSYMBOL_VALUE_ADDRESS (obj, msym), &name,
                                &begin, &end);
 
       if (name == NULL || begin == 0 || end == 0)
@@ -1014,7 +1011,7 @@ hppa_hpux_find_import_stub_for_addr (CORE_ADDR funcaddr)
 {
   struct objfile *objfile;
   struct bound_minimal_symbol funsym;
-  struct minimal_symbol *stubsym;
+  struct bound_minimal_symbol stubsym;
   CORE_ADDR stubaddr;
 
   funsym = lookup_minimal_symbol_by_pc (funcaddr);
@@ -1025,17 +1022,17 @@ hppa_hpux_find_import_stub_for_addr (CORE_ADDR funcaddr)
       stubsym = lookup_minimal_symbol_solib_trampoline
        (MSYMBOL_LINKAGE_NAME (funsym.minsym), objfile);
 
-      if (stubsym)
+      if (stubsym.minsym)
        {
          struct unwind_table_entry *u;
 
-         u = find_unwind_entry (MSYMBOL_VALUE (stubsym));
+         u = find_unwind_entry (MSYMBOL_VALUE (stubsym.minsym));
          if (u == NULL 
              || (u->stub_unwind.stub_type != IMPORT
                  && u->stub_unwind.stub_type != IMPORT_SHLIB))
            continue;
 
-          stubaddr = MSYMBOL_VALUE (stubsym);
+          stubaddr = MSYMBOL_VALUE (stubsym.minsym);
 
          /* If we found an IMPORT stub, then we can stop searching;
             if we found an IMPORT_SHLIB, we want to continue the search
@@ -1096,10 +1093,10 @@ hppa_hpux_find_dummy_bpaddr (CORE_ADDR addr)
       find_pc_partial_function (addr, NULL, &func, NULL);
       ALL_OBJFILE_MSYMBOLS (sec->objfile, msym)
        {
-         u = find_unwind_entry (MSYMBOL_VALUE_ADDRESS (msym));
-         if (func != MSYMBOL_VALUE_ADDRESS (msym) 
+         u = find_unwind_entry (MSYMBOL_VALUE_ADDRESS (sec->objfile, msym));
+         if (func != MSYMBOL_VALUE_ADDRESS (sec->objfile, msym) 
              && (!u || u->stub_unwind.stub_type == 0))
-           return MSYMBOL_VALUE_ADDRESS (msym);
+           return MSYMBOL_VALUE_ADDRESS (sec->objfile, msym);
        }
     }
 
@@ -1367,21 +1364,20 @@ hppa_hpux_supply_save_state (const struct regset *regset,
 
 /* HP-UX register set.  */
 
-static struct regset hppa_hpux_regset =
+static const struct regset hppa_hpux_regset =
 {
   NULL,
   hppa_hpux_supply_save_state
 };
 
-static const struct regset *
-hppa_hpux_regset_from_core_section (struct gdbarch *gdbarch,
-                                   const char *sect_name, size_t sect_size)
+static void
+hppa_hpux_iterate_over_regset_sections (struct gdbarch *gdbarch,
+                                       iterate_over_regset_sections_cb *cb,
+                                       void *cb_data,
+                                       const struct regcache *regcache)
 {
-  if (strcmp (sect_name, ".reg") == 0
-      && sect_size >= HPPA_HPUX_PA89_SAVE_STATE_SIZE + 8)
-    return &hppa_hpux_regset;
-
-  return NULL;
+  cb (".reg", HPPA_HPUX_PA89_SAVE_STATE_SIZE + 8, &hppa_hpux_regset,
+      NULL, cb_data);
 }
 \f
 
@@ -1497,8 +1493,8 @@ hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_skip_permanent_breakpoint
     (gdbarch, hppa_skip_permanent_breakpoint);
 
-  set_gdbarch_regset_from_core_section
-    (gdbarch, hppa_hpux_regset_from_core_section);
+  set_gdbarch_iterate_over_regset_sections
+    (gdbarch, hppa_hpux_iterate_over_regset_sections);
 
   frame_unwind_append_unwinder (gdbarch, &hppa_hpux_sigtramp_frame_unwind);
 }
This page took 0.02566 seconds and 4 git commands to generate.