diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-01-05 13:31:26 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-01-05 13:31:26 +0000 |
commit | 15a5b3eeaf29a0d6e55274892b5d153386d266d4 (patch) | |
tree | 4f836f484045c5689bc2f502ae9462cdc2e00e51 /gdb/arm-tdep.c | |
parent | 4c54fc26ed171989615301442435fa4dd3af9755 (diff) | |
download | gdb-15a5b3eeaf29a0d6e55274892b5d153386d266d4.zip gdb-15a5b3eeaf29a0d6e55274892b5d153386d266d4.tar.gz gdb-15a5b3eeaf29a0d6e55274892b5d153386d266d4.tar.bz2 |
2003-01-05 Andrew Cagney <ac131313@redhat.com>
* arm-tdep.c (prologue_cache): Change to a pointer.
(_initialize_arm_tdep): Allocate prologue_cache.
(check_prologue_cache): Update.
(save_prologue_cache): Update.
(arm_gdbarch_init): Update.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r-- | gdb/arm-tdep.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index e988db4..dba7dad 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -658,20 +658,20 @@ thumb_scan_prologue (struct frame_info *fi) in a row (once to get the frame chain, and once to fill in the extra frame information). */ -static struct frame_info prologue_cache; +static struct frame_info *prologue_cache; static int check_prologue_cache (struct frame_info *fi) { int i; - if (get_frame_pc (fi) == get_frame_pc (&prologue_cache)) + if (get_frame_pc (fi) == get_frame_pc (prologue_cache)) { - fi->extra_info->framereg = prologue_cache.extra_info->framereg; - fi->extra_info->framesize = prologue_cache.extra_info->framesize; - fi->extra_info->frameoffset = prologue_cache.extra_info->frameoffset; + fi->extra_info->framereg = prologue_cache->extra_info->framereg; + fi->extra_info->framesize = prologue_cache->extra_info->framesize; + fi->extra_info->frameoffset = prologue_cache->extra_info->frameoffset; for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) - get_frame_saved_regs (fi)[i] = get_frame_saved_regs (&prologue_cache)[i]; + get_frame_saved_regs (fi)[i] = get_frame_saved_regs (prologue_cache)[i]; return 1; } else @@ -686,13 +686,13 @@ save_prologue_cache (struct frame_info *fi) { int i; - deprecated_update_frame_pc_hack (&prologue_cache, get_frame_pc (fi)); - prologue_cache.extra_info->framereg = fi->extra_info->framereg; - prologue_cache.extra_info->framesize = fi->extra_info->framesize; - prologue_cache.extra_info->frameoffset = fi->extra_info->frameoffset; + deprecated_update_frame_pc_hack (prologue_cache, get_frame_pc (fi)); + prologue_cache->extra_info->framereg = fi->extra_info->framereg; + prologue_cache->extra_info->framesize = fi->extra_info->framesize; + prologue_cache->extra_info->frameoffset = fi->extra_info->frameoffset; for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) - get_frame_saved_regs (&prologue_cache)[i] = get_frame_saved_regs (fi)[i]; + get_frame_saved_regs (prologue_cache)[i] = get_frame_saved_regs (fi)[i]; } @@ -3024,13 +3024,13 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* We can't use SIZEOF_FRAME_SAVED_REGS here, since that still references the old architecture vector, not the one we are building here. */ - if (get_frame_saved_regs (&prologue_cache) != NULL) - xfree (get_frame_saved_regs (&prologue_cache)); + if (get_frame_saved_regs (prologue_cache) != NULL) + xfree (get_frame_saved_regs (prologue_cache)); /* We can't use NUM_REGS nor NUM_PSEUDO_REGS here, since that still references the old architecture vector, not the one we are building here. */ - prologue_cache.saved_regs = (CORE_ADDR *) + prologue_cache->saved_regs = (CORE_ADDR *) xcalloc (1, (sizeof (CORE_ADDR) * (gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch)))); @@ -3158,10 +3158,9 @@ The valid values are:\n"); add_com ("othernames", class_obscure, arm_othernames, "Switch to the next set of register names."); - /* Fill in the prologue_cache fields. */ - prologue_cache.saved_regs = NULL; - prologue_cache.extra_info = (struct frame_extra_info *) - xcalloc (1, sizeof (struct frame_extra_info)); + /* Allocate the prologue_cache. */ + prologue_cache = deprecated_frame_xmalloc (); + deprecated_set_frame_extra_info_hack (prologue_cache, xcalloc (1, sizeof (struct frame_extra_info))); /* Debugging flag. */ add_show_from_set (add_set_cmd ("arm", class_maintenance, var_zinteger, |