Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [commit] mep-tdep.c: prologue analyzer update
Date: Sat, 14 Jul 2007 00:17:00 -0000	[thread overview]
Message-ID: <20070713171750.632b6c58@ironwood.lan> (raw)
In-Reply-To: <m3lkdl3scf.fsf@codesourcery.com>

> The comment might want to mention why we should only do this for
> forward branches.  :)

Thanks for the feedback!  I've updated the comment as follows...

	* mep-tdep.c (mep_analyze_prologue): Update comment for BRA
	instruction case.

Index: mep-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mep-tdep.c,v
retrieving revision 1.6
diff -u -p -r1.6 mep-tdep.c
--- mep-tdep.c	13 Jul 2007 00:00:15 -0000	1.6
+++ mep-tdep.c	14 Jul 2007 00:14:16 -0000
@@ -1812,13 +1812,24 @@ mep_analyze_prologue (CORE_ADDR start_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;


      reply	other threads:[~2007-07-14  0:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13  0:01 Kevin Buettner
2007-07-13  3:17 ` Jim Blandy
2007-07-14  0:17   ` Kevin Buettner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070713171750.632b6c58@ironwood.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox