class ExprValue

Defined at line 30 of file ../../src/developer/debug/zxdb/expr/expr_value.h

Holds a value for an expression. This could be the value of a variable in memory (e.g. the value

of "a" when you type "print a"), or it could be a temporary that the debugger has computed as

part of an expression.

Public Methods

void ExprValue ()

Defined at line 15 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (bool value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Constructs a value from the corresponding C++ value of the given size.

If the type is null, a type matching the corresponding C++ parameter name ("int32_t", etc.)

will be created to represent the value (this is useful for tests).

Defined at line 17 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (int8_t value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 20 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (uint8_t value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 23 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (int16_t value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 26 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (uint16_t value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 29 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (int32_t value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 32 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (uint32_t value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 35 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (int64_t value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 38 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (uint64_t value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 41 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (float value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 44 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (double value, fxl::RefPtr<Type> type, const ExprValueSource & source)

Defined at line 47 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

void ExprValue (fxl::RefPtr<Type> symbol_type, std::vector<uint8_t> data, const ExprValueSource & source)

Full constructor. This takes the type and stores it assuming the type is good. Prefer the other

version when possible unless you're sure the type is not a declaration.

Defined at line 67 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

bool operator!= (const ExprValue & other)

Defined at line 71 of file ../../src/developer/debug/zxdb/expr/expr_value.h

void ExprValue (fxl::RefPtr<Type> symbol_type, TaggedData data, const ExprValueSource & source)

Defined at line 71 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

Type * type ()

May be null if there's no symbol type.

Defined at line 74 of file ../../src/developer/debug/zxdb/expr/expr_value.h

bool operator== (const ExprValue & other)

Used for tests. If a SymbolType is defined, the string representation is compared since the

pointers may not match in practice.

Defined at line 74 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

const fxl::RefPtr<Type> & type_ref ()

Defined at line 75 of file ../../src/developer/debug/zxdb/expr/expr_value.h

const ExprValueSource & source ()

Indicates the location where this value came from.

Defined at line 78 of file ../../src/developer/debug/zxdb/expr/expr_value.h

const TaggedData & data ()

Defined at line 80 of file ../../src/developer/debug/zxdb/expr/expr_value.h

int GetBaseType ()

Determines which base type the Value's Type is.

TODO(brettw) this should be removed, it does not support forward definitions. Callers should

interrogate GetConcreteType() instead.

Defined at line 80 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

Err EnsureAllValid ()

Returns an "optimized out" error if not all bytes of the tagged buffer are marked valid.

Defined at line 91 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

Err EnsureSizeIs (size_t size)

Returns an error if the size of the data doesn't match the parameter.

Defined at line 97 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <typename T>
T GetAs ()

These return the data casted to the corresponding value (specializations below class

declaration). It will assert if the internal type and data size doesn't match the requested

type.

Err PromoteTo64 (int64_t * output)

Gets the result as the given 64/128-bit value, promoting all shorter values to the longer ones.

If the data size is empty or greater than the requested bits it will return an error.

Defined at line 203 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

Err PromoteTo64 (uint64_t * output)

Defined at line 229 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

Err PromoteTo128 (int128_t * output)

Defined at line 255 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

Err PromoteTo128 (uint128_t * output)

Defined at line 273 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

Err PromoteToDouble (double * output)

Gets the result as a double. This will convert floats and doubles to doubles. It will not

convert ints to floating point.

Defined at line 291 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
int8_t GetAs<signed char> ()

Defined at line 107 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
uint8_t GetAs<unsigned char> ()

Defined at line 115 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
int16_t GetAs<short> ()

Defined at line 123 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
uint16_t GetAs<unsigned short> ()

Defined at line 131 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
int32_t GetAs<int> ()

Defined at line 139 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
uint32_t GetAs<unsigned int> ()

Defined at line 147 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
int64_t GetAs<long> ()

Defined at line 155 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
uint64_t GetAs<unsigned long> ()

Defined at line 163 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
int128_t GetAs<__int128> ()

Defined at line 171 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
uint128_t GetAs<unsigned __int128> ()

Defined at line 179 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
float GetAs<float> ()

Defined at line 187 of file ../../src/developer/debug/zxdb/expr/expr_value.cc

template <>
double GetAs<double> ()

Defined at line 195 of file ../../src/developer/debug/zxdb/expr/expr_value.cc