Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Jacobowitz <drow@mvista.com>, Don Howard <dhoward@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] mips: Fix "info registers" output
Date: Sun, 10 Mar 2002 08:30:00 -0000	[thread overview]
Message-ID: <3C8B8A11.8070609@cygnus.com> (raw)
In-Reply-To: <20020310015637.A13373@nevyn.them.org>

> 
> FP_REGISTER_DOUBLE describes a property of the ABI.  I don't really
> think it's the appropriate check when printing floating-point
> registers; we always take care to print the single-precision value even
> if FP_REGISTER_DOUBLE, because they might be used in single-precision
> anyway.

True, sort of.  The decision is a function of that FP bit, 
FP_REGISTER_DOUBLE and the user typing ``(gdb) set mips 
fp-register-double on, damit!'' (the user is always right :-).

If the FP register bit is used by just this code, other parts of GDB are 
going to be inconsistent since they are still using FP_REGISTER_DOUBLE 
when [un]packing FP registers.  Can I suggest using FP_REGISTER_DOUBLE 
initially (#if 0 #else #endif the code in mips2_fp_compat()) and bug 
report the need to change everyting to use mips2_fp_compat() as a 
separate change.

Apart from that, I think the code is brilliant.  Just suggest a few 
comment tweaks before the commit.

+      if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ 
{
+ 
   mips_read_fp_register_single (regno, rare_buffer + 4);
+ 
   mips_read_fp_register_single (regno + 1, rare_buffer);
+ 
}
+      else
+ 
{
+ 
   mips_read_fp_register_single (regno, rare_buffer);
+ 
   mips_read_fp_register_single (regno + 1, rare_buffer + 4);
+ 
}

Suggest mentioning that mips_read_fp_register_single() handles the 
problem of extracting the correct four bytes from from each register.

> -  /* use HI and LO to control the order of combining two flt regs */
> -  int HI = (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG);
> -  int LO = (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG);

Yes! In 20:20 hindsight that was a very confusing idea.

> +      /* 4-byte registers: we can fit two registers per row.  */
> +      /* Also print every pair of 4-byte regs as an 8-byte double.  */
> +      mips_read_fp_register_single (regnum, raw_buffer);
> +      flt1 = unpack_double (builtin_type_float, raw_buffer, &inv1);
> +
> +      mips_read_fp_register_single (regnum + 1, raw_buffer);
> +      flt2 = unpack_double (builtin_type_float, raw_buffer, &inv2);
>  
> +      mips_read_fp_register_double (regnum, raw_buffer);
> +      doub = unpack_double (builtin_type_double, raw_buffer, &inv3);
> +      
>        printf_filtered (" %-5s", REGISTER_NAME (regnum));

Suggest a FIXME and bug report here.  It isn't safe to assume things 
like builtin_type_double is 64 bit.  The code should use the ABI 
independant builtin_type_ieee_BLAH.  But this is a separate bug and not 
your problem :-)

enjoy,
Andrew







  reply	other threads:[~2002-03-10 16:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20010619225007.A10141@nevyn.them.org>
2001-06-20  7:19 ` Andrew Cagney
2001-06-21  0:45 ` Eli Zaretskii
2001-06-21  8:37   ` Daniel Jacobowitz
2001-06-21  9:29     ` Eli Zaretskii
2001-06-21  9:44       ` Daniel Jacobowitz
2001-06-21 12:00         ` Eli Zaretskii
2001-06-21 13:12           ` Daniel Jacobowitz
2001-06-21 14:22           ` Don Howard
2002-03-07 13:59 ` Daniel Jacobowitz
2002-03-09 18:05   ` Andrew Cagney
2002-03-09 22:58     ` Daniel Jacobowitz
2002-03-10  8:30       ` Andrew Cagney [this message]
2002-03-10  9:00         ` Daniel Jacobowitz
2002-03-10  9:46           ` Andrew Cagney
2002-03-10 11:30             ` Daniel Jacobowitz
2002-03-10 12:45               ` Andrew Cagney
2002-03-10 14:26                 ` Daniel Jacobowitz
2002-03-10 15:18                   ` Andrew Cagney

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=3C8B8A11.8070609@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=dhoward@redhat.com \
    --cc=drow@mvista.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