Make sure terminal settings are restored before exiting
[deliverable/binutils-gdb.git] / gdb / hppa-tdep.c
index f9c1bf279c281dd670d85042af4277d630243338..01a7c8098c8515d60174ae47ff0dd3e6f458acb2 100644 (file)
@@ -46,13 +46,44 @@ static int hppa_debug = 0;
 static const int hppa32_num_regs = 128;
 static const int hppa64_num_regs = 96;
 
+/* We use the objfile->obj_private pointer for two things:
+ * 1.  An unwind table;
+ *
+ * 2.  A pointer to any associated shared library object.
+ *
+ * #defines are used to help refer to these objects.
+ */
+
+/* Info about the unwind table associated with an object file.
+ * This is hung off of the "objfile->obj_private" pointer, and
+ * is allocated in the objfile's psymbol obstack.  This allows
+ * us to have unique unwind info for each executable and shared
+ * library that we are debugging.
+ */
+struct hppa_unwind_info
+  {
+    struct unwind_table_entry *table;  /* Pointer to unwind info */
+    struct unwind_table_entry *cache;  /* Pointer to last entry we found */
+    int last;                          /* Index of last entry */
+  };
+
+struct hppa_objfile_private
+  {
+    struct hppa_unwind_info *unwind_info;      /* a pointer */
+    struct so_list *so_info;                   /* a pointer  */
+    CORE_ADDR dp;
+
+    int dummy_call_sequence_reg;
+    CORE_ADDR dummy_call_sequence_addr;
+  };
+
 /* hppa-specific object data -- unwind and solib info.
    TODO/maybe: think about splitting this into two parts; the unwind data is 
    common to all hppa targets, but is only used in this file; we can register 
    that separately and make this static. The solib data is probably hpux-
    specific, so we can create a separate extern objfile_data that is registered
    by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c.  */
-const struct objfile_data *hppa_objfile_priv_data = NULL;
+static const struct objfile_data *hppa_objfile_priv_data = NULL;
 
 /* Get at various relevent fields of an instruction word.  */
 #define MASK_5 0x1f
@@ -170,7 +201,7 @@ hppa_symbol_address(const char *sym)
     return (CORE_ADDR)-1;
 }
 
-struct hppa_objfile_private *
+static struct hppa_objfile_private *
 hppa_init_objfile_priv_data (struct objfile *objfile)
 {
   struct hppa_objfile_private *priv;
@@ -529,13 +560,16 @@ find_unwind_entry (CORE_ADDR pc)
   return NULL;
 }
 
-/* The epilogue is defined here as the area either on the `bv' instruction 
+/* Implement the stack_frame_destroyed_p gdbarch method.
+
+   The epilogue is defined here as the area either on the `bv' instruction 
    itself or an instruction which destroys the function's stack frame.
    
    We do not assume that the epilogue is at the end of a function as we can
    also have return sequences in the middle of a function.  */
+
 static int
-hppa_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
+hppa_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   unsigned long status;
@@ -2778,14 +2812,6 @@ hppa_frame_prev_register_helper (struct frame_info *this_frame,
       return frame_unwind_got_constant (this_frame, regnum, pc + 4);
     }
 
-  /* Make sure the "flags" register is zero in all unwound frames.
-     The "flags" registers is a HP-UX specific wart, and only the code
-     in hppa-hpux-tdep.c depends on it.  However, it is easier to deal
-     with it here.  This shouldn't affect other systems since those
-     should provide zero for the "flags" register anyway.  */
-  if (regnum == HPPA_FLAGS_REGNUM)
-    return frame_unwind_got_constant (this_frame, regnum, 0);
-
   return trad_frame_get_prev_register (this_frame, saved_regs, regnum);
 }
 \f
@@ -3112,8 +3138,8 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* The following gdbarch vector elements do not depend on the address
      size, or in any other gdbarch element previously set.  */
   set_gdbarch_skip_prologue (gdbarch, hppa_skip_prologue);
-  set_gdbarch_in_function_epilogue_p (gdbarch,
-                                     hppa_in_function_epilogue_p);
+  set_gdbarch_stack_frame_destroyed_p (gdbarch,
+                                      hppa_stack_frame_destroyed_p);
   set_gdbarch_inner_than (gdbarch, core_addr_greaterthan);
   set_gdbarch_sp_regnum (gdbarch, HPPA_SP_REGNUM);
   set_gdbarch_fp0_regnum (gdbarch, HPPA_FP0_REGNUM);
This page took 0.024498 seconds and 4 git commands to generate.