Sha256: b69e3563ebef0aa7a9257d6a40e405d9ffaf85bca00968cbf765b2c8cc3e3005

Contents?: true

Size: 1.35 KB

Versions: 11

Compression:

Stored size: 1.35 KB

Contents

# -*- Ruby -*-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
# We use this as the default startup file for irb inside trepan
# Down the line we will have a way for folks to add/override this
# with their own file.
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:PROMPT][:SIMPLE] = 
    {:PROMPT_C=>"trepan ?> ",
     :PROMPT_I=>"trepan >> ",
     :PROMPT_N=>"trepan >> ",
     :PROMPT_S=>nil,
     :RETURN=>"=> %s\n"}

# Using dbgr to issue a debugger statement inside irb:
#  dbgr %w(info program)
#  dbgr 'info program'  # also works
# But...
#  dbgr info program    # wrong!
# 
puts "You are in a trepan session. You should have access to program scope."
puts "'dbgr', 'step', 'ne', 'q', 'cont' commands have been added."

if defined?($trepan) && $trepan
   puts 'You should have access to debugger state via global variable $trepan'
end
if defined?($trepan_frame) && $trepan_frame
   puts 'You should have access to the program frame via global variable $trepan_frame'
end
if defined?($trepan_cmdproc) && $trepan_cmdproc
   puts 'You should have access to the command processor via global variable $trepan_cmdproc'
end

# Monkeypatch to save the current IRB statement to be run.
class IRB::Context
  alias_method :_trepan_original_evaluate, :evaluate
  def evaluate(line, line_no)
    $trepan_irb_statements = line
    _trepan_original_evaluate(line, line_no)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
trepanning-2.15.35 data/irbrc
trepanning-1.93.35 data/irbrc
trepanning-2.15.33 data/irbrc
trepanning-1.93.32 data/irbrc
trepanning-0.1.6 data/irbrc
trepanning-0.1.4 data/irbrc
trepanning-0.1.3 data/irbrc
trepanning-0.1.2 data/irbrc
trepanning-0.1.1 data/irbrc
trepanning-0.1.0 data/irbrc
trepanning-0.0.8 data/irbrc