ROSE  0.11.98.0
Unparser/Settings.h
1 // Basic types for binary unparsing.
2 #ifndef ROSE_BinaryAnalysis_Unparser_Settings_H
3 #define ROSE_BinaryAnalysis_Unparser_Settings_H
4 #include <featureTests.h>
5 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 
7 #include <Rose/Color.h>
8 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
9 #include <Rose/BinaryAnalysis/Unparser/EdgeArrows.h>
10 #include <Sawyer/CommandLine.h>
11 
12 namespace Rose {
13 namespace BinaryAnalysis {
14 namespace Unparser {
15 
17 struct Style {
22  std::string ansiStyle() const;
23 };
24 
30 struct Settings {
31  virtual ~Settings() {}
32 
35  struct {
36  struct {
38  } line;
39  struct {
40  Style style;
41  } trailing;
42  } comment;
43 
44  struct {
50  struct {
51  bool showing;
52  } cg;
53  struct {
54  bool showing;
55  bool concrete;
56  } stackDelta;
57  struct {
58  bool showing;
59  } callconv;
60  struct {
61  bool showing;
62  } noop;
63  struct {
64  bool showing;
65  } mayReturn;
66  } function;
68  struct {
70  struct {
76  } cfg;
77  struct {
79  } reach;
80  } bblock;
82  struct {
84  } dblock;
85 
86  struct {
87  struct {
88  bool showing;
89  bool useLabels;
90  size_t fieldWidth;
91  Style style;
92  } address;
94  struct {
95  bool showing;
96  size_t perLine;
97  size_t fieldWidth;
98  Style style;
99  } bytes;
101  struct {
102  bool showing;
103  size_t fieldWidth;
104  Style style;
105  } stackDelta;
107  struct {
108  size_t fieldWidth;
109  std::string semanticFailureMarker;
111  Style style;
112  } mnemonic;
114  struct {
115  std::string separator;
116  size_t fieldWidth;
118  Style style;
119  } operands;
121  struct {
122  bool showing;
124  std::string pre;
125  std::string post;
126  size_t fieldWidth;
127  } comment;
129  struct {
130  bool showing;
132  bool tracing;
133  Style style;
134  } semantics;
135  } insn;
137  struct {
139  } arrow;
141  std::string linePrefix;
142 
143  Settings();
144  static Settings full();
145  static Settings minimal();
146 };
147 
148 // Forward declarations.
149 class Base;
150 class State;
151 typedef Sawyer::SharedPointer<Base> BasePtr;
152 
154 Sawyer::CommandLine::SwitchGroup commandLineSwitches(Settings &settings);
155 
156 } // namespace
157 } // namespace
158 } // namespace
159 
160 #endif
161 #endif
Control colored command output.
Definition: Color.h:40
struct Rose::BinaryAnalysis::Unparser::Settings::@777::@788 mayReturn
Settings for may-return analysis.
struct Rose::BinaryAnalysis::Unparser::Settings::@780::@794 mnemonic
Settings for instruction mnemonics.
std::string semanticFailureMarker
Mark instruction if it had semantic failures.
Color::Colorization colorization
Overrides for global color settings.
struct Rose::BinaryAnalysis::Unparser::Settings::@780::@791 address
Settings for instruction starting addresses.
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.
struct Rose::BinaryAnalysis::Unparser::Settings::@780::@795 operands
Settings for the operand list.
Main namespace for the ROSE library.
Settings that control unparsing.
struct Rose::BinaryAnalysis::Unparser::Settings::@778::@790 reach
Reachability analysis results.
bool showingPredecessors
Show basic block predecessors?
struct Rose::BinaryAnalysis::Unparser::Settings::@781 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?
struct Rose::BinaryAnalysis::Unparser::Settings::@778 bblock
Settings for basic blocks.
bool showing
Show function call graph?
struct Rose::BinaryAnalysis::Unparser::Settings::@776::@782 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::@777::@785 stackDelta
Settings for function stack deltas.
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.
InstructionSemantics::BaseSemantics::Formatter formatter
How to format the semantic state output.
bool showingArrows
Draw arrows from one block to another.
std::string separator
How to separate one operand from another.
struct Rose::BinaryAnalysis::Unparser::Settings::@778::@789 cfg
Settings for control flow graphs.
struct Rose::BinaryAnalysis::Unparser::Settings::@780 insn
Settings for instructions.
Binary analysis.
struct Rose::BinaryAnalysis::Unparser::Settings::@776::@783 trailing
Comment extending to the end of the line.
Style separatorStyle
Style of the line separating functions.
Style semanticFailureStyle
Style for the semantic failure indicator.
struct Rose::BinaryAnalysis::Unparser::Settings::@780::@792 bytes
Settings for the bytes that make up an instruction.
std::string post
String to terminate a comment.
bool showingWidth
Show width of all expression terms in square brackets.
struct Rose::BinaryAnalysis::Unparser::Settings::@777::@786 callconv
Settings for function calling convention.
size_t fieldWidth
Min characters to use per insn address.
bool concrete
Show concrete or symbolic deltas.
struct Rose::BinaryAnalysis::Unparser::Settings::@777::@787 noop
Settings for no-op analysis.
bool showingDemangled
Show demangled name in preference to mangled name.
struct Rose::BinaryAnalysis::Unparser::Settings::@777::@784 cg
Settings for function call graphs.
bool showingReachability
Show code reachability in the basic block prologue area.
bool showingSuccessors
Show basic block successors?