+2019-04-11 Alan Hayward <alan.hayward@arm.com>
+
+ * aarch64-tdep.c (aarch64_analyze_prologue_test): Reset saved regs.
+ * trad-frame.c (trad_frame_reset_saved_regs): New function.
+ (trad_frame_alloc_saved_regs): Call trad_frame_reset_saved_regs.
+ * trad-frame.h (trad_frame_reset_saved_regs): New declaration.
+
2019-04-10 Kevin Buettner <kevinb@redhat.com>
* amd64-linux-nat.c (amd64_linux_collect_native_gregset): New
};
instruction_reader_test reader (insns);
+ trad_frame_reset_saved_regs (gdbarch, cache.saved_regs);
CORE_ADDR end = aarch64_analyze_prologue (gdbarch, 0, 128, &cache, reader);
SELF_CHECK (end == 4 * 5);
};
instruction_reader_test reader (insns);
+ trad_frame_reset_saved_regs (gdbarch, cache.saved_regs);
CORE_ADDR end = aarch64_analyze_prologue (gdbarch, 0, 128, &cache,
reader);
return this_trad_cache;
}
+/* See trad-frame.h. */
+
+void
+trad_frame_reset_saved_regs (struct gdbarch *gdbarch,
+ struct trad_frame_saved_reg *regs)
+{
+ int numregs = gdbarch_num_cooked_regs (gdbarch);
+ for (int regnum = 0; regnum < numregs; regnum++)
+ {
+ regs[regnum].realreg = regnum;
+ regs[regnum].addr = -1;
+ }
+}
+
struct trad_frame_saved_reg *
trad_frame_alloc_saved_regs (struct gdbarch *gdbarch)
{
- int regnum;
int numregs = gdbarch_num_cooked_regs (gdbarch);
struct trad_frame_saved_reg *this_saved_regs
= FRAME_OBSTACK_CALLOC (numregs, struct trad_frame_saved_reg);
- for (regnum = 0; regnum < numregs; regnum++)
- {
- this_saved_regs[regnum].realreg = regnum;
- this_saved_regs[regnum].addr = -1;
- }
+ trad_frame_reset_saved_regs (gdbarch, this_saved_regs);
return this_saved_regs;
}
int trad_frame_realreg_p (struct trad_frame_saved_reg this_saved_regs[],
int regnum);
+/* Reset the save regs cache, setting register values to -1. */
+void trad_frame_reset_saved_regs (struct gdbarch *gdbarch,
+ struct trad_frame_saved_reg *regs);
/* Return a freshly allocated (and initialized) trad_frame array. */
struct trad_frame_saved_reg *trad_frame_alloc_saved_regs (struct frame_info *);