Otawa
0.10
|
#include <otawa/loader/old_gliss/Process.h>
Public Member Functions | |
Process (Manager *manager, Loader *loader, hard::Platform *platform, const PropList &props=PropList::EMPTY) | |
void * | state (void) const |
virtual hard::Platform * | platform (void) |
Get the platform of the process. More... | |
virtual Inst * | start (void) |
Get the address of the first instruction of the program. More... | |
virtual File * | loadFile (elm::CString path) |
Load an existing file. More... | |
virtual Loader * | loader (void) const |
Get the loader that has created this process. More... | |
virtual void | get (Address at, signed char &val) |
virtual void | get (Address at, unsigned char &val) |
virtual void | get (Address at, signed short &val) |
virtual void | get (Address at, unsigned short &val) |
virtual void | get (Address at, signed long &val) |
virtual void | get (Address at, unsigned long &val) |
virtual void | get (Address at, signed long long &val) |
virtual void | get (Address at, unsigned long long &val) |
virtual void | get (Address at, Address &val) |
Get an address value from the process. More... | |
virtual void | get (Address at, string &str) |
Get a string value from the process. More... | |
virtual void | get (Address at, char *buf, int size) |
Get a byte block value from the process. More... | |
virtual Option< Pair< cstring, int > > | getSourceLine (Address addr) throw (UnsupportedFeatureException) |
Get the source file and the line matching the given address. More... | |
virtual void | getAddresses (cstring file, int line, Vector< Pair< Address, Address > > &addresses) throw (UnsupportedFeatureException) |
Get the list of addresses implementing the given (source, line) pair. More... | |
Manager * | manager (void) |
Get the manager owning this process. More... | |
virtual const hard::CacheConfiguration & | cache (void) |
Get the cache hierarchy of the current processor. More... | |
virtual Inst * | findInstAt (address_t addr) |
Find the instruction at the given address. More... | |
virtual Inst * | findInstAt (const string &label) |
find the instruction at the given label if the label matches a code segment. More... | |
virtual address_t | findLabel (const string &label) |
Find the address of the given label. More... | |
File * | program (void) const |
Get the program file, that is, the startup executable of the process. More... | |
virtual int | instSize (void) const =0 |
Get the instruction size. More... | |
virtual Processor * | decoder (void) |
Get a decoder usuful to decode instructions. More... | |
Symbol * | findSymbol (const string &name) |
Find the symbol matching the given name. More... | |
Symbol * | findSymbolAt (const Address &address) |
Find a symbol by its address. More... | |
virtual Address | initialSP (void) const |
Get the initial address of the stack pointer. More... | |
virtual Inst * | newNOp (Address addr=Address::null) |
Build a NOP instruction at the given address. More... | |
virtual void | deleteNop (Inst *inst) |
Delete a NOP instruction previously allocated by NewOP(). More... | |
virtual int | maxTemp (void) const |
Get the maximum number of temporaries used in the semantics instruction block. More... | |
virtual void | get (Address at, t::int8 &val) |
Get a signed byte value from the process. More... | |
virtual void | get (Address at, t::uint8 &val) |
Get an unsigned byte value from the process. More... | |
virtual void | get (Address at, t::int16 &val) |
Get a signed half-word value from the process. More... | |
virtual void | get (Address at, t::uint16 &val) |
Get a unsigned half-word value from the process. More... | |
virtual void | get (Address at, t::int32 &val) |
Get a signed word value from the process. More... | |
virtual void | get (Address at, t::uint32 &val) |
Get a unsigned word value from the process. More... | |
virtual void | get (Address at, t::int64 &val) |
Get a signed long word value from the process. More... | |
virtual void | get (Address at, t::uint64 &val) |
Get a unsigned long word value from the process. More... | |
virtual void | get (Address at, float &val) |
Get a float value from the process. More... | |
virtual void | get (Address at, double &val) |
Get a double value from the process. More... | |
virtual void | get (Address at, long double &val) |
Get a long double value from the process. More... | |
virtual SimState * | newState (void) |
Get a fresh startup state of the process for functional simulation. More... | |
virtual sim::Simulator * | simulator (void) |
Find the simulator used for the current process. More... | |
File * | loadProgram (elm::CString path) |
Load the program file. More... | |
virtual Address | defaultStack (void) const |
Get a default address for the stack top. More... | |
virtual void | semInit (sem::Block &block) const |
Provide semantic sequence to initialize the environment before performing static analysis. More... | |
Property * | getProp (const AbstractIdentifier *id) const |
Find a property by its identifier. More... | |
void | setProp (Property *prop) |
Set the property in the property list removing any double. More... | |
void | setProp (const AbstractIdentifier *id) |
void | removeProp (const AbstractIdentifier *id) |
Remove a property matching the given identifier. More... | |
void | removeProp (const AbstractIdentifier &id) |
Property * | extractProp (const AbstractIdentifier *id) |
Remove a property matching the given identifier and return it. More... | |
Property * | extractProp (const AbstractIdentifier &id) |
Remove a property matching the given identifier and return it. More... | |
void | addProp (Property *prop) |
Add property to the list without checking of duplication. More... | |
void | removeAllProp (const AbstractIdentifier *id) |
Remove all the properties matching the given identifier. More... | |
bool | hasProp (const AbstractIdentifier &id) const |
Test if the property list contains a property matching the given identifier. More... | |
void | clearProps (void) |
Remove all properties from the list. More... | |
void | addProps (const PropList &props) |
Add all properties from the given property list, in a reverse order. More... | |
void | print (elm::io::Output &out) const |
Display the current property list. More... | |
void | lock (void) |
void | unlock () |
Public Attributes | |
Inst * | _start |
hard::Platform * | _platform |
void * | _state |
void * | _memory |
int | argc |
char ** | argv |
char ** | envp |
Loader * | _loader |
Static Public Attributes | |
static const PropList | EMPTY |
This is an empty proplist for convenience. More... | |
Protected Member Functions | |
virtual Inst * | decode (address_t addr)=0 |
virtual void * | memory (void)=0 |
void | addFile (File *file) |
Add the given file to the list of files. More... | |
void | provide (AbstractFeature &feature) |
This method let provide feature from the loader / processors. More... | |
Friends | |
class | Segment |
otawa::loader::old_gliss::Process::Process | ( | Manager * | manager, |
Loader * | loader, | ||
hard::Platform * | platform, | ||
const PropList & | props = PropList::EMPTY |
||
) |
|
protectedinherited |
Add the given file to the list of files.
The first added file is considered as the program file.
file | Added file. |
References otawa::Process::files, and otawa::Process::prog.
Referenced by otawa::Process::Process().
|
inherited |
Add property to the list without checking of duplication.
prop | Property to add. |
References otawa::Property::_next.
Referenced by otawa::Identifier< T >::add(), otawa::ast::ASTInfo::ASTInfo(), otawa::Identifier< otawa::arm::Info * >::copy(), otawa::AbstractIdentifier::initProps(), otawa::ContextualProperty::make(), otawa::script::Script::makeConfig(), otawa::ccg::Builder::processLBlockSet(), otawa::ipet::ILPSystemGetter::processWorkSpace(), otawa::Identifier< T >::ref(), otawa::ContextualProperty::ref(), and otawa::ContextualProperty::refProps().
|
inherited |
Add all properties from the given property list, in a reverse order.
props | Property list to clone. |
References copy(), otawa::PropList::head, and otawa::Property::next().
Referenced by otawa::display::CFGDrawer::CFGDrawer(), otawa::display::GraphVizGraph::GraphVizGraph(), otawa::ParamFeature::instantiate(), otawa::Manager::loadXML(), otawa::display::GraphVizGraph::newEdge(), otawa::display::GraphVizGraph::newNode(), otawa::PropList::operator=(), otawa::Process::Process(), otawa::PropList::PropList(), otawa::display::GraphVizItem::setProps(), otawa::VirtualBasicBlock::VirtualBasicBlock(), and otawa::VirtualCFG::VirtualCFG().
|
virtualinherited |
Get the cache hierarchy of the current processor.
The cachers are ordered according the index in the vector.
References otawa::hard::Platform::cache(), and otawa::Process::platform().
|
inherited |
Remove all properties from the list.
References otawa::Property::next().
Referenced by otawa::PSTBuilder::getVCFG(), otawa::PropList::operator=(), otawa::display::GraphVizItem::setProps(), otawa::PropList::~PropList(), and otawa::WorkSpace::~WorkSpace().
|
virtualinherited |
Get a decoder usuful to decode instructions.
May be overriden to give instruction set architecture dependent decoders.
Referenced by otawa::TextDecoder::processWorkSpace().
|
virtualinherited |
Get a default address for the stack top.
Referenced by otawa::clp::Analysis::processWorkSpace(), and otawa::dcache::BlockBuilder::setup().
|
virtualinherited |
Delete a NOP instruction previously allocated by NewOP().
inst | Instruction to delete. |
|
inherited |
Remove a property matching the given identifier and return it.
Caller is responsible of the management of the obtained property.
id | Identifier of the property to extract. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::script::Script::makeConfig().
|
inlineinherited |
Remove a property matching the given identifier and return it.
Caller is responsible of the management of the obtained property.
id | Identifier of the property to extract. |
References otawa::PropList::extractProp().
Referenced by otawa::PropList::extractProp().
Find the instruction at the given address.
addr | Address of instruction to retrieve. |
addr | Address to look at. |
Referenced by otawa::PFGBuilder::addFunction(), otawa::CFGInfo::findCFG(), otawa::Process::findInstAt(), otawa::DelayedBuilder::makeNOp(), otawa::DelayedBuilder::next(), otawa::FlowFactLoader::onIgnoreControl(), otawa::FlowFactLoader::onIgnoreSeq(), otawa::FlowFactLoader::onLoop(), otawa::FlowFactLoader::onMemoryAccess(), otawa::FlowFactLoader::onMultiBranch(), otawa::FlowFactLoader::onMultiCall(), otawa::FlowFactLoader::onNoCall(), otawa::FlowFactLoader::onNoInline(), otawa::FlowFactLoader::onNoReturn(), otawa::FlowFactLoader::onPreserve(), otawa::FlowFactLoader::onReturn(), otawa::FlowFactLoader::onSetInlining(), otawa::FlowFactLoader::scanIgnoreControl(), otawa::FlowFactLoader::scanIgnoreSeq(), otawa::FlowFactLoader::scanMultiBranch(), otawa::FlowFactLoader::scanMultiCall(), otawa::FlowFactLoader::scanNoInline(), otawa::FlowFactLoader::scanSetInlining(), and otawa::DelayedBuilder::size().
find the instruction at the given label if the label matches a code segment.
label | Label to look for. |
References otawa::Process::findInstAt(), and otawa::Process::findLabel().
Find the address of the given label.
For performing it, it looks iteratively one each file of the process until finding it.
label | Label to find. |
References otawa::Address::null.
Referenced by otawa::FlowFactLoader::addressOf(), and otawa::Process::findInstAt().
Find the symbol matching the given name.
name | Symbol name to look for. |
Referenced by otawa::LabelAddress::toAddress().
Find a symbol by its address.
address | Address of the looked symbol. |
References elm::stree::SegmentBuilder< K, T, class >::add(), otawa::Symbol::DATA, otawa::Symbol::FUNCTION, elm::stree::SegmentBuilder< K, T, class >::make(), otawa::Address::offset(), and otawa::Process::smap.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Get an address value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
Reimplemented from otawa::Process.
Get a string value from the process.
at | Address of the value to get. |
str | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
Reimplemented from otawa::Process.
|
virtual |
Get a byte block value from the process.
at | Address of the value to get. |
buf | Buffer to store block to. |
size | Size of block. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
Reimplemented from otawa::Process.
Get a signed byte value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
Referenced by otawa::VarTextDecoder::getBytes(), and otawa::CFGCheckSummer::processCFG().
Get an unsigned byte value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
Get a signed half-word value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
Get a unsigned half-word value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
Get a signed word value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
Get a unsigned word value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
Get a signed long word value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
Get a unsigned long word value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
|
virtualinherited |
Get a float value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
|
virtualinherited |
Get a double value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
|
virtualinherited |
Get a long double value from the process.
at | Address of the value to get. |
val | Got value. |
UnsupportedFeatureException | if this method is called but the loader does not provide this feature. |
OutOfMemStaticException | if the given address does not point to a static segment of the executable file. |
References otawa::MEMORY_ACCESS_FEATURE.
|
virtual |
Get the list of addresses implementing the given (source, line) pair.
file | Looked source file. |
line | Looked source line. |
addresses | Output parameter containing the list of address ranges matching the given line. This vector is empty if the source (file, line) cannot be found. |
UnsupportedFeatureException | If this function is called and the feature SOURCE_LINE_FEATURE is not implemented. |
Reimplemented from otawa::Process.
|
inherited |
Find a property by its identifier.
id | Identifier of the property to find. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::Identifier< otawa::arm::Info * >::exists(), otawa::ContextualProperty::exists(), otawa::ContextualProperty::find(), otawa::Identifier< T >::get(), otawa::PropList::hasProp(), otawa::ContextualProperty::make(), otawa::ParamFeature::matches(), otawa::ImmutableRef< T, I >::print(), otawa::ContextualProperty::print(), otawa::Identifier< T >::ref(), otawa::ContextualProperty::ref(), otawa::ContextualProperty::refProps(), otawa::Identifier< T >::set(), otawa::Identifier< T >::use(), and otawa::Identifier< T >::value().
|
virtual |
Get the source file and the line matching the given address.
addr | Address to get source and line. |
UnsupportedFeatureException | If this function is called and the feature SOURCE_LINE_FEATURE is not implemented. |
Reimplemented from otawa::Process.
|
inlineinherited |
Test if the property list contains a property matching the given identifier.
id | Property identifier to look for. |
References otawa::PropList::getProp().
Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().
|
virtualinherited |
Get the initial address of the stack pointer.
If the program is embedded, this call does not return any meaningful value as the value is initialized at the program start. For program running in a rich OS environment, this is the value of the stack pointer after the OS has filled environment and program arguments.
References otawa::Address::null.
|
pure virtualinherited |
Get the instruction size.
Referenced by otawa::VarTextDecoder::getInst(), otawa::Process::newNOp(), otawa::ParExeGraph::ParExeGraph(), otawa::TextDecoder::processWorkSpace(), and otawa::FixedTextDecoder::setup().
|
virtual |
Get the loader that has created this process.
The result may be null.
Reimplemented from otawa::Process.
|
virtual |
Load an existing file.
path | Path to the file to load. |
LoadException | Error during the load. |
UnsupportedPlatformException | Platform of the file does not match the platform of the process. |
Implements otawa::Process.
|
inherited |
Load the program file.
References otawa::Process::loadFile(), and otawa::Process::prog.
|
inlineinherited |
Get the manager owning this process.
Referenced by otawa::ipet::ILPSystemGetter::processWorkSpace(), and otawa::Process::simulator().
|
virtualinherited |
Get the maximum number of temporaries used in the semantics instruction block.
|
protectedpure virtual |
|
virtualinherited |
Build a NOP instruction at the given address.
addr | Address of the instruction (default to null address). |
References otawa::Process::instSize().
|
virtualinherited |
Get a fresh startup state of the process for functional simulation.
|
virtual |
|
inherited |
Display the current property list.
out | Output to use. |
Referenced by otawa::operator<<(), and otawa::ContextualProperty::print().
|
inlineinherited |
Get the program file, that is, the startup executable of the process.
Referenced by otawa::ast::ASTLoader::findLabel(), otawa::ProcessException::message(), otawa::operator<<(), otawa::ipet::ConstraintLoader::processCFG(), otawa::CFGBuilder::processWorkSpace(), otawa::ast::ASTLoader::processWorkSpace(), otawa::display::ILPSystemDisplayer::processWorkSpace(), otawa::FlowFactLoader::processWorkSpace(), and otawa::script::Script::work().
|
protectedinherited |
This method let provide feature from the loader / processors.
References otawa::Process::provided.
|
inherited |
Remove all the properties matching the given identifier.
id | Identifier of properties to remove. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::LoopUnroller::unroll().
|
inherited |
Remove a property matching the given identifier.
id | Identifier of the property to remove. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::PSTBuilder::buildTree(), otawa::BBRemover< T >::clean(), otawa::display::CFGOutput::processCFG(), otawa::SubCFGBuilder::processWorkSpace(), otawa::Ref< T, I >::remove(), and otawa::ContextualPath::Ref< T >::remove().
|
inlineinherited |
References otawa::PropList::removeProp().
Referenced by otawa::PropList::removeProp().
|
virtualinherited |
Provide semantic sequence to initialize the environment before performing static analysis.
As a default, do nothing.
|
inherited |
Set the property in the property list removing any double.
prop | Property to set. |
References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().
|
inlineinherited |
References otawa::PropList::setProp().
Referenced by otawa::PropList::setProp().
|
virtualinherited |
Find the simulator used for the current process.
References _, otawa::Manager::findSimulator(), otawa::Process::manager(), name, otawa::SIMULATOR, and otawa::SIMULATOR_NAME.
Referenced by otawa::tsim::BBTimeSimulator::setup(), and otawa::tsim::BBPath::simulate().
|
virtual |
Get the address of the first instruction of the program.
Implements otawa::Process.
|
inline |
References _state.
|
friend |
Loader* otawa::loader::old_gliss::Process::_loader |
void* otawa::loader::old_gliss::Process::_memory |
hard::Platform* otawa::loader::old_gliss::Process::_platform |
Inst* otawa::loader::old_gliss::Process::_start |
void* otawa::loader::old_gliss::Process::_state |
Referenced by state().
int otawa::loader::old_gliss::Process::argc |
char** otawa::loader::old_gliss::Process::argv |
|
staticinherited |
This is an empty proplist for convenience.
char ** otawa::loader::old_gliss::Process::envp |