diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-01-08 17:21:30 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-01-08 17:21:30 +0000 |
commit | 49e0150c540bb49db39bf824655ba42eaa9b1d64 (patch) | |
tree | d22e13ba9a7c5d92eb8a801af981804a29f2c204 | |
parent | 518bff51211073170183f96333aeb26982dd894f (diff) | |
download | gdb-49e0150c540bb49db39bf824655ba42eaa9b1d64.tar.gz |
2003-01-08 Andrew Cagney <cagney@redhat.com>
* alpha-tdep.c: Use get_frame_extra_info.
* arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
* h8300-tdep.c, ia64-tdep.c, m68hc11-tdep.c, mcore-tdep.c: Ditto.
* mips-tdep.c, mn10300-tdep.c, s390-tdep.c, sh-tdep.c: Ditto.
* sparc-tdep.c, xstormy16-tdep.c: Ditto.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/alpha-tdep.c | 33 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 95 | ||||
-rw-r--r-- | gdb/avr-tdep.c | 75 | ||||
-rw-r--r-- | gdb/cris-tdep.c | 24 | ||||
-rw-r--r-- | gdb/d10v-tdep.c | 28 | ||||
-rw-r--r-- | gdb/h8300-tdep.c | 24 | ||||
-rw-r--r-- | gdb/ia64-tdep.c | 59 | ||||
-rw-r--r-- | gdb/m68hc11-tdep.c | 37 | ||||
-rw-r--r-- | gdb/mcore-tdep.c | 40 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 22 | ||||
-rw-r--r-- | gdb/mn10300-tdep.c | 36 | ||||
-rw-r--r-- | gdb/s390-tdep.c | 61 | ||||
-rw-r--r-- | gdb/sh-tdep.c | 59 | ||||
-rw-r--r-- | gdb/sparc-tdep.c | 102 | ||||
-rw-r--r-- | gdb/xstormy16-tdep.c | 34 |
16 files changed, 383 insertions, 352 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ebea1b21561..acbe8e68894 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2003-01-08 Andrew Cagney <cagney@redhat.com> + * alpha-tdep.c: Use get_frame_extra_info. + * arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto. + * h8300-tdep.c, ia64-tdep.c, m68hc11-tdep.c, mcore-tdep.c: Ditto. + * mips-tdep.c, mn10300-tdep.c, s390-tdep.c, sh-tdep.c: Ditto. + * sparc-tdep.c, xstormy16-tdep.c: Ditto. + * alpha-tdep.c: Use get_next_frame. * arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto. * dwarf2cfi.c, h8300-tdep.c, i386-tdep.c, ia64-tdep.c: Ditto. diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 037ae39d159..9cca20dab9b 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -401,7 +401,7 @@ alpha_find_saved_regs (struct frame_info *frame) return; } - proc_desc = frame->extra_info->proc_desc; + proc_desc = get_frame_extra_info (frame)->proc_desc; if (proc_desc == NULL) /* I'm not sure how/whether this can happen. Normally when we can't find a proc_desc, we "synthesize" one using heuristic_proc_desc @@ -488,11 +488,12 @@ read_next_frame_reg (struct frame_info *fi, int regno) static CORE_ADDR alpha_frame_saved_pc (struct frame_info *frame) { - alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc; + alpha_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc; /* We have to get the saved pc from the sigcontext if it is a signal handler frame. */ - int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM - : frame->extra_info->pc_reg; + int pcreg = ((get_frame_type (frame) == SIGTRAMP_FRAME) + ? PC_REGNUM + : get_frame_extra_info (frame)->pc_reg); if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc)) return read_memory_integer (get_frame_base (frame) - 8, 8); @@ -967,12 +968,12 @@ void alpha_print_extra_frame_info (struct frame_info *fi) { if (fi - && fi->extra_info - && fi->extra_info->proc_desc - && fi->extra_info->proc_desc->pdr.framereg < NUM_REGS) + && get_frame_extra_info (fi) + && get_frame_extra_info (fi)->proc_desc + && get_frame_extra_info (fi)->proc_desc->pdr.framereg < NUM_REGS) printf_filtered (" frame pointer is at %s+%s\n", - REGISTER_NAME (fi->extra_info->proc_desc->pdr.framereg), - paddr_d (fi->extra_info->proc_desc->pdr.frameoffset)); + REGISTER_NAME (get_frame_extra_info (fi)->proc_desc->pdr.framereg), + paddr_d (get_frame_extra_info (fi)->proc_desc->pdr.frameoffset)); } static void @@ -989,16 +990,16 @@ alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame) /* NOTE: cagney/2003-01-03: No need to set saved_regs to NULL, always NULL by default. */ /* frame->saved_regs = NULL; */ - frame->extra_info->localoff = 0; - frame->extra_info->pc_reg = ALPHA_RA_REGNUM; - frame->extra_info->proc_desc = proc_desc == &temp_proc_desc ? 0 : proc_desc; + get_frame_extra_info (frame)->localoff = 0; + get_frame_extra_info (frame)->pc_reg = ALPHA_RA_REGNUM; + get_frame_extra_info (frame)->proc_desc = proc_desc == &temp_proc_desc ? 0 : proc_desc; if (proc_desc) { /* Get the locals offset and the saved pc register from the procedure descriptor, they are valid even if we are in the middle of the prologue. */ - frame->extra_info->localoff = PROC_LOCALOFF (proc_desc); - frame->extra_info->pc_reg = PROC_PC_REG (proc_desc); + get_frame_extra_info (frame)->localoff = PROC_LOCALOFF (proc_desc); + get_frame_extra_info (frame)->pc_reg = PROC_PC_REG (proc_desc); /* Fixup frame-pointer - only needed for top frame */ @@ -1045,7 +1046,7 @@ alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame) static CORE_ADDR alpha_frame_locals_address (struct frame_info *fi) { - return (get_frame_base (fi) - fi->extra_info->localoff); + return (get_frame_base (fi) - get_frame_extra_info (fi)->localoff); } static CORE_ADDR @@ -1293,7 +1294,7 @@ alpha_pop_frame (void) struct frame_info *frame = get_current_frame (); CORE_ADDR new_sp = get_frame_base (frame); - alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc; + alpha_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc; /* we need proc_desc to know how to restore the registers; if it is NULL, construct (a temporary) one */ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 59920e2d711..5d8fbfc0ce8 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -568,7 +568,7 @@ thumb_scan_prologue (struct frame_info *fi) frame pointer, adjust the stack pointer, and save registers. Do this until all basic prolog instructions are found. */ - fi->extra_info->framesize = 0; + get_frame_extra_info (fi)->framesize = 0; for (current_pc = prologue_start; (current_pc < prologue_end) && ((findmask & 7) != 7); current_pc += 2) @@ -591,9 +591,9 @@ thumb_scan_prologue (struct frame_info *fi) for (regno = ARM_LR_REGNUM; regno >= 0; regno--) if (mask & (1 << regno)) { - fi->extra_info->framesize += 4; + get_frame_extra_info (fi)->framesize += 4; get_frame_saved_regs (fi)[saved_reg[regno]] = - -(fi->extra_info->framesize); + -(get_frame_extra_info (fi)->framesize); /* Reset saved register map. */ saved_reg[regno] = regno; } @@ -609,23 +609,23 @@ thumb_scan_prologue (struct frame_info *fi) offset = (insn & 0x7f) << 2; /* get scaled offset */ if (insn & 0x80) /* is it signed? (==subtracting) */ { - fi->extra_info->frameoffset += offset; + get_frame_extra_info (fi)->frameoffset += offset; offset = -offset; } - fi->extra_info->framesize -= offset; + get_frame_extra_info (fi)->framesize -= offset; } else if ((insn & 0xff00) == 0xaf00) /* add r7, sp, #imm */ { findmask |= 2; /* setting of r7 found */ - fi->extra_info->framereg = THUMB_FP_REGNUM; + get_frame_extra_info (fi)->framereg = THUMB_FP_REGNUM; /* get scaled offset */ - fi->extra_info->frameoffset = (insn & 0xff) << 2; + get_frame_extra_info (fi)->frameoffset = (insn & 0xff) << 2; } else if (insn == 0x466f) /* mov r7, sp */ { findmask |= 2; /* setting of r7 found */ - fi->extra_info->framereg = THUMB_FP_REGNUM; - fi->extra_info->frameoffset = 0; + get_frame_extra_info (fi)->framereg = THUMB_FP_REGNUM; + get_frame_extra_info (fi)->frameoffset = 0; saved_reg[THUMB_FP_REGNUM] = ARM_SP_REGNUM; } else if ((insn & 0xffc0) == 0x4640) /* mov r0-r7, r8-r15 */ @@ -667,9 +667,9 @@ check_prologue_cache (struct frame_info *fi) 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; + get_frame_extra_info (fi)->framereg = get_frame_extra_info (prologue_cache)->framereg; + get_frame_extra_info (fi)->framesize = get_frame_extra_info (prologue_cache)->framesize; + get_frame_extra_info (fi)->frameoffset = get_frame_extra_info (prologue_cache)->frameoffset; for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) get_frame_saved_regs (fi)[i] = get_frame_saved_regs (prologue_cache)[i]; return 1; @@ -687,9 +687,9 @@ 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; + get_frame_extra_info (prologue_cache)->framereg = get_frame_extra_info (fi)->framereg; + get_frame_extra_info (prologue_cache)->framesize = get_frame_extra_info (fi)->framesize; + get_frame_extra_info (prologue_cache)->frameoffset = get_frame_extra_info (fi)->frameoffset; for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) get_frame_saved_regs (prologue_cache)[i] = get_frame_saved_regs (fi)[i]; @@ -775,9 +775,9 @@ arm_scan_prologue (struct frame_info *fi) return; /* Assume there is no frame until proven otherwise. */ - fi->extra_info->framereg = ARM_SP_REGNUM; - fi->extra_info->framesize = 0; - fi->extra_info->frameoffset = 0; + get_frame_extra_info (fi)->framereg = ARM_SP_REGNUM; + get_frame_extra_info (fi)->framesize = 0; + get_frame_extra_info (fi)->frameoffset = 0; /* Check for Thumb prologue. */ if (arm_pc_is_thumb (get_frame_pc (fi))) @@ -914,7 +914,7 @@ arm_scan_prologue (struct frame_info *fi) unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */ imm = (imm >> rot) | (imm << (32 - rot)); fp_offset = -imm; - fi->extra_info->framereg = ARM_FP_REGNUM; + get_frame_extra_info (fi)->framereg = ARM_FP_REGNUM; } else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */ { @@ -970,11 +970,11 @@ arm_scan_prologue (struct frame_info *fi) /* The frame size is just the negative of the offset (from the original SP) of the last thing thing we pushed on the stack. The frame offset is [new FP] - [new SP]. */ - fi->extra_info->framesize = -sp_offset; - if (fi->extra_info->framereg == ARM_FP_REGNUM) - fi->extra_info->frameoffset = fp_offset - sp_offset; + get_frame_extra_info (fi)->framesize = -sp_offset; + if (get_frame_extra_info (fi)->framereg == ARM_FP_REGNUM) + get_frame_extra_info (fi)->frameoffset = fp_offset - sp_offset; else - fi->extra_info->frameoffset = 0; + get_frame_extra_info (fi)->frameoffset = 0; save_prologue_cache (fi); } @@ -1022,7 +1022,7 @@ static CORE_ADDR arm_frame_chain (struct frame_info *fi) { CORE_ADDR caller_pc; - int framereg = fi->extra_info->framereg; + int framereg = get_frame_extra_info (fi)->framereg; if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0)) /* A generic call dummy's frame is the same as caller's. */ @@ -1050,7 +1050,7 @@ arm_frame_chain (struct frame_info *fi) /* Now, scan the prologue and obtain the frame register. */ deprecated_update_frame_pc_hack (caller_fi, caller_pc); arm_scan_prologue (caller_fi); - framereg = caller_fi->extra_info->framereg; + framereg = get_frame_extra_info (caller_fi)->framereg; /* Deallocate the storage associated with the temporary frame created above. */ @@ -1062,7 +1062,7 @@ arm_frame_chain (struct frame_info *fi) if (framereg == ARM_FP_REGNUM || framereg == THUMB_FP_REGNUM) return arm_find_callers_reg (fi, framereg); else - return get_frame_base (fi) + fi->extra_info->framesize; + return get_frame_base (fi) + get_frame_extra_info (fi)->framesize; } /* This function actually figures out the frame address for a given pc @@ -1085,9 +1085,9 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - fi->extra_info->framesize = 0; - fi->extra_info->frameoffset = 0; - fi->extra_info->framereg = 0; + get_frame_extra_info (fi)->framesize = 0; + get_frame_extra_info (fi)->frameoffset = 0; + get_frame_extra_info (fi)->framereg = 0; if (get_next_frame (fi)) deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi))); @@ -1105,8 +1105,9 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) get_frame_base (get_next_frame (fi)), ARM_SP_REGNUM); else - sp = (get_frame_base (get_next_frame (fi)) - get_next_frame (fi)->extra_info->frameoffset - + get_next_frame (fi)->extra_info->framesize); + sp = (get_frame_base (get_next_frame (fi)) + - get_frame_extra_info (get_next_frame (fi))->frameoffset + + get_frame_extra_info (get_next_frame (fi))->framesize); /* Determine whether or not we're in a sigtramp frame. Unfortunately, it isn't sufficient to test (get_frame_type (fi) @@ -1132,10 +1133,10 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) get_frame_saved_regs (fi)[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, get_frame_pc (fi), reg); /* FIXME: What about thumb mode? */ - fi->extra_info->framereg = ARM_SP_REGNUM; - deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (fi)[fi->extra_info->framereg], REGISTER_RAW_SIZE (fi->extra_info->framereg))); - fi->extra_info->framesize = 0; - fi->extra_info->frameoffset = 0; + get_frame_extra_info (fi)->framereg = ARM_SP_REGNUM; + deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (fi)[get_frame_extra_info (fi)->framereg], REGISTER_RAW_SIZE (get_frame_extra_info (fi)->framereg))); + get_frame_extra_info (fi)->framesize = 0; + get_frame_extra_info (fi)->frameoffset = 0; } else @@ -1144,18 +1145,18 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (!get_next_frame (fi)) /* This is the innermost frame? */ - deprecated_update_frame_base_hack (fi, read_register (fi->extra_info->framereg)); + deprecated_update_frame_base_hack (fi, read_register (get_frame_extra_info (fi)->framereg)); else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 0, 0)) /* Next inner most frame is a dummy, just grab its frame. Dummy frames always have the same FP as their caller. */ deprecated_update_frame_base_hack (fi, get_frame_base (get_next_frame (fi))); - else if (fi->extra_info->framereg == ARM_FP_REGNUM - || fi->extra_info->framereg == THUMB_FP_REGNUM) + else if (get_frame_extra_info (fi)->framereg == ARM_FP_REGNUM + || get_frame_extra_info (fi)->framereg == THUMB_FP_REGNUM) { /* not the innermost frame */ /* If we have an FP, the callee saved it. */ - if (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg] != 0) - deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg], 4)); + if (get_frame_saved_regs (get_next_frame (fi))[get_frame_extra_info (fi)->framereg] != 0) + deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (get_next_frame (fi))[get_frame_extra_info (fi)->framereg], 4)); else if (fromleaf) /* If we were called by a frameless fn. then our frame is still in the frame pointer register on the board... */ @@ -1166,9 +1167,10 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) determined by arm_scan_prologue. */ for (reg = 0; reg < NUM_REGS; reg++) if (get_frame_saved_regs (fi)[reg] != 0) - get_frame_saved_regs (fi)[reg] += (get_frame_base (fi) - + fi->extra_info->framesize - - fi->extra_info->frameoffset); + get_frame_saved_regs (fi)[reg] + += (get_frame_base (fi) + + get_frame_extra_info (fi)->framesize + - get_frame_extra_info (fi)->frameoffset); } } @@ -1191,7 +1193,7 @@ arm_frame_saved_pc (struct frame_info *fi) if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), (get_frame_base (fi) - - fi->extra_info->frameoffset), + - get_frame_extra_info (fi)->frameoffset), get_frame_base (fi))) { return read_memory_integer (get_frame_saved_regs (fi)[ARM_PC_REGNUM], @@ -1514,8 +1516,9 @@ arm_pop_frame (void) { int regnum; struct frame_info *frame = get_current_frame (); - CORE_ADDR old_SP = (get_frame_base (frame) - frame->extra_info->frameoffset - + frame->extra_info->framesize); + CORE_ADDR old_SP = (get_frame_base (frame) + - get_frame_extra_info (frame)->frameoffset + + get_frame_extra_info (frame)->framesize); if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), get_frame_base (frame), diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index cedabaf16f0..a4893babb25 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -469,7 +469,7 @@ avr_scan_prologue (struct frame_info *fi) unsigned char prologue[AVR_MAX_PROLOGUE_SIZE]; int vpc = 0; - fi->extra_info->framereg = AVR_SP_REGNUM; + get_frame_extra_info (fi)->framereg = AVR_SP_REGNUM; if (find_pc_partial_function (get_frame_pc (fi), &name, &prologue_start, &prologue_end)) @@ -491,7 +491,7 @@ avr_scan_prologue (struct frame_info *fi) /* Search the prologue looking for instructions that set up the frame pointer, adjust the stack pointer, and save registers. */ - fi->extra_info->framesize = 0; + get_frame_extra_info (fi)->framesize = 0; prologue_len = prologue_end - prologue_start; read_memory (prologue_start, prologue, prologue_len); @@ -509,7 +509,7 @@ avr_scan_prologue (struct frame_info *fi) 0xcd, 0xbf /* out __SP_L__,r28 */ }; - fi->extra_info->framereg = AVR_FP_REGNUM; + get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM; insn = EXTRACT_INSN (&prologue[vpc]); /* ldi r28,lo8(<RAM_ADDR> - <LOCALS_SIZE>) */ if ((insn & 0xf0f0) == 0xe0c0) @@ -524,7 +524,7 @@ avr_scan_prologue (struct frame_info *fi) { deprecated_update_frame_base_hack (fi, locals); - fi->extra_info->is_main = 1; + get_frame_extra_info (fi)->is_main = 1; return; } } @@ -601,9 +601,9 @@ avr_scan_prologue (struct frame_info *fi) from <= AVR_LAST_PUSHED_REGNUM; ++from) get_frame_saved_regs (fi)[from] = ++i; } - fi->extra_info->locals_size = loc_size; - fi->extra_info->framesize = loc_size + num_pushes; - fi->extra_info->framereg = AVR_FP_REGNUM; + get_frame_extra_info (fi)->locals_size = loc_size; + get_frame_extra_info (fi)->framesize = loc_size + num_pushes; + get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM; return; } @@ -624,14 +624,14 @@ avr_scan_prologue (struct frame_info *fi) vpc += sizeof (img); get_frame_saved_regs (fi)[0] = 2; get_frame_saved_regs (fi)[1] = 1; - fi->extra_info->framesize += 3; + get_frame_extra_info (fi)->framesize += 3; } else if (memcmp (img + 1, prologue, sizeof (img) - 1) == 0) { vpc += sizeof (img) - 1; get_frame_saved_regs (fi)[0] = 2; get_frame_saved_regs (fi)[1] = 1; - fi->extra_info->framesize += 3; + get_frame_extra_info (fi)->framesize += 3; } } @@ -645,8 +645,8 @@ avr_scan_prologue (struct frame_info *fi) { /* Bits 4-9 contain a mask for registers R0-R32. */ regno = (insn & 0x1f0) >> 4; - ++fi->extra_info->framesize; - get_frame_saved_regs (fi)[regno] = fi->extra_info->framesize; + ++get_frame_extra_info (fi)->framesize; + get_frame_saved_regs (fi)[regno] = get_frame_extra_info (fi)->framesize; scan_stage = 1; } else @@ -669,7 +669,7 @@ avr_scan_prologue (struct frame_info *fi) if (memcmp (prologue + vpc, img, sizeof (img)) == 0) { vpc += 4; - fi->extra_info->framereg = AVR_FP_REGNUM; + get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM; scan_stage = 2; } } @@ -718,8 +718,8 @@ avr_scan_prologue (struct frame_info *fi) } else return; - fi->extra_info->locals_size = locals_size; - fi->extra_info->framesize += locals_size; + get_frame_extra_info (fi)->locals_size = locals_size; + get_frame_extra_info (fi)->framesize += locals_size; } } @@ -740,12 +740,12 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi) frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); frame_saved_regs_zalloc (fi); - fi->extra_info->return_pc = 0; - fi->extra_info->args_pointer = 0; - fi->extra_info->locals_size = 0; - fi->extra_info->framereg = 0; - fi->extra_info->framesize = 0; - fi->extra_info->is_main = 0; + get_frame_extra_info (fi)->return_pc = 0; + get_frame_extra_info (fi)->args_pointer = 0; + get_frame_extra_info (fi)->locals_size = 0; + get_frame_extra_info (fi)->framereg = 0; + get_frame_extra_info (fi)->framesize = 0; + get_frame_extra_info (fi)->is_main = 0; avr_scan_prologue (fi); @@ -757,14 +757,18 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi) deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), AVR_PC_REGNUM)); } - else if (!get_next_frame (fi)) /* this is the innermost frame? */ - deprecated_update_frame_base_hack (fi, read_register (fi->extra_info->framereg)); - else if (fi->extra_info->is_main != 1) /* not the innermost frame, not `main' */ + else if (!get_next_frame (fi)) + /* this is the innermost frame? */ + deprecated_update_frame_base_hack (fi, read_register (get_frame_extra_info (fi)->framereg)); + else if (get_frame_extra_info (fi)->is_main != 1) + /* not the innermost frame, not `main' */ /* If we have an next frame, the callee saved it. */ { struct frame_info *next_fi = get_next_frame (fi); - if (fi->extra_info->framereg == AVR_SP_REGNUM) - deprecated_update_frame_base_hack (fi, get_frame_base (next_fi) + 2 /* ret addr */ + next_fi->extra_info->framesize); + if (get_frame_extra_info (fi)->framereg == AVR_SP_REGNUM) + deprecated_update_frame_base_hack (fi, (get_frame_base (next_fi) + + 2 /* ret addr */ + + get_frame_extra_info (next_fi)->framesize)); /* FIXME: I don't analyse va_args functions */ else { @@ -794,23 +798,24 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* TRoth: Do we want to do this if we are in main? I don't think we should since return_pc makes no sense when we are in main. */ - if ((get_frame_pc (fi)) && (fi->extra_info->is_main == 0)) /* We are not in CALL_DUMMY */ + if ((get_frame_pc (fi)) && (get_frame_extra_info (fi)->is_main == 0)) + /* We are not in CALL_DUMMY */ { CORE_ADDR addr; int i; - addr = get_frame_base (fi) + fi->extra_info->framesize + 1; + addr = get_frame_base (fi) + get_frame_extra_info (fi)->framesize + 1; /* Return address in stack in different endianness */ - fi->extra_info->return_pc = + get_frame_extra_info (fi)->return_pc = read_memory_unsigned_integer (avr_make_saddr (addr), 1) << 8; - fi->extra_info->return_pc |= + get_frame_extra_info (fi)->return_pc |= read_memory_unsigned_integer (avr_make_saddr (addr + 1), 1); /* This return address in words, must be converted to the bytes address */ - fi->extra_info->return_pc *= 2; + get_frame_extra_info (fi)->return_pc *= 2; /* Resolve a pushed registers addresses */ for (i = 0; i < NUM_REGS; i++) @@ -857,7 +862,7 @@ avr_pop_frame (void) } /* Don't forget the update the PC too! */ - write_pc (frame->extra_info->return_pc); + write_pc (get_frame_extra_info (frame)->return_pc); } flush_cached_frames (); } @@ -874,7 +879,7 @@ avr_frame_saved_pc (struct frame_info *frame) get_frame_base (frame), AVR_PC_REGNUM); else - return frame->extra_info->return_pc; + return get_frame_extra_info (frame)->return_pc; } static CORE_ADDR @@ -1040,14 +1045,14 @@ avr_frame_chain (struct frame_info *frame) get_frame_base (frame))) { /* initialize the return_pc now */ - frame->extra_info->return_pc + get_frame_extra_info (frame)->return_pc = deprecated_read_register_dummy (get_frame_pc (frame), get_frame_base (frame), AVR_PC_REGNUM); return get_frame_base (frame); } - return (frame->extra_info->is_main ? 0 - : get_frame_base (frame) + frame->extra_info->framesize + 2 /* ret addr */ ); + return (get_frame_extra_info (frame)->is_main ? 0 + : get_frame_base (frame) + get_frame_extra_info (frame)->framesize + 2 /* ret addr */ ); } /* Store the address of the place in which to copy the structure the diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 6ae9f436745..065ba3d2f47 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -488,7 +488,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi, short source_register; /* This frame is with respect to a leaf until a push srp is found. */ - fi->extra_info->leaf_function = 1; + get_frame_extra_info (fi)->leaf_function = 1; /* This frame is without the FP until a push fp is found. */ have_fp = 0; @@ -527,7 +527,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi, { return ip; } - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->leaf_function = 0; } else if (regno == FP_REGNUM) { @@ -689,7 +689,7 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi, get_frame_saved_regs (fi)[regno] = get_frame_base (fi) - val; val -= 4; } - if (fi->extra_info->leaf_function) + if (get_frame_extra_info (fi)->leaf_function) { /* Set the register SP to contain the stack pointer of the caller. */ @@ -1209,8 +1209,8 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - fi->extra_info->return_pc = 0; - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->return_pc = 0; + get_frame_extra_info (fi)->leaf_function = 0; if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), @@ -1219,12 +1219,12 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM)); - fi->extra_info->return_pc = + get_frame_extra_info (fi)->return_pc = deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), PC_REGNUM); /* FIXME: Is this necessarily true? */ - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->leaf_function = 0; } else { @@ -1235,16 +1235,16 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (get_frame_saved_regs (fi)[SRP_REGNUM] != 0) { /* SRP was saved on the stack; non-leaf function. */ - fi->extra_info->return_pc = + get_frame_extra_info (fi)->return_pc = read_memory_integer (get_frame_saved_regs (fi)[SRP_REGNUM], REGISTER_RAW_SIZE (SRP_REGNUM)); } else { /* SRP is still in a register; leaf function. */ - fi->extra_info->return_pc = read_register (SRP_REGNUM); + get_frame_extra_info (fi)->return_pc = read_register (SRP_REGNUM); /* FIXME: Should leaf_function be set to 1 here? */ - fi->extra_info->leaf_function = 1; + get_frame_extra_info (fi)->leaf_function = 1; } } } @@ -1276,7 +1276,7 @@ cris_frame_chain (struct frame_info *fi) CORE_ADDR cris_frame_saved_pc (struct frame_info *fi) { - return fi->extra_info->return_pc; + return get_frame_extra_info (fi)->return_pc; } /* Setup the function arguments for calling a function in the inferior. */ @@ -1570,7 +1570,7 @@ cris_pop_frame (void) } /* Restore the PC. */ - write_register (PC_REGNUM, fi->extra_info->return_pc); + write_register (PC_REGNUM, get_frame_extra_info (fi)->return_pc); } flush_cached_frames (); } diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index f4bb749b4e9..d3b78673a8d 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -512,7 +512,7 @@ d10v_frame_saved_pc (struct frame_info *frame) get_frame_base (frame), PC_REGNUM)); else - return ((frame)->extra_info->return_pc); + return (get_frame_extra_info (frame)->return_pc); } /* Immediately after a function call, return the saved pc. We can't @@ -570,7 +570,7 @@ do_d10v_pop_frame (struct frame_info *fi) } write_register (PC_REGNUM, read_register (LR_REGNUM)); - write_register (SP_REGNUM, fp + fi->extra_info->size); + write_register (SP_REGNUM, fp + get_frame_extra_info (fi)->size); target_store_registers (-1); flush_cached_frames (); } @@ -690,12 +690,12 @@ d10v_frame_chain (struct frame_info *fi) d10v_frame_init_saved_regs (fi); - if (fi->extra_info->return_pc == IMEM_START - || inside_entry_file (fi->extra_info->return_pc)) + if (get_frame_extra_info (fi)->return_pc == IMEM_START + || inside_entry_file (get_frame_extra_info (fi)->return_pc)) { /* This is meant to halt the backtrace at "_start". Make sure we don't halt it at a generic dummy frame. */ - if (!DEPRECATED_PC_IN_CALL_DUMMY (fi->extra_info->return_pc, 0, 0)) + if (!DEPRECATED_PC_IN_CALL_DUMMY (get_frame_extra_info (fi)->return_pc, 0, 0)) return (CORE_ADDR) 0; } @@ -854,7 +854,7 @@ d10v_frame_init_saved_regs (struct frame_info *fi) pc += 4; } - fi->extra_info->size = -next_addr; + get_frame_extra_info (fi)->size = -next_addr; if (!(fp & 0xffff)) fp = d10v_read_sp (); @@ -870,11 +870,11 @@ d10v_frame_init_saved_regs (struct frame_info *fi) CORE_ADDR return_pc = read_memory_unsigned_integer (get_frame_saved_regs (fi)[LR_REGNUM], REGISTER_RAW_SIZE (LR_REGNUM)); - fi->extra_info->return_pc = d10v_make_iaddr (return_pc); + get_frame_extra_info (fi)->return_pc = d10v_make_iaddr (return_pc); } else { - fi->extra_info->return_pc = d10v_make_iaddr (read_register (LR_REGNUM)); + get_frame_extra_info (fi)->return_pc = d10v_make_iaddr (read_register (LR_REGNUM)); } /* The SP is not normally (ever?) saved, but check anyway */ @@ -884,11 +884,11 @@ d10v_frame_init_saved_regs (struct frame_info *fi) /* otherwise, it isn't being used, so we use the SP instead */ if (uses_frame) get_frame_saved_regs (fi)[SP_REGNUM] - = d10v_read_fp () + fi->extra_info->size; + = d10v_read_fp () + get_frame_extra_info (fi)->size; else { - get_frame_saved_regs (fi)[SP_REGNUM] = fp + fi->extra_info->size; - fi->extra_info->frameless = 1; + get_frame_saved_regs (fi)[SP_REGNUM] = fp + get_frame_extra_info (fi)->size; + get_frame_extra_info (fi)->frameless = 1; get_frame_saved_regs (fi)[FP_REGNUM] = 0; } } @@ -900,9 +900,9 @@ d10v_init_extra_frame_info (int fromleaf, struct frame_info *fi) frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); frame_saved_regs_zalloc (fi); - fi->extra_info->frameless = 0; - fi->extra_info->size = 0; - fi->extra_info->return_pc = 0; + get_frame_extra_info (fi)->frameless = 0; + get_frame_extra_info (fi)->size = 0; + get_frame_extra_info (fi)->return_pc = 0; /* If get_frame_pc (fi) is zero, but this is not the outermost frame, then let's snatch the return_pc from the callee, so that diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index b8a65613a66..8119a2de5c5 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -440,11 +440,11 @@ h8300_examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, } /* The args are always reffed based from the stack pointer */ - fi->extra_info->args_pointer = after_prolog_fp; + get_frame_extra_info (fi)->args_pointer = after_prolog_fp; /* Locals are always reffed based from the fp */ - fi->extra_info->locals_pointer = after_prolog_fp; + get_frame_extra_info (fi)->locals_pointer = after_prolog_fp; /* The PC is at a known place */ - fi->extra_info->from_pc = + get_frame_extra_info (fi)->from_pc = read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD); /* Rememeber any others too */ @@ -498,7 +498,7 @@ h8300_frame_chain (struct frame_info *thisframe) get_frame_base (thisframe), get_frame_base (thisframe))) { /* initialize the from_pc now */ - thisframe->extra_info->from_pc = + get_frame_extra_info (thisframe)->from_pc = deprecated_read_register_dummy (get_frame_pc (thisframe), get_frame_base (thisframe), E_PC_REGNUM); @@ -522,18 +522,18 @@ h8300_frame_saved_pc (struct frame_info *frame) get_frame_base (frame), E_PC_REGNUM); else - return frame->extra_info->from_pc; + return get_frame_extra_info (frame)->from_pc; } static void h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi) { - if (!fi->extra_info) + if (!get_frame_extra_info (fi)) { frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - fi->extra_info->from_pc = 0; - fi->extra_info->args_pointer = 0; /* Unknown */ - fi->extra_info->locals_pointer = 0; /* Unknown */ + get_frame_extra_info (fi)->from_pc = 0; + get_frame_extra_info (fi)->args_pointer = 0; /* Unknown */ + get_frame_extra_info (fi)->locals_pointer = 0; /* Unknown */ if (!get_frame_pc (fi)) { @@ -550,7 +550,7 @@ h8300_frame_locals_address (struct frame_info *fi) if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), get_frame_base (fi))) return (CORE_ADDR) 0; /* Not sure what else to do... */ - return fi->extra_info->locals_pointer; + return get_frame_extra_info (fi)->locals_pointer; } /* Return the address of the argument block for the frame @@ -562,7 +562,7 @@ h8300_frame_args_address (struct frame_info *fi) if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), get_frame_base (fi))) return (CORE_ADDR) 0; /* Not sure what else to do... */ - return fi->extra_info->args_pointer; + return get_frame_extra_info (fi)->args_pointer; } /* Round N up or down to the nearest multiple of UNIT. @@ -776,7 +776,7 @@ h8300_pop_frame (void) } /* Don't forget to update the PC too! */ - write_register (E_PC_REGNUM, frame->extra_info->from_pc); + write_register (E_PC_REGNUM, get_frame_extra_info (frame)->from_pc); } flush_cached_frames (); } diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index d971828e60d..b37da525580 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -716,7 +716,7 @@ ia64_frame_chain (struct frame_info *frame) return read_memory_integer (get_frame_saved_regs (frame)[IA64_VFP_REGNUM], 8); else return (get_frame_base (frame) - + frame->extra_info->mem_stack_frame_size); + + get_frame_extra_info (frame)->mem_stack_frame_size); } } @@ -847,9 +847,9 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) if (frame && !do_fsr_stuff - && frame->extra_info->after_prologue != 0 - && frame->extra_info->after_prologue <= lim_pc) - return frame->extra_info->after_prologue; + && get_frame_extra_info (frame)->after_prologue != 0 + && get_frame_extra_info (frame)->after_prologue <= lim_pc) + return get_frame_extra_info (frame)->after_prologue; lim_pc = refine_prologue_limit (pc, lim_pc, &trust_limit); @@ -1123,11 +1123,11 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) /* Extract the size of the rotating portion of the stack frame and the register rename base from the current frame marker. */ - sor = ((frame->extra_info->cfm >> 14) & 0xf) * 8; - rrb_gr = (frame->extra_info->cfm >> 18) & 0x7f; + sor = ((get_frame_extra_info (frame)->cfm >> 14) & 0xf) * 8; + rrb_gr = (get_frame_extra_info (frame)->cfm >> 18) & 0x7f; - for (i = 0, addr = frame->extra_info->bsp; - i < frame->extra_info->sof; + for (i = 0, addr = get_frame_extra_info (frame)->bsp; + i < get_frame_extra_info (frame)->sof; i++, addr += 8) { if (IS_NaT_COLLECTION_ADDR (addr)) @@ -1149,11 +1149,12 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) } } - if (frame && frame->extra_info) { - frame->extra_info->after_prologue = last_prologue_pc; - frame->extra_info->mem_stack_frame_size = mem_stack_frame_size; - frame->extra_info->fp_reg = fp_reg; - } + if (frame && get_frame_extra_info (frame)) + { + get_frame_extra_info (frame)->after_prologue = last_prologue_pc; + get_frame_extra_info (frame)->mem_stack_frame_size = mem_stack_frame_size; + get_frame_extra_info (frame)->fp_reg = fp_reg; + } return last_prologue_pc; } @@ -1253,7 +1254,7 @@ ia64_get_saved_register (char *raw_buffer, else if (regnum == IA64_BSP_REGNUM) { store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - frame->extra_info->bsp); + get_frame_extra_info (frame)->bsp); } else if (regnum == IA64_VFP_REGNUM) { @@ -1262,7 +1263,7 @@ ia64_get_saved_register (char *raw_buffer, above. If the function lacks one of these frame pointers, we can still provide a value since we know the size of the frame */ CORE_ADDR vfp = (get_frame_base (frame) - + frame->extra_info->mem_stack_frame_size); + + get_frame_extra_info (frame)->mem_stack_frame_size); store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp); } else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM) @@ -1278,7 +1279,7 @@ ia64_get_saved_register (char *raw_buffer, { /* Fetch predicate register rename base from current frame marker for this frame. */ - int rrb_pr = (frame->extra_info->cfm >> 32) & 0x3f; + int rrb_pr = (get_frame_extra_info (frame)->cfm >> 32) & 0x3f; /* Adjust the register number to account for register rotation. */ regnum = IA64_PR16_REGNUM @@ -1378,7 +1379,7 @@ ia64_get_saved_register (char *raw_buffer, { /* Fetch floating point register rename base from current frame marker for this frame. */ - int rrb_fr = (frame->extra_info->cfm >> 25) & 0x7f; + int rrb_fr = (get_frame_extra_info (frame)->cfm >> 25) & 0x7f; /* Adjust the floating point register number to account for register rotation. */ @@ -1462,7 +1463,7 @@ int ia64_frameless_function_invocation (struct frame_info *frame) { FRAME_INIT_SAVED_REGS (frame); - return (frame->extra_info->mem_stack_frame_size == 0); + return (get_frame_extra_info (frame)->mem_stack_frame_size == 0); } CORE_ADDR @@ -1538,21 +1539,23 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) else cfm = read_register (IA64_PFS_REGNUM); - bsp = frn->extra_info->bsp; + bsp = get_frame_extra_info (frn)->bsp; } - frame->extra_info->cfm = cfm; - frame->extra_info->sof = cfm & 0x7f; - frame->extra_info->sol = (cfm >> 7) & 0x7f; + get_frame_extra_info (frame)->cfm = cfm; + get_frame_extra_info (frame)->sof = cfm & 0x7f; + get_frame_extra_info (frame)->sol = (cfm >> 7) & 0x7f; if (get_next_frame (frame) == 0 || (get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME) || next_frame_is_call_dummy) - frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof); + get_frame_extra_info (frame)->bsp = + rse_address_add (bsp, -get_frame_extra_info (frame)->sof); else - frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sol); + get_frame_extra_info (frame)->bsp = + rse_address_add (bsp, -get_frame_extra_info (frame)->sol); - frame->extra_info->after_prologue = 0; - frame->extra_info->mem_stack_frame_size = -1; /* Not yet determined */ - frame->extra_info->fp_reg = 0; + get_frame_extra_info (frame)->after_prologue = 0; + get_frame_extra_info (frame)->mem_stack_frame_size = -1; /* Not yet determined */ + get_frame_extra_info (frame)->fp_reg = 0; } static int @@ -2027,7 +2030,7 @@ ia64_pop_frame_regular (struct frame_info *frame) wants bsp to be set at the end of all used registers. It's likely that this code will need to be revised to accomodate other operating systems. */ - bsp = rse_address_add (frame->extra_info->bsp, + bsp = rse_address_add (get_frame_extra_info (frame)->bsp, (pfs & 0x7f) - ((pfs >> 7) & 0x7f)); write_register (IA64_BSP_REGNUM, bsp); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 57111cf3039..69c54d111a7 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -401,7 +401,7 @@ m68hc11_saved_pc_after_call (struct frame_info *frame) static CORE_ADDR m68hc11_frame_saved_pc (struct frame_info *frame) { - return frame->extra_info->return_pc; + return get_frame_extra_info (frame)->return_pc; } static CORE_ADDR @@ -409,10 +409,10 @@ m68hc11_frame_args_address (struct frame_info *frame) { CORE_ADDR addr; - addr = get_frame_base (frame) + frame->extra_info->size + STACK_CORRECTION + 2; - if (frame->extra_info->return_kind == RETURN_RTC) + addr = get_frame_base (frame) + get_frame_extra_info (frame)->size + STACK_CORRECTION + 2; + if (get_frame_extra_info (frame)->return_kind == RETURN_RTC) addr += 1; - else if (frame->extra_info->return_kind == RETURN_RTI) + else if (get_frame_extra_info (frame)->return_kind == RETURN_RTI) addr += 7; return addr; @@ -449,8 +449,8 @@ m68hc11_pop_frame (void) write_register (regnum, read_memory_integer (get_frame_saved_regs (frame)[regnum], 2)); - write_register (HARD_PC_REGNUM, frame->extra_info->return_pc); - sp = (fp + frame->extra_info->size + 2) & 0x0ffff; + write_register (HARD_PC_REGNUM, get_frame_extra_info (frame)->return_pc); + sp = (fp + get_frame_extra_info (frame)->size + 2) & 0x0ffff; write_register (HARD_SP_REGNUM, sp); } flush_cached_frames (); @@ -819,8 +819,8 @@ m68hc11_frame_chain (struct frame_info *frame) get_frame_base (frame))) return get_frame_base (frame); /* dummy frame same as caller's frame */ - if (frame->extra_info->return_pc == 0 - || inside_entry_file (frame->extra_info->return_pc)) + if (get_frame_extra_info (frame)->return_pc == 0 + || inside_entry_file (get_frame_extra_info (frame)->return_pc)) return (CORE_ADDR) 0; if (get_frame_base (frame) == 0) @@ -828,7 +828,7 @@ m68hc11_frame_chain (struct frame_info *frame) return (CORE_ADDR) 0; } - addr = get_frame_base (frame) + frame->extra_info->size + STACK_CORRECTION - 2; + addr = get_frame_base (frame) + get_frame_extra_info (frame)->size + STACK_CORRECTION - 2; addr = read_memory_unsigned_integer (addr, 2) & 0x0FFFF; return addr; } @@ -850,21 +850,22 @@ m68hc11_frame_init_saved_regs (struct frame_info *fi) memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS); pc = get_frame_pc (fi); - fi->extra_info->return_kind = m68hc11_get_return_insn (pc); - m68hc11_guess_from_prologue (pc, get_frame_base (fi), &pc, &fi->extra_info->size, + get_frame_extra_info (fi)->return_kind = m68hc11_get_return_insn (pc); + m68hc11_guess_from_prologue (pc, get_frame_base (fi), &pc, + &get_frame_extra_info (fi)->size, get_frame_saved_regs (fi)); - addr = get_frame_base (fi) + fi->extra_info->size + STACK_CORRECTION; + addr = get_frame_base (fi) + get_frame_extra_info (fi)->size + STACK_CORRECTION; if (soft_regs[SOFT_FP_REGNUM].name) get_frame_saved_regs (fi)[SOFT_FP_REGNUM] = addr - 2; /* Take into account how the function was called/returns. */ - if (fi->extra_info->return_kind == RETURN_RTC) + if (get_frame_extra_info (fi)->return_kind == RETURN_RTC) { get_frame_saved_regs (fi)[HARD_PAGE_REGNUM] = addr; addr++; } - else if (fi->extra_info->return_kind == RETURN_RTI) + else if (get_frame_extra_info (fi)->return_kind == RETURN_RTI) { get_frame_saved_regs (fi)[HARD_CCR_REGNUM] = addr; get_frame_saved_regs (fi)[HARD_D_REGNUM] = addr + 1; @@ -890,8 +891,8 @@ m68hc11_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (fromleaf) { - fi->extra_info->return_kind = m68hc11_get_return_insn (get_frame_pc (fi)); - fi->extra_info->return_pc = m68hc11_saved_pc_after_call (fi); + get_frame_extra_info (fi)->return_kind = m68hc11_get_return_insn (get_frame_pc (fi)); + get_frame_extra_info (fi)->return_pc = m68hc11_saved_pc_after_call (fi); } else { @@ -899,7 +900,7 @@ m68hc11_init_extra_frame_info (int fromleaf, struct frame_info *fi) addr = read_memory_unsigned_integer (addr, 2) & 0x0ffff; /* Take into account the 68HC12 specific call (PC + page). */ - if (fi->extra_info->return_kind == RETURN_RTC + if (get_frame_extra_info (fi)->return_kind == RETURN_RTC && addr >= 0x08000 && addr < 0x0c000 && USE_PAGE_REGISTER) { @@ -910,7 +911,7 @@ m68hc11_init_extra_frame_info (int fromleaf, struct frame_info *fi) addr += ((page & 0x0ff) << 14); addr += 0x1000000; } - fi->extra_info->return_pc = addr; + get_frame_extra_info (fi)->return_pc = addr; } } diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index 16709cd7237..71acfd2bd86 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -300,8 +300,8 @@ analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame) deprecated_set_frame_prev_hack (dummy, NULL); deprecated_update_frame_pc_hack (dummy, pc); deprecated_update_frame_base_hack (dummy, frame); - dummy->extra_info->status = 0; - dummy->extra_info->framesize = 0; + get_frame_extra_info (dummy)->status = 0; + get_frame_extra_info (dummy)->framesize = 0; memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS); mcore_analyze_prologue (dummy, 0, 0); return dummy; @@ -360,7 +360,7 @@ mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue) if (func_addr == entry_point_address ()) { if (fi != NULL) - fi->extra_info->status |= NO_MORE_FRAMES; + get_frame_extra_info (fi)->status |= NO_MORE_FRAMES; return pc; } @@ -606,16 +606,16 @@ mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue) /* Save everything we have learned about this frame into FI. */ if (fi != NULL) { - fi->extra_info->framesize = framesize; - fi->extra_info->fp_regnum = fp_regnum; - fi->extra_info->status = flags; + get_frame_extra_info (fi)->framesize = framesize; + get_frame_extra_info (fi)->fp_regnum = fp_regnum; + get_frame_extra_info (fi)->status = flags; /* Fix the frame pointer. When gcc uses r8 as a frame pointer, it is really an arg ptr. We adjust fi->frame to be a "real" frame pointer. */ if (get_next_frame (fi) == NULL) { - if (fi->extra_info->status & MY_FRAME_IN_SP) + if (get_frame_extra_info (fi)->status & MY_FRAME_IN_SP) deprecated_update_frame_base_hack (fi, read_sp () + framesize); else deprecated_update_frame_base_hack (fi, read_register (fp_regnum) + framesize); @@ -651,11 +651,11 @@ mcore_frame_chain (struct frame_info * fi) CORE_ADDR callers_addr; /* Analyze the prologue of this function. */ - if (fi->extra_info->status == 0) + if (get_frame_extra_info (fi)->status == 0) mcore_analyze_prologue (fi, 0, 0); /* If mcore_analyze_prologue set NO_MORE_FRAMES, quit now. */ - if (fi->extra_info->status & NO_MORE_FRAMES) + if (get_frame_extra_info (fi)->status & NO_MORE_FRAMES) return 0; /* Now that we've analyzed our prologue, we can start to ask @@ -671,9 +671,9 @@ mcore_frame_chain (struct frame_info * fi) is <our base> + -<caller's frame size>. */ dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi)); - if (dummy->extra_info->status & MY_FRAME_IN_FP) + if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_FP) { - int fp = dummy->extra_info->fp_regnum; + int fp = get_frame_extra_info (dummy)->fp_regnum; /* Our caller has a frame pointer. */ if (get_frame_saved_regs (fi)[fp] != 0) @@ -681,19 +681,19 @@ mcore_frame_chain (struct frame_info * fi) /* The "FP" was saved on the stack. Don't forget to adjust the "FP" with the framesize to get a real FP. */ callers_addr = read_memory_integer (get_frame_saved_regs (fi)[fp], REGISTER_SIZE) - + dummy->extra_info->framesize; + + get_frame_extra_info (dummy)->framesize; } else { /* It's still in the register. Don't forget to adjust the "FP" with the framesize to get a real FP. */ - callers_addr = read_register (fp) + dummy->extra_info->framesize; + callers_addr = read_register (fp) + get_frame_extra_info (dummy)->framesize; } } else { /* Our caller does not have a frame pointer. */ - callers_addr = get_frame_base (fi) + dummy->extra_info->framesize; + callers_addr = get_frame_base (fi) + get_frame_extra_info (dummy)->framesize; } return callers_addr; @@ -724,13 +724,13 @@ mcore_skip_prologue (CORE_ADDR pc) CORE_ADDR mcore_frame_args_address (struct frame_info * fi) { - return get_frame_base (fi) - fi->extra_info->framesize; + return get_frame_base (fi) - get_frame_extra_info (fi)->framesize; } CORE_ADDR mcore_frame_locals_address (struct frame_info * fi) { - return get_frame_base (fi) - fi->extra_info->framesize; + return get_frame_base (fi) - get_frame_extra_info (fi)->framesize; } /* Return the frame pointer in use at address PC. */ @@ -739,14 +739,14 @@ void mcore_virtual_frame_pointer (CORE_ADDR pc, int *reg, LONGEST *offset) { struct frame_info *dummy = analyze_dummy_frame (pc, 0); - if (dummy->extra_info->status & MY_FRAME_IN_SP) + if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_SP) { *reg = SP_REGNUM; *offset = 0; } else { - *reg = dummy->extra_info->fp_regnum; + *reg = get_frame_extra_info (dummy)->fp_regnum; *offset = 0; } } @@ -1050,8 +1050,8 @@ mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi) frame_saved_regs_zalloc (fi); frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - fi->extra_info->status = 0; - fi->extra_info->framesize = 0; + get_frame_extra_info (fi)->status = 0; + get_frame_extra_info (fi)->framesize = 0; if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi), get_frame_base (fi))) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 1cc39a88b65..f6aecd82028 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -492,12 +492,12 @@ void mips_print_extra_frame_info (struct frame_info *fi) { if (fi - && fi->extra_info - && fi->extra_info->proc_desc - && fi->extra_info->proc_desc->pdr.framereg < NUM_REGS) + && get_frame_extra_info (fi) + && get_frame_extra_info (fi)->proc_desc + && get_frame_extra_info (fi)->proc_desc->pdr.framereg < NUM_REGS) printf_filtered (" frame pointer is at %s+%s\n", - REGISTER_NAME (fi->extra_info->proc_desc->pdr.framereg), - paddr_d (fi->extra_info->proc_desc->pdr.frameoffset)); + REGISTER_NAME (get_frame_extra_info (fi)->proc_desc->pdr.framereg), + paddr_d (get_frame_extra_info (fi)->proc_desc->pdr.frameoffset)); } /* Number of bytes of storage in the actual machine representation for @@ -1434,7 +1434,7 @@ mips_find_saved_regs (struct frame_info *fci) return; } - proc_desc = fci->extra_info->proc_desc; + proc_desc = get_frame_extra_info (fci)->proc_desc; if (proc_desc == NULL) /* I'm not sure how/whether this can happen. Normally when we can't find a proc_desc, we "synthesize" one using heuristic_proc_desc @@ -1695,7 +1695,7 @@ static CORE_ADDR mips_frame_saved_pc (struct frame_info *frame) { CORE_ADDR saved_pc; - mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc; + mips_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc; /* We have to get the saved pc from the sigcontext if it is a signal handler frame. */ int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM @@ -2477,7 +2477,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) frame_extra_info_zalloc (fci, sizeof (struct frame_extra_info)); fci->saved_regs = NULL; - fci->extra_info->proc_desc = + get_frame_extra_info (fci)->proc_desc = proc_desc == &temp_proc_desc ? 0 : proc_desc; if (proc_desc) { @@ -2529,12 +2529,12 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) /* hack: if argument regs are saved, guess these contain args */ /* assume we can't tell how many args for now */ - fci->extra_info->num_args = -1; + get_frame_extra_info (fci)->num_args = -1; for (regnum = MIPS_LAST_ARG_REGNUM; regnum >= A0_REGNUM; regnum--) { if (PROC_REG_MASK (proc_desc) & (1 << regnum)) { - fci->extra_info->num_args = regnum - A0_REGNUM + 1; + get_frame_extra_info (fci)->num_args = regnum - A0_REGNUM + 1; break; } } @@ -3816,7 +3816,7 @@ mips_pop_frame (void) register int regnum; struct frame_info *frame = get_current_frame (); CORE_ADDR new_sp = get_frame_base (frame); - mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc; + mips_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc; if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), 0, 0)) { diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 2e8ca162424..1921e4bcac0 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -163,8 +163,8 @@ analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame) deprecated_set_frame_prev_hack (dummy, NULL); deprecated_update_frame_pc_hack (dummy, pc); deprecated_update_frame_base_hack (dummy, frame); - dummy->extra_info->status = 0; - dummy->extra_info->stack_size = 0; + get_frame_extra_info (dummy)->status = 0; + get_frame_extra_info (dummy)->stack_size = 0; memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS); mn10300_analyze_prologue (dummy, 0); return dummy; @@ -209,9 +209,9 @@ fix_frame_pointer (struct frame_info *fi, int stack_size) { if (fi && get_next_frame (fi) == NULL) { - if (fi->extra_info->status & MY_FRAME_IN_SP) + if (get_frame_extra_info (fi)->status & MY_FRAME_IN_SP) deprecated_update_frame_base_hack (fi, read_sp () - stack_size); - else if (fi->extra_info->status & MY_FRAME_IN_FP) + else if (get_frame_extra_info (fi)->status & MY_FRAME_IN_FP) deprecated_update_frame_base_hack (fi, read_register (A3_REGNUM)); } } @@ -415,13 +415,13 @@ mn10300_analyze_prologue (struct frame_info *fi, CORE_ADDR pc) if (strcmp (name, "start") == 0) { if (fi != NULL) - fi->extra_info->status = NO_MORE_FRAMES; + get_frame_extra_info (fi)->status = NO_MORE_FRAMES; return pc; } /* At the start of a function our frame is in the stack pointer. */ if (fi) - fi->extra_info->status = MY_FRAME_IN_SP; + get_frame_extra_info (fi)->status = MY_FRAME_IN_SP; /* Get the next two bytes into buf, we need two because rets is a two byte insn and the first isn't enough to uniquely identify it. */ @@ -473,7 +473,7 @@ mn10300_analyze_prologue (struct frame_info *fi, CORE_ADDR pc) if (buf[0] == 0xf2 && (buf[1] & 0xf3) == 0xf0) { if (fi) - fi->extra_info->status = NO_MORE_FRAMES; + get_frame_extra_info (fi)->status = NO_MORE_FRAMES; return addr; } @@ -524,8 +524,8 @@ mn10300_analyze_prologue (struct frame_info *fi, CORE_ADDR pc) /* The frame pointer is now valid. */ if (fi) { - fi->extra_info->status |= MY_FRAME_IN_FP; - fi->extra_info->status &= ~MY_FRAME_IN_SP; + get_frame_extra_info (fi)->status |= MY_FRAME_IN_FP; + get_frame_extra_info (fi)->status &= ~MY_FRAME_IN_SP; } /* Quit now if we're beyond the stop point. */ @@ -599,7 +599,7 @@ mn10300_analyze_prologue (struct frame_info *fi, CORE_ADDR pc) /* Note the size of the stack in the frame info structure. */ stack_size = extract_signed_integer (buf, imm_size); if (fi) - fi->extra_info->stack_size = stack_size; + get_frame_extra_info (fi)->stack_size = stack_size; /* We just consumed 2 + imm_size bytes. */ addr += 2 + imm_size; @@ -662,11 +662,11 @@ mn10300_frame_chain (struct frame_info *fi) struct frame_info *dummy; /* Walk through the prologue to determine the stack size, location of saved registers, end of the prologue, etc. */ - if (fi->extra_info->status == 0) + if (get_frame_extra_info (fi)->status == 0) mn10300_analyze_prologue (fi, (CORE_ADDR) 0); /* Quit now if mn10300_analyze_prologue set NO_MORE_FRAMES. */ - if (fi->extra_info->status & NO_MORE_FRAMES) + if (get_frame_extra_info (fi)->status & NO_MORE_FRAMES) return 0; /* Now that we've analyzed our prologue, determine the frame @@ -688,7 +688,7 @@ mn10300_frame_chain (struct frame_info *fi) find stuff for us. */ dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi)); - if (dummy->extra_info->status & MY_FRAME_IN_FP) + if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_FP) { /* Our caller has a frame pointer. So find the frame in $a3 or in the stack. */ @@ -704,7 +704,7 @@ mn10300_frame_chain (struct frame_info *fi) /* Our caller does not have a frame pointer. So his frame starts at the base of our frame (fi->frame) + register save space + <his size>. */ - return get_frame_base (fi) + adjust + -dummy->extra_info->stack_size; + return get_frame_base (fi) + adjust + -get_frame_extra_info (dummy)->stack_size; } } @@ -903,8 +903,8 @@ mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi) frame_saved_regs_zalloc (fi); frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - fi->extra_info->status = 0; - fi->extra_info->stack_size = 0; + get_frame_extra_info (fi)->status = 0; + get_frame_extra_info (fi)->stack_size = 0; mn10300_analyze_prologue (fi, 0); } @@ -931,10 +931,10 @@ mn10300_virtual_frame_pointer (CORE_ADDR pc, /* Set up a dummy frame_info, Analyze the prolog and fill in the extra info. */ /* Results will tell us which type of frame it uses. */ - if (dummy->extra_info->status & MY_FRAME_IN_SP) + if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_SP) { *reg = SP_REGNUM; - *offset = -(dummy->extra_info->stack_size); + *offset = -(get_frame_extra_info (dummy)->stack_size); } else { diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index b231792ca41..c3135321b2d 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -317,18 +317,18 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info, { good_prologue = 1; if (saved_regs && fextra_info && get_next_frame (fi) - && get_next_frame (fi)->extra_info - && get_next_frame (fi)->extra_info->sigcontext) + && get_frame_extra_info (get_next_frame (fi)) + && get_frame_extra_info (get_next_frame (fi))->sigcontext) { /* We are backtracing from a signal handler */ - save_reg_addr = get_next_frame (fi)->extra_info->sigcontext + + save_reg_addr = get_frame_extra_info (get_next_frame (fi))->sigcontext + REGISTER_BYTE (S390_GP0_REGNUM); for (regidx = 0; regidx < S390_NUM_GPRS; regidx++) { saved_regs[S390_GP0_REGNUM + regidx] = save_reg_addr; save_reg_addr += S390_GPR_SIZE; } - save_reg_addr = get_next_frame (fi)->extra_info->sigcontext + + save_reg_addr = get_frame_extra_info (get_next_frame (fi))->sigcontext + (GDB_TARGET_IS_ESAME ? S390X_SIGREGS_FP0_OFFSET : S390_SIGREGS_FP0_OFFSET); for (regidx = 0; regidx < S390_NUM_FPRS; regidx++) @@ -772,8 +772,8 @@ s390_function_start (struct frame_info *fi) { CORE_ADDR function_start = 0; - if (fi->extra_info && fi->extra_info->initialised) - function_start = fi->extra_info->function_start; + if (get_frame_extra_info (fi) && get_frame_extra_info (fi)->initialised) + function_start = get_frame_extra_info (fi)->function_start; else if (get_frame_pc (fi)) function_start = get_pc_function_start (get_frame_pc (fi)); return function_start; @@ -790,8 +790,8 @@ s390_frameless_function_invocation (struct frame_info *fi) if (get_next_frame (fi) == NULL) /* no may be frameless */ { - if (fi->extra_info) - fextra_info_ptr = fi->extra_info; + if (get_frame_extra_info (fi)) + fextra_info_ptr = get_frame_extra_info (fi); else { fextra_info_ptr = &fextra_info; @@ -907,9 +907,9 @@ s390_init_extra_frame_info (int fromleaf, struct frame_info *fi) frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); if (get_frame_pc (fi)) s390_get_frame_info (s390_sniff_pc_function_start (get_frame_pc (fi), fi), - fi->extra_info, fi, 1); + get_frame_extra_info (fi), fi, 1); else - s390_memset_extra_info (fi->extra_info); + s390_memset_extra_info (get_frame_extra_info (fi)); } /* If saved registers of frame FI are not known yet, read and cache them. @@ -928,11 +928,13 @@ s390_frame_init_saved_regs (struct frame_info *fi) frame_saved_regs_zalloc (fi); if (get_frame_pc (fi)) { - quick = (fi->extra_info && fi->extra_info->initialised - && fi->extra_info->good_prologue); - s390_get_frame_info (quick ? fi->extra_info->function_start : - s390_sniff_pc_function_start (get_frame_pc (fi), fi), - fi->extra_info, fi, !quick); + quick = (get_frame_extra_info (fi) + && get_frame_extra_info (fi)->initialised + && get_frame_extra_info (fi)->good_prologue); + s390_get_frame_info (quick + ? get_frame_extra_info (fi)->function_start + : s390_sniff_pc_function_start (get_frame_pc (fi), fi), + get_frame_extra_info (fi), fi, !quick); } } } @@ -951,8 +953,8 @@ s390_frame_args_address (struct frame_info *fi) static CORE_ADDR s390_frame_saved_pc_nofix (struct frame_info *fi) { - if (fi->extra_info && fi->extra_info->saved_pc_valid) - return fi->extra_info->saved_pc; + if (get_frame_extra_info (fi) && get_frame_extra_info (fi)->saved_pc_valid) + return get_frame_extra_info (fi)->saved_pc; if (deprecated_generic_find_dummy_frame (get_frame_pc (fi), get_frame_base (fi))) @@ -960,19 +962,19 @@ s390_frame_saved_pc_nofix (struct frame_info *fi) get_frame_base (fi), S390_PC_REGNUM); s390_frame_init_saved_regs (fi); - if (fi->extra_info) + if (get_frame_extra_info (fi)) { - fi->extra_info->saved_pc_valid = 1; - if (fi->extra_info->good_prologue + get_frame_extra_info (fi)->saved_pc_valid = 1; + if (get_frame_extra_info (fi)->good_prologue && get_frame_saved_regs (fi)[S390_RETADDR_REGNUM]) - fi->extra_info->saved_pc + get_frame_extra_info (fi)->saved_pc = ADDR_BITS_REMOVE (read_memory_integer (get_frame_saved_regs (fi)[S390_RETADDR_REGNUM], S390_GPR_SIZE)); else - fi->extra_info->saved_pc + get_frame_extra_info (fi)->saved_pc = ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM)); - return fi->extra_info->saved_pc; + return get_frame_extra_info (fi)->saved_pc; } return 0; } @@ -982,19 +984,20 @@ s390_frame_saved_pc (struct frame_info *fi) { CORE_ADDR saved_pc = 0, sig_pc; - if (fi->extra_info && fi->extra_info->sig_fixed_saved_pc_valid) - return fi->extra_info->sig_fixed_saved_pc; + if (get_frame_extra_info (fi) + && get_frame_extra_info (fi)->sig_fixed_saved_pc_valid) + return get_frame_extra_info (fi)->sig_fixed_saved_pc; saved_pc = s390_frame_saved_pc_nofix (fi); - if (fi->extra_info) + if (get_frame_extra_info (fi)) { - fi->extra_info->sig_fixed_saved_pc_valid = 1; + get_frame_extra_info (fi)->sig_fixed_saved_pc_valid = 1; if (saved_pc) { if (s390_is_sigreturn (saved_pc, fi, NULL, &sig_pc)) saved_pc = sig_pc; } - fi->extra_info->sig_fixed_saved_pc = saved_pc; + get_frame_extra_info (fi)->sig_fixed_saved_pc = saved_pc; } return saved_pc; } @@ -1046,7 +1049,7 @@ s390_frame_chain (struct frame_info *thisframe) frame_pointer_saved_pc ? 11 : 15)), S390_GPR_SIZE); - thisframe->extra_info->sigcontext = sregs; + get_frame_extra_info (thisframe)->sigcontext = sregs; } else { diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 701db7965f0..cb7059b6689 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -934,7 +934,8 @@ sh_frame_chain (struct frame_info *frame) get_frame_base (frame))) return get_frame_base (frame); /* dummy frame same as caller's frame */ if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame))) - return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, 4); + return read_memory_integer (get_frame_base (frame) + + get_frame_extra_info (frame)->f_offset, 4); else return 0; } @@ -981,7 +982,9 @@ sh64_frame_chain (struct frame_info *frame) size = 4; else size = REGISTER_RAW_SIZE (translate_insn_rn (FP_REGNUM, media_mode)); - return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, size); + return read_memory_integer (get_frame_base (frame) + + get_frame_extra_info (frame)->f_offset, + size); } else return 0; @@ -1079,8 +1082,8 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi) return; } - fi->extra_info->leaf_function = 1; - fi->extra_info->f_offset = 0; + get_frame_extra_info (fi)->leaf_function = 1; + get_frame_extra_info (fi)->f_offset = 0; for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++) where[rn] = -1; @@ -1112,7 +1115,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi) { where[gdbarch_tdep (current_gdbarch)->PR_REGNUM] = depth; /* If we're storing the pr then this isn't a leaf */ - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->leaf_function = 0; depth += 4; } else if (IS_MOV_R3 (insn)) @@ -1167,7 +1170,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi) get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4; } - fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4; + get_frame_extra_info (fi)->f_offset = depth - where[FP_REGNUM] - 4; /* Work out the return pc - either from the saved pr or the pr value */ } @@ -1419,8 +1422,8 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi) return; } - fi->extra_info->leaf_function = 1; - fi->extra_info->f_offset = 0; + get_frame_extra_info (fi)->leaf_function = 1; + get_frame_extra_info (fi)->f_offset = 0; for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++) where[rn] = -1; @@ -1470,7 +1473,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi) int reg_nr = tdep->PR_C_REGNUM; where[reg_nr] = depth - ((((next_insn & 0xf) ^ 0x8) - 0x8) << 2); - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->leaf_function = 0; pc += insn_size; } } @@ -1498,7 +1501,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi) int reg_nr = tdep->PR_C_REGNUM; where[reg_nr] = depth - (r0_val - 4); r0_val -= 4; - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->leaf_function = 0; } else if (IS_MOV_R14_R0 (insn)) { @@ -1526,14 +1529,14 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi) { where[tdep->PR_REGNUM] = depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 3); - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->leaf_function = 0; } else if (IS_STL_R18_R15 (insn)) { where[tdep->PR_REGNUM] = depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 2); - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->leaf_function = 0; } else if (IS_STQ_R14_R15 (insn)) @@ -1589,7 +1592,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi) else get_frame_saved_regs (fi)[sp_regnum] = get_frame_base (fi); - fi->extra_info->f_offset = depth - where[fp_regnum]; + get_frame_extra_info (fi)->f_offset = depth - where[fp_regnum]; } static void @@ -1620,8 +1623,8 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi) return; } - fi->extra_info->leaf_function = 1; - fi->extra_info->f_offset = 0; + get_frame_extra_info (fi)->leaf_function = 1; + get_frame_extra_info (fi)->f_offset = 0; for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++) where[rn] = -1; @@ -1653,7 +1656,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi) { where[tdep->PR_REGNUM] = depth; /* If we're storing the pr then this isn't a leaf */ - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->leaf_function = 0; depth += 4; } else if (IS_MOV_R3 (insn)) @@ -1720,7 +1723,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi) get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4; } - fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4; + get_frame_extra_info (fi)->f_offset = depth - where[FP_REGNUM] - 4; /* Work out the return pc - either from the saved pr or the pr value */ } @@ -1742,17 +1745,17 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi) by assuming it's always FP. */ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM)); - fi->extra_info->return_pc = deprecated_read_register_dummy (get_frame_pc (fi), + get_frame_extra_info (fi)->return_pc = deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), PC_REGNUM); - fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4); - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4); + get_frame_extra_info (fi)->leaf_function = 0; return; } else { FRAME_INIT_SAVED_REGS (fi); - fi->extra_info->return_pc = + get_frame_extra_info (fi)->return_pc = sh_find_callers_reg (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM); } } @@ -1773,17 +1776,17 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM)); - fi->extra_info->return_pc = + get_frame_extra_info (fi)->return_pc = deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), PC_REGNUM); - fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4); - fi->extra_info->leaf_function = 0; + get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4); + get_frame_extra_info (fi)->leaf_function = 0; return; } else { FRAME_INIT_SAVED_REGS (fi); - fi->extra_info->return_pc = + get_frame_extra_info (fi)->return_pc = sh64_get_saved_pr (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM); } } @@ -1909,7 +1912,7 @@ sh64_extract_struct_value_address (char *regbuf) static CORE_ADDR sh_frame_saved_pc (struct frame_info *frame) { - return ((frame)->extra_info->return_pc); + return (get_frame_extra_info (frame)->return_pc); } /* Discard from the stack the innermost frame, @@ -1936,7 +1939,7 @@ sh_pop_frame (void) write_register (regnum, read_memory_integer (get_frame_saved_regs (frame)[regnum], 4)); - write_register (PC_REGNUM, frame->extra_info->return_pc); + write_register (PC_REGNUM, get_frame_extra_info (frame)->return_pc); write_register (SP_REGNUM, fp + 4); } flush_cached_frames (); @@ -1979,7 +1982,7 @@ sh64_pop_frame (void) size)); } - write_register (PC_REGNUM, frame->extra_info->return_pc); + write_register (PC_REGNUM, get_frame_extra_info (frame)->return_pc); write_register (SP_REGNUM, fp + 8); } flush_cached_frames (); diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 8dcca8a0b6d..b8a014fc13d 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -295,10 +295,10 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); frame_saved_regs_zalloc (fi); - fi->extra_info->bottom = + get_frame_extra_info (fi)->bottom = (get_next_frame (fi) ? (get_frame_base (fi) == get_frame_base (get_next_frame (fi)) - ? get_next_frame (fi)->extra_info->bottom + ? get_frame_extra_info (get_next_frame (fi))->bottom : get_frame_base (get_next_frame (fi))) : read_sp ()); @@ -320,7 +320,8 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* A frameless function interrupted by a signal did not change the frame pointer, fix up frame pointer accordingly. */ deprecated_update_frame_base_hack (fi, get_frame_base (get_next_frame (fi))); - fi->extra_info->bottom = get_next_frame (fi)->extra_info->bottom; + get_frame_extra_info (fi)->bottom = + get_frame_extra_info (get_next_frame (fi))->bottom; } else { @@ -335,8 +336,8 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* Decide whether this is a function with a ``flat register window'' frame. For such functions, the frame pointer is actually in %i7. */ - fi->extra_info->flat = 0; - fi->extra_info->in_prologue = 0; + get_frame_extra_info (fi)->flat = 0; + get_frame_extra_info (fi)->in_prologue = 0; if (find_pc_partial_function (get_frame_pc (fi), &name, &prologue_start, &prologue_end)) { /* See if the function starts with an add (which will be of a @@ -361,9 +362,9 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) buf = alloca (MAX_REGISTER_RAW_SIZE); /* We definitely have a flat frame now. */ - fi->extra_info->flat = 1; + get_frame_extra_info (fi)->flat = 1; - fi->extra_info->sp_offset = offset; + get_frame_extra_info (fi)->sp_offset = offset; /* Overwrite the frame's address with the value in %i7. */ get_saved_register (buf, 0, 0, fi, I7_REGNUM, 0); @@ -373,18 +374,18 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047); /* Record where the fp got saved. */ - fi->extra_info->fp_addr = - get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn); + get_frame_extra_info (fi)->fp_addr = + get_frame_base (fi) + get_frame_extra_info (fi)->sp_offset + X_SIMM13 (insn); /* Also try to collect where the pc got saved to. */ - fi->extra_info->pc_addr = 0; + get_frame_extra_info (fi)->pc_addr = 0; insn = fetch_instruction (prologue_start + 12); if (X_OP (insn) == 3 && X_RD (insn) == 15 && X_OP3 (insn) == 4 && X_RS1 (insn) == 14) - fi->extra_info->pc_addr = - get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn); + get_frame_extra_info (fi)->pc_addr = + get_frame_base (fi) + get_frame_extra_info (fi)->sp_offset + X_SIMM13 (insn); } } else @@ -411,7 +412,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) } if (addr >= get_frame_pc (fi)) { - fi->extra_info->in_prologue = 1; + get_frame_extra_info (fi)->in_prologue = 1; deprecated_update_frame_base_hack (fi, read_register (SP_REGNUM)); } } @@ -484,7 +485,7 @@ sparc_frame_saved_pc (struct frame_info *frame) scbuf, sizeof (scbuf)); return extract_address (scbuf, sizeof (scbuf)); } - else if (frame->extra_info->in_prologue || + else if (get_frame_extra_info (frame)->in_prologue || (get_next_frame (frame) != NULL && ((get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME) || deprecated_frame_in_dummy (get_next_frame (frame))) && @@ -496,10 +497,10 @@ sparc_frame_saved_pc (struct frame_info *frame) frame, O7_REGNUM, (enum lval_type *) NULL); return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE)); } - if (frame->extra_info->flat) - addr = frame->extra_info->pc_addr; + if (get_frame_extra_info (frame)->flat) + addr = get_frame_extra_info (frame)->pc_addr; else - addr = frame->extra_info->bottom + FRAME_SAVED_I0 + + addr = get_frame_extra_info (frame)->bottom + FRAME_SAVED_I0 + SPARC_INTREG_SIZE * (I7_REGNUM - I0_REGNUM); if (addr == 0) @@ -533,7 +534,7 @@ setup_arbitrary_frame (int argc, CORE_ADDR *argv) internal_error (__FILE__, __LINE__, "create_new_frame returned invalid frame"); - frame->extra_info->bottom = argv[1]; + get_frame_extra_info (frame)->bottom = argv[1]; deprecated_update_frame_pc_hack (frame, FRAME_SAVED_PC (frame)); return frame; } @@ -675,7 +676,7 @@ examine_prologue (CORE_ADDR start_pc, int frameless_p, struct frame_info *fi, { if (saved_regs && X_I (insn)) saved_regs[X_RD (insn)] = - get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn); + get_frame_base (fi) + get_frame_extra_info (fi)->sp_offset + X_SIMM13 (insn); } else break; @@ -845,8 +846,9 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, { /* FIXME MVS: wrong test for dummy frame at entry. */ - if (get_frame_pc (frame1) >= (frame1->extra_info->bottom ? - frame1->extra_info->bottom : read_sp ()) + if (get_frame_pc (frame1) >= (get_frame_extra_info (frame1)->bottom + ? get_frame_extra_info (frame1)->bottom + : read_sp ()) && get_frame_pc (frame1) <= get_frame_base (frame1)) { /* Dummy frame. All but the window regs are in there somewhere. @@ -861,7 +863,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, This is because frame1 is initialized to frame->next (frame1->prev == frame) and is then advanced towards the innermost (next) frame. */ - addr = (get_prev_frame (frame1)->extra_info->bottom + addr = (get_frame_extra_info (get_prev_frame (frame1))->bottom + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE + FRAME_SAVED_I0); else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8) @@ -870,7 +872,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, This is because frame1 is initialized to frame->next (frame1->prev == frame) and is then advanced towards the innermost (next) frame. */ - addr = (get_prev_frame (frame1)->extra_info->bottom + addr = (get_frame_extra_info (get_prev_frame (frame1))->bottom + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE + FRAME_SAVED_L0); else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8) @@ -888,13 +890,13 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, addr = get_frame_base (frame1) + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE - (FP_REGISTER_BYTES + 24 * SPARC_INTREG_SIZE); } - else if (frame1->extra_info->flat) + else if (get_frame_extra_info (frame1)->flat) { if (regnum == RP_REGNUM) - addr = frame1->extra_info->pc_addr; + addr = get_frame_extra_info (frame1)->pc_addr; else if (regnum == I7_REGNUM) - addr = frame1->extra_info->fp_addr; + addr = get_frame_extra_info (frame1)->fp_addr; else { CORE_ADDR func_start; @@ -912,11 +914,11 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, { /* Normal frame. Local and In registers are saved on stack. */ if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8) - addr = (get_prev_frame (frame1)->extra_info->bottom + addr = (get_frame_extra_info (get_prev_frame (frame1))->bottom + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE + FRAME_SAVED_I0); else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8) - addr = (get_prev_frame (frame1)->extra_info->bottom + addr = (get_frame_extra_info (get_prev_frame (frame1))->bottom + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE + FRAME_SAVED_L0); else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8) @@ -1119,8 +1121,9 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr) memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR)); - if (get_frame_pc (fi) >= (fi->extra_info->bottom ? - fi->extra_info->bottom : read_sp ()) + if (get_frame_pc (fi) >= (get_frame_extra_info (fi)->bottom + ? get_frame_extra_info (fi)->bottom + : read_sp ()) && get_frame_pc (fi) <= get_frame_base (fi)) { /* Dummy frame. All but the window regs are in there somewhere. */ @@ -1156,24 +1159,26 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr) frame_addr + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE - DUMMY_STACK_REG_BUF_SIZE; - frame_addr = fi->extra_info->bottom ? - fi->extra_info->bottom : read_sp (); + frame_addr = (get_frame_extra_info (fi)->bottom + ? get_frame_extra_info (fi)->bottom + : read_sp ()); } - else if (fi->extra_info->flat) + else if (get_frame_extra_info (fi)->flat) { CORE_ADDR func_start; find_pc_partial_function (get_frame_pc (fi), NULL, &func_start, NULL); examine_prologue (func_start, 0, fi, saved_regs_addr); /* Flat register window frame. */ - saved_regs_addr[RP_REGNUM] = fi->extra_info->pc_addr; - saved_regs_addr[I7_REGNUM] = fi->extra_info->fp_addr; + saved_regs_addr[RP_REGNUM] = get_frame_extra_info (fi)->pc_addr; + saved_regs_addr[I7_REGNUM] = get_frame_extra_info (fi)->fp_addr; } else { /* Normal frame. Just Local and In registers */ - frame_addr = fi->extra_info->bottom ? - fi->extra_info->bottom : read_sp (); + frame_addr = (get_frame_extra_info (fi)->bottom + ? get_frame_extra_info (fi)->bottom + : read_sp ()); for (regnum = L0_REGNUM; regnum < L0_REGNUM + 8; regnum++) saved_regs_addr[regnum] = (frame_addr + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE @@ -1185,16 +1190,17 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr) } if (get_next_frame (fi)) { - if (fi->extra_info->flat) + if (get_frame_extra_info (fi)->flat) { - saved_regs_addr[O7_REGNUM] = fi->extra_info->pc_addr; + saved_regs_addr[O7_REGNUM] = get_frame_extra_info (fi)->pc_addr; } else { /* Pull off either the next frame pointer or the stack pointer */ CORE_ADDR next_next_frame_addr = - (get_next_frame (fi)->extra_info->bottom ? - get_next_frame (fi)->extra_info->bottom : read_sp ()); + (get_frame_extra_info (get_next_frame (fi))->bottom + ? get_frame_extra_info (get_next_frame (fi))->bottom + : read_sp ()); for (regnum = O0_REGNUM; regnum < O0_REGNUM + 8; regnum++) saved_regs_addr[regnum] = (next_next_frame_addr @@ -1263,7 +1269,7 @@ sparc_pop_frame (void) 7 * SPARC_INTREG_SIZE); } - if (frame->extra_info->flat) + if (get_frame_extra_info (frame)->flat) { /* Each register might or might not have been saved, need to test individually. */ @@ -1340,11 +1346,11 @@ sparc_pop_frame (void) read_memory_integer (fsr[NPC_REGNUM], REGISTER_RAW_SIZE (NPC_REGNUM))); } - else if (frame->extra_info->flat) + else if (get_frame_extra_info (frame)->flat) { - if (frame->extra_info->pc_addr) + if (get_frame_extra_info (frame)->pc_addr) pc = PC_ADJUST ((CORE_ADDR) - read_memory_integer (frame->extra_info->pc_addr, + read_memory_integer (get_frame_extra_info (frame)->pc_addr, REGISTER_RAW_SIZE (PC_REGNUM))); else { @@ -2685,10 +2691,10 @@ sparc64_stack_align (CORE_ADDR addr) extern void sparc_print_extra_frame_info (struct frame_info *fi) { - if (fi && fi->extra_info && fi->extra_info->flat) + if (fi && get_frame_extra_info (fi) && get_frame_extra_info (fi)->flat) printf_filtered (" flat, pc saved at 0x%s, fp saved at 0x%s\n", - paddr_nz (fi->extra_info->pc_addr), - paddr_nz (fi->extra_info->fp_addr)); + paddr_nz (get_frame_extra_info (fi)->pc_addr), + paddr_nz (get_frame_extra_info (fi)->fp_addr)); } /* MULTI_ARCH support */ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index a44a9c3fc91..3ecfd3c6cd2 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -478,7 +478,7 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, fp = xstormy16_frame_saved_register (fi, E_FP_REGNUM); /* Initialize framesize with size of PC put on stack by CALLF inst. */ - fi->extra_info->framesize = xstormy16_pc_size; + get_frame_extra_info (fi)->framesize = xstormy16_pc_size; } for (next_addr = start_addr; next_addr < end_addr; next_addr += xstormy16_inst_size) @@ -492,8 +492,8 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, if (fi) { regnum = inst & 0x000f; - get_frame_saved_regs (fi)[regnum] = fi->extra_info->framesize; - fi->extra_info->framesize += xstormy16_reg_size; + get_frame_saved_regs (fi)[regnum] = get_frame_extra_info (fi)->framesize; + get_frame_extra_info (fi)->framesize += xstormy16_reg_size; } } @@ -501,28 +501,28 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, else if (inst == 0x301f || inst == 0x303f) /* inc r15, #0x1/#0x3 */ { if (fi) /* Record the frame size. */ - fi->extra_info->framesize += ((inst & 0x0030) >> 4) + 1; + get_frame_extra_info (fi)->framesize += ((inst & 0x0030) >> 4) + 1; } /* optional stack allocation for args and local vars > 4 && < 16 byte */ else if ((inst & 0xff0f) == 0x510f) /* 51Hf add r15, #0xH */ { if (fi) /* Record the frame size. */ - fi->extra_info->framesize += (inst & 0x00f0) >> 4; + get_frame_extra_info (fi)->framesize += (inst & 0x00f0) >> 4; } /* optional stack allocation for args and local vars >= 16 byte */ else if (inst == 0x314f && inst2 >= 0x0010) /* 314f HHHH add r15, #0xH */ { if (fi) /* Record the frame size. */ - fi->extra_info->framesize += inst2; + get_frame_extra_info (fi)->framesize += inst2; next_addr += xstormy16_inst_size; } else if (inst == 0x46fd) /* mov r13, r15 */ { if (fi) /* Record that the frame pointer is in use. */ - fi->extra_info->frameless_p = 0; + get_frame_extra_info (fi)->frameless_p = 0; if (frameless) *frameless = 0; } @@ -548,7 +548,7 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, if (offset & 0x0800) offset -= 0x1000; - get_frame_saved_regs (fi)[regnum] = fi->extra_info->framesize + offset; + get_frame_saved_regs (fi)[regnum] = get_frame_extra_info (fi)->framesize + offset; } next_addr += xstormy16_inst_size; } @@ -593,14 +593,14 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, by convention what we put here is simply the previous _value_ of the SP (as opposed to an address where the previous value would have been pushed). */ - if (fi->extra_info->frameless_p) + if (get_frame_extra_info (fi)->frameless_p) { - get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - fi->extra_info->framesize; + get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - get_frame_extra_info (fi)->framesize; deprecated_update_frame_base_hack (fi, sp); } else { - get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - fi->extra_info->framesize; + get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - get_frame_extra_info (fi)->framesize; deprecated_update_frame_base_hack (fi, fp); } @@ -783,11 +783,11 @@ xstormy16_frame_saved_pc (struct frame_info *fi) static void xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi) { - if (!fi->extra_info) + if (!get_frame_extra_info (fi)) { frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - fi->extra_info->framesize = 0; - fi->extra_info->frameless_p = 1; /* Default frameless, detect framed */ + get_frame_extra_info (fi)->framesize = 0; + get_frame_extra_info (fi)->frameless_p = 1; /* Default frameless, detect framed */ /* By default, the fi->frame is set to the value of the FP reg by gdb. This may not always be right; we may be in a frameless function, @@ -829,7 +829,7 @@ xstormy16_frame_chain (struct frame_info *fi) else { /* Return computed offset from this frame's fp. */ - return get_frame_base (fi) - fi->extra_info->framesize; + return get_frame_base (fi) - get_frame_extra_info (fi)->framesize; } } @@ -837,8 +837,8 @@ static int xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) { return chain < 0x8000 && FRAME_SAVED_PC (thisframe) >= 0x8000 && - (thisframe->extra_info->frameless_p || - get_frame_base (thisframe) - thisframe->extra_info->framesize == chain); + (get_frame_extra_info (thisframe)->frameless_p || + get_frame_base (thisframe) - get_frame_extra_info (thisframe)->framesize == chain); } /* Function: xstormy16_saved_pc_after_call |