aboutsummaryrefslogtreecommitdiff
path: root/gdb/doublest.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-03-09 02:29:39 +0000
committerPedro Alves <palves@redhat.com>2016-03-09 02:47:40 +0000
commitb79497cb1cdc9b3053e5f0387bf3056c08c9bbdd (patch)
treea203c96dfab366888677ad75977a132ef2036567 /gdb/doublest.h
parentaacca8a7a9c7f93955fa9dbf796b030ffce1b956 (diff)
downloadgdb-b79497cb1cdc9b3053e5f0387bf3056c08c9bbdd.zip
gdb-b79497cb1cdc9b3053e5f0387bf3056c08c9bbdd.tar.gz
gdb-b79497cb1cdc9b3053e5f0387bf3056c08c9bbdd.tar.bz2
Assert that a floating type's length is at least as long as its format
This would have caught the HP/PA bug fixed in the previous patch: .../src/gdb/gdbtypes.c:4690: internal-error: arch_float_type: Assertion `len >= floatformat_totalsize_bytes (floatformats[0])' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) Tested on x86-64 Fedora 23, --enable-targets=all. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * doublest.c (floatformat_totalsize_bytes): New function. (floatformat_from_type): Assert that the type's length is at least as long as the floatformat's totalsize. * doublest.h (floatformat_totalsize_bytes): New declaration. * gdbtypes.c (arch_float_type): Assert that the type's length is at least as long as the floatformat's totalsize.
Diffstat (limited to 'gdb/doublest.h')
-rw-r--r--gdb/doublest.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/doublest.h b/gdb/doublest.h
index ae42bdb..9522829 100644
--- a/gdb/doublest.h
+++ b/gdb/doublest.h
@@ -89,6 +89,10 @@ extern const char *floatformat_mantissa (const struct floatformat *,
const struct floatformat *floatformat_from_type (const struct type *type);
+/* Return the floatformat's total size in host bytes. */
+
+extern size_t floatformat_totalsize_bytes (const struct floatformat *fmt);
+
extern DOUBLEST extract_typed_floating (const void *addr,
const struct type *type);
extern void store_typed_floating (void *addr, const struct type *type,