* printcmd.c (print_scalar_formatted): Compare the length of the
authorJim Blandy <jimb@codesourcery.com>
Fri, 7 Dec 2001 21:07:59 +0000 (21:07 +0000)
committerJim Blandy <jimb@codesourcery.com>
Fri, 7 Dec 2001 21:07:59 +0000 (21:07 +0000)
value against the lengths of the target's floating-point types,
not the host's.  Add support for `long double'.

gdb/ChangeLog
gdb/printcmd.c

index 9acd44a037df1d7a6f9e35088f62b2676f28dfcd..b29b15df378f5ee734c903b8c28a26bd1f46dd32 100644 (file)
@@ -1,3 +1,9 @@
+2001-12-07  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'.
+
 2001-12-07  Martin M. Hunt  <hunt@redhat.com>
 
        * configure.in: Check for sys/filio.h
index 2486ba7fa95eaa84eb9a653a6ed6344075dfb428..bb02d8d42eeb1b2b537d452ce564de4135c58760 100644 (file)
@@ -455,10 +455,12 @@ print_scalar_formatted (char *valaddr, struct type *type, int format, int size,
       break;
 
     case 'f':
-      if (len == sizeof (float))
+      if (len == TYPE_LENGTH (builtin_type_float))
         type = builtin_type_float;
-      else if (len == sizeof (double))
+      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;