GDB (xrefs)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
gdb_mpz Struct Reference

#include "gmp-utils.h"

Public Member Functions

 gdb_mpz ()
 
 gdb_mpz (const mpz_t &from_val)
 
 gdb_mpz (const gdb_mpz &from)
 
template<typename T , typename = gdb::Requires<std::is_integral<T>>>
 gdb_mpz (T src)
 
 gdb_mpz (gdb_mpz &&from)
 
gdb_mpzoperator= (const gdb_mpz &from)
 
gdb_mpzoperator= (gdb_mpz &&other)
 
template<typename T , typename = gdb::Requires<std::is_integral<T>>>
gdb_mpzoperator= (T src)
 
gdb_mpzoperator= (bool src)
 
bool set (const char *str, int base)
 
gdb_mpz pow (unsigned long exp) const
 
template<typename T >
T as_integer () const
 
template<typename T >
T as_integer_truncate () const
 
void read (gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order, bool unsigned_p)
 
void write (gdb::array_view< gdb_byte > buf, enum bfd_endian byte_order, bool unsigned_p) const
 
void truncate (gdb::array_view< gdb_byte > buf, enum bfd_endian byte_order, bool unsigned_p) const
 
std::string str () const
 
 ~gdb_mpz ()
 
void negate ()
 
void complement ()
 
void mask (unsigned n)
 
int sgn () const
 
 operator bool () const
 
gdb_mpzoperator*= (long other)
 
gdb_mpz operator* (const gdb_mpz &other) const
 
gdb_mpz operator/ (const gdb_mpz &other) const
 
gdb_mpz operator% (const gdb_mpz &other) const
 
gdb_mpzoperator+= (unsigned long other)
 
gdb_mpzoperator+= (const gdb_mpz &other)
 
gdb_mpz operator+ (const gdb_mpz &other) const
 
gdb_mpzoperator-= (unsigned long other)
 
gdb_mpzoperator-= (const gdb_mpz &other)
 
gdb_mpz operator- (const gdb_mpz &other) const
 
gdb_mpzoperator<<= (unsigned long nbits)
 
gdb_mpz operator<< (unsigned long nbits) const
 
gdb_mpz operator>> (unsigned long nbits) const
 
gdb_mpzoperator>>= (unsigned long nbits)
 
gdb_mpz operator& (const gdb_mpz &other) const
 
gdb_mpz operator| (const gdb_mpz &other) const
 
gdb_mpz operator^ (const gdb_mpz &other) const
 
bool operator> (const gdb_mpz &other) const
 
bool operator>= (const gdb_mpz &other) const
 
bool operator< (const gdb_mpz &other) const
 
bool operator<= (const gdb_mpz &other) const
 
bool operator< (long other) const
 
template<typename T , typename = gdb::Requires<std::is_integral<T>>>
bool operator== (T other) const
 
bool operator== (const gdb_mpz &other) const
 
bool operator!= (const gdb_mpz &other) const
 

Static Public Member Functions

static gdb_mpz pow (unsigned long base, unsigned long exp)
 

Private Member Functions

template<typename T >
void set (T src)
 
void export_bits (gdb::array_view< gdb_byte > buf, int endian, bool unsigned_p, bool safe) const
 

Private Attributes

mpz_t m_val
 

Friends

struct gdb_mpq
 
struct gdb_mpf
 

Detailed Description

Definition at line 39 of file gmp-utils.h.

Constructor & Destructor Documentation

◆ gdb_mpz() [1/5]

gdb_mpz::gdb_mpz ( )
inline

Definition at line 42 of file gmp-utils.h.

References m_val.

Referenced by operator==().

◆ gdb_mpz() [2/5]

gdb_mpz::gdb_mpz ( const mpz_t & from_val)
inlineexplicit

Definition at line 44 of file gmp-utils.h.

References m_val.

◆ gdb_mpz() [3/5]

gdb_mpz::gdb_mpz ( const gdb_mpz & from)
inline

Definition at line 50 of file gmp-utils.h.

References m_val.

◆ gdb_mpz() [4/5]

template<typename T , typename = gdb::Requires<std::is_integral<T>>>
gdb_mpz::gdb_mpz ( T src)
inlineexplicit

Definition at line 61 of file gmp-utils.h.

References m_val, and set().

◆ gdb_mpz() [5/5]

gdb_mpz::gdb_mpz ( gdb_mpz && from)
inlineexplicit

Definition at line 67 of file gmp-utils.h.

References m_val.

◆ ~gdb_mpz()

gdb_mpz::~gdb_mpz ( )
inline

Definition at line 165 of file gmp-utils.h.

References m_val.

Member Function Documentation

◆ as_integer()

template<typename T >
T gdb_mpz::as_integer ( ) const

◆ as_integer_truncate()

template<typename T >
T gdb_mpz::as_integer_truncate ( ) const

Definition at line 641 of file gmp-utils.h.

References export_bits().

◆ complement()

void gdb_mpz::complement ( )
inline

Definition at line 174 of file gmp-utils.h.

References m_val.

Referenced by value_complement().

◆ export_bits()

void gdb_mpz::export_bits ( gdb::array_view< gdb_byte > buf,
int endian,
bool unsigned_p,
bool safe ) const
private

Definition at line 69 of file gmp-utils.c.

References m_val, mask(), pow(), sgn(), and str().

Referenced by as_integer(), as_integer_truncate(), truncate(), and write().

◆ mask()

void gdb_mpz::mask ( unsigned n)
inline

Definition at line 178 of file gmp-utils.h.

References m_val.

Referenced by export_bits(), value_as_mpz(), and value_from_mpz().

◆ negate()

void gdb_mpz::negate ( )
inline

◆ operator bool()

gdb_mpz::operator bool ( ) const
inlineexplicit

Definition at line 186 of file gmp-utils.h.

References sgn().

◆ operator!=()

bool gdb_mpz::operator!= ( const gdb_mpz & other) const
inline

Definition at line 352 of file gmp-utils.h.

References m_val.

◆ operator%()

gdb_mpz gdb_mpz::operator% ( const gdb_mpz & other) const
inline

Definition at line 209 of file gmp-utils.h.

References m_val.

◆ operator&()

gdb_mpz gdb_mpz::operator& ( const gdb_mpz & other) const
inline

Definition at line 280 of file gmp-utils.h.

References m_val.

◆ operator*()

gdb_mpz gdb_mpz::operator* ( const gdb_mpz & other) const
inline

Definition at line 195 of file gmp-utils.h.

References m_val.

◆ operator*=()

gdb_mpz & gdb_mpz::operator*= ( long other)
inline

Definition at line 189 of file gmp-utils.h.

References m_val.

◆ operator+()

gdb_mpz gdb_mpz::operator+ ( const gdb_mpz & other) const
inline

Definition at line 228 of file gmp-utils.h.

References m_val.

◆ operator+=() [1/2]

gdb_mpz & gdb_mpz::operator+= ( const gdb_mpz & other)
inline

Definition at line 222 of file gmp-utils.h.

References m_val.

◆ operator+=() [2/2]

gdb_mpz & gdb_mpz::operator+= ( unsigned long other)
inline

Definition at line 216 of file gmp-utils.h.

References m_val.

◆ operator-()

gdb_mpz gdb_mpz::operator- ( const gdb_mpz & other) const
inline

Definition at line 247 of file gmp-utils.h.

References m_val.

◆ operator-=() [1/2]

gdb_mpz & gdb_mpz::operator-= ( const gdb_mpz & other)
inline

Definition at line 241 of file gmp-utils.h.

References m_val.

◆ operator-=() [2/2]

gdb_mpz & gdb_mpz::operator-= ( unsigned long other)
inline

Definition at line 235 of file gmp-utils.h.

References m_val.

◆ operator/()

gdb_mpz gdb_mpz::operator/ ( const gdb_mpz & other) const
inline

Definition at line 202 of file gmp-utils.h.

References m_val.

◆ operator<() [1/2]

bool gdb_mpz::operator< ( const gdb_mpz & other) const
inline

Definition at line 311 of file gmp-utils.h.

References m_val.

◆ operator<() [2/2]

bool gdb_mpz::operator< ( long other) const
inline

Definition at line 321 of file gmp-utils.h.

References m_val.

◆ operator<<()

gdb_mpz gdb_mpz::operator<< ( unsigned long nbits) const
inline

Definition at line 260 of file gmp-utils.h.

References m_val.

◆ operator<<=()

gdb_mpz & gdb_mpz::operator<<= ( unsigned long nbits)
inline

Definition at line 254 of file gmp-utils.h.

References m_val.

◆ operator<=()

bool gdb_mpz::operator<= ( const gdb_mpz & other) const
inline

Definition at line 316 of file gmp-utils.h.

References m_val.

◆ operator=() [1/4]

gdb_mpz & gdb_mpz::operator= ( bool src)
inline

Definition at line 93 of file gmp-utils.h.

References m_val.

◆ operator=() [2/4]

gdb_mpz & gdb_mpz::operator= ( const gdb_mpz & from)
inline

Definition at line 74 of file gmp-utils.h.

References m_val.

◆ operator=() [3/4]

gdb_mpz & gdb_mpz::operator= ( gdb_mpz && other)
inline

Definition at line 80 of file gmp-utils.h.

References m_val.

◆ operator=() [4/4]

template<typename T , typename = gdb::Requires<std::is_integral<T>>>
gdb_mpz & gdb_mpz::operator= ( T src)
inline

Definition at line 87 of file gmp-utils.h.

References set().

◆ operator==() [1/2]

bool gdb_mpz::operator== ( const gdb_mpz & other) const
inline

Definition at line 347 of file gmp-utils.h.

References m_val.

◆ operator==() [2/2]

template<typename T , typename = gdb::Requires<std::is_integral<T>>>
bool gdb_mpz::operator== ( T other) const
inline

Definition at line 332 of file gmp-utils.h.

References gdb_mpz(), and m_val.

◆ operator>()

bool gdb_mpz::operator> ( const gdb_mpz & other) const
inline

Definition at line 301 of file gmp-utils.h.

References m_val.

◆ operator>=()

bool gdb_mpz::operator>= ( const gdb_mpz & other) const
inline

Definition at line 306 of file gmp-utils.h.

References m_val.

◆ operator>>()

gdb_mpz gdb_mpz::operator>> ( unsigned long nbits) const
inline

Definition at line 267 of file gmp-utils.h.

References m_val.

◆ operator>>=()

gdb_mpz & gdb_mpz::operator>>= ( unsigned long nbits)
inline

Definition at line 274 of file gmp-utils.h.

References m_val.

◆ operator^()

gdb_mpz gdb_mpz::operator^ ( const gdb_mpz & other) const
inline

Definition at line 294 of file gmp-utils.h.

References m_val.

◆ operator|()

gdb_mpz gdb_mpz::operator| ( const gdb_mpz & other) const
inline

Definition at line 287 of file gmp-utils.h.

References m_val.

◆ pow() [1/2]

static gdb_mpz gdb_mpz::pow ( unsigned long base,
unsigned long exp )
inlinestatic

◆ pow() [2/2]

gdb_mpz gdb_mpz::pow ( unsigned long exp) const
inline

Definition at line 115 of file gmp-utils.h.

References m_val.

◆ read()

void gdb_mpz::read ( gdb::array_view< const gdb_byte > buf,
enum bfd_endian byte_order,
bool unsigned_p )

◆ set() [1/2]

bool gdb_mpz::set ( const char * str,
int base )
inline

Definition at line 101 of file gmp-utils.h.

References m_val, and str().

Referenced by ada_get_gnat_encoded_number(), gdb_mpz(), rust_parser::lex_number(), and operator=().

◆ set() [2/2]

template<typename T >
void gdb_mpz::set ( T src)
private

Definition at line 604 of file gmp-utils.h.

References m_val.

◆ sgn()

int gdb_mpz::sgn ( ) const
inline

Definition at line 183 of file gmp-utils.h.

References m_val.

Referenced by ada_value_binop(), export_bits(), fits_in_type(), and operator bool().

◆ str()

std::string gdb_mpz::str ( ) const
inline

Definition at line 162 of file gmp-utils.h.

References gmp_string_printf(), and m_val.

Referenced by expr::dump_for_expression(), export_bits(), and set().

◆ truncate()

void gdb_mpz::truncate ( gdb::array_view< gdb_byte > buf,
enum bfd_endian byte_order,
bool unsigned_p ) const
inline

Definition at line 154 of file gmp-utils.h.

References export_bits().

Referenced by value_from_mpz().

◆ write()

void gdb_mpz::write ( gdb::array_view< gdb_byte > buf,
enum bfd_endian byte_order,
bool unsigned_p ) const
inline

Friends And Related Symbol Documentation

◆ gdb_mpf

friend struct gdb_mpf
friend

Definition at line 382 of file gmp-utils.h.

◆ gdb_mpq

friend struct gdb_mpq
friend

Definition at line 381 of file gmp-utils.h.

Member Data Documentation

◆ m_val

mpz_t gdb_mpz::m_val
private

The documentation for this struct was generated from the following files: