X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fm88k-tdep.c;h=6514fe636028aafcd9dfe54503e99b59a3d47711;hb=e17a4113357102b55cfa5b80557d590a46a43300;hp=b1b0cfba11c3cde16fb6d060bcb2d66dd6201eaf;hpb=5af949e350b923403600c1da34774b49a77c925c;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index b1b0cfba11..6514fe6360 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -39,9 +39,9 @@ /* Fetch the instruction at PC. */ static unsigned long -m88k_fetch_instruction (CORE_ADDR pc) +m88k_fetch_instruction (CORE_ADDR pc, enum bfd_endian byte_order) { - return read_memory_unsigned_integer (pc, 4); + return read_memory_unsigned_integer (pc, 4, byte_order); } /* Register information. */ @@ -526,9 +526,11 @@ struct m88k_prologue_insn m88k_prologue_insn_table[] = prologue. */ static CORE_ADDR -m88k_analyze_prologue (CORE_ADDR pc, CORE_ADDR limit, +m88k_analyze_prologue (struct gdbarch *gdbarch, + CORE_ADDR pc, CORE_ADDR limit, struct m88k_frame_cache *cache) { + enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR end = limit; /* Provide a dummy cache if necessary. */ @@ -548,7 +550,7 @@ m88k_analyze_prologue (CORE_ADDR pc, CORE_ADDR limit, while (pc < limit) { struct m88k_prologue_insn *pi = m88k_prologue_insn_table; - unsigned long insn = m88k_fetch_instruction (pc); + unsigned long insn = m88k_fetch_instruction (pc, byte_order); while ((insn & pi->mask) != pi->insn) pi++; @@ -643,12 +645,14 @@ m88k_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) return sal.end; } - return m88k_analyze_prologue (pc, pc + m88k_max_prologue_size, NULL); + return m88k_analyze_prologue (gdbarch, pc, pc + m88k_max_prologue_size, + NULL); } static struct m88k_frame_cache * m88k_frame_cache (struct frame_info *this_frame, void **this_cache) { + struct gdbarch *gdbarch = get_frame_arch (this_frame); struct m88k_frame_cache *cache; CORE_ADDR frame_sp; @@ -661,7 +665,8 @@ m88k_frame_cache (struct frame_info *this_frame, void **this_cache) cache->pc = get_frame_func (this_frame); if (cache->pc != 0) - m88k_analyze_prologue (cache->pc, get_frame_pc (this_frame), cache); + m88k_analyze_prologue (gdbarch, cache->pc, get_frame_pc (this_frame), + cache); /* Calculate the stack pointer used in the prologue. */ if (cache->fp_offset != -1)