../commit.txt~
[deliverable/binutils-gdb.git] / gdb / alpha-tdep.c
index b462154452b5ff318632fa5288e714379a0f7a94..10e753b29452b79f8e3add204768c7f47a5330ed 100644 (file)
@@ -81,7 +81,7 @@ static const int subq_function = 0x29;
 /* Return the name of the REGNO register.
 
    An empty name corresponds to a register number that used to
-   be used for a virtual register. That virtual register has
+   be used for a virtual register.  That virtual register has
    been removed, but the index is still reserved to maintain
    compatibility with existing remote alpha targets.  */
 
@@ -229,30 +229,38 @@ alpha_sts (struct gdbarch *gdbarch, void *out, const void *in)
    register is a floating point register and memory format is float, as the
    register format must be double or memory format is an integer with 4
    bytes or less, as the representation of integers in floating point
-   registers is different. */
+   registers is different.  */
 
 static int
-alpha_convert_register_p (struct gdbarch *gdbarch, int regno, struct type *type)
+alpha_convert_register_p (struct gdbarch *gdbarch, int regno,
+                         struct type *type)
 {
   return (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 31
          && TYPE_LENGTH (type) != 8);
 }
 
-static void
+static int
 alpha_register_to_value (struct frame_info *frame, int regnum,
-                        struct type *valtype, gdb_byte *out)
+                        struct type *valtype, gdb_byte *out,
+                       int *optimizedp, int *unavailablep)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
   gdb_byte in[MAX_REGISTER_SIZE];
 
-  frame_register_read (frame, regnum, in);
-  switch (TYPE_LENGTH (valtype))
+  /* Convert to TYPE.  */
+  if (!get_frame_register_bytes (frame, regnum, 0,
+                                register_size (gdbarch, regnum),
+                                in, optimizedp, unavailablep))
+    return 0;
+
+  if (TYPE_LENGTH (valtype) == 4)
     {
-    case 4:
-      alpha_sts (get_frame_arch (frame), out, in);
-      break;
-    default:
-      error (_("Cannot retrieve value from floating point register"));
+      alpha_sts (gdbarch, out, in);
+      *optimizedp = *unavailablep = 0;
+      return 1;
     }
+
+  error (_("Cannot retrieve value from floating point register"));
 }
 
 static void
@@ -493,7 +501,8 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
          break;
 
        default:
-         internal_error (__FILE__, __LINE__, _("unknown floating point width"));
+         internal_error (__FILE__, __LINE__,
+                         _("unknown floating point width"));
        }
       break;
 
@@ -516,7 +525,8 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
          break;
 
        default:
-         internal_error (__FILE__, __LINE__, _("unknown floating point width"));
+         internal_error (__FILE__, __LINE__,
+                         _("unknown floating point width"));
        }
       break;
 
@@ -561,7 +571,8 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
          error (_("Cannot set a 128-bit long double return value."));
 
        default:
-         internal_error (__FILE__, __LINE__, _("unknown floating point width"));
+         internal_error (__FILE__, __LINE__,
+                         _("unknown floating point width"));
        }
       break;
 
@@ -585,7 +596,8 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
          error (_("Cannot set a 128-bit long double return value."));
 
        default:
-         internal_error (__FILE__, __LINE__, _("unknown floating point width"));
+         internal_error (__FILE__, __LINE__,
+                         _("unknown floating point width"));
        }
       break;
 
@@ -719,7 +731,7 @@ alpha_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   /* Can't determine prologue from the symbol table, need to examine
      instructions.  */
 
-  /* Skip the typical prologue instructions. These are the stack adjustment
+  /* Skip the typical prologue instructions.  These are the stack adjustment
      instruction and the instructions that save registers on the stack
      or in the gcc frame.  */
   for (offset = 0; offset < 100; offset += ALPHA_INSN_SIZE)
@@ -924,6 +936,7 @@ alpha_sigtramp_frame_sniffer (const struct frame_unwind *self,
 
 static const struct frame_unwind alpha_sigtramp_frame_unwind = {
   SIGTRAMP_FRAME,
+  default_frame_unwind_stop_reason,
   alpha_sigtramp_frame_this_id,
   alpha_sigtramp_frame_prev_register,
   NULL,
@@ -1059,8 +1072,7 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc,
 
      If anything different is found, the function returns without
      changing PC and FRAME_SIZE.  Otherwise, PC will point immediately
-     after this sequence, and FRAME_SIZE will be updated.
-  */
+     after this sequence, and FRAME_SIZE will be updated.  */
 
   /* lda     REG_INDEX,NB_OF_ITERATIONS */
 
@@ -1176,7 +1188,7 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *this_frame,
              if (word & 0x8000)
                {
                  /* Consider only the first stack allocation instruction
-                    to contain the static size of the frame. */
+                    to contain the static size of the frame.  */
                  if (frame_size == 0)
                    frame_size = (-word) & 0xffff;
                }
@@ -1232,10 +1244,11 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *this_frame,
                 So we recognize only a few registers (t7, t9, ra) within
                 the procedure prologue as valid return address registers.
                 If we encounter a return instruction, we extract the
-                the return address register from it.
+                return address register from it.
 
                 FIXME: Rewriting GDB to access the procedure descriptors,
-                e.g. via the minimal symbol table, might obviate this hack.  */
+                e.g. via the minimal symbol table, might obviate this
+                hack.  */
              if (return_reg == -1
                  && cur_pc < (start_pc + 80)
                  && (reg == ALPHA_T7_REGNUM
@@ -1339,6 +1352,7 @@ alpha_heuristic_frame_prev_register (struct frame_info *this_frame,
 
 static const struct frame_unwind alpha_heuristic_frame_unwind = {
   NORMAL_FRAME,
+  default_frame_unwind_stop_reason,
   alpha_heuristic_frame_this_id,
   alpha_heuristic_frame_prev_register,
   NULL,
@@ -1511,7 +1525,7 @@ alpha_next_pc (struct frame_info *frame, CORE_ADDR pc)
 
   insn = alpha_read_insn (gdbarch, pc);
 
-  /* Opcode is top 6 bits. */
+  /* Opcode is top 6 bits.  */
   op = (insn >> 26) & 0x3f;
 
   if (op == 0x1a)
@@ -1674,7 +1688,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   tdep->sc_regs_offset = 4 * 8;
   tdep->sc_fpregs_offset = tdep->sc_regs_offset + 32 * 8 + 8;
 
-  tdep->jb_pc = -1;    /* longjmp support not enabled by default  */
+  tdep->jb_pc = -1;    /* longjmp support not enabled by default.  */
 
   tdep->return_in_memory = alpha_return_in_memory_always;
 
@@ -1780,6 +1794,7 @@ If you are debugging a stripped executable, GDB needs to search through the\n\
 program for the start of a function.  This command sets the distance of the\n\
 search.  The only need to set it is when debugging a stripped executable."),
                            reinit_frame_cache_sfunc,
-                           NULL, /* FIXME: i18n: The distance searched for the start of a function is \"%d\".  */
+                           NULL, /* FIXME: i18n: The distance searched for
+                                    the start of a function is \"%d\".  */
                            &setlist, &showlist);
 }
This page took 0.025623 seconds and 4 git commands to generate.