Package ghidra.app.decompiler
Class DecompileOptions
- java.lang.Object
-
- ghidra.app.decompiler.DecompileOptions
-
public class DecompileOptions extends java.lang.Object
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 Classes Modifier and Type Class Description static class
DecompileOptions.CommentStyleEnum
static class
DecompileOptions.IntegerFormatEnum
-
Field Summary
Fields Modifier and Type Field Description static int
SUGGESTED_DECOMPILE_TIMEOUT_SECS
static int
SUGGESTED_MAX_PAYLOAD_BYTES
-
Constructor Summary
Constructors Constructor Description DecompileOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCacheSize()
java.awt.Color
getCodeViewerBackgroundColor()
java.awt.Color
getCommentColor()
DecompileOptions.CommentStyleEnum
getCommentStyle()
java.awt.Color
getConstantColor()
java.awt.Color
getCurrentVariableHighlightColor()
java.awt.Color
getDefaultColor()
java.awt.Font
getDefaultFont()
int
getDefaultTimeout()
DecompilerLanguage
getDisplayLanguage()
java.awt.Color
getFunctionColor()
java.awt.Color
getGlobalColor()
java.awt.Color
getKeywordColor()
int
getMaxPayloadMBytes()
int
getMaxWidth()
int
getMiddleMouseHighlightButton()
java.awt.Color
getMiddleMouseHighlightColor()
java.awt.Color
getParameterColor()
java.lang.String
getProtoEvalModel()
java.awt.Color
getSearchHighlightColor()
java.awt.Color
getTypeColor()
java.awt.Color
getVariableColor()
java.lang.String
getXML(DecompInterface iface)
Produce XML document of configuration options to be sent to decompiler process.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
isConventionPrint()
boolean
isDisplayLineNumbers()
boolean
isDisplayNamespaces()
boolean
isEliminateUnreachable()
boolean
isEOLCommentIncluded()
boolean
isHeadCommentIncluded()
boolean
isNoCastPrint()
boolean
isPLATECommentIncluded()
boolean
isPOSTCommentIncluded()
boolean
isPRECommentIncluded()
boolean
isSimplifyDoublePrecision()
boolean
isWARNCommentIncluded()
void
registerOptions(Plugin ownerPlugin, ToolOptions opt, Program program, HelpLocation help)
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
setDisplayLanguage(DecompilerLanguage val)
void
setEliminateUnreachable(boolean eliminateUnreachable)
void
setEOLCommentIncluded(boolean commentEOLInclude)
void
setHeadCommentIncluded(boolean commentHeadInclude)
void
setMaxPayloadMBytes(int mbytes)
void
setNoCastPrint(boolean noCastPrint)
void
setPLATECommentIncluded(boolean commentPLATEInclude)
void
setPOSTCommentIncluded(boolean commentPOSTInclude)
void
setPRECommentIncluded(boolean commentPREInclude)
void
setProtoEvalModel(java.lang.String protoEvalModel)
void
setSimplifyDoublePrecision(boolean simplifyDoublePrecision)
void
setWARNCommentIncluded(boolean commentWARNInclude)
-
-
-
Field Detail
-
SUGGESTED_DECOMPILE_TIMEOUT_SECS
public static final int SUGGESTED_DECOMPILE_TIMEOUT_SECS
- See Also:
- Constant Field Values
-
SUGGESTED_MAX_PAYLOAD_BYTES
public static final int SUGGESTED_MAX_PAYLOAD_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
grabFromToolAndProgram
public 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.- 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
public void grabFromProgram(Program program)
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
public java.lang.String getProtoEvalModel()
-
setProtoEvalModel
public void setProtoEvalModel(java.lang.String protoEvalModel)
-
registerOptions
public void registerOptions(Plugin ownerPlugin, ToolOptions opt, Program program, HelpLocation help)
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 programhlep
-
-
getXML
public java.lang.String getXML(DecompInterface iface)
Produce XML document of configuration options to be sent to decompiler process. This object is global to all decompile processes so we can tailor to the specific process by passing in the interface- Parameters:
iface
- specific DecompInterface being sent options- Returns:
- XML document as a string
-
getMaxWidth
public int getMaxWidth()
-
getKeywordColor
public java.awt.Color getKeywordColor()
-
getTypeColor
public java.awt.Color getTypeColor()
-
getFunctionColor
public java.awt.Color getFunctionColor()
-
getCommentColor
public java.awt.Color getCommentColor()
-
getConstantColor
public java.awt.Color getConstantColor()
-
getVariableColor
public java.awt.Color getVariableColor()
-
getParameterColor
public java.awt.Color getParameterColor()
-
getGlobalColor
public java.awt.Color getGlobalColor()
-
getDefaultColor
public java.awt.Color getDefaultColor()
-
getCodeViewerBackgroundColor
public java.awt.Color getCodeViewerBackgroundColor()
-
getCurrentVariableHighlightColor
public java.awt.Color getCurrentVariableHighlightColor()
-
getMiddleMouseHighlightColor
public java.awt.Color getMiddleMouseHighlightColor()
-
getSearchHighlightColor
public java.awt.Color getSearchHighlightColor()
-
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()
-
isDisplayNamespaces
public boolean isDisplayNamespaces()
-
getDisplayLanguage
public DecompilerLanguage getDisplayLanguage()
-
isConventionPrint
public boolean isConventionPrint()
-
setConventionPrint
public void setConventionPrint(boolean conventionPrint)
-
isNoCastPrint
public boolean isNoCastPrint()
-
setNoCastPrint
public void setNoCastPrint(boolean noCastPrint)
-
setDisplayLanguage
public void setDisplayLanguage(DecompilerLanguage val)
-
getDefaultFont
public java.awt.Font getDefaultFont()
-
getDefaultTimeout
public int getDefaultTimeout()
-
setDefaultTimeout
public void setDefaultTimeout(int timeout)
-
getMaxPayloadMBytes
public int getMaxPayloadMBytes()
-
setMaxPayloadMBytes
public void setMaxPayloadMBytes(int mbytes)
-
getCommentStyle
public DecompileOptions.CommentStyleEnum getCommentStyle()
-
setCommentStyle
public void setCommentStyle(DecompileOptions.CommentStyleEnum commentStyle)
-
getCacheSize
public int getCacheSize()
-
-