From 203890574da95d16f8c453491026d349be4b2721 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Fri, 30 Mar 2007 14:31:44 +0000 Subject: * doublest.c (convert_floatformat_to_doublest): Use floatformat_classify. (floatformat_is_nan): Rename to... (floatformat_classify): ...this. Return more information. * doublest.h (enum float_kind): New. (floatformat_is_nan): Replace prototype... (floatformat_classify): ...with this one. * valprint.c (print_floating): Use floatformat_classify. Handle infinity. * gdb.base/infnan.c, gdb.base/infnan.exp: New files. --- gdb/doublest.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gdb/doublest.h') diff --git a/gdb/doublest.h b/gdb/doublest.h index 058b4a3..983c7be 100644 --- a/gdb/doublest.h +++ b/gdb/doublest.h @@ -64,6 +64,17 @@ typedef double DOUBLEST; # undef SCANF_HAS_LONG_DOUBLE #endif +/* Different kinds of floatformat numbers recognized by + floatformat_classify. To avoid portability issues, we use local + values instead of the C99 macros (FP_NAN et cetera). */ +enum float_kind { + float_nan, + float_infinite, + float_zero, + float_normal, + float_subnormal +}; + extern void floatformat_to_doublest (const struct floatformat *, const void *in, DOUBLEST *out); extern void floatformat_from_doublest (const struct floatformat *, @@ -71,7 +82,8 @@ extern void floatformat_from_doublest (const struct floatformat *, extern int floatformat_is_negative (const struct floatformat *, const bfd_byte *); -extern int floatformat_is_nan (const struct floatformat *, const bfd_byte *); +extern enum float_kind floatformat_classify (const struct floatformat *, + const bfd_byte *); extern const char *floatformat_mantissa (const struct floatformat *, const bfd_byte *); -- cgit v1.1