Rename in_function_epilogue_p to stack_frame_destroyed_p
[deliverable/binutils-gdb.git] / gdb / rs6000-tdep.c
index 1dd6165331ef79d185d02bc76e0f1640a8ecaa2c..eb40430bee3074242b127bfa2a4100f4d2059527 100644 (file)
@@ -934,10 +934,10 @@ rs6000_in_function_epilogue_frame_p (struct frame_info *curfrm,
   return 0;
 }
 
-/* Implementation of gdbarch_in_function_epilogue_p.  */
+/* Implement the stack_frame_destroyed_p gdbarch method.  */
 
 static int
-rs6000_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
+rs6000_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   return rs6000_in_function_epilogue_frame_p (get_current_frame (),
                                              gdbarch, pc);
@@ -2220,7 +2220,7 @@ static int
 rs6000_in_solib_return_trampoline (struct gdbarch *gdbarch,
                                   CORE_ADDR pc, const char *name)
 {
-  return name && !strncmp (name, "@FIX", 4);
+  return name && startswith (name, "@FIX");
 }
 
 /* Skip code that the user doesn't want to see when stepping:
@@ -3349,10 +3349,12 @@ static const struct frame_unwind rs6000_frame_unwind =
   default_frame_sniffer
 };
 
+/* Allocate and initialize a frame cache for an epilogue frame.
+   SP is restored and prev-PC is stored in LR.  */
+
 static struct rs6000_frame_cache *
 rs6000_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
 {
-  volatile struct gdb_exception ex;
   struct rs6000_frame_cache *cache;
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -3364,7 +3366,7 @@ rs6000_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
   (*this_cache) = cache;
   cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
 
-  TRY_CATCH (ex, RETURN_MASK_ERROR)
+  TRY
     {
       /* At this point the stack looks as if we just entered the
         function, and the return address is stored in LR.  */
@@ -3379,12 +3381,19 @@ rs6000_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
       trad_frame_set_value (cache->saved_regs,
                            gdbarch_pc_regnum (gdbarch), lr);
     }
-  if (ex.reason < 0 && ex.error != NOT_AVAILABLE_ERROR)
-    throw_exception (ex);
+  CATCH (ex, RETURN_MASK_ERROR)
+    {
+      if (ex.error != NOT_AVAILABLE_ERROR)
+       throw_exception (ex);
+    }
+  END_CATCH
 
   return cache;
 }
 
+/* Implementation of frame_unwind.this_id, as defined in frame_unwind.h.
+   Return the frame ID of an epilogue frame.  */
+
 static void
 rs6000_epilogue_frame_this_id (struct frame_info *this_frame,
                               void **this_cache, struct frame_id *this_id)
@@ -3400,6 +3409,9 @@ rs6000_epilogue_frame_this_id (struct frame_info *this_frame,
     (*this_id) = frame_id_build (info->base, pc);
 }
 
+/* Implementation of frame_unwind.prev_register, as defined in frame_unwind.h.
+   Return the register value of REGNUM in previous frame.  */
+
 static struct value *
 rs6000_epilogue_frame_prev_register (struct frame_info *this_frame,
                                     void **this_cache, int regnum)
@@ -3409,6 +3421,9 @@ rs6000_epilogue_frame_prev_register (struct frame_info *this_frame,
   return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
 }
 
+/* Implementation of frame_unwind.sniffer, as defined in frame_unwind.h.
+   Check whether this an epilogue frame.  */
+
 static int
 rs6000_epilogue_frame_sniffer (const struct frame_unwind *self,
                               struct frame_info *this_frame,
@@ -3422,6 +3437,9 @@ rs6000_epilogue_frame_sniffer (const struct frame_unwind *self,
     return 0;
 }
 
+/* Frame unwinder for epilogue frame.  This is required for reverse step-over
+   a function without debug information.  */
+
 static const struct frame_unwind rs6000_epilogue_frame_unwind =
 {
   NORMAL_FRAME,
@@ -3668,7 +3686,9 @@ bfd_uses_spe_extensions (bfd *abfd)
 #define PPC_XT(insn)   ((PPC_TX (insn) << 5) | PPC_T (insn))
 #define PPC_XER_NB(xer)        (xer & 0x7f)
 
-/* Record Vector-Scalar Registers.  */
+/* Record Vector-Scalar Registers.
+   For VSR less than 32, it's represented by an FPR and an VSR-upper register.
+   Otherwise, it's just a VR register.  Record them accordingly.  */
 
 static int
 ppc_record_vsr (struct regcache *regcache, struct gdbarch_tdep *tdep, int vsr)
@@ -3693,11 +3713,12 @@ ppc_record_vsr (struct regcache *regcache, struct gdbarch_tdep *tdep, int vsr)
   return 0;
 }
 
-/* Parse instructions of primary opcode-4.  */
+/* Parse and record instructions primary opcode-4 at ADDR.
+   Return 0 if successful.  */
 
 static int
 ppc_process_record_op4 (struct gdbarch *gdbarch, struct regcache *regcache,
-                          CORE_ADDR addr, uint32_t insn)
+                       CORE_ADDR addr, uint32_t insn)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int ext = PPC_FIELD (insn, 21, 11);
@@ -3961,7 +3982,8 @@ ppc_process_record_op4 (struct gdbarch *gdbarch, struct regcache *regcache,
   return -1;
 }
 
-/* Parse instructions of primary opcode-19.  */
+/* Parse and record instructions of primary opcode-19 at ADDR.
+   Return 0 if successful.  */
 
 static int
 ppc_process_record_op19 (struct gdbarch *gdbarch, struct regcache *regcache,
@@ -4004,7 +4026,8 @@ ppc_process_record_op19 (struct gdbarch *gdbarch, struct regcache *regcache,
   return -1;
 }
 
-/* Parse instructions of primary opcode-31.  */
+/* Parse and record instructions of primary opcode-31 at ADDR.
+   Return 0 if successful.  */
 
 static int
 ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache,
@@ -4482,7 +4505,8 @@ UNKNOWN_OP:
   return -1;
 }
 
-/* Parse instructions of primary opcode-59.  */
+/* Parse and record instructions of primary opcode-59 at ADDR.
+   Return 0 if successful.  */
 
 static int
 ppc_process_record_op59 (struct gdbarch *gdbarch, struct regcache *regcache,
@@ -4574,7 +4598,8 @@ ppc_process_record_op59 (struct gdbarch *gdbarch, struct regcache *regcache,
   return -1;
 }
 
-/* Parse instructions of primary opcode-60.  */
+/* Parse and record instructions of primary opcode-60 at ADDR.
+   Return 0 if successful.  */
 
 static int
 ppc_process_record_op60 (struct gdbarch *gdbarch, struct regcache *regcache,
@@ -4856,7 +4881,8 @@ ppc_process_record_op60 (struct gdbarch *gdbarch, struct regcache *regcache,
   return -1;
 }
 
-/* Parse instructions of primary opcode-63.  */
+/* Parse and record instructions of primary opcode-63 at ADDR.
+   Return 0 if successful.  */
 
 static int
 ppc_process_record_op63 (struct gdbarch *gdbarch, struct regcache *regcache,
@@ -5864,7 +5890,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     set_gdbarch_push_dummy_call (gdbarch, ppc64_sysv_abi_push_dummy_call);
 
   set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
-  set_gdbarch_in_function_epilogue_p (gdbarch, rs6000_in_function_epilogue_p);
+  set_gdbarch_stack_frame_destroyed_p (gdbarch, rs6000_stack_frame_destroyed_p);
   set_gdbarch_skip_main_prologue (gdbarch, rs6000_skip_main_prologue);
 
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -6026,7 +6052,7 @@ powerpc_set_vector_abi (char *args, int from_tty,
                        struct cmd_list_element *c)
 {
   struct gdbarch_info info;
-  enum powerpc_vector_abi vector_abi;
+  int vector_abi;
 
   for (vector_abi = POWERPC_VEC_AUTO;
        vector_abi != POWERPC_VEC_LAST;
This page took 0.031573 seconds and 4 git commands to generate.