Ignore MOD field for control/debug register move
[deliverable/binutils-gdb.git] / gdb / hppa-hpux-tdep.c
index ad9b4fad41dc897067d53d651abde3f827bb380a..688ac9a8cd2ebabcacc3c023c2afa26991ccf75c 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for HP-UX on PA-RISC.
 
-   Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   Copyright (C) 2002-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -36,8 +36,6 @@
 #include "regcache.h"
 #include "exceptions.h"
 
-#include "gdb_string.h"
-
 #define IS_32BIT_TARGET(_gdbarch) \
        ((gdbarch_tdep (_gdbarch))->bytes_per_address == 4)
 
 extern void _initialize_hppa_hpux_tdep (void);
 extern initialize_file_ftype _initialize_hppa_hpux_tdep;
 
-static int
-in_opd_section (CORE_ADDR pc)
-{
-  struct obj_section *s;
-  int retval = 0;
-
-  s = find_pc_section (pc);
-
-  retval = (s != NULL
-           && s->the_bfd_section->name != NULL
-           && strcmp (s->the_bfd_section->name, ".opd") == 0);
-  return (retval);
-}
-
 /* Return one if PC is in the call path of a trampoline, else return zero.
 
    Note we return one for *any* call trampoline (long-call, arg-reloc), not
    just shared library trampolines (import, export).  */
 
 static int
-hppa32_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch,
-                                     CORE_ADDR pc, char *name)
+hppa32_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct bound_minimal_symbol minsym;
@@ -99,7 +82,7 @@ hppa32_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch,
 
   minsym = lookup_minimal_symbol_by_pc (pc);
   if (minsym.minsym
-      && strcmp (SYMBOL_LINKAGE_NAME (minsym.minsym), ".stub") == 0)
+      && strcmp (MSYMBOL_LINKAGE_NAME (minsym.minsym), ".stub") == 0)
     return 1;
 
   /* Get the unwind descriptor corresponding to PC, return zero
@@ -156,8 +139,7 @@ hppa32_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch,
 }
 
 static int
-hppa64_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch,
-                                     CORE_ADDR pc, char *name)
+hppa64_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
@@ -184,7 +166,7 @@ hppa64_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch,
   if (! minsym.minsym)
     return 0;
 
-  sec = SYMBOL_OBJ_SECTION (minsym.minsym)->the_bfd_section;
+  sec = MSYMBOL_OBJ_SECTION (minsym.objfile, minsym.minsym)->the_bfd_section;
 
   if (bfd_get_section_vma (sec->owner, sec) <= pc
       && pc < (bfd_get_section_vma (sec->owner, sec)
@@ -386,8 +368,8 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
          ALL_MSYMBOLS (objfile, msymbol)
          {
            if (MSYMBOL_TYPE (msymbol) == mst_text
-               && strcmp (SYMBOL_LINKAGE_NAME (msymbol),
-                           SYMBOL_LINKAGE_NAME (msym.minsym)) == 0)
+               && strcmp (MSYMBOL_LINKAGE_NAME (msymbol),
+                          MSYMBOL_LINKAGE_NAME (msym.minsym)) == 0)
              {
                function_found = 1;
                break;
@@ -476,7 +458,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)
@@ -485,16 +467,16 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
              return orig_pc == pc ? 0 : pc & ~0x3;
            }
 
-         libsym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (stubsym.minsym),
+         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."),
-                      SYMBOL_PRINT_NAME (stubsym.minsym));
+                      MSYMBOL_PRINT_NAME (stubsym.minsym));
              return orig_pc == pc ? 0 : pc & ~0x3;
            }
 
-         return SYMBOL_VALUE (libsym);
+         return MSYMBOL_VALUE (libsym.minsym);
        }
 
       /* Does it look like bl X,%rp or bl X,%r0?  Another way to do a
@@ -798,7 +780,7 @@ hppa64_hpux_find_global_pointer (struct gdbarch *gdbarch,
 
   faddr = value_as_address (function);
 
-  if (in_opd_section (faddr))
+  if (pc_in_section (faddr, ".opd"))
     {
       target_read_memory (faddr, buf, sizeof (buf));
       return extract_unsigned_integer (&buf[24], 8, byte_order);
@@ -989,7 +971,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 (SYMBOL_VALUE_ADDRESS (msym), &name,
+      find_pc_partial_function (MSYMBOL_VALUE_ADDRESS (obj, msym), &name,
                                &begin, &end);
 
       if (name == NULL || begin == 0 || end == 0)
@@ -1030,7 +1012,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);
@@ -1039,19 +1021,19 @@ hppa_hpux_find_import_stub_for_addr (CORE_ADDR funcaddr)
   ALL_OBJFILES (objfile)
     {
       stubsym = lookup_minimal_symbol_solib_trampoline
-       (SYMBOL_LINKAGE_NAME (funsym.minsym), objfile);
+       (MSYMBOL_LINKAGE_NAME (funsym.minsym), objfile);
 
-      if (stubsym)
+      if (stubsym.minsym)
        {
          struct unwind_table_entry *u;
 
-         u = find_unwind_entry (SYMBOL_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 = SYMBOL_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
@@ -1112,10 +1094,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 (SYMBOL_VALUE_ADDRESS (msym));
-         if (func != SYMBOL_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 SYMBOL_VALUE_ADDRESS (msym);
+           return MSYMBOL_VALUE_ADDRESS (sec->objfile, msym);
        }
     }
 
@@ -1278,9 +1260,9 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
 
 static void
 hppa_hpux_supply_ss_narrow (struct regcache *regcache,
-                           int regnum, const char *save_state)
+                           int regnum, const gdb_byte *save_state)
 {
-  const char *ss_narrow = save_state + HPPA_HPUX_SS_NARROW_OFFSET;
+  const gdb_byte *ss_narrow = save_state + HPPA_HPUX_SS_NARROW_OFFSET;
   int i, offset = 0;
 
   for (i = HPPA_R1_REGNUM; i < HPPA_FP0_REGNUM; i++)
@@ -1294,9 +1276,9 @@ hppa_hpux_supply_ss_narrow (struct regcache *regcache,
 
 static void
 hppa_hpux_supply_ss_fpblock (struct regcache *regcache,
-                            int regnum, const char *save_state)
+                            int regnum, const gdb_byte *save_state)
 {
-  const char *ss_fpblock = save_state + HPPA_HPUX_SS_FPBLOCK_OFFSET;
+  const gdb_byte *ss_fpblock = save_state + HPPA_HPUX_SS_FPBLOCK_OFFSET;
   int i, offset = 0;
 
   /* FIXME: We view the floating-point state as 64 single-precision
@@ -1329,9 +1311,9 @@ hppa_hpux_supply_ss_fpblock (struct regcache *regcache,
 
 static void
 hppa_hpux_supply_ss_wide (struct regcache *regcache,
-                         int regnum, const char *save_state)
+                         int regnum, const gdb_byte *save_state)
 {
-  const char *ss_wide = save_state + HPPA_HPUX_SS_WIDE_OFFSET;
+  const gdb_byte *ss_wide = save_state + HPPA_HPUX_SS_WIDE_OFFSET;
   int i, offset = 8;
 
   if (register_size (get_regcache_arch (regcache), HPPA_R1_REGNUM) == 4)
@@ -1353,8 +1335,8 @@ hppa_hpux_supply_save_state (const struct regset *regset,
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  const char *proc_info = regs;
-  const char *save_state = proc_info + 8;
+  const gdb_byte *proc_info = regs;
+  const gdb_byte *save_state = proc_info + 8;
   ULONGEST flags;
 
   flags = extract_unsigned_integer (save_state + HPPA_HPUX_SS_FLAGS_OFFSET,
@@ -1383,7 +1365,7 @@ 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
This page took 0.028635 seconds and 4 git commands to generate.