Sha256: 44c05a0261bc05f522785baa5619c1a091459a9ab34dcf0e506f19d4c065e5b3

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
require_relative '../../base/subsubcmd'

class Trepan::SubSubcommand::InfoRegistersPc < Trepan::SubSubcommand
  unless defined?(HELP)
    Trepanning::SubSubcommand.set_name_prefix(__FILE__, self)
    HELP         = <<EOH
#{CMD}

Show the value of the VM program counter (PC).
The VM program is an offset into the instruction sequence for the next
VM instruction in the sequence to be executed. 

See also "info disassemble" and "info registers".'
EOH
    MIN_ABBREV   = 'pc'.size
    NEED_STACK   = true
    MIN_ARGS     = 0
    MAX_ARGS     = 0
    SHORT_HELP   = 'Show the value of the VM program counter (PC).'
  end

  def run(args)
    msg("VM pc = %d" % @proc.frame.pc_offset)
  end
end

if __FILE__ == $0
  require_relative '../../../mock'
  require_relative '../registers'
  cmd = MockDebugger::subsub_setup(Trepan::SubSubcommand::InfoRegisters,
                                   Trepan::SubSubcommand::InfoRegistersPc,
                                   false)
  cmd.run([])
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trepanning-2.15.35 processor/command/info_subcmd/registers_subcmd/pc.rb
trepanning-1.93.35 processor/command/info_subcmd/registers_subcmd/pc.rb
trepanning-2.15.33 processor/command/info_subcmd/registers_subcmd/pc.rb
trepanning-1.93.32 processor/command/info_subcmd/registers_subcmd/pc.rb
trepanning-0.1.6 processor/command/info_subcmd/registers_subcmd/pc.rb
trepanning-0.1.4 processor/command/info_subcmd/registers_subcmd/pc.rb
trepanning-0.1.3 processor/command/info_subcmd/registers_subcmd/pc.rb