Package ghidra.app.decompiler.location

# Class VariableDecompilerLocation

java.lang.Object
ghidra.program.util.ProgramLocation
ghidra.program.util.FunctionLocation
ghidra.program.util.VariableLocation
ghidra.program.util.VariableLocFieldLocation
ghidra.app.decompiler.location.VariableDecompilerLocation

All Implemented Interfaces:
  `DecompilerLocation`, `Cloneable`, `Comparable<ProgramLocation>`

public class VariableDecompilerLocation extends VariableLocFieldLocation implements DecompilerLocation
A location created when a function variable is clicked in the Decompiler.

- ## Field Summary

  ### Fields inherited from class ghidra.program.util.FunctionLocation

  `functionAddr`

  ### Fields inherited from class ghidra.program.util.ProgramLocation

  `addr, program, refAddr`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VariableDecompilerLocation()`
  `VariableDecompilerLocation(Program program, Address locationAddr, Variable var, DecompilerLocationInfo info)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `int`
  `getCharPos()`
  Returns the character position.
  `DecompileResults`
  `getDecompile()`
  Results from the decompilation
  `Address`
  `getFunctionEntryPoint()`
  `int`
  `getLineNumber()`
  Returns the line number.
  `ClangToken`
  `getToken()`
  C text token at the current cursor location
  `String`
  `getTokenName()`
  Returns the name of the token for the current location.
  `int`
  `hashCode()`
  `void`
  `restoreState(Program p, SaveState ss)`
  Restore this function location using the given program and save state object.
  `void`
  `saveState(SaveState ss)`
  Save this function location to the given save state object.

  ### Methods inherited from class ghidra.program.util.VariableLocFieldLocation

  `getLoc`

  ### Methods inherited from class ghidra.program.util.VariableLocation

  `compareTo, getVariable, isLocationFor, isParameter, isReturn, isValid, toString`

  ### Methods inherited from class ghidra.program.util.FunctionLocation

  `getFunctionAddress`

  ### Methods inherited from class ghidra.program.util.ProgramLocation

  `clone, compareAddr, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, getTranslatedCopy`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### VariableDecompilerLocation

    public VariableDecompilerLocation(Program program, Address locationAddr, Variable var, DecompilerLocationInfo info)

  - ### VariableDecompilerLocation

    public VariableDecompilerLocation()

- ## Method Details

  - ### getFunctionEntryPoint

    public Address getFunctionEntryPoint()
    Specified by:
      `getFunctionEntryPoint` in interface `DecompilerLocation`

  - ### getDecompile

    public DecompileResults getDecompile()
    Description copied from interface: `DecompilerLocation`
    Results from the decompilation
    Specified by:
      `getDecompile` in interface `DecompilerLocation`
    Returns:
      C-AST, DFG, and CFG object. null if there are no results attached to this location

  - ### getToken

    public ClangToken getToken()
    Description copied from interface: `DecompilerLocation`
    C text token at the current cursor location
    Specified by:
      `getToken` in interface `DecompilerLocation`
    Returns:
      token at this location, could be null if there are no decompiler results

  - ### getTokenName

    public String getTokenName()
    Description copied from interface: `DecompilerLocation`
    Returns the name of the token for the current location.
    Specified by:
      `getTokenName` in interface `DecompilerLocation`
    Returns:
      the name of the token for the current location

  - ### getLineNumber

    public int getLineNumber()
    Description copied from interface: `DecompilerLocation`
    Returns the line number.
    Specified by:
      `getLineNumber` in interface `DecompilerLocation`
    Returns:
      the line number

  - ### getCharPos

    public int getCharPos()
    Description copied from interface: `DecompilerLocation`
    Returns the character position.
    Specified by:
      `getCharPos` in interface `DecompilerLocation`
    Returns:
      the character position

  - ### saveState

    public void saveState(SaveState ss)
    Description copied from class: `FunctionLocation`
    Save this function location to the given save state object.
    Overrides:
      `saveState` in class `VariableLocFieldLocation`
    Parameters:
      `ss` - the save state object for saving the location

  - ### restoreState

    public void restoreState(Program p, SaveState ss)
    Description copied from class: `FunctionLocation`
    Restore this function location using the given program and save state object.
    Overrides:
      `restoreState` in class `VariableLocFieldLocation`
    Parameters:
      `p` - the program containing the function location
      `ss` - the save state object for saving the location

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `VariableLocFieldLocation`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `VariableLocFieldLocation`