Package ghidra.app.util
Class SymbolInspector
java.lang.Object
ghidra.app.util.SymbolInspector
- All Implemented Interfaces:
OptionsChangeListener
Class for coloring symbols.
-
Constructor Summary
ConstructorsConstructorDescriptionSymbolInspector(ToolOptions options, Component repaintComp) Constructs a new symbol inspectorSymbolInspector(ServiceProvider serviceProvider, Component repaintComp) Constructs a new symbol inspector It uses the tool to get the CATEGORY_BROWSER_DISPLAY options -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Call this when you are done with this inspector and will not use it again.Get the color used to render the given symbol.getColorAndStyle(Program p, Reference r) Gets the color and style used to render the given reference.Gets the color and style used to render the given symbol.intDeprecated, for removal: This API element is subject to removal in a future version.returns nullgetScreenElement(Program p, Reference r) Get the ScreenElement corresponding to the type of the reference.Get the ScreenElement corresponding to the type of the symbolintGet the style used to render the given symbolbooleanReturns true if symbol is at a non-existent addressbooleanReturns true if the symbol is on a data item.booleanReturns true if the symbol is on "dead" codebooleanChecks if the given symbol is at an external entry pointbooleanbooleanChecks if the symbol is at a functionbooleanChecks if the symbol is global or localbooleanChecks if the symbol is at or inside an instructionbooleanChecks if the symbol is localbooleanChecks if the symbol is not a primary symbolbooleanChecks if the symbol is offcutbooleanreturns true if the symbol is primarybooleanChecks if the symbol is at the beginning of a subroutine.booleanChecks if the symbol is a function variablevoidoptionsChanged(ToolOptions options, String name, Object oldValue, Object newValue) Notification that an option changed.voidDeprecated, for removal: This API element is subject to removal in a future version.this method does nothing
-
Constructor Details
-
SymbolInspector
Constructs a new symbol inspector It uses the tool to get the CATEGORY_BROWSER_DISPLAY options- Parameters:
serviceProvider- a service provider for getting servicesrepaintComp- the component to repaint when the options change
-
SymbolInspector
Constructs a new symbol inspector- Parameters:
options- the options from which to get colorsrepaintComp- the component to repaint when the options change
-
-
Method Details
-
optionsChanged
Description copied from interface:OptionsChangeListenerNotification that an option changed.Note: to reject an options change, you can throw a
OptionsVetoException.- Specified by:
optionsChangedin interfaceOptionsChangeListener- Parameters:
options- options object containing the property that changedname- name of option that changedoldValue- old value of the optionnewValue- new value of the option
-
dispose
public void dispose()Call this when you are done with this inspector and will not use it again. Cleans up listeners, etc. -
setProgram
Deprecated, for removal: This API element is subject to removal in a future version.this method does nothingDoes nothing- Parameters:
p- the program
-
getProgram
Deprecated, for removal: This API element is subject to removal in a future version.returns nullReturns null.- Returns:
- null
-
isBadReferenceSymbol
Returns true if symbol is at a non-existent address- Parameters:
s- the symbol to check- Returns:
- boolean true if symbol is bad
-
isDataSymbol
Returns true if the symbol is on a data item.- Parameters:
s- the symbol to check- Returns:
- boolean true if s is a data symbol
-
isDeadCodeSymbol
Returns true if the symbol is on "dead" code- Parameters:
s- the symbol to check- Returns:
- boolean true if the symbol is on dead code
-
isEntryPointSymbol
Checks if the given symbol is at an external entry point- Parameters:
s- the symbol to check- Returns:
- boolean true if the symbol is at an external entry point address.
-
isFunctionSymbol
Checks if the symbol is at a function- Parameters:
s- the symbol to check.- Returns:
- boolean true if there is a function at the symbol's address.
-
isVariableSymbol
Checks if the symbol is a function variable- Parameters:
s- the symbol to check- Returns:
- true if s is a function variable symbol
-
isGlobalSymbol
Checks if the symbol is global or local- Parameters:
s- the symbol to check- Returns:
- boolean true if the symbol is global, false if the symbol is local.
-
isInstructionSymbol
Checks if the symbol is at or inside an instruction- Parameters:
s- the symbol to check- Returns:
- boolean true if the symbol is on an instruction
-
isLocalSymbol
Checks if the symbol is local- Parameters:
s- the symbol to check- Returns:
- boolean true if the symbol is local, false if it is global
-
isNonPrimarySymbol
Checks if the symbol is not a primary symbol- Parameters:
s- the symbol to check.- Returns:
- boolean true if the symbol is non-primary
-
isOffcutSymbol
Checks if the symbol is offcut- Parameters:
s- the symbol to check- Returns:
- boolean true if the symbol is offcut
-
isPrimarySymbol
returns true if the symbol is primary- Parameters:
s- the symbol to check- Returns:
- boolean true if the symbol is primary
-
isSubroutineSymbol
Checks if the symbol is at the beginning of a subroutine.- Parameters:
s- the symbol to check- Returns:
- boolean true if the symbol is at the beginning of a subroutine.
-
isExternalSymbol
-
getColorAndStyle
Gets the color and style used to render the given symbol. Calling this method is faster than callinggetColor(Symbol)andgetStyle(Symbol)separately.- Parameters:
s- the symbol- Returns:
- the color and style
-
getColorAndStyle
Gets the color and style used to render the given reference. Calling this method is faster than callinggetColor(Symbol)andgetStyle(Symbol)separately.- Parameters:
p- the programr- the reference- Returns:
- the color and style
-
getColor
Get the color used to render the given symbol.- Parameters:
s- symbol to inspect- Returns:
- Color for the symbol
-
getStyle
Get the style used to render the given symbol- Parameters:
s- symbol to inspect- Returns:
- the style for the symbol
-
getScreenElement
Get the ScreenElement corresponding to the type of the symbol- Parameters:
s- the symbol to inspect- Returns:
- the screen element
-
getScreenElement
Get the ScreenElement corresponding to the type of the reference.- Parameters:
p- the programr- the reference to inspect- Returns:
- the screen element
-
getOffcutSymbolColor
-
getOffcutSymbolStyle
public int getOffcutSymbolStyle()
-