summaryrefslogtreecommitdiffstats
path: root/gdb/m68hc11-tdep.c
diff options
context:
space:
mode:
authorMarkus Deuling <deuling@de.ibm.com>2008-01-11 14:43:15 +0000
committerMarkus Deuling <deuling@de.ibm.com>2008-01-11 14:43:15 +0000
commitbe8626e05a1d01d9467d67dead4d3b176d0a9cb6 (patch)
tree10c5e0ac7fbee4ec243419c6a9a06ad374c13ad8 /gdb/m68hc11-tdep.c
parented49a04fe1bc299bc4b22c01a15c1f46ae21a294 (diff)
downloadppe42-binutils-be8626e05a1d01d9467d67dead4d3b176d0a9cb6.tar.gz
ppe42-binutils-be8626e05a1d01d9467d67dead4d3b176d0a9cb6.zip
* 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.
Diffstat (limited to 'gdb/m68hc11-tdep.c')
-rw-r--r--gdb/m68hc11-tdep.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index b85cb8f4ba..1504bf3d21 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -146,9 +146,8 @@ struct gdbarch_tdep
int elf_flags;
};
-#define M6811_TDEP gdbarch_tdep (current_gdbarch)
-#define STACK_CORRECTION (M6811_TDEP->stack_correction)
-#define USE_PAGE_REGISTER (M6811_TDEP->use_page_register)
+#define STACK_CORRECTION(gdbarch) (gdbarch_tdep (gdbarch)->stack_correction)
+#define USE_PAGE_REGISTER(gdbarch) (gdbarch_tdep (gdbarch)->use_page_register)
struct m68hc11_unwind_cache
{
@@ -367,9 +366,9 @@ m68hc11_pseudo_register_write (struct gdbarch *gdbarch,
static const char *
m68hc11_register_name (struct gdbarch *gdbarch, int reg_nr)
{
- if (reg_nr == M68HC12_HARD_PC_REGNUM && USE_PAGE_REGISTER)
+ if (reg_nr == M68HC12_HARD_PC_REGNUM && USE_PAGE_REGISTER (gdbarch))
return "pc";
- if (reg_nr == HARD_PC_REGNUM && USE_PAGE_REGISTER)
+ if (reg_nr == HARD_PC_REGNUM && USE_PAGE_REGISTER (gdbarch))
return "ppc";
if (reg_nr < 0)
@@ -604,8 +603,8 @@ m68hc11_get_return_insn (CORE_ADDR pc)
- the offset of the previous frame saved address (from current frame)
- the soft registers which are pushed. */
static CORE_ADDR
-m68hc11_scan_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
- struct m68hc11_unwind_cache *info)
+m68hc11_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
+ CORE_ADDR current_pc, struct m68hc11_unwind_cache *info)
{
LONGEST save_addr;
CORE_ADDR func_end;
@@ -629,7 +628,7 @@ m68hc11_scan_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
return pc;
}
- seq_table = gdbarch_tdep (current_gdbarch)->prologue;
+ seq_table = gdbarch_tdep (gdbarch)->prologue;
/* The 68hc11 stack is as follows:
@@ -755,7 +754,7 @@ m68hc11_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
return sal.end;
}
- pc = m68hc11_scan_prologue (pc, (CORE_ADDR) -1, &tmp_cache);
+ pc = m68hc11_scan_prologue (gdbarch, pc, (CORE_ADDR) -1, &tmp_cache);
return pc;
}
@@ -778,6 +777,7 @@ struct m68hc11_unwind_cache *
m68hc11_frame_unwind_cache (struct frame_info *next_frame,
void **this_prologue_cache)
{
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
ULONGEST prev_sp;
ULONGEST this_base;
struct m68hc11_unwind_cache *info;
@@ -808,7 +808,7 @@ m68hc11_frame_unwind_cache (struct frame_info *next_frame,
current_pc = frame_pc_unwind (next_frame);
if (info->pc != 0)
- m68hc11_scan_prologue (info->pc, current_pc, info);
+ m68hc11_scan_prologue (gdbarch, info->pc, current_pc, info);
info->saved_regs[HARD_PC_REGNUM].addr = info->size;
@@ -817,7 +817,7 @@ m68hc11_frame_unwind_cache (struct frame_info *next_frame,
info->saved_regs[HARD_PC_REGNUM].addr = info->sp_offset;
this_base = frame_unwind_register_unsigned (next_frame, HARD_SP_REGNUM);
prev_sp = this_base + info->sp_offset + 2;
- this_base += STACK_CORRECTION;
+ this_base += STACK_CORRECTION (gdbarch);
}
else
{
@@ -825,7 +825,7 @@ m68hc11_frame_unwind_cache (struct frame_info *next_frame,
to before the first saved register giving the SP. */
prev_sp = this_base + info->size + 2;
- this_base += STACK_CORRECTION;
+ this_base += STACK_CORRECTION (gdbarch);
if (soft_regs[SOFT_FP_REGNUM].name)
info->saved_regs[SOFT_FP_REGNUM].addr = info->size - 2;
}
@@ -855,8 +855,8 @@ m68hc11_frame_unwind_cache (struct frame_info *next_frame,
/* Adjust all the saved registers so that they contain addresses and not
offsets. */
for (i = 0;
- i < gdbarch_num_regs (current_gdbarch)
- + gdbarch_num_pseudo_regs (current_gdbarch) - 1;
+ i < gdbarch_num_regs (gdbarch)
+ + gdbarch_num_pseudo_regs (gdbarch) - 1;
i++)
if (trad_frame_addr_p (info->saved_regs, i))
{
@@ -916,7 +916,7 @@ m68hc11_frame_prev_register (struct frame_info *next_frame,
/* Take into account the 68HC12 specific call (PC + page). */
if (info->return_kind == RETURN_RTC
&& *addrp >= 0x08000 && *addrp < 0x0c000
- && USE_PAGE_REGISTER)
+ && USE_PAGE_REGISTER (get_frame_arch (next_frame)))
{
int page_optimized;
@@ -1216,7 +1216,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
write_memory (sp, buf, 2);
/* Finally, update the stack pointer... */
- sp -= STACK_CORRECTION;
+ sp -= STACK_CORRECTION (gdbarch);
regcache_cooked_write_unsigned (regcache, HARD_SP_REGNUM, sp);
/* ...and fake a frame pointer. */
OpenPOWER on IntegriCloud