ROSE  0.11.28.0
BinaryUnparser.h
1 // Basic types for binary unparsing.
2 #ifndef ROSE_BinaryAnalysis_Unparser_H
3 #define ROSE_BinaryAnalysis_Unparser_H
4 
5 #include <featureTests.h>
6 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
7 
8 #include <Color.h>
9 #include <BaseSemantics2.h>
10 #include <BinaryEdgeArrows.h>
11 #include <Sawyer/CommandLine.h>
12 
13 namespace Rose {
14 namespace BinaryAnalysis {
15 namespace Unparser {
16 
18 struct Style {
23  std::string ansiStyle() const;
24 };
25 
31 struct Settings {
32  virtual ~Settings() {}
33 
36  struct {
37  struct {
39  } line;
40  struct {
41  Style style;
42  } trailing;
43  } comment;
44 
45  struct {
51  struct {
52  bool showing;
53  } cg;
54  struct {
55  bool showing;
56  bool concrete;
57  } stackDelta;
58  struct {
59  bool showing;
60  } callconv;
61  struct {
62  bool showing;
63  } noop;
64  struct {
65  bool showing;
66  } mayReturn;
67  } function;
69  struct {
71  struct {
77  } cfg;
78  struct {
80  } reach;
81  } bblock;
83  struct {
85  } dblock;
86 
87  struct {
88  struct {
89  bool showing;
90  bool useLabels;
91  size_t fieldWidth;
92  Style style;
93  } address;
95  struct {
96  bool showing;
97  size_t perLine;
98  size_t fieldWidth;
99  Style style;
100  } bytes;
102  struct {
103  bool showing;
104  size_t fieldWidth;
105  Style style;
106  } stackDelta;
108  struct {
109  size_t fieldWidth;
110  std::string semanticFailureMarker;
112  Style style;
113  } mnemonic;
115  struct {
116  std::string separator;
117  size_t fieldWidth;
119  Style style;
120  } operands;
122  struct {
123  bool showing;
125  std::string pre;
126  std::string post;
127  size_t fieldWidth;
128  } comment;
130  struct {
131  bool showing;
133  bool tracing;
134  Style style;
135  } semantics;
136  } insn;
138  struct {
140  } arrow;
142  Settings();
143  static Settings full();
144  static Settings minimal();
145 };
146 
147 // Forward declarations.
148 class Base;
149 class State;
150 typedef Sawyer::SharedPointer<Base> BasePtr;
151 
153 Sawyer::CommandLine::SwitchGroup commandLineSwitches(Settings &settings);
154 
155 } // namespace
156 } // namespace
157 } // namespace
158 
159 #endif
160 #endif
Control colored command output.
Definition: Color.h:40
struct Rose::BinaryAnalysis::Unparser::Settings::@844::@851 trailing
Comment extending to the end of the line.
struct Rose::BinaryAnalysis::Unparser::Settings::@848::@862 mnemonic
Settings for instruction mnemonics.
std::string semanticFailureMarker
Mark instruction if it had semantic failures.
struct Rose::BinaryAnalysis::Unparser::Settings::@848::@863 operands
Settings for the operand list.
Color::Colorization colorization
Overrides for global color settings.
bool usingDescription
Lacking comment, use instruction description as comment?
size_t perLine
Max number of bytes to show per line of output.
A collection of related switch declarations.
Main namespace for the ROSE library.
Settings that control unparsing.
bool showingPredecessors
Show basic block predecessors?
struct Rose::BinaryAnalysis::Unparser::Settings::@848 insn
Settings for instructions.
struct Rose::BinaryAnalysis::Unparser::Settings::@845::@855 noop
Settings for no-op analysis.
struct Rose::BinaryAnalysis::Unparser::Settings::@846 bblock
Settings for basic blocks.
struct Rose::BinaryAnalysis::Unparser::Settings::@849 arrow
How to render arrows along the left margin.
EdgeArrows::ArrowStylePreset style
One of the arrow style presets.
bool useLabels
Generate labels and use them instead of addresses?
Sawyer::Optional< Color::HSV > background
Optional background color.
Sawyer::Optional< Color::HSV > foreground
Optional foreground color.
bool showingSharing
Show functions when block is shared?
bool showing
Show function call graph?
struct Rose::BinaryAnalysis::Unparser::Settings::@844::@850 line
Comment occupying an entire line.
std::string ansiStyle() const
Generate the ANSI escape for the style.
bool tracing
Show instruction semantics traces when showing semantics.
Style style
Style for printing the address.
struct Rose::BinaryAnalysis::Unparser::Settings::@845::@854 callconv
Settings for function calling convention.
bool showingReasons
Show reasons for function existing.
Style titleStyle
Style for title line of function.
bool showingSourceLocation
Show source file name and line number when available.
std::string pre
String to introduce a comment.
struct Rose::BinaryAnalysis::Unparser::Settings::@846::@858 reach
Reachability analysis results.
bool showingArrows
Draw arrows from one block to another.
std::string separator
How to separate one operand from another.
struct Rose::BinaryAnalysis::Unparser::Settings::@845::@856 mayReturn
Settings for may-return analysis.
struct Rose::BinaryAnalysis::Unparser::Settings::@846::@857 cfg
Settings for control flow graphs.
Style separatorStyle
Style of the line separating functions.
Style semanticFailureStyle
Style for the semantic failure indicator.
struct Rose::BinaryAnalysis::Unparser::Settings::@845::@852 cg
Settings for function call graphs.
std::string post
String to terminate a comment.
bool showingWidth
Show width of all expression terms in square brackets.
struct Rose::BinaryAnalysis::Unparser::Settings::@848::@860 bytes
Settings for the bytes that make up an instruction.
struct Rose::BinaryAnalysis::Unparser::Settings::@845::@853 stackDelta
Settings for function stack deltas.
size_t fieldWidth
Min characters to use per insn address.
bool concrete
Show concrete or symbolic deltas.
bool showingDemangled
Show demangled name in preference to mangled name.
InstructionSemantics2::BaseSemantics::Formatter formatter
How to format the semantic state output.
bool showingReachability
Show code reachability in the basic block prologue area.
struct Rose::BinaryAnalysis::Unparser::Settings::@848::@859 address
Settings for instruction starting addresses.
bool showingSuccessors
Show basic block successors?