Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [testsuite/alpha] Add test for step over fbne instruction
Date: Fri, 20 May 2005 11:31:00 -0000	[thread overview]
Message-ID: <20050520061810.GA29720@redhat.com> (raw)
In-Reply-To: <20050520034254.GZ1462@adacore.com>

On Fri, May 20, 2005 at 01:42:54PM +1000, Joel Brobecker wrote:
> int
> main (void)
> {
>   gt ();
> 
>   return 0;
> }
> 
> /* gt(). Obtained from the following code:
> 
>    void
>    gt (void)
>    {
>      double a = 360.0;
>    
>      if (a > 0)
>        a = 0.0;
>      else
>        a = -a;
>    }
> 
>   The purpose of the test is to stop just before the check against
>   zero, and do a stepi. GDB should step one instruction and stop,
>   rather than letting the program continue until the it terminates.  */
> 
> asm("        .rdata\n"
>     "        .align 3\n"

.rdata is an ecoff thing; it won't work for elf systems.  I suggest
that you pass in this data from main and leave the symbol work to 
the compiler.  That is,

	extern double gt(double);
	int main ()
	{
	  gt (360.0);
	  gt (-360.0);
	  return 0;
	}

	/* double gt(double a)
	   {
	     if (a > 0)
	       a = 0;
	     else
	       a = -a;
	     return a;
	   }
	*/

	asm (
	"	.text\n"
	"	.ent gt\n"
	"gt:\n"
	"	.frame $30,0,$26,0"
	"	.prologue 0\n"
	"	cpys $f31,$f31,$f0\n"
	"	fble $f16,$gt_1\n"	/* stop at this instruction.  */
	"	cpysn $f16,$f16,$f0\n"
	"$gt_1:\n"
	"	ret $31,($26),1\n"
	"        .end gt\n");

I might also suggest that you test both branch directions.


r~


  reply	other threads:[~2005-05-20  6:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-20  7:02 Joel Brobecker
2005-05-20 11:31 ` Richard Henderson [this message]
2005-05-25  5:15   ` Joel Brobecker
2005-05-25 15:09 Richard Henderson
2005-05-26  3:14 ` Joel Brobecker
2005-05-26  3:27   ` Richard Henderson
2005-05-26  3:41     ` Daniel Jacobowitz
2005-05-26  5:02     ` Joel Brobecker
2005-05-26  6:04       ` Daniel Jacobowitz
2005-05-28 22:10   ` Daniel Jacobowitz
2005-05-29  2:53     ` Joel Brobecker

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=20050520061810.GA29720@redhat.com \
    --to=rth@redhat.com \
    --cc=brobecker@adacore.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