2004-02-16 Andrew Cagney <cagney@redhat.com>
+ * dwarf2-frame.c (dwarf2_frame_ops): New function.
+ (dwarf2_frame_set_init_reg): Use, instead of gdbarch_data.
+ (dwarf2_frame_init_reg): Ditto.
+
* printcmd.c (display_command): Check that EXP isn't NULL. Fix
suggested by Joshua Neuheisel
return ops;
}
+static struct dwarf2_frame_ops *
+dwarf2_frame_ops (struct gdbarch *gdbarch)
+{
+ struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+ if (ops == NULL)
+ {
+ /* ULGH, called during architecture initialization. Patch
+ things up. */
+ ops = dwarf2_frame_init (gdbarch);
+ set_gdbarch_data (gdbarch, dwarf2_frame_data, ops);
+ }
+ return ops;
+}
+
/* Set the architecture-specific register state initialization
function for GDBARCH to INIT_REG. */
{
struct dwarf2_frame_ops *ops;
- ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+ ops = dwarf2_frame_ops (gdbarch);
ops->init_reg = init_reg;
}
{
struct dwarf2_frame_ops *ops;
- ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+ ops = dwarf2_frame_ops (gdbarch);
ops->init_reg (gdbarch, regnum, reg);
}
\f