Class: DSP::DisassembledInstruction

Inherits:
DSPBase
  • Object
show all
Defined in:
lib/dsp/dsp_protocol.rb

Overview

interface DisassembledInstruction {

    /** The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. */
    address: string;
    /** Optional raw bytes representing the instruction and its operands, in an implementation-defined format. */
    instructionBytes?: string;
    /** Text representing the instruction and its operands, in an implementation-defined format. */
    instruction: string;
    /** Name of the symbol that corresponds with the location of this instruction, if any. */
    symbol?: string;
    /** Source location that corresponds to this instruction, if any.
        Should always be set (if available) on the first instruction returned,
        but can be omitted afterwards if this instruction maps to the same source file as the previous instruction.
    */
    location?: Source;
    /** The line within the source location that corresponds to this instruction, if any. */
    line?: number;
    /** The column within the line that corresponds to this instruction, if any. */
    column?: number;
    /** The end line of the range that corresponds to this instruction, if any. */
    endLine?: number;
    /** The end column of the range that corresponds to this instruction, if any. */
    endColumn?: number;
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ DisassembledInstruction

Returns a new instance of DisassembledInstruction.



4594
4595
4596
4597
# File 'lib/dsp/dsp_protocol.rb', line 4594

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[instructionBytes symbol location line column endLine endColumn]
end

Instance Attribute Details

#addressObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def address
  @address
end

#columnObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def column
  @column
end

#endColumnObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def endColumn
  @endColumn
end

#endLineObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def endLine
  @endLine
end

#instructionObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def instruction
  @instruction
end

#instructionBytesObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def instructionBytes
  @instructionBytes
end

#lineObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def line
  @line
end

#locationObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def location
  @location
end

#symbolObject

type: string # type: string # type: string # type: string # type: Source # type: number # type: number # type: number # type: number



4592
4593
4594
# File 'lib/dsp/dsp_protocol.rb', line 4592

def symbol
  @symbol
end

Instance Method Details

#from_h!(value) ⇒ Object



4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
# File 'lib/dsp/dsp_protocol.rb', line 4599

def from_h!(value)
  value = {} if value.nil?
  self.address = value['address']
  self.instructionBytes = value['instructionBytes']
  self.instruction = value['instruction']
  self.symbol = value['symbol']
  self.location = Source.new(value['location']) unless value['location'].nil?
  self.line = value['line']
  self.column = value['column']
  self.endLine = value['endLine']
  self.endColumn = value['endColumn']
  self
end