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