aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-12-07 21:07:59 +0000
committerJim Blandy <jimb@codesourcery.com>2001-12-07 21:07:59 +0000
commitf4697836921014a6a3a39f9fbcbfe707e62f4a98 (patch)
tree6f2c619d366b1fd0c4bd8e0ad46405f88139f6c5 /gdb/printcmd.c
parent7a345fb3e39283ea821a1e7118ae2412bc53c742 (diff)
downloadgdb-f4697836921014a6a3a39f9fbcbfe707e62f4a98.zip
gdb-f4697836921014a6a3a39f9fbcbfe707e62f4a98.tar.gz
gdb-f4697836921014a6a3a39f9fbcbfe707e62f4a98.tar.bz2
* 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'.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 2486ba7..bb02d8d 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -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;