*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / mep-tdep.c
index 5d604378d829058474b5efc22779094dd65c6063..b6038cc48327291d77770708cf176182242c4017 100644 (file)
@@ -9,7 +9,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,
@@ -18,9 +18,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"
 #include "frame.h"
@@ -930,9 +928,9 @@ current_ccr_names ()
 
 
 static const char *
-mep_register_name (int regnr)
+mep_register_name (struct gdbarch *gdbarch, int regnr)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);  
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);  
 
   /* General-purpose registers.  */
   static const char *gpr_names[] = {
@@ -1033,7 +1031,7 @@ mep_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
 {
   /* Filter reserved or unused register numbers.  */
   {
-    const char *name = mep_register_name (regnum);
+    const char *name = mep_register_name (gdbarch, regnum);
 
     if (! name || name[0] == '\0')
       return 0;
@@ -1812,13 +1810,24 @@ mep_analyze_prologue (CORE_ADDR start_pc, CORE_ADDR limit_pc,
         }
       else if (IS_BRA (insn) && BRA_DISP (insn) > 0)
        {
-         /* When a loop appears as the first statement as a function
+         /* When a loop appears as the first statement of a function
             body, gcc 4.x will use a BRA instruction to branch to the
             loop condition checking code.  This BRA instruction is
             marked as part of the prologue.  We therefore set next_pc
             to this branch target and also stop the prologue scan. 
             The instructions at and beyond the branch target should
-            no longer be associated with the prologue.  */
+            no longer be associated with the prologue.
+            
+            Note that we only consider forward branches here.  We
+            presume that a forward branch is being used to skip over
+            a loop body.
+            
+            A backwards branch is covered by the default case below.
+            If we were to encounter a backwards branch, that would
+            most likely mean that we've scanned through a loop body.
+            We definitely want to stop the prologue scan when this
+            happens and that is precisely what is done by the default
+            case below.  */
          next_pc = pc + BRA_DISP (insn);
          after_last_frame_setup_insn = next_pc;
          break;
@@ -1904,7 +1913,7 @@ mep_skip_prologue (CORE_ADDR pc)
 /* Breakpoints.  */
 
 static const unsigned char *
-mep_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
+mep_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR * pcptr, int *lenptr)
 {
   static unsigned char breakpoint[] = { 0x70, 0x32 };
   *lenptr = sizeof (breakpoint);
This page took 0.024979 seconds and 4 git commands to generate.