Otawa  0.10
otawa::dfa::State Class Reference

Represents a value of the data state. More...

#include <otawa/dfa/State.h>

Classes

class  MemIter
 
class  RegIter
 

Public Types

typedef t::uint32 address_t
 

Public Member Functions

 State (Process &process)
 Build the initial state. More...
 
Processprocess (void) const
 
void set (const hard::Register *reg, Value value)
 Set the value of a register. More...
 
Value get (const hard::Register *reg) const
 Get a register value. More...
 
void record (const MemCell &cell)
 Record a configured memory item. More...
 
bool isInitialized (Address addr) const
 Test if the current state contains initialized data. More...
 
void get (const Address &a, t::uint8 &v) const
 Get a value from the initialized memory of the process. More...
 
void get (const Address &a, t::uint16 &v) const
 Get a value from the initialized memory of the process. More...
 
void get (const Address &a, t::uint32 &v) const
 Get a value from the initialized memory of the process. More...
 
void get (const Address &a, t::uint64 &v) const
 Get a value from the initialized memory of the process. More...
 
void get (const Address &a, float &v) const
 Get a value from the initialized memory of the process. More...
 
void get (const Address &a, double &v) const
 Get a value from the initialized memory of the process. More...
 
void get (const Address &a, Address &v) const
 Get a value from the initialized memory of the process. More...
 

Private Types

typedef avl::Map< const
hard::Register *, Value
reg_map_t
 
typedef avl::Map< Address,
MemCell
mem_map_t
 

Private Attributes

reg_map_t regs
 
stree::Tree< address_t, bool > mem
 
mem_map_t cmem
 
Processproc
 

Detailed Description

Represents a value of the data state.

Data flow state.

Often used to describe the initial state as the join of the user external information on data state and from the initialized data state from the executable content.

Member Typedef Documentation

Constructor & Destructor Documentation

otawa::dfa::State::State ( Process process)

Build the initial state.

Parameters
processCurrent process.

References elm::stree::SegmentBuilder< K, T, class >::add(), elm::stree::SegmentBuilder< K, T, class >::make(), mem, and proc.

Member Function Documentation

Value otawa::dfa::State::get ( const hard::Register reg) const

Get a register value.

Parameters
regRegister to look for.
Returns
Found value or None value.

References elm::avl::Map< K, T, C >::get(), and regs.

void otawa::dfa::State::get ( const Address a,
t::uint8 v 
) const
inline

Get a value from the initialized memory of the process.

Parameters
aAddress to get value from.
vReturned value.
Warning
This function must only be called on an initialized address. Else unexpected result may arise.

References proc.

void otawa::dfa::State::get ( const Address a,
t::uint16 v 
) const
inline

Get a value from the initialized memory of the process.

Parameters
aAddress to get value from.
vReturned value.
Warning
This function must only be called on an initialized address. Else unexpected result may arise.

References proc.

void otawa::dfa::State::get ( const Address a,
t::uint32 v 
) const
inline

Get a value from the initialized memory of the process.

Parameters
aAddress to get value from.
vReturned value.
Warning
This function must only be called on an initialized address. Else unexpected result may arise.

References proc.

void otawa::dfa::State::get ( const Address a,
t::uint64 v 
) const
inline

Get a value from the initialized memory of the process.

Parameters
aAddress to get value from.
vReturned value.
Warning
This function must only be called on an initialized address. Else unexpected result may arise.

References proc.

void otawa::dfa::State::get ( const Address a,
float &  v 
) const
inline

Get a value from the initialized memory of the process.

Parameters
aAddress to get value from.
vReturned value.
Warning
This function must only be called on an initialized address. Else unexpected result may arise.

References proc.

void otawa::dfa::State::get ( const Address a,
double &  v 
) const
inline

Get a value from the initialized memory of the process.

Parameters
aAddress to get value from.
vReturned value.
Warning
This function must only be called on an initialized address. Else unexpected result may arise.

References proc.

void otawa::dfa::State::get ( const Address a,
Address v 
) const
inline

Get a value from the initialized memory of the process.

Parameters
aAddress to get value from.
vReturned value.
Warning
This function must only be called on an initialized address. Else unexpected result may arise.

References proc.

bool otawa::dfa::State::isInitialized ( Address  addr) const
inline

Test if the current state contains initialized data.

Parameters
addrAddress to test.
Returns
True if the data is initialized, false else.

References otawa::Address::offset().

Process& otawa::dfa::State::process ( void  ) const
inline

References proc.

void otawa::dfa::State::record ( const MemCell cell)

Record a configured memory item.

Parameters
cellMemory cell description to record.

References otawa::dfa::MemCell::address(), cmem, and elm::avl::Map< K, T, C >::put().

Referenced by otawa::FlowFactLoader::onMemSet().

void otawa::dfa::State::set ( const hard::Register reg,
Value  val 
)

Set the value of a register.

Parameters
regSet register.
valSet value.

References elm::avl::Map< K, T, C >::hasKey(), elm::avl::Map< K, T, C >::put(), regs, and elm::avl::Map< K, T, C >::remove().

Referenced by otawa::FlowFactLoader::onRegSet().

Member Data Documentation

mem_map_t otawa::dfa::State::cmem
private

Referenced by record().

stree::Tree<address_t, bool> otawa::dfa::State::mem
private

Referenced by State().

Process& otawa::dfa::State::proc
private

Referenced by State().

reg_map_t otawa::dfa::State::regs
private

Referenced by get(), and set().


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