From be8626e05a1d01d9467d67dead4d3b176d0a9cb6 Mon Sep 17 00:00:00 2001 From: Markus Deuling Date: Fri, 11 Jan 2008 14:43:15 +0000 Subject: * alpha-tdep.c (alpha_heuristic_proc_start) (alpha_sigtramp_register_address): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. (alpha_heuristic_frame_unwind_cache): Use get_frame_arch to get at the current architecture by frame_info. Update alpha_heuristic_proc_start call. (alpha_sigtramp_frame_this_id, alpha_sigtramp_frame_prev_register): Use get_frame_arch to get at the current architecture by frame_info. Update alpha_sigtramp_register_address call. * arm-tdep.c (thumb_scan_prologue): Add gdbarch as parameter and replace current_gdbarch by gdbarch. Update caller. (convert_to_extended, convert_from_extended): Add endianess parameter for comparison. Update caller. (arm_extract_return_value, arm_store_return_value): Use get_regcache_arch to get at the current architecture. * cris-tdep.c (cris_register_size): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. Update caller. (cris_gdb_func, move_to_preg_op, none_reg_mode_move_from_preg_op): Add gdbarch as parameter. Update caller. Replace current_gdbarch by gdbarch. * h8300-tdep.c (E_PSEUDO_CCR_REGNUM, E_PSEUDO_EXR_REGNUM, BINWORD): Add gdbarch as parameter. Update caller. (h8300_init_frame_cache): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. Update caller. * hppa-tdep.c (skip_prologue_hard_way): Add gdbarch as parameter and update caller. Replace current_gdbarch by gdbarch. * m32c-tdep.c (m32c_skip_trampoline_code): Use get_frame_arch to get at the current architecture. Replace current_gdbarch by gdbarch. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. (STACK_CORRECTION, USE_PAGE_REGISTER): Replace M6811_TDEP by its expression. Add gdbarch as parameter and replace current_gdbarch with it. Update caller. (M6811_TDEP): Remove. (m68hc11_frame_prev_register): Use get_frame_arch to get at the current architecture. (m68hc11_scan_prologue): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. Update caller. * m68k-tdep.c (m68k_analyze_prologue): Add gdbarch as parameter and update caller. (m68k_analyze_register_saves): Likewise. Also replace current_gdbarch by gdbarch. * rs6000-tdep.c (skip_prologue): Add gdbarch as parameter and update caller. Relace current_gdbarch by gdbarch. (altivec_register_p, spe_register_p): Likewise. * ppc-tdep.h (altivec_register_p, spe_register_p): Add gdbarch as parameter. * ppc-linux-nat.c (fetch_register, store_register): Update caller of altivec_register_p and spe_register_p. * score-tdep.c (score_fetch_inst): Add gdbarch as parameter. Update caller. Replace current_gdbarch by gdbarch. (score_analyze_prologue): use get_frame_arch to get at the current architecture. * sparc-tdep.h (sparc_analyze_prologue): Add gdbarch as parameter. * sparc-tdep.c (sparc_analyze_prologue): Likewise. Replace current_gdbarch by gdbarch. Update caller. (sparc_frame_cache): Use get_frame_arch to get at the current architecture. * sparce64-tdep.c (sparc64_skip_prologue): Update call of sparc_analyze_prologue. * mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Add gdbarch as parameter. --- gdb/alpha-tdep.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'gdb/alpha-tdep.c') diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 7d0eee9..e00bfd0 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -768,9 +768,10 @@ alpha_sigtramp_frame_unwind_cache (struct frame_info *next_frame, all arithmetic, it doesn't seem worthwhile to cache it. */ static CORE_ADDR -alpha_sigtramp_register_address (CORE_ADDR sigcontext_addr, int regnum) +alpha_sigtramp_register_address (struct gdbarch *gdbarch, + CORE_ADDR sigcontext_addr, int regnum) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (regnum >= 0 && regnum < 32) return sigcontext_addr + tdep->sc_regs_offset + regnum * 8; @@ -790,9 +791,10 @@ alpha_sigtramp_frame_this_id (struct frame_info *next_frame, void **this_prologue_cache, struct frame_id *this_id) { + struct gdbarch *gdbarch = get_frame_arch (next_frame); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); struct alpha_sigtramp_unwind_cache *info = alpha_sigtramp_frame_unwind_cache (next_frame, this_prologue_cache); - struct gdbarch_tdep *tdep; CORE_ADDR stack_addr, code_addr; /* If the OSABI couldn't locate the sigcontext, give up. */ @@ -802,7 +804,6 @@ alpha_sigtramp_frame_this_id (struct frame_info *next_frame, /* If we have dynamic signal trampolines, find their start. If we do not, then we must assume there is a symbol record that can provide the start address. */ - tdep = gdbarch_tdep (get_frame_arch (next_frame)); if (tdep->dynamic_sigtramp_offset) { int offset; @@ -817,7 +818,7 @@ alpha_sigtramp_frame_this_id (struct frame_info *next_frame, code_addr = frame_func_unwind (next_frame, SIGTRAMP_FRAME); /* The stack address is trivially read from the sigcontext. */ - stack_addr = alpha_sigtramp_register_address (info->sigcontext_addr, + stack_addr = alpha_sigtramp_register_address (gdbarch, info->sigcontext_addr, ALPHA_SP_REGNUM); stack_addr = get_frame_memory_unsigned (next_frame, stack_addr, ALPHA_REGISTER_SIZE); @@ -841,7 +842,8 @@ alpha_sigtramp_frame_prev_register (struct frame_info *next_frame, if (info->sigcontext_addr != 0) { /* All integer and fp registers are stored in memory. */ - addr = alpha_sigtramp_register_address (info->sigcontext_addr, regnum); + addr = alpha_sigtramp_register_address (get_frame_arch (next_frame), + info->sigcontext_addr, regnum); if (addr != 0) { *optimizedp = 0; @@ -920,9 +922,9 @@ static unsigned int heuristic_fence_post = 0; function. But we're guessing anyway... */ static CORE_ADDR -alpha_heuristic_proc_start (CORE_ADDR pc) +alpha_heuristic_proc_start (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); CORE_ADDR last_non_nop = pc; CORE_ADDR fence = pc - heuristic_fence_post; CORE_ADDR orig_pc = pc; @@ -999,6 +1001,7 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *next_frame, void **this_prologue_cache, CORE_ADDR start_pc) { + struct gdbarch *gdbarch = get_frame_arch (next_frame); struct alpha_heuristic_unwind_cache *info; ULONGEST val; CORE_ADDR limit_pc, cur_pc; @@ -1013,7 +1016,7 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *next_frame, limit_pc = frame_pc_unwind (next_frame); if (start_pc == 0) - start_pc = alpha_heuristic_proc_start (limit_pc); + start_pc = alpha_heuristic_proc_start (gdbarch, limit_pc); info->start_pc = start_pc; frame_reg = ALPHA_SP_REGNUM; -- cgit v1.1