Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: float host/target confusion in `f' format
@ 2001-09-11 21:44 Jim Blandy
  2001-09-12 11:09 ` Michael Snyder
  2001-09-12 11:51 ` Andrew Cagney
  0 siblings, 2 replies; 5+ messages in thread
From: Jim Blandy @ 2001-09-11 21:44 UTC (permalink / raw)
  To: gdb-patches

Does this look like the right thing to do?  (I hate floating point types.)

2001-09-11  Jim Blandy  <jimb@redhat.com>

	* printcmd.c (print_scalar_formatted): Compare the length of the
	value against the lengths of the target's floating-point types,
	not the host's.

Index: gdb/printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.27
diff -c -r1.27 printcmd.c
*** gdb/printcmd.c	2001/09/12 04:18:08	1.27
--- gdb/printcmd.c	2001/09/12 04:22:02
***************
*** 455,463 ****
        break;
  
      case 'f':
!       if (len == sizeof (float))
          type = builtin_type_float;
!       else if (len == sizeof (double))
          type = builtin_type_double;
        print_floating (valaddr, type, stream);
        break;
--- 455,463 ----
        break;
  
      case 'f':
!       if (len == TYPE_LENGTH (builtin_type_float))
          type = builtin_type_float;
!       else if (len == TYPE_LENGTH (builtin_type_double))
          type = builtin_type_double;
        print_floating (valaddr, type, stream);
        break;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: float host/target confusion in `f' format
  2001-09-11 21:44 RFA: float host/target confusion in `f' format Jim Blandy
@ 2001-09-12 11:09 ` Michael Snyder
  2001-09-12 11:51 ` Andrew Cagney
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Snyder @ 2001-09-12 11:09 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb-patches

Jim Blandy wrote:
> 
> Does this look like the right thing to do?  (I hate floating point types.)

Looks right to me...

> 
> 2001-09-11  Jim Blandy  <jimb@redhat.com>
> 
>         * printcmd.c (print_scalar_formatted): Compare the length of the
>         value against the lengths of the target's floating-point types,
>         not the host's.
> 
> Index: gdb/printcmd.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/printcmd.c,v
> retrieving revision 1.27
> diff -c -r1.27 printcmd.c
> *** gdb/printcmd.c      2001/09/12 04:18:08     1.27
> --- gdb/printcmd.c      2001/09/12 04:22:02
> ***************
> *** 455,463 ****
>         break;
> 
>       case 'f':
> !       if (len == sizeof (float))
>           type = builtin_type_float;
> !       else if (len == sizeof (double))
>           type = builtin_type_double;
>         print_floating (valaddr, type, stream);
>         break;
> --- 455,463 ----
>         break;
> 
>       case 'f':
> !       if (len == TYPE_LENGTH (builtin_type_float))
>           type = builtin_type_float;
> !       else if (len == TYPE_LENGTH (builtin_type_double))
>           type = builtin_type_double;
>         print_floating (valaddr, type, stream);
>         break;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: float host/target confusion in `f' format
  2001-09-11 21:44 RFA: float host/target confusion in `f' format Jim Blandy
  2001-09-12 11:09 ` Michael Snyder
@ 2001-09-12 11:51 ` Andrew Cagney
  2001-09-12 12:28   ` Jim Blandy
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2001-09-12 11:51 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb-patches

> !       if (len == TYPE_LENGTH (builtin_type_float))
>           type = builtin_type_float;
> !       else if (len == TYPE_LENGTH (builtin_type_double))
>           type = builtin_type_double;
> 

should a long double test added?
andrew



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: float host/target confusion in `f' format
  2001-09-12 11:51 ` Andrew Cagney
@ 2001-09-12 12:28   ` Jim Blandy
  2001-12-07 13:09     ` Jim Blandy
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Blandy @ 2001-09-12 12:28 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> should a long double test added?

2001-09-11  Jim Blandy  <jimb@redhat.com>

	* printcmd.c (print_scalar_formatted): Compare the length of the
	value against the lengths of the target's floating-point types,
	not the host's.  Add support for `long double'.

Index: gdb/printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.27
diff -c -r1.27 printcmd.c
*** gdb/printcmd.c	2001/09/12 04:18:08	1.27
--- gdb/printcmd.c	2001/09/12 19:26:35
***************
*** 455,464 ****
        break;
  
      case 'f':
!       if (len == sizeof (float))
          type = builtin_type_float;
!       else if (len == sizeof (double))
          type = builtin_type_double;
        print_floating (valaddr, type, stream);
        break;
  
--- 455,466 ----
        break;
  
      case 'f':
!       if (len == TYPE_LENGTH (builtin_type_float))
          type = builtin_type_float;
!       else if (len == TYPE_LENGTH (builtin_type_double))
          type = builtin_type_double;
+       else if (len == TYPE_LENGTH (builtin_type_long_double))
+         type = builtin_type_long_double;
        print_floating (valaddr, type, stream);
        break;
  


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RFA: float host/target confusion in `f' format
  2001-09-12 12:28   ` Jim Blandy
@ 2001-12-07 13:09     ` Jim Blandy
  0 siblings, 0 replies; 5+ messages in thread
From: Jim Blandy @ 2001-12-07 13:09 UTC (permalink / raw)
  To: gdb-patches


I've committed this patch.

Jim Blandy <jimb@cygnus.com> writes:
> 2001-09-11  Jim Blandy  <jimb@redhat.com>
> 
> 	* printcmd.c (print_scalar_formatted): Compare the length of the
> 	value against the lengths of the target's floating-point types,
> 	not the host's.  Add support for `long double'.
> 
> Index: gdb/printcmd.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/printcmd.c,v
> retrieving revision 1.27
> diff -c -r1.27 printcmd.c
> *** gdb/printcmd.c	2001/09/12 04:18:08	1.27
> --- gdb/printcmd.c	2001/09/12 19:26:35
> ***************
> *** 455,464 ****
>         break;
>   
>       case 'f':
> !       if (len == sizeof (float))
>           type = builtin_type_float;
> !       else if (len == sizeof (double))
>           type = builtin_type_double;
>         print_floating (valaddr, type, stream);
>         break;
>   
> --- 455,466 ----
>         break;
>   
>       case 'f':
> !       if (len == TYPE_LENGTH (builtin_type_float))
>           type = builtin_type_float;
> !       else if (len == TYPE_LENGTH (builtin_type_double))
>           type = builtin_type_double;
> +       else if (len == TYPE_LENGTH (builtin_type_long_double))
> +         type = builtin_type_long_double;
>         print_floating (valaddr, type, stream);
>         break;
>   
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-12-07 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-11 21:44 RFA: float host/target confusion in `f' format Jim Blandy
2001-09-12 11:09 ` Michael Snyder
2001-09-12 11:51 ` Andrew Cagney
2001-09-12 12:28   ` Jim Blandy
2001-12-07 13:09     ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox