#include <VirtualMachineSemantics.h>
Collaboration diagram for VirtualMachineSemantics::MemoryCell< ValueType >:

Has an address data and size in bytes.
When a state is created, every register and memory location will be given a unique named value. However, it's not practicle to store a named value for every possible memory address, yet we want the following example to work correctly:
1: mov eax, ds:[edx] // first read returns V1 2: mov eax, ds:[edx] // subsequent reads from same address also return V1 3: mov ds:[ecx], eax // write to unknown address clobbers all memory 4: mov eax, ds:[edx] // read from same address as above returns V2 5: mov eax, ds:[edx] // subsequent reads from same address also return V2
Furthermore, the read from ds:[edx] at #1 above, retroactively stores V1 in the original memory state. That way if we need to do additional analyses starting from the same initial state it will be available to use.
To summarize: every memory address is given a unique named value. These values are implicit until the memory location is actually read.
See also readMemory() and writeMemory().
Public Member Functions | |
| template<size_t Len> | |
| MemoryCell (const ValueType< 32 > &address, const ValueType< Len > data, size_t nbytes) | |
| bool | is_clobbered () const |
| void | set_clobbered () |
| bool | is_written () const |
| void | set_written () |
| bool | may_alias (const MemoryCell &other) const |
Returns true if this memory value could possibly overlap with the other memory value. | |
| bool | must_alias (const MemoryCell &other) const |
Returns true if this memory address is the same as the other. | |
| void | print (std::ostream &, RenameMap *rmap=NULL) const |
| Prints the value of a memory cell on a single line. | |
Public Attributes | |
| ValueType< 32 > | address |
| ValueType< 32 > | data |
| size_t | nbytes |
| bool | clobbered |
| bool | written |
Friends | |
| bool | operator== (const MemoryCell &a, const MemoryCell &b) |
| bool | operator!= (const MemoryCell &a, const MemoryCell &b) |
| bool | operator< (const MemoryCell &a, const MemoryCell &b) |
| std::ostream & | operator<< (std::ostream &o, const MemoryCell &me) |
| VirtualMachineSemantics::MemoryCell< ValueType >::MemoryCell | ( | const ValueType< 32 > & | address, | |
| const ValueType< Len > | data, | |||
| size_t | nbytes | |||
| ) | [inline] |
| bool VirtualMachineSemantics::MemoryCell< ValueType >::is_clobbered | ( | ) | const [inline] |
| void VirtualMachineSemantics::MemoryCell< ValueType >::set_clobbered | ( | ) | [inline] |
| bool VirtualMachineSemantics::MemoryCell< ValueType >::is_written | ( | ) | const [inline] |
| void VirtualMachineSemantics::MemoryCell< ValueType >::set_written | ( | ) | [inline] |
| bool VirtualMachineSemantics::MemoryCell< ValueType >::may_alias | ( | const MemoryCell< ValueType > & | other | ) | const |
Returns true if this memory value could possibly overlap with the other memory value.
In other words, returns false only if this memory location cannot overlap with other memory location. Two addresses that are identical alias one another.
| bool VirtualMachineSemantics::MemoryCell< ValueType >::must_alias | ( | const MemoryCell< ValueType > & | other | ) | const |
Returns true if this memory address is the same as the other.
Note that "same" is more strict than "overlap".
| void VirtualMachineSemantics::MemoryCell< ValueType >::print | ( | std::ostream & | , | |
| RenameMap * | rmap = NULL | |||
| ) | const |
Prints the value of a memory cell on a single line.
If a rename map is specified then named values will be renamed to have a shorter name. See the ValueType<>::rename() method for details.
| bool operator== | ( | const MemoryCell< ValueType > & | a, | |
| const MemoryCell< ValueType > & | b | |||
| ) | [friend] |
| bool operator!= | ( | const MemoryCell< ValueType > & | a, | |
| const MemoryCell< ValueType > & | b | |||
| ) | [friend] |
| bool operator< | ( | const MemoryCell< ValueType > & | a, | |
| const MemoryCell< ValueType > & | b | |||
| ) | [friend] |
| std::ostream& operator<< | ( | std::ostream & | o, | |
| const MemoryCell< ValueType > & | me | |||
| ) | [friend] |
| ValueType<32> VirtualMachineSemantics::MemoryCell< ValueType >::address |
| ValueType<32> VirtualMachineSemantics::MemoryCell< ValueType >::data |
| size_t VirtualMachineSemantics::MemoryCell< ValueType >::nbytes |
| bool VirtualMachineSemantics::MemoryCell< ValueType >::clobbered |
| bool VirtualMachineSemantics::MemoryCell< ValueType >::written |
1.4.7