aboutsummaryrefslogtreecommitdiff
path: root/gdb/doublest.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-03-30 14:31:44 +0000
committerDaniel Jacobowitz <drow@false.org>2007-03-30 14:31:44 +0000
commit203890574da95d16f8c453491026d349be4b2721 (patch)
tree710bf3d3ba4bba96d041b36ee261296db68f66a4 /gdb/doublest.h
parent30b50213ec9759b035bc719efb13ef5e090ed7ef (diff)
downloadgdb-203890574da95d16f8c453491026d349be4b2721.zip
gdb-203890574da95d16f8c453491026d349be4b2721.tar.gz
gdb-203890574da95d16f8c453491026d349be4b2721.tar.bz2
* 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.
Diffstat (limited to 'gdb/doublest.h')
-rw-r--r--gdb/doublest.h14
1 files changed, 13 insertions, 1 deletions
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 *);