class Rubinius::Debugger::BreakPoint

Attributes

commands[R]
condition[R]
descriptor[R]
ip[R]
line[R]
method[R]
paired_bp[R]

Public Class Methods

for_ip(exec, ip, name=:anon) click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 4
def self.for_ip(exec, ip, name=:anon)
  line = exec.line_from_ip(ip)

  BreakPoint.new(name, exec, ip, line)
end
new(descriptor, method, ip, line, condition=nil) click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 10
def initialize(descriptor, method, ip, line, condition=nil)
  @descriptor = descriptor
  @method = method
  @ip = ip
  @line = line
  @for_step = false
  @paired_bp = nil
  @temp = false
  @commands = nil
  @condition = condition

  @set = false
end

Public Instance Methods

activate() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 51
def activate
  @set = true
  @method.set_breakpoint @ip, self
end
delete!() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 77
def delete!
  remove!
end
describe() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 30
def describe
  "#{descriptor} - #{location}"
end
for_step!(scope) click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 34
def for_step!(scope)
  @temp = true
  @for_step = scope
end
for_step?() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 43
def for_step?
  @for_step
end
has_commands?() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 85
def has_commands?
  !@commands.nil?
end
has_condition?() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 93
def has_condition?
  !@condition.nil?
end
hit!(loc) click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 63
def hit!(loc)
  return true unless @temp

  if @for_step
    return false unless loc.variables == @for_step
  end

  remove!

  @paired_bp.remove! if @paired_bp

  return true
end
location() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 26
def location
  "#{@method.active_path}:#{@line} (+#{ip})"
end
paired_with(bp) click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 47
def paired_with(bp)
  @paired_bp = bp
end
remove!() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 56
def remove!
  return unless @set

  @set = false
  @method.clear_breakpoint(@ip)
end
set_commands(commands) click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 81
def set_commands(commands)
  @commands = commands
end
set_condition(condition) click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 89
def set_condition(condition)
  @condition = condition
end
set_temp!() click to toggle source
# File lib/rubinius/debugger/breakpoint.rb, line 39
def set_temp!
  @temp = true
end