Package ghidra.app.cmd.disassemble

# Class DisassembleCommand

java.lang.Object
ghidra.framework.cmd.BackgroundCommand
ghidra.app.cmd.disassemble.DisassembleCommand

All Implemented Interfaces:
  `Command`

Direct Known Subclasses:
  `ArmDisassembleCommand`, `Hcs12DisassembleCommand`, `MipsDisassembleCommand`, `PowerPCDisassembleCommand`, `X86_64DisassembleCommand`

public class DisassembleCommand extends BackgroundCommand
Command object for performing disassembly

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected boolean`
  `disassemblyPerformed`
  `protected String`
  `languageError`
  `protected boolean`
  `nonExecutableStart`
  `protected AddressSetView`
  `startSet`
  `protected boolean`
  `unalignedStart`
  `protected boolean`
  `useDefaultRepeatPatternBehavior`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  ``
  `DisassembleCommand(Address start, AddressSetView restrictedSet, boolean followFlow)`
  Constructor for DisassembleCommand.
  ``
  `DisassembleCommand(AddressSetView startSet, AddressSetView restrictedSet)`
  Constructor for DisassembleCommand.
  ``
  `DisassembleCommand(AddressSetView startSet, AddressSetView restrictedSet, boolean followFlow)`
  Constructor for DisassembleCommand.
  `protected`
  `DisassembleCommand(String name, AddressSetView startSet, AddressSetView restrictedSet, boolean followFlow)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `applyTo(DomainObject obj, TaskMonitor monitor)`
  Method called when this command is to apply changes to the given domain object.
  `protected boolean`
  `doDisassembly(TaskMonitor monitor, Program program, int instructionAlignment)`
  `protected AddressSet`
  `doDisassemblySeeds(Disassembler disassembler, AddressSet seedSet, ghidra.app.plugin.core.analysis.AutoAnalysisManager mgr)`
  Do disassembly of a seedSet of address locations
  `void`
  `enableCodeAnalysis(boolean enable)`
  Set code analysis enablement.
  `AddressSet`
  `getDisassembledAddressSet()`
  Returns an address set of all instructions that were disassembled.
  `String`
  `getStatusMsg()`
  Returns the status message indicating the status of the command.
  `void`
  `setInitialContext(RegisterValue initialContextValue)`
  Allows a specified initial context to be used at all start points.
  `void`
  `setSeedContext(DisassemblerContextImpl seedContext)`
  Allows the disassembler context to be seeded for the various disassembly start points which may be encountered using the future flow state of the specified seedContext.

  ### Methods inherited from class ghidra.framework.cmd.BackgroundCommand

  `applyTo, canCancel, dispose, getName, hasProgress, isModal, setStatusMsg, taskCompleted, toString`

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

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

- ## Field Details

  - ### startSet

    protected AddressSetView startSet

  - ### useDefaultRepeatPatternBehavior

    protected boolean useDefaultRepeatPatternBehavior

  - ### disassemblyPerformed

    protected boolean disassemblyPerformed

  - ### languageError

    protected String languageError

  - ### unalignedStart

    protected boolean unalignedStart

  - ### nonExecutableStart

    protected boolean nonExecutableStart

- ## Constructor Details

  - ### DisassembleCommand

    public DisassembleCommand(Address start, AddressSetView restrictedSet, boolean followFlow)
    Constructor for DisassembleCommand.
    Parameters:
      `start` - Address to start disassembly.
      `restrictedSet` - addresses that can be disassembled. a null set implies no restrictions
      `followFlow` - true means the disassembly should follow flow

  - ### DisassembleCommand

    public DisassembleCommand(AddressSetView startSet, AddressSetView restrictedSet)
    Constructor for DisassembleCommand.
    Parameters:
      `startSet` - set of addresses to be the start of a disassembly. The Command object will attempt to start a disassembly at each address in this set.
      `restrictedSet` - addresses that can be disassembled. a null set implies no restrictions

  - ### DisassembleCommand

    public DisassembleCommand(AddressSetView startSet, AddressSetView restrictedSet, boolean followFlow)
    Constructor for DisassembleCommand.
    Parameters:
      `startSet` - set of addresses to be the start of a disassembly. The Command object will attempt to start a disassembly at each address in this set.
      `restrictedSet` - addresses that can be disassembled. a null set implies no restrictions

  - ### DisassembleCommand

    protected DisassembleCommand(String name, AddressSetView startSet, AddressSetView restrictedSet, boolean followFlow)

- ## Method Details

  - ### setSeedContext

    public void setSeedContext(DisassemblerContextImpl seedContext)
    Allows the disassembler context to be seeded for the various disassembly start points which may be encountered using the future flow state of the specified seedContext. Any initial context set via the `setInitialContext(RegisterValue)` method will take precedence when combined with any seed values. The seedContext should remain unchanged while disassembler command is actively running.
    Parameters:
      `seedContext` - seed context or null

  - ### setInitialContext

    public void setInitialContext(RegisterValue initialContextValue)
    Allows a specified initial context to be used at all start points. This value will take precedence when combined with any individual seed context values specified by the `setSeedContext(DisassemblerContextImpl)` method. The defaultSeedContext should remain unchanged while disassembler command is actively running.
    Parameters:
      `initialContextValue` - the initial context value to set or null to clear it

  - ### enableCodeAnalysis

    public void enableCodeAnalysis(boolean enable)
    Set code analysis enablement. By default new instructions will be submitted for auto-analysis.
    Parameters:
      `enable` -

  - ### getStatusMsg

    public String getStatusMsg()
    Description copied from interface: `Command`
    Returns the status message indicating the status of the command.
    Specified by:
      `getStatusMsg` in interface `Command`
    Overrides:
      `getStatusMsg` in class `BackgroundCommand`
    Returns:
      reason for failure, or null if the status of the command was successful

  - ### applyTo

    public boolean applyTo(DomainObject obj, TaskMonitor monitor)
    Description copied from class: `BackgroundCommand`
    Method called when this command is to apply changes to the given domain object. A monitor is provided to display status information about the command as it executes in the background.
    Specified by:
      `applyTo` in class `BackgroundCommand`
    Parameters:
      `obj` - domain object that will be affected by the command
      `monitor` - monitor to show progress of the command
    Returns:
      true if the command applied successfully

  - ### doDisassembly

    protected boolean doDisassembly(TaskMonitor monitor, Program program, int instructionAlignment)

  - ### doDisassemblySeeds

    protected AddressSet doDisassemblySeeds(Disassembler disassembler, AddressSet seedSet, ghidra.app.plugin.core.analysis.AutoAnalysisManager mgr)
    Do disassembly of a seedSet of address locations
    Parameters:
      `disassembler` - disassembler to use
      `seedSet` - set of addresses to be disassembled
      `mgr` -
    Returns:
      addresses actually disassembled

  - ### getDisassembledAddressSet

    public AddressSet getDisassembledAddressSet()
    Returns an address set of all instructions that were disassembled.
    Returns:
      an address set of all instructions that were disassembled