Package ghidra.app.decompiler
Class DecompileOptions
java.lang.Object
ghidra.app.decompiler.DecompileOptions
Configuration options for the decompiler
This stores the options and can create an XML
string to be sent to the decompiler process
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
static enum
static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(Encoder encoder, DecompInterface iface) Encode all the configuration options to a stream for the decompiler process.int
int
int
int
int
int
void
grabFromProgram
(Program program) Grab all the decompiler options from the program specifically and cache them in this object.void
grabFromToolAndProgram
(Plugin ownerPlugin, ToolOptions opt, Program program) Grab all the decompiler options from various sources within a specific tool and program and cache them in this object.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
registerOptions
(Plugin ownerPlugin, ToolOptions opt, Program program) This registers all the decompiler tool options with ghidra, and has the side effect of pulling all the current values for the options if they existvoid
setCommentStyle
(DecompileOptions.CommentStyleEnum commentStyle) void
setConventionPrint
(boolean conventionPrint) void
setDefaultTimeout
(int timeout) void
void
setEliminateUnreachable
(boolean eliminateUnreachable) void
setEOLCommentIncluded
(boolean commentEOLInclude) void
setHeadCommentIncluded
(boolean commentHeadInclude) void
setMaxInstructions
(int num) void
setMaxPayloadMBytes
(int mbytes) void
setMaxWidth
(int maxwidth) void
setNoCastPrint
(boolean noCastPrint) void
setPLATECommentIncluded
(boolean commentPLATEInclude) void
setPOSTCommentIncluded
(boolean commentPOSTInclude) void
setPRECommentIncluded
(boolean commentPREInclude) void
setProtoEvalModel
(String protoEvalModel) void
setSimplifyDoublePrecision
(boolean simplifyDoublePrecision) void
setWARNCommentIncluded
(boolean commentWARNInclude)
-
Field Details
-
SUGGESTED_DECOMPILE_TIMEOUT_SECS
public static final int SUGGESTED_DECOMPILE_TIMEOUT_SECS- See Also:
-
SUGGESTED_MAX_PAYLOAD_BYTES
public static final int SUGGESTED_MAX_PAYLOAD_BYTES- See Also:
-
SUGGESTED_MAX_INSTRUCTIONS
public static final int SUGGESTED_MAX_INSTRUCTIONS- See Also:
-
-
Constructor Details
-
DecompileOptions
public DecompileOptions()
-
-
Method Details
-
grabFromToolAndProgram
Grab all the decompiler options from various sources within a specific tool and program and cache them in this object.- Parameters:
ownerPlugin
- the plugin that owns the "tool options" for the decompileropt
- the Options object that contains the "tool options" specific to the decompilerprogram
- the program whose "program options" are relevant to the decompiler
-
grabFromProgram
Grab all the decompiler options from the program specifically and cache them in this object.- Parameters:
program
- the program whose "program options" are relevant to the decompiler
-
getProtoEvalModel
-
setProtoEvalModel
-
registerOptions
This registers all the decompiler tool options with ghidra, and has the side effect of pulling all the current values for the options if they exist- Parameters:
ownerPlugin
- the plugin to which the options should be registeredopt
- the options object to register withprogram
- the program
-
encode
Encode all the configuration options to a stream for the decompiler process. This object is global to all decompile processes so we can tailor to the specific process by passing in the interface.- Parameters:
encoder
- is the stream encoderiface
- specific DecompInterface being sent options- Throws:
IOException
- for errors writing to the underlying stream
-
getMaxWidth
public int getMaxWidth() -
setMaxWidth
public void setMaxWidth(int maxwidth) -
getKeywordColor
- Returns:
- color associated with keyword tokens
-
getTypeColor
- Returns:
- color associated with data-type tokens
-
getFunctionColor
- Returns:
- color associated with a function name token
-
getCommentColor
- Returns:
- color used to display comments
-
getConstantColor
- Returns:
- color associated with constant tokens
-
getVariableColor
- Returns:
- color associated with (local) variable tokens
-
getParameterColor
- Returns:
- color associated with parameter tokens
-
getGlobalColor
- Returns:
- color associated with global variable tokens
-
getSpecialColor
- Returns:
- color associated with volatile variables or other special tokens
-
getDefaultColor
- Returns:
- color for generic syntax or other unspecified tokens
-
getErrorColor
- Returns:
- color used on tokens that need to warn of an error or other unusual conditions
-
getCodeViewerBackgroundColor
- Returns:
- the background color for the decompiler window
-
getCurrentVariableHighlightColor
- Returns:
- the color used display the current highlighted variable
-
getMiddleMouseHighlightColor
- Returns:
- color used to highlight token(s) selected with a middle button clock
-
getSearchHighlightColor
- Returns:
- color used to highlight search results
-
getMiddleMouseHighlightButton
public int getMiddleMouseHighlightButton() -
isPRECommentIncluded
public boolean isPRECommentIncluded() -
setPRECommentIncluded
public void setPRECommentIncluded(boolean commentPREInclude) -
isPLATECommentIncluded
public boolean isPLATECommentIncluded() -
setPLATECommentIncluded
public void setPLATECommentIncluded(boolean commentPLATEInclude) -
isPOSTCommentIncluded
public boolean isPOSTCommentIncluded() -
setPOSTCommentIncluded
public void setPOSTCommentIncluded(boolean commentPOSTInclude) -
isEOLCommentIncluded
public boolean isEOLCommentIncluded() -
setEOLCommentIncluded
public void setEOLCommentIncluded(boolean commentEOLInclude) -
isWARNCommentIncluded
public boolean isWARNCommentIncluded() -
setWARNCommentIncluded
public void setWARNCommentIncluded(boolean commentWARNInclude) -
isHeadCommentIncluded
public boolean isHeadCommentIncluded() -
setHeadCommentIncluded
public void setHeadCommentIncluded(boolean commentHeadInclude) -
isEliminateUnreachable
public boolean isEliminateUnreachable() -
setEliminateUnreachable
public void setEliminateUnreachable(boolean eliminateUnreachable) -
isSimplifyDoublePrecision
public boolean isSimplifyDoublePrecision() -
setSimplifyDoublePrecision
public void setSimplifyDoublePrecision(boolean simplifyDoublePrecision) -
isDisplayLineNumbers
public boolean isDisplayLineNumbers() -
getDisplayLanguage
-
isConventionPrint
public boolean isConventionPrint() -
setConventionPrint
public void setConventionPrint(boolean conventionPrint) -
isNoCastPrint
public boolean isNoCastPrint() -
setNoCastPrint
public void setNoCastPrint(boolean noCastPrint) -
setDisplayLanguage
-
getDefaultFont
-
getDefaultTimeout
public int getDefaultTimeout() -
setDefaultTimeout
public void setDefaultTimeout(int timeout) -
getMaxPayloadMBytes
public int getMaxPayloadMBytes() -
setMaxPayloadMBytes
public void setMaxPayloadMBytes(int mbytes) -
getMaxInstructions
public int getMaxInstructions() -
setMaxInstructions
public void setMaxInstructions(int num) -
getCommentStyle
-
setCommentStyle
-
getCacheSize
public int getCacheSize()
-