*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / m68k-tdep.c
index 98f048ef84a25306a772e3bc4bea452764b4c668..bfb1af9f945bdf1a5e1488ce98d9636ab385cf3b 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-dependent code for the Motorola 68000 series.
 
    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -168,9 +168,9 @@ m68k_register_name (struct gdbarch *gdbarch, int regnum)
    needs any special handling.  */
 
 static int
-m68k_convert_register_p (int regnum, struct type *type)
+m68k_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
 {
-  if (!gdbarch_tdep (current_gdbarch)->fpregs_present)
+  if (!gdbarch_tdep (gdbarch)->fpregs_present)
     return 0;
   return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7
          && type != builtin_type_m68881_ext);
@@ -527,7 +527,7 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 /* Convert a dwarf or dwarf2 regnumber to a GDB regnum.  */
 
 static int
-m68k_dwarf_reg_to_regnum (int num)
+m68k_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int num)
 {
   if (num < 8)
     /* d0..7 */
@@ -535,15 +535,14 @@ m68k_dwarf_reg_to_regnum (int num)
   else if (num < 16)
     /* a0..7 */
     return (num - 8) + M68K_A0_REGNUM;
-  else if (num < 24 && gdbarch_tdep (current_gdbarch)->fpregs_present)
+  else if (num < 24 && gdbarch_tdep (gdbarch)->fpregs_present)
     /* fp0..7 */
     return (num - 16) + M68K_FP0_REGNUM;
   else if (num == 25)
     /* pc */
     return M68K_PC_REGNUM;
   else
-    return gdbarch_num_regs (current_gdbarch)
-          + gdbarch_num_pseudo_regs (current_gdbarch);
+    return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
 }
 
 \f
@@ -691,7 +690,8 @@ m68k_analyze_frame_setup (CORE_ADDR pc, CORE_ADDR current_pc,
    smaller.  Otherwise, return PC.  */
 
 static CORE_ADDR
-m68k_analyze_register_saves (CORE_ADDR pc, CORE_ADDR current_pc,
+m68k_analyze_register_saves (struct gdbarch *gdbarch, CORE_ADDR pc,
+                            CORE_ADDR current_pc,
                             struct m68k_frame_cache *cache)
 {
   if (cache->locals >= 0)
@@ -705,7 +705,7 @@ m68k_analyze_register_saves (CORE_ADDR pc, CORE_ADDR current_pc,
        {
          op = read_memory_unsigned_integer (pc, 2);
          if (op == P_FMOVEMX_SP
-             && gdbarch_tdep (current_gdbarch)->fpregs_present)
+             && gdbarch_tdep (gdbarch)->fpregs_present)
            {
              /* fmovem.x REGS,-(%sp) */
              op = read_memory_unsigned_integer (pc + 2, 2);
@@ -789,13 +789,13 @@ m68k_analyze_register_saves (CORE_ADDR pc, CORE_ADDR current_pc,
    */
 
 static CORE_ADDR
-m68k_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
-                      struct m68k_frame_cache *cache)
+m68k_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
+                      CORE_ADDR current_pc, struct m68k_frame_cache *cache)
 {
   unsigned int op;
 
   pc = m68k_analyze_frame_setup (pc, current_pc, cache);
-  pc = m68k_analyze_register_saves (pc, current_pc, cache);
+  pc = m68k_analyze_register_saves (gdbarch, pc, current_pc, cache);
   if (pc >= current_pc)
     return current_pc;
 
@@ -813,14 +813,14 @@ m68k_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
 /* Return PC of first real instruction.  */
 
 static CORE_ADDR
-m68k_skip_prologue (CORE_ADDR start_pc)
+m68k_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
 {
   struct m68k_frame_cache cache;
   CORE_ADDR pc;
   int op;
 
   cache.locals = -1;
-  pc = m68k_analyze_prologue (start_pc, (CORE_ADDR) -1, &cache);
+  pc = m68k_analyze_prologue (gdbarch, start_pc, (CORE_ADDR) -1, &cache);
   if (cache.locals < 0)
     return start_pc;
   return pc;
@@ -869,7 +869,8 @@ m68k_frame_cache (struct frame_info *next_frame, void **this_cache)
 
   cache->pc = frame_func_unwind (next_frame, NORMAL_FRAME);
   if (cache->pc != 0)
-    m68k_analyze_prologue (cache->pc, frame_pc_unwind (next_frame), cache);
+    m68k_analyze_prologue (get_frame_arch (next_frame), cache->pc,
+                          frame_pc_unwind (next_frame), cache);
 
   if (cache->locals < 0)
     {
This page took 0.024521 seconds and 4 git commands to generate.