1#ifndef ROSE_BinaryAnalysis_AsmFunctionIndex_H
2#define ROSE_BinaryAnalysis_AsmFunctionIndex_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
7#include <Rose/Diagnostics.h>
10#include <SgAsmFunction.h>
17namespace BinaryAnalysis {
144 return val(a)<val(b);
147 return val(a)!=val(b);
159 return val(a) < val(b);
162 return val(a) != val(b);
171 return val(a) < val(b);
174 return val(a) != val(b);
179 return extent.
size();
210 if (newlist.empty() || comp.unique(newlist.back(), *fi))
211 newlist.push_back(*fi);
304 virtual void print(std::ostream&)
const;
374 void set_prefix(
const std::string &header,
const std::string &separator=
" ",
const std::string &data=
" ");
463 } callingConventionCallback;
478 } stackDeltaCallback;
500 typedef std::vector<SgAsmFunction*> Functions;
Print function minimum address.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
Print calling convention.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
Print function ending address.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
Print function entry address.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
Print whether function can return.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
Base class for printing table cells.
std::string name
Column name used when printing table headers.
std::string desc
Optional description to appear in footnote.
std::string header_prefix
Character(s) to print before headings.
std::string separator_prefix
Character(s) to print before line separators.
void set_prefix(const std::string &header, const std::string &separator=" ", const std::string &data=" ")
Set prefix characters.
std::string center(const std::string &, size_t width)
Center s in a string of length width.
std::string data_prefix
Character(s) to print before data cells.
OutputCallback(const std::string &name, size_t width, const std::string description="")
Constructor.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
size_t width
Minimum width of column header or data.
virtual bool operator()(bool enabled, const HeadingArgs &)
Callback to print a column heading.
virtual bool operator()(bool enabled, const BeforeAfterArgs &)
Callback for before and after the table.
Print function reason bits.
virtual bool operator()(bool enabled, const HeadingArgs &)
Callback to print a column heading.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
Print function size in bytes.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
Print number of instructions in function.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
virtual bool operator()(bool enabled, const HeadingArgs &)
Callback to print a column heading.
virtual bool operator()(bool enabled, const DataArgs &)
Callback to print data for a table cell.
Functions indexed by entry address.
virtual void add_function(SgAsmFunction *)
Adds a function to the end of this index.
AsmFunctionIndex()
Constructs an empty index.
virtual void init()
Initializes the callback lists.
AsmFunctionIndex & sort_by_name(bool unique=false)
Specific sorting method.
virtual void print(std::ostream &) const
Prints a function index to an output stream.
AsmFunctionIndex & sort_by_ninsns(bool unique=false)
Specific sorting method.
AsmFunctionIndex & sort_by_nbytes(bool unique=false)
Specific sorting method.
AsmFunctionIndex & sort_by_begin_addr(bool unique=false)
Specific sorting method.
AsmFunctionIndex & reverse()
Reverse the order of the functions.
virtual size_t size() const
Returns the number of functions in the index.
virtual bool empty() const
Determines if an index is empty.
Callbacks::List< OutputCallback > output_callbacks
List of callbacks to be invoked when printing columns.
Functions functions
Functions in index order.
AsmFunctionIndex(SgNode *ast)
Constructs an index from an AST.
virtual void clear()
Clears the index.
virtual void add_functions(SgNode *ast)
Adds functions to this index.
AsmFunctionIndex & sort_by_entry_addr(bool unique=false)
Specific sorting method.
AsmFunctionIndex & sort(Comparator comp, bool unique=false)
Sort the functions in the index.
List of callback functors.
Interval::Value size() const
Number of scalar elements represented.
Represents a synthesized function.
rose_addr_t const & get_entryVa() const
Property: Primary entry address.
size_t get_extent(Rose::BinaryAnalysis::AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL, NodeSelector *selector=NULL)
Returns information about the function addresses.
std::string const & get_name() const
Property: Name.
This class represents the base class for all IR nodes within Sage III.
Arguments for before-and after.
int when
Zero implies before table, one implies after table.
Arguments for column cells.
Base class for callback arguments.
const AsmFunctionIndex * index
Index object being printed.
std::ostream & output
Stream to which index is being printed.
Footnotes * footnotes
Footnotes (newly created for each index output).
Arguments for column heading callbacks.
char sep
If non-NUL, then print a line of these characters.
Functor for sorting by function beginning address.
Functor for sorting by number of bytes in function.
Functor for sorting by function entry virtual address.
Functor for sorting by number of instructions in function.
Functor to sort functions by name.