GDB (xrefs)
Defines | Functions
/home/stan/gdb/src/gdb/dfp.c File Reference
#include "defs.h"
#include "expression.h"
#include "gdbtypes.h"
#include "value.h"
#include "dfp.h"
#include "dpd/decimal128.h"
#include "dpd/decimal64.h"
#include "dpd/decimal32.h"

Go to the source code of this file.

Defines

#define OPPOSITE_BYTE_ORDER   BFD_ENDIAN_BIG

Functions

static void match_endianness (const gdb_byte *from, int len, enum bfd_endian byte_order, gdb_byte *to)
static void set_decnumber_context (decContext *ctx, int len)
static void decimal_check_errors (decContext *ctx)
static void decimal_from_number (const decNumber *from, gdb_byte *to, int len)
static void decimal_to_number (const gdb_byte *from, int len, decNumber *to)
void decimal_to_string (const gdb_byte *decbytes, int len, enum bfd_endian byte_order, char *s)
int decimal_from_string (gdb_byte *decbytes, int len, enum bfd_endian byte_order, const char *string)
void decimal_from_integral (struct value *from, gdb_byte *to, int len, enum bfd_endian byte_order)
void decimal_from_floating (struct value *from, gdb_byte *to, int len, enum bfd_endian byte_order)
DOUBLEST decimal_to_doublest (const gdb_byte *from, int len, enum bfd_endian byte_order)
void decimal_binop (enum exp_opcode op, const gdb_byte *x, int len_x, enum bfd_endian byte_order_x, const gdb_byte *y, int len_y, enum bfd_endian byte_order_y, gdb_byte *result, int len_result, enum bfd_endian byte_order_result)
int decimal_is_zero (const gdb_byte *x, int len, enum bfd_endian byte_order)
int decimal_compare (const gdb_byte *x, int len_x, enum bfd_endian byte_order_x, const gdb_byte *y, int len_y, enum bfd_endian byte_order_y)
void decimal_convert (const gdb_byte *from, int len_from, enum bfd_endian byte_order_from, gdb_byte *to, int len_to, enum bfd_endian byte_order_to)

Define Documentation

#define OPPOSITE_BYTE_ORDER   BFD_ENDIAN_BIG

Referenced by match_endianness().


Function Documentation

void decimal_binop ( enum exp_opcode  op,
const gdb_byte x,
int  len_x,
enum bfd_endian  byte_order_x,
const gdb_byte y,
int  len_y,
enum bfd_endian  byte_order_y,
gdb_byte result,
int  len_result,
enum bfd_endian  byte_order_result 
)
static void decimal_check_errors ( decContext *  ctx) [static]

Definition at line 81 of file dfp.c.

References _, and error().

Referenced by decimal_binop(), decimal_compare(), and decimal_from_string().

int decimal_compare ( const gdb_byte x,
int  len_x,
enum bfd_endian  byte_order_x,
const gdb_byte y,
int  len_y,
enum bfd_endian  byte_order_y 
)
void decimal_convert ( const gdb_byte from,
int  len_from,
enum bfd_endian  byte_order_from,
gdb_byte to,
int  len_to,
enum bfd_endian  byte_order_to 
)

Definition at line 371 of file dfp.c.

References decimal_from_number(), decimal_to_number(), and match_endianness().

Referenced by printf_decfloat(), and value_cast().

void decimal_from_floating ( struct value from,
gdb_byte to,
int  len,
enum bfd_endian  byte_order 
)

Definition at line 241 of file dfp.c.

References decimal_from_string(), DOUBLEST_PRINT_FORMAT, value_as_double(), xfree(), and xstrprintf().

Referenced by value_cast().

void decimal_from_integral ( struct value from,
gdb_byte to,
int  len,
enum bfd_endian  byte_order 
)
static void decimal_from_number ( const decNumber *  from,
gdb_byte to,
int  len 
) [static]

Definition at line 100 of file dfp.c.

References set_decnumber_context().

Referenced by decimal_binop(), decimal_convert(), and decimal_from_integral().

int decimal_from_string ( gdb_byte decbytes,
int  len,
enum bfd_endian  byte_order,
const char *  string 
)
int decimal_is_zero ( const gdb_byte x,
int  len,
enum bfd_endian  byte_order 
)

Definition at line 320 of file dfp.c.

References decimal_to_number(), and match_endianness().

Referenced by value_logical_not().

DOUBLEST decimal_to_doublest ( const gdb_byte from,
int  len,
enum bfd_endian  byte_order 
)

Definition at line 255 of file dfp.c.

References decimal_to_string(), and MAX_DECIMAL_STRING.

Referenced by unpack_double(), and unpack_long().

static void decimal_to_number ( const gdb_byte from,
int  len,
decNumber *  to 
) [static]

Definition at line 123 of file dfp.c.

References _, and error().

Referenced by decimal_binop(), decimal_compare(), decimal_convert(), and decimal_is_zero().

void decimal_to_string ( const gdb_byte decbytes,
int  len,
enum bfd_endian  byte_order,
char *  s 
)

Definition at line 146 of file dfp.c.

References _, error(), and match_endianness().

Referenced by decimal_to_doublest(), print_decimal_floating(), and printf_decfloat().

static void match_endianness ( const gdb_byte from,
int  len,
enum bfd_endian  byte_order,
gdb_byte to 
) [static]
static void set_decnumber_context ( decContext *  ctx,
int  len 
) [static]

Definition at line 61 of file dfp.c.

Referenced by decimal_binop(), decimal_compare(), decimal_from_number(), and decimal_from_string().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines