diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-02-16 20:32:01 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-02-16 20:32:01 +0000 |
commit | f090b9b105484e447876f776f78153adab214f70 (patch) | |
tree | 5ba68388b3e527f61c972865e46b44e20b48976c /gdb/dwarf2-frame.c | |
parent | fd33e6cbf81f2bc8f7332e06286634f59f1d57b3 (diff) | |
download | gdb-f090b9b105484e447876f776f78153adab214f70.zip gdb-f090b9b105484e447876f776f78153adab214f70.tar.gz gdb-f090b9b105484e447876f776f78153adab214f70.tar.bz2 |
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.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r-- | gdb/dwarf2-frame.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 1012f44..8c62419 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -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); } |