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