1 #ifndef Rose_BinaryAnalysis_LinuxSyscall_H
2 #define Rose_BinaryAnalysis_LinuxSyscall_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include <AbstractLocation.h>
7 #include <BinarySmtSolver.h>
8 #include <boost/filesystem.hpp>
9 #include <Partitioner2/BasicTypes.h>
10 #include <RoseException.h>
11 #include <Sawyer/Map.h>
45 : id(id), name(name) {}
52 Declarations declarations_;
59 void declare(
const Declaration &declaration);
65 void declare(
const boost::filesystem::path &headerFileName);
74 std::vector<Declaration>
lookup(
const std::string &name)
const;
77 static std::vector<Declaration>
parseHeaderFile(
const boost::filesystem::path &headerFileName);
SmtSolverPtr Ptr
Reference counting pointer for SMT solvers.
Declarative information about a system call.
uint64_t id
Identification number.
const AbstractLocation & ident() const
Property: Abstract location that identifies the particular system call.
static std::vector< Declaration > parseHeaderFile(const boost::filesystem::path &headerFileName)
Parse a Linux header file to obtain declarations for system calls.
Base class for machine instructions.
Holds a value or nothing.
std::string name
Name of system call.
Main namespace for the ROSE library.
SgAsmInstruction * hasSystemCall(const Partitioner2::BasicBlockPtr &) const
Determine whether a basic block has a system call.
Analyzes basic blocks to get system call names.
Sawyer::Container::Map< uint64_t, Declaration > Declarations
Table of syscall declarations indexed by syscall IDs.
Sawyer::Optional< Declaration > lookup(uint64_t id) const
Look up a system call by ID number.
virtual bool isSystemCall(SgAsmInstruction *) const
Predicate to determine whether an instruction is a system call.
Exceptions for system call analysis.
Declaration(uint64_t id, const std::string &name)
Constructor.
void declare(const Declaration &declaration)
Declare a system call.
void ident(const AbstractLocation &location)
Property: Abstract location that identifies the particular system call.
const Declarations & declarations() const
All declarations.
Partitions instructions into basic blocks and functions.
Base class for all ROSE exceptions.
Exception(const std::string &mesg)
Construct an exception with a message.
Declaration()
Default constructor.
Container associating values with keys.
virtual Sawyer::Optional< Declaration > analyze(const Partitioner2::Partitioner &, const Partitioner2::BasicBlockPtr &, SgAsmInstruction *, const SmtSolver::Ptr &solver=SmtSolver::Ptr()) const
Analyze a basic block and return the system calls.