1 #ifndef ROSE_Partitioner2_DataBlock_H
2 #define ROSE_Partitioner2_DataBlock_H
4 #include <featureTests.h>
5 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
7 #include <Partitioner2/BasicTypes.h>
8 #include <SageBuilderAsm.h>
9 #include <SourceLocation.h>
11 #include <boost/serialization/access.hpp>
12 #include <Sawyer/Attribute.h>
13 #include <Sawyer/SharedPointer.h>
19 namespace Partitioner2 {
42 std::vector<BasicBlockPtr> attachedBasicBlockOwners_;
43 std::vector<FunctionPtr> attachedFunctionOwners_;
47 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
49 friend class boost::serialization::access;
52 void serialize(S &s,
const unsigned version) {
54 s & BOOST_SERIALIZATION_NVP(isFrozen_);
55 s & BOOST_SERIALIZATION_NVP(startVa_);
57 s & BOOST_SERIALIZATION_NVP(type_);
58 s & BOOST_SERIALIZATION_NVP(comment_);
59 }
else if (S::is_loading::value) {
61 s & boost::serialization::make_nvp(
"size_", nBytes);
65 ASSERT_not_reachable(
"Rose::BinaryAnalysis::Partitioner2::DataBlock version 2 is no longer supported");
67 s & BOOST_SERIALIZATION_NVP(attachedBasicBlockOwners_);
68 s & BOOST_SERIALIZATION_NVP(attachedFunctionOwners_);
71 s & BOOST_SERIALIZATION_NVP(sourceLocation_);
100 rose_addr_t
address()
const {
return startVa_; }
117 const std::string&
comment()
const;
118 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.
void sourceLocation(const SourceLocation &loc)
Property: Optional location of data in source code.
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.
std::vector< uint8_t > read(const MemoryMap::Ptr &) const
Read static data from a memory map.
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.