ROSE 0.11.145.354
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
12namespace Rose {
13namespace BinaryAnalysis {
14namespace Unparser {
15
31
37struct Settings {
38 virtual ~Settings() {}
39
42 struct {
43 struct {
45 } line;
46 struct {
49 } comment;
50
51 struct {
57 struct {
58 bool showing;
59 } cg;
60 struct {
61 bool showing;
62 bool concrete;
64 struct {
65 bool showing;
67 struct {
68 bool showing;
69 } noop;
70 struct {
71 bool showing;
75 struct {
77 struct {
85 } cfg;
86 struct {
92 struct {
94 } dblock;
95
96 struct {
97 struct {
98 bool showing;
99 bool useLabels;
100 size_t fieldWidth;
101 Style style;
104 struct {
105 bool showing;
106 size_t perLine;
107 size_t fieldWidth;
108 Style style;
111 struct {
112 bool showing;
113 size_t fieldWidth;
114 Style style;
117 struct {
118 bool showing;
119 size_t fieldWidth;
120 Style style;
123 struct {
124 size_t fieldWidth;
127 Style style;
130 struct {
131 std::string separator;
132 size_t fieldWidth;
134 Style style;
137 struct {
138 bool showing;
140 std::string pre;
141 std::string post;
142 size_t fieldWidth;
143 // Style style; // see `comment.trailing.style` above
144 } comment;
146 struct {
147 bool showing;
149 bool tracing;
150 Style style;
151 } semantics;
154 struct {
158 std::string linePrefix;
159
160 Settings();
161 static Settings full();
162 static Settings minimal();
163};
164
165// Forward declarations.
166class Base;
167class State;
168typedef Sawyer::SharedPointer<Base> BasePtr;
169
172
173} // namespace
174} // namespace
175} // namespace
176
177#endif
178#endif
A collection of related switch declarations.
Represents no value.
Definition Optional.h:34
Holds a value or nothing.
Definition Optional.h:54
Reference-counting intrusive smart pointer.
Sawyer::CommandLine::SwitchGroup commandLineSwitches(Settings &settings)
Command-line switches for unparser settings.
The ROSE library.
Settings that control unparsing.
struct Rose::BinaryAnalysis::Unparser::Settings::@710::@717 cg
Settings for function call graphs.
struct Rose::BinaryAnalysis::Unparser::Settings::@714 arrow
How to render arrows along the left margin.
struct Rose::BinaryAnalysis::Unparser::Settings::@711 bblock
Settings for basic blocks.
bool showingDemangled
Show demangled name in preference to mangled name.
bool showingPredecessors
Show basic block predecessors?
size_t fieldWidth
Min characters to use per insn address.
bool showingReasons
Show reasons for function existing.
size_t perLine
Max number of bytes to show per line of output.
bool showingSourceLocation
Show source file name and line number when available.
InstructionSemantics::BaseSemantics::Formatter formatter
How to format the semantic state output.
struct Rose::BinaryAnalysis::Unparser::Settings::@710::@718 stackDelta
Settings for function stack deltas.
struct Rose::BinaryAnalysis::Unparser::Settings::@710::@721 mayReturn
Settings for may-return analysis.
std::string pre
String to introduce a comment.
bool showing
Show function call graph?
bool showingPostBlock
Show info about what happens after the last instruction.
std::string post
String to terminate a comment.
bool tracing
Show instruction semantics traces when showing semantics.
bool showingSuccessors
Show basic block successors?
Style semanticFailureStyle
Style for the semantic failure indicator.
std::string semanticFailureMarker
Mark instruction if it had semantic failures.
struct Rose::BinaryAnalysis::Unparser::Settings::@710::@719 callconv
Settings for function calling convention.
struct Rose::BinaryAnalysis::Unparser::Settings::@709::@715 line
Comment occupying an entire line.
struct Rose::BinaryAnalysis::Unparser::Settings::@713::@724 address
Settings for instruction starting addresses.
bool showingReachability
Show code reachability in the basic block prologue area.
struct Rose::BinaryAnalysis::Unparser::Settings::@710 function
Settings for functions.
Style titleStyle
Style for title line of function.
Style separatorStyle
Style of the line separating functions.
bool showingArrows
Draw arrows from one block to another.
struct Rose::BinaryAnalysis::Unparser::Settings::@711::@723 reach
Reachability analysis results.
struct Rose::BinaryAnalysis::Unparser::Settings::@711::@722 cfg
Settings for control flow graphs.
struct Rose::BinaryAnalysis::Unparser::Settings::@713::@727 frameDelta
Settings for frame deltas.
std::string separator
How to separate one operand from another.
struct Rose::BinaryAnalysis::Unparser::Settings::@709::@716 trailing
Comment extending to the end of the line.
Color::Colorization colorization
Overrides for global color settings.
bool showingSharing
Show functions when block is shared?
bool showingCallReturnFallThroughEdges
Show call-return fall through edges from one block to the next.
bool showingNormalFallThroughEdges
Show normal fall through edges from one block to the next.
Style style
Style for printing the address.
struct Rose::BinaryAnalysis::Unparser::Settings::@713::@728 mnemonic
Settings for instruction mnemonics.
struct Rose::BinaryAnalysis::Unparser::Settings::@713 insn
Settings for instructions.
struct Rose::BinaryAnalysis::Unparser::Settings::@713::@725 bytes
Settings for the bytes that make up an instruction.
EdgeArrows::ArrowStylePreset style
One of the arrow style presets.
bool concrete
Show concrete or symbolic deltas.
bool useLabels
Generate labels and use them instead of addresses?
struct Rose::BinaryAnalysis::Unparser::Settings::@710::@720 noop
Settings for no-op analysis.
bool showingWidth
Show width of all expression terms in square brackets.
bool usingDescription
Lacking comment, use instruction description as comment?
struct Rose::BinaryAnalysis::Unparser::Settings::@713::@729 operands
Settings for the operand list.
Style()
Construct an empty style using default colors.
Sawyer::Optional< Color::HSV > background
Optional background color.
Style(const Sawyer::Optional< Color::HSV > &fg, const Sawyer::Optional< Color::HSV > &bg=Sawyer::Nothing())
Construct a new style with the specified foreground and background colors.
Sawyer::Optional< Color::HSV > foreground
Optional foreground color.
std::string ansiStyle() const
Generate the ANSI escape for the style.
Control colored command output.
Definition Color.h:37