* gdb.opt/clobbered-registers-O2.c: New testcase source file.
[deliverable/binutils-gdb.git] / gdb / m32c-tdep.c
index cb8a7add52c72048d906ed6ad21cd30eac638901..49d07ce5cc0057e51eb6078838f42ec5a10daa17 100644 (file)
@@ -6,7 +6,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -15,9 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 
@@ -1836,7 +1834,7 @@ m32c_analyze_frame_prologue (struct frame_info *next_frame,
 {
   if (! *this_prologue_cache)
     {
-      CORE_ADDR func_start = frame_func_unwind (next_frame);
+      CORE_ADDR func_start = frame_func_unwind (next_frame, NORMAL_FRAME);
       CORE_ADDR stop_addr = frame_pc_unwind (next_frame);
 
       /* If we couldn't find any function containing the PC, then
@@ -1900,7 +1898,8 @@ m32c_this_id (struct frame_info *next_frame,
   CORE_ADDR base = m32c_frame_base (next_frame, this_prologue_cache);
 
   if (base)
-    *this_id = frame_id_build (base, frame_func_unwind (next_frame));
+    *this_id = frame_id_build (base,
+                              frame_func_unwind (next_frame, NORMAL_FRAME));
   /* Otherwise, leave it unset, and that will terminate the backtrace.  */
 }
 
@@ -2318,10 +2317,10 @@ m32c_return_value (struct gdbarch *gdbarch,
    their program is calling, not in some trampoline code they've never
    seen before.)
 
-   The SKIP_TRAMPOLINE_CODE gdbarch method tells GDB how to step
+   The gdbarch_skip_trampoline_code method tells GDB how to step
    through such trampoline functions transparently to the user.  When
    given the address of a trampoline function's first instruction,
-   SKIP_TRAMPOLINE_CODE should return the address of the first
+   gdbarch_skip_trampoline_code should return the address of the first
    instruction of the function really being called.  If GDB decides it
    wants to step into that function, it will set a breakpoint there
    and silently continue to it.
@@ -2331,7 +2330,7 @@ m32c_return_value (struct gdbarch *gdbarch,
    code sequence seems more fragile.  */
 
 static CORE_ADDR
-m32c_skip_trampoline_code (CORE_ADDR stop_pc)
+m32c_skip_trampoline_code (struct frame_info *frame, CORE_ADDR stop_pc)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
@@ -2534,6 +2533,7 @@ m32c_virtual_frame_pointer (CORE_ADDR pc,
   CORE_ADDR func_addr, func_end, sal_end;
   struct m32c_prologue p;
 
+  struct regcache *regcache = get_current_regcache ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   
   if (!find_pc_partial_function (pc, &name, &func_addr, &func_end))
@@ -2543,20 +2543,20 @@ m32c_virtual_frame_pointer (CORE_ADDR pc,
   switch (p.kind)
     {
     case prologue_with_frame_ptr:
-      *frame_regnum = m32c_banked_register (tdep->fb, current_regcache)->num;
+      *frame_regnum = m32c_banked_register (tdep->fb, regcache)->num;
       *frame_offset = p.frame_ptr_offset;
       break;
     case prologue_sans_frame_ptr:
-      *frame_regnum = m32c_banked_register (tdep->sp, current_regcache)->num;
+      *frame_regnum = m32c_banked_register (tdep->sp, regcache)->num;
       *frame_offset = p.frame_size;
       break;
     default:
-      *frame_regnum = m32c_banked_register (tdep->sp, current_regcache)->num;
+      *frame_regnum = m32c_banked_register (tdep->sp, regcache)->num;
       *frame_offset = 0;
       break;
     }
   /* Sanity check */
-  if (*frame_regnum > NUM_REGS)
+  if (*frame_regnum > gdbarch_num_regs (current_gdbarch))
     internal_error (__FILE__, __LINE__, _("No virtual frame pointer available"));
 }
 
This page took 0.024923 seconds and 4 git commands to generate.