GDB (xrefs)
|
#include "defs.h"
#include "doublest.h"
#include "floatformat.h"
#include "gdb_assert.h"
#include "gdb_string.h"
#include "gdbtypes.h"
#include <math.h>
Go to the source code of this file.
Defines | |
#define | FLOATFORMAT_CHAR_BIT 8 |
#define | FLOATFORMAT_LARGEST_BYTES 16 |
Functions | |
static unsigned long | get_field (const bfd_byte *data, enum floatformat_byteorders order, unsigned int total_len, unsigned int start, unsigned int len) |
static enum floatformat_byteorders | floatformat_normalize_byteorder (const struct floatformat *fmt, const void *from, void *to) |
static void | convert_floatformat_to_doublest (const struct floatformat *fmt, const void *from, DOUBLEST *to) |
static void | put_field (unsigned char *data, enum floatformat_byteorders order, unsigned int total_len, unsigned int start, unsigned int len, unsigned long stuff_to_put) |
static void | convert_doublest_to_floatformat (CONST struct floatformat *fmt, const DOUBLEST *from, void *to) |
int | floatformat_is_negative (const struct floatformat *fmt, const bfd_byte *uval) |
enum float_kind | floatformat_classify (const struct floatformat *fmt, const bfd_byte *uval) |
const char * | floatformat_mantissa (const struct floatformat *fmt, const bfd_byte *val) |
void | floatformat_to_doublest (const struct floatformat *fmt, const void *in, DOUBLEST *out) |
void | floatformat_from_doublest (const struct floatformat *fmt, const DOUBLEST *in, void *out) |
static struct floatformat * | floatformat_from_length (struct gdbarch *gdbarch, int len) |
struct floatformat * | floatformat_from_type (const struct type *type) |
DOUBLEST | extract_typed_floating (const void *addr, const struct type *type) |
void | store_typed_floating (void *addr, const struct type *type, DOUBLEST val) |
void | convert_typed_floating (const void *from, const struct type *from_type, void *to, const struct type *to_type) |
Variables | |
static struct floatformat * | host_float_format = GDB_HOST_FLOAT_FORMAT |
static struct floatformat * | host_double_format = GDB_HOST_DOUBLE_FORMAT |
static struct floatformat * | host_long_double_format = GDB_HOST_LONG_DOUBLE_FORMAT |
#define FLOATFORMAT_CHAR_BIT 8 |
Definition at line 37 of file doublest.c.
Referenced by convert_doublest_to_floatformat(), convert_floatformat_to_doublest(), floatformat_classify(), floatformat_is_negative(), floatformat_mantissa(), floatformat_normalize_byteorder(), get_field(), and put_field().
#define FLOATFORMAT_LARGEST_BYTES 16 |
Definition at line 41 of file doublest.c.
Referenced by convert_doublest_to_floatformat(), convert_floatformat_to_doublest(), floatformat_classify(), floatformat_is_negative(), and floatformat_mantissa().
static void convert_doublest_to_floatformat | ( | CONST struct floatformat * | fmt, |
const DOUBLEST * | from, | ||
void * | to | ||
) | [static] |
Definition at line 345 of file doublest.c.
References FLOATFORMAT_CHAR_BIT, floatformat_from_doublest(), FLOATFORMAT_LARGEST_BYTES, floatformat_normalize_byteorder(), L, gdb::printing::long, memcpy(), memset(), and put_field().
Referenced by floatformat_from_doublest().
static void convert_floatformat_to_doublest | ( | const struct floatformat * | fmt, |
const void * | from, | ||
DOUBLEST * | to | ||
) | [static] |
Definition at line 167 of file doublest.c.
References float_infinite, float_nan, FLOATFORMAT_CHAR_BIT, floatformat_classify(), FLOATFORMAT_LARGEST_BYTES, floatformat_normalize_byteorder(), floatformat_to_doublest(), gdb_assert, get_field(), and min.
Referenced by floatformat_to_doublest().
void convert_typed_floating | ( | const void * | from, |
const struct type * | from_type, | ||
void * | to, | ||
const struct type * | to_type | ||
) |
Definition at line 864 of file doublest.c.
References _, floatformat_from_doublest(), floatformat_from_type(), floatformat_to_doublest(), memcpy(), memset(), min, TYPE_LENGTH, and warning().
Referenced by do_ppc_sysv_return_value(), i386_extract_return_value(), i386_store_return_value(), i387_register_to_value(), i387_value_to_register(), ia64_extract_return_value(), ia64_push_dummy_call(), ia64_register_to_value(), ia64_store_return_value(), ia64_value_to_register(), m68k_register_to_value(), m68k_svr4_extract_return_value(), m68k_svr4_store_return_value(), m68k_value_to_register(), ppc64_sysv_abi_push_dummy_call(), ppc64_sysv_abi_push_float(), ppc64_sysv_abi_return_value(), ppc_sysv_abi_push_dummy_call(), rs6000_lynx178_push_dummy_call(), rs6000_lynx178_return_value(), rs6000_push_dummy_call(), rs6000_register_to_value(), rs6000_return_value(), and rs6000_value_to_register().
DOUBLEST extract_typed_floating | ( | const void * | addr, |
const struct type * | type | ||
) |
Definition at line 819 of file doublest.c.
References floatformat_from_type(), and floatformat_to_doublest().
Referenced by print_i387_value(), sh64_register_convert_to_raw(), sh_register_convert_to_raw(), unpack_double(), and unpack_long().
enum float_kind floatformat_classify | ( | const struct floatformat * | fmt, |
const bfd_byte * | uval | ||
) |
Definition at line 534 of file doublest.c.
References float_infinite, float_nan, float_normal, float_subnormal, float_zero, FLOATFORMAT_CHAR_BIT, FLOATFORMAT_LARGEST_BYTES, floatformat_normalize_byteorder(), gdb_assert, get_field(), and min.
Referenced by convert_floatformat_to_doublest(), and print_floating().
void floatformat_from_doublest | ( | const struct floatformat * | fmt, |
const DOUBLEST * | in, | ||
void * | out | ||
) |
Definition at line 729 of file doublest.c.
References convert_doublest_to_floatformat(), gdb_assert, host_double_format, host_float_format, host_long_double_format, and memcpy().
Referenced by convert_doublest_to_floatformat(), convert_from_extended(), convert_to_extended(), convert_typed_floating(), sh64_register_convert_to_raw(), sh_register_convert_to_raw(), and store_typed_floating().
static struct floatformat* floatformat_from_length | ( | struct gdbarch * | gdbarch, |
int | len | ||
) | [static, read] |
Definition at line 770 of file doublest.c.
References _, error(), gdbarch_byte_order(), gdbarch_double_bit(), gdbarch_double_format(), gdbarch_float_bit(), gdbarch_float_format(), gdbarch_half_bit(), gdbarch_half_format(), gdbarch_long_double_bit(), and gdbarch_long_double_format().
Referenced by floatformat_from_type().
struct floatformat* floatformat_from_type | ( | const struct type * | type | ) | [read] |
Definition at line 804 of file doublest.c.
References floatformat_from_length(), gdb_assert, gdbarch_byte_order(), get_type_arch(), TYPE_CODE, TYPE_CODE_FLT, TYPE_FLOATFORMAT, and TYPE_LENGTH.
Referenced by arm_extract_return_value(), arm_store_return_value(), convert_typed_floating(), extract_typed_floating(), print_floating(), store_typed_floating(), and unpack_double().
int floatformat_is_negative | ( | const struct floatformat * | fmt, |
const bfd_byte * | uval | ||
) |
Definition at line 508 of file doublest.c.
References FLOATFORMAT_CHAR_BIT, FLOATFORMAT_LARGEST_BYTES, floatformat_normalize_byteorder(), gdb_assert, and get_field().
Referenced by print_floating().
const char* floatformat_mantissa | ( | const struct floatformat * | fmt, |
const bfd_byte * | val | ||
) |
Definition at line 621 of file doublest.c.
References FLOATFORMAT_CHAR_BIT, FLOATFORMAT_LARGEST_BYTES, floatformat_normalize_byteorder(), gdb_assert, get_field(), len, and xsnprintf().
Referenced by print_floating().
static enum floatformat_byteorders floatformat_normalize_byteorder | ( | const struct floatformat * | fmt, |
const void * | from, | ||
void * | to | ||
) | [static] |
Definition at line 115 of file doublest.c.
References FLOATFORMAT_CHAR_BIT, and gdb_assert.
Referenced by convert_doublest_to_floatformat(), convert_floatformat_to_doublest(), floatformat_classify(), floatformat_is_negative(), and floatformat_mantissa().
void floatformat_to_doublest | ( | const struct floatformat * | fmt, |
const void * | in, | ||
DOUBLEST * | out | ||
) |
Definition at line 699 of file doublest.c.
References convert_floatformat_to_doublest(), gdb_assert, host_double_format, host_float_format, host_long_double_format, and memcpy().
Referenced by convert_floatformat_to_doublest(), convert_from_extended(), convert_to_extended(), convert_typed_floating(), extract_typed_floating(), sh64_extract_return_value(), sh64_register_convert_to_virtual(), and sh_register_convert_to_virtual().
static unsigned long get_field | ( | const bfd_byte * | data, |
enum floatformat_byteorders | order, | ||
unsigned int | total_len, | ||
unsigned int | start, | ||
unsigned int | len | ||
) | [static] |
Definition at line 46 of file doublest.c.
References FLOATFORMAT_CHAR_BIT, gdb_assert, len, and gdb::printing::long.
Referenced by convert_floatformat_to_doublest(), floatformat_classify(), floatformat_is_negative(), and floatformat_mantissa().
static void put_field | ( | unsigned char * | data, |
enum floatformat_byteorders | order, | ||
unsigned int | total_len, | ||
unsigned int | start, | ||
unsigned int | len, | ||
unsigned long | stuff_to_put | ||
) | [static] |
Definition at line 279 of file doublest.c.
References FLOATFORMAT_CHAR_BIT, gdb_assert, and len.
Referenced by convert_doublest_to_floatformat().
void store_typed_floating | ( | void * | addr, |
const struct type * | type, | ||
DOUBLEST | val | ||
) |
Definition at line 832 of file doublest.c.
References floatformat_from_doublest(), floatformat_from_type(), memset(), and TYPE_LENGTH.
Referenced by define_symbol(), scalar_binop(), sh64_extract_return_value(), sh64_register_convert_to_virtual(), sh_register_convert_to_virtual(), and value_from_double().
struct floatformat* host_double_format = GDB_HOST_DOUBLE_FORMAT [static] |
Definition at line 694 of file doublest.c.
Referenced by floatformat_from_doublest(), and floatformat_to_doublest().
struct floatformat* host_float_format = GDB_HOST_FLOAT_FORMAT [static] |
Definition at line 693 of file doublest.c.
Referenced by floatformat_from_doublest(), and floatformat_to_doublest().
struct floatformat* host_long_double_format = GDB_HOST_LONG_DOUBLE_FORMAT [static] |
Definition at line 696 of file doublest.c.
Referenced by floatformat_from_doublest(), and floatformat_to_doublest().