ROSE  0.9.10.89
Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::Unparser::State Class Reference

Description

State for unparsing.

This object stores the current state for unparsing. The state is kept separate from the unparser class so that (1) the unparser can be a const reference, and (2) multiple threads can be unparsing with the same unparser object.

Definition at line 21 of file BinaryUnparserBase.h.

#include <BinaryUnparserBase.h>

Public Types

typedef Sawyer::Container::Map< rose_addr_t, std::string > AddrString
 Map from address to string. More...
 

Public Member Functions

 State (const Partitioner2::Partitioner &, const Settings &, const Base &frontUnparser)
 
const Partitioner2::Partitionerpartitioner () const
 
const Partitioner2::FunctionCallGraphcg () const
 
const std::vector< unsigned > cfgVertexReachability () const
 
void cfgVertexReachability (const std::vector< unsigned > &)
 
unsigned isCfgVertexReachable (size_t vertexId) const
 
Partitioner2::FunctionPtr currentFunction () const
 
void currentFunction (const Partitioner2::FunctionPtr &)
 
Partitioner2::BasicBlockPtr currentBasicBlock () const
 
void currentBasicBlock (const Partitioner2::BasicBlockPtr &)
 
const std::string & nextInsnLabel () const
 
void nextInsnLabel (const std::string &)
 
const RegisterNamesregisterNames () const
 
void registerNames (const RegisterNames &r)
 
const AddrStringbasicBlockLabels () const
 
AddrStringbasicBlockLabels ()
 
const BasefrontUnparser () const
 
void reachabilityName (unsigned value, const std::string &name)
 Assign a reachability name to a reachability value. More...
 
std::string reachabilityName (unsigned value) const
 Assign a reachability name to a reachability value. More...
 

Member Typedef Documentation

Map from address to string.

Definition at line 23 of file BinaryUnparserBase.h.

Member Function Documentation

void Rose::BinaryAnalysis::Unparser::State::reachabilityName ( unsigned  value,
const std::string &  name 
)

Assign a reachability name to a reachability value.

The two-argument version of this function associates a name with a value. An empty name clears the association.

The one-argument version returns the name corresponding to the value, or generates a name on the fly. To generate a name, the value is first looked up in the mapping and that name is used if present. Otherwise, the value is broken down into individual bits and the resulting string is the comma-separated names for each of the bits. If the mapping has a name for a bit then it's used. Otherwise, if the bit is greater than or equal to Reachability::Reason::USER_DEFINED_0 the string will be "user-defined-x" where x is the number of bits to right shift the flag to make it equal to USER_DEFINED_0. Otherwise, the name of the bit is obtained by treating the value as an enum and obtaining the enum name. If that fails due to the fact that not all bits have corresponding enum constants, the name is the hexadecimal string for the bit.

std::string Rose::BinaryAnalysis::Unparser::State::reachabilityName ( unsigned  value) const

Assign a reachability name to a reachability value.

The two-argument version of this function associates a name with a value. An empty name clears the association.

The one-argument version returns the name corresponding to the value, or generates a name on the fly. To generate a name, the value is first looked up in the mapping and that name is used if present. Otherwise, the value is broken down into individual bits and the resulting string is the comma-separated names for each of the bits. If the mapping has a name for a bit then it's used. Otherwise, if the bit is greater than or equal to Reachability::Reason::USER_DEFINED_0 the string will be "user-defined-x" where x is the number of bits to right shift the flag to make it equal to USER_DEFINED_0. Otherwise, the name of the bit is obtained by treating the value as an enum and obtaining the enum name. If that fails due to the fact that not all bits have corresponding enum constants, the name is the hexadecimal string for the bit.


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