Package ghidra.app.util.bin.format.dwarf4.expression

# Class DWARFExpression

java.lang.Object
ghidra.app.util.bin.format.dwarf4.expression.DWARFExpression

public class DWARFExpression extends Object
A `DWARFExpression` is an immutable list of `operations` and some factory methods to read an expression from its binary representation.

Use a `DWARFExpressionEvaluator` to execute a `DWARFExpression`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `exprToString(byte[] exprBytes, DIEAggregate diea)`
  `int`
  `findOpByOffset(long offset)`
  Finds the index of an `operation` by its offset from the beginning of the expression.
  `int`
  `getLastActiveOpIndex()`
  Returns the index of the last operation that is not a NOP.
  `ghidra.app.util.bin.format.dwarf4.expression.DWARFExpressionOperation`
  `getOp(int i)`
  `int`
  `getOpCount()`
  `static DWARFExpression`
  `read(byte[] exprBytes, byte addrSize, boolean isLittleEndian, int dwarf_format)`
  `static DWARFExpression`
  `read(BinaryReader reader, byte addrSize, int dwarf_format)`
  `String`
  `toString()`
  `String`
  `toString(int caretPosition, boolean newlines, boolean offsets)`

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### exprToString

    public static String exprToString(byte[] exprBytes, DIEAggregate diea)

  - ### read

    public static DWARFExpression read(byte[] exprBytes, byte addrSize, boolean isLittleEndian, int dwarf_format) throws DWARFExpressionException
    Throws:
      `DWARFExpressionException`

  - ### read

    public static DWARFExpression read(BinaryReader reader, byte addrSize, int dwarf_format) throws DWARFExpressionException
    Throws:
      `DWARFExpressionException`

  - ### getOp

    public ghidra.app.util.bin.format.dwarf4.expression.DWARFExpressionOperation getOp(int i)

  - ### getOpCount

    public int getOpCount()

  - ### getLastActiveOpIndex

    public int getLastActiveOpIndex()
    Returns the index of the last operation that is not a NOP.
    Returns:

  - ### findOpByOffset

    public int findOpByOffset(long offset)
    Finds the index of an `operation` by its offset from the beginning of the expression.

    Parameters:
      `offset` -
    Returns:
      -1 if there is no op at the specified offset

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### toString

    public String toString(int caretPosition, boolean newlines, boolean offsets)