* mep-tdep.c (mep_analyze_prologue): Update comment for BRA
authorKevin Buettner <kevinb@redhat.com>
Sat, 14 Jul 2007 00:15:50 +0000 (00:15 +0000)
committerKevin Buettner <kevinb@redhat.com>
Sat, 14 Jul 2007 00:15:50 +0000 (00:15 +0000)
instruction case.

gdb/ChangeLog
gdb/mep-tdep.c

index de167a6b980d74a72cd0831745af868a84462abf..f211744e3c5711e5c01366f006ac596f7893a0a9 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-13  Kevin Buettner  <kevinb@redhat.com>
+
+       * mep-tdep.c (mep_analyze_prologue): Update comment for BRA
+       instruction case.
+
 2007-07-12  Kevin Buettner  <kevinb@redhat.com>
 
        * mep-tdep.c (IS_BRA, BRA_DISP): New macros.
index 5d604378d829058474b5efc22779094dd65c6063..01baab3700a34dc6d2d5a9e78337d27e1b4faad0 100644 (file)
@@ -1812,13 +1812,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;
This page took 0.030407 seconds and 4 git commands to generate.