2004-02-16 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Mon, 16 Feb 2004 20:32:01 +0000 (20:32 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 16 Feb 2004 20:32:01 +0000 (20:32 +0000)
* dwarf2-frame.c (dwarf2_frame_ops): New function.
(dwarf2_frame_set_init_reg): Use, instead of gdbarch_data.
(dwarf2_frame_init_reg): Ditto.

gdb/ChangeLog
gdb/dwarf2-frame.c

index 9650674f7a464844bcd279f3991c98c7085817da..c7d69d92b7a2c4650ab9fcfd6aa8b01344bf8a83 100644 (file)
@@ -1,5 +1,9 @@
 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
 
index 1012f440003c79f2e1696dd67de5de59d4054d8c..8c6241984532335a7948993a2384e51c5893ccd2 100644 (file)
@@ -518,6 +518,20 @@ dwarf2_frame_init (struct gdbarch *gdbarch)
   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.  */
 
@@ -528,7 +542,7 @@ dwarf2_frame_set_init_reg (struct gdbarch *gdbarch,
 {
   struct dwarf2_frame_ops *ops;
 
-  ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+  ops = dwarf2_frame_ops (gdbarch);
   ops->init_reg = init_reg;
 }
 
@@ -540,7 +554,7 @@ dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
 {
   struct dwarf2_frame_ops *ops;
 
-  ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+  ops = dwarf2_frame_ops (gdbarch);
   ops->init_reg (gdbarch, regnum, reg);
 }
 \f
This page took 0.027321 seconds and 4 git commands to generate.