class ExprValueSource

Defined at line 20 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

Holds the source of a value. This allows taking the address of an object stored in an ExprValue

("&foo"), and for updating the contents of variables (currently not supported yet).

Public Methods

const char * TypeToString (Type t)

Returns a string corresponding to the given type, "register", "temporary", etc.

Defined at line 36 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

void ExprValueSource (Type type)

Constructors and destructors need to be out-of-line so they can get the definition of

LocalExprValue in this file.

Defined at line 16 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

void ExprValueSource (uint64_t address, uint32_t bit_size, uint32_t bit_shift)

Initializes indicating a memory address and optional bitfield information.

Defined at line 18 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

void ExprValueSource (debug::RegisterID id, uint32_t bit_size, uint32_t bit_shift)

Initializes indicating a register and optional bitfield information. The register does not have

to be a canonical register.

Defined at line 21 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

void ExprValueSource (fxl::RefPtr<LocalExprValue> local_source)

Initializes indicating a reference to a local value.

Defined at line 24 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

void ExprValueSource (const ExprValueSource & other)

Defined at line 27 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

void ExprValueSource (ExprValueSource && other)

Defined at line 28 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

void ~ExprValueSource ()

Defined at line 30 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

ExprValueSource & operator= (const ExprValueSource & other)

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

ExprValueSource & operator= (ExprValueSource && other)

Defined at line 33 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

uint128_t SetBits (uint128_t existing, uint128_t new_value)

Writes the |new_value| over some |existing| value, taking into account the bit size and

shift information from this ExprValueSource. The returned value can be used to update the

register or memory for a bitfield.

This ExprValueSource must be a bitfield (is_bitfield() == true) for this to be called.

Defined at line 54 of file ../../src/developer/debug/zxdb/expr/expr_value_source.cc

Type type ()

Defined at line 79 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

bool is_bitfield ()

Defined at line 81 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

uint64_t address ()

Valid when type_ == kAddress.

Defined at line 84 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

debug::RegisterID register_id ()

Valid when type_ == kRegister.

Defined at line 87 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

uint32_t bit_size ()

Number of bits used for bitfields. 0 means it is not a bitfield and all bits are used.

Defined at line 90 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

uint32_t bit_shift ()

Number of bits to shift to the left to get the storage location. This is the offset of the low

bit. Note that this is different than the DWARF definition.

If a bitfield occupies bits 3-6 (inclusive) of a 32-bit integer:

high low

3 2 1 0

10987654 32109876 54321098 76543210

[--]

<

-- bit_shift

Then the bit_size() will be 4 and the bit_shift() will be 3.

The memory layout will be the result of doing the shift and mask and memcpy-ing out which

will reorder the bytes in little-endian.

Defined at line 107 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

const fxl::RefPtr<LocalExprValue> & local_value ()

Value when type_ == kLocal.

Defined at line 110 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

ExprValueSource GetOffsetInto (uint32_t offset, uint32_t new_bit_size, uint32_t bit_shift)

Returns a new ExprValueSource pointing to the given offset inside of this one. If this one is

not in memory, the returned one will be the same.

When computing offsets of bitfields, the shifts are just added to any existing one, but the bit

size (if given) will overwrite any existing one.

Defined at line 117 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

bool operator== (const ExprValueSource & other)

Defined at line 133 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

bool operator!= (const ExprValueSource & other)

Defined at line 137 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h

Enumerations

enum Type
Name Value
kTemporary 0
kMemory 1
kRegister 2
kConstant 3
kComposite 4
kLocal 5

Where this value came from.

Defined at line 23 of file ../../src/developer/debug/zxdb/expr/expr_value_source.h