1 #ifndef ROSE_BinaryAnalysis_Partitioner2_DataBlock_H
2 #define ROSE_BinaryAnalysis_Partitioner2_DataBlock_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
7 #include <Rose/SourceLocation.h>
8 #include <SageBuilderAsm.h>
10 #include <boost/serialization/access.hpp>
11 #include <Sawyer/Attribute.h>
12 #include <Sawyer/SharedPointer.h>
17 namespace BinaryAnalysis {
18 namespace Partitioner2 {
41 std::vector<BasicBlockPtr> attachedBasicBlockOwners_;
42 std::vector<FunctionPtr> attachedFunctionOwners_;
46 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
48 friend class boost::serialization::access;
51 void serialize(S &s,
const unsigned version) {
53 s & BOOST_SERIALIZATION_NVP(isFrozen_);
54 s & BOOST_SERIALIZATION_NVP(startVa_);
56 s & BOOST_SERIALIZATION_NVP(type_);
57 s & BOOST_SERIALIZATION_NVP(comment_);
58 }
else if (S::is_loading::value) {
60 s & boost::serialization::make_nvp(
"size_", nBytes);
64 ASSERT_not_reachable(
"Rose::BinaryAnalysis::Partitioner2::DataBlock version 2 is no longer supported");
66 s & BOOST_SERIALIZATION_NVP(attachedBasicBlockOwners_);
67 s & BOOST_SERIALIZATION_NVP(attachedFunctionOwners_);
70 s & BOOST_SERIALIZATION_NVP(sourceLocation_);
99 rose_addr_t
address()
const {
return startVa_; }
116 const std::string&
comment()
const;
117 void comment(
const std::string& s);
const std::string & comment() const
Property: Comment.
Information about a source location.
Sawyer::SharedPointer< DataBlock > Ptr
Shared pointer to a data block.
bool isFrozen() const
Determine if data block is read-only.
const std::vector< FunctionPtr > & attachedFunctionOwners() const
Functions that are attached to the partitioner and own this data block.
SgAsmIntegerType * buildTypeU8()
8-bit unsigned.
std::string printableName() const
A printable name for this data block.
Main namespace for the ROSE library.
rose_addr_t address() const
Returns the starting address.
size_t size() const
Returns the size in bytes.
std::vector< uint8_t > read(const MemoryMapPtr &) const
Read static data from a memory map.
const std::vector< BasicBlockPtr > & attachedBasicBlockOwners() const
Basic blocks that are attached to the partitioner and own this data block.
static Ptr instance(rose_addr_t startVa, SgAsmType *)
Static allocating constructor.
AddressInterval extent() const
Addresses represented.
const SourceLocation & sourceLocation() const
Property: Optional location of data in source code.
Base class for binary types.
Base class for reference counted objects.
API and storage for attributes.
static Ptr instanceBytes(rose_addr_t startVa, size_t nBytes)
Static allocating constructor.
Partitions instructions into basic blocks and functions.
size_t nAttachedOwners() const
Number of attached basic block and function owners.
SgAsmVectorType * buildTypeVector(size_t, SgAsmType *)
Fixed-size, packed array.
SgAsmType * type() const
Property: Type of data stored in this block.