Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::DataBlock Class Reference


Data block information.

A data block represents data with a type.

Definition at line 20 of file DataBlock.h.

#include <DataBlock.h>

Inheritance diagram for Rose::BinaryAnalysis::Partitioner2::DataBlock:
Inheritance graph
Collaboration diagram for Rose::BinaryAnalysis::Partitioner2::DataBlock:
Collaboration graph

Public Types

typedef Sawyer::SharedPointer< DataBlockPtr
 Shared pointer to a data block. More...
- Public Types inherited from Sawyer::Attribute::Storage<>
typedef SynchronizationTraits< Sawyer::SingleThreadedTagSync

Public Member Functions

bool isFrozen () const
 Determine if data block is read-only. More...
rose_addr_t address () const
 Returns the starting address. More...
size_t size () const
 Returns the size in bytes. More...
size_t nAttachedOwners () const
 Number of attached basic block and function owners. More...
AddressInterval extent () const
 Addresses represented. More...
std::string printableName () const
 A printable name for this data block. More...
std::vector< uint8_t > read (const MemoryMap::Ptr &) const
 Read static data from a memory map. More...
SgAsmTypetype () const
 Property: Type of data stored in this block. More...
void type (SgAsmType *t)
 Property: Type of data stored in this block. More...
const std::string & comment () const
 Property: Comment.
void comment (const std::string &s)
 Property: Comment.
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor. More...
 SharedObject (const SharedObject &)
 Copy constructor. More...
virtual ~SharedObject ()
 Virtual destructor. More...
SharedObjectoperator= (const SharedObject &)
 Assignment. More...
- Public Member Functions inherited from Sawyer::Attribute::Storage<>
 Storage ()
 Default constructor. More...
 Storage (const Storage &other)
 Copy constructor. More...
Storageoperator= (const Storage &other)
 Assignment operator. More...
bool attributeExists (Id id) const
 Check attribute existence. More...
void eraseAttribute (Id id)
 Erase an attribute. More...
void clearAttributes ()
 Erase all attributes. More...
void setAttribute (Id id, const T &value)
 Store an attribute. More...
bool setAttributeMaybe (Id id, const T &value)
 Store an attribute if not already present. More...
getAttribute (Id id) const
 Get an attribute that is known to exist. More...
attributeOrElse (Id id, const T &dflt) const
 Return an attribute or a specified value. More...
attributeOrDefault (Id id) const
 Return an attribute or a default-constructed value. More...
Sawyer::Optional< T > optionalAttribute (Id id) const
 Return the attribute as an optional value. More...
size_t nAttributes () const
 Number of attributes stored. More...
std::vector< IdattributeIds () const
 Returns ID numbers for all IDs stored in this container. More...

Static Public Member Functions

static Ptr instance (rose_addr_t startVa, SgAsmType *)
 Static allocating constructor. More...
static Ptr instanceBytes (rose_addr_t startVa, size_t nBytes)
 Static allocating constructor. More...

Protected Member Functions

 DataBlock (rose_addr_t startVa, SgAsmType *type)

Member Typedef Documentation

Shared pointer to a data block.

See Shared ownership.

Definition at line 23 of file DataBlock.h.

Member Function Documentation

static Ptr Rose::BinaryAnalysis::Partitioner2::DataBlock::instance ( rose_addr_t  startVa,

Static allocating constructor.

static Ptr Rose::BinaryAnalysis::Partitioner2::DataBlock::instanceBytes ( rose_addr_t  startVa,
size_t  nBytes 

Static allocating constructor.

Creates a data block whose type is just an array of bytes.

The startVa is the starting address of the data block.

bool Rose::BinaryAnalysis::Partitioner2::DataBlock::isFrozen ( ) const

Determine if data block is read-only.

Returns true if read-only, false otherwise.

Definition at line 75 of file DataBlock.h.

rose_addr_t Rose::BinaryAnalysis::Partitioner2::DataBlock::address ( ) const

Returns the starting address.

Definition at line 78 of file DataBlock.h.

size_t Rose::BinaryAnalysis::Partitioner2::DataBlock::size ( ) const

Returns the size in bytes.

SgAsmType* Rose::BinaryAnalysis::Partitioner2::DataBlock::type ( ) const

Property: Type of data stored in this block.

The type can only be changed when the data block is in a detached state (i.e., when isFrozen is false).

Definition at line 88 of file DataBlock.h.

void Rose::BinaryAnalysis::Partitioner2::DataBlock::type ( SgAsmType t)

Property: Type of data stored in this block.

The type can only be changed when the data block is in a detached state (i.e., when isFrozen is false).

size_t Rose::BinaryAnalysis::Partitioner2::DataBlock::nAttachedOwners ( ) const

Number of attached basic block and function owners.

Returns the number of data blocks and functions that are attached to the CFG/AUM and that own this data block.

Definition at line 102 of file DataBlock.h.

AddressInterval Rose::BinaryAnalysis::Partitioner2::DataBlock::extent ( ) const

Addresses represented.

std::string Rose::BinaryAnalysis::Partitioner2::DataBlock::printableName ( ) const

A printable name for this data block.

Returns a string like 'data block 0x10001234'.

std::vector<uint8_t> Rose::BinaryAnalysis::Partitioner2::DataBlock::read ( const MemoryMap::Ptr ) const

Read static data from a memory map.

This is a simple wrapper around memory map reading functionality so that the data for this static data block can be retrieved from the memory map without needing to know how to use the quite extensive memory map API. This method reads this object's data from the provided memory map and returns a vector of the bytes. The returned vector will be truncated if any of the bytes of this data block are not present in the map.

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