Class: Rubinius::Debugger::DeferredBreakPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/rubinius/debugger/breakpoint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(debugger, frame, klass, which, name, line = nil, list = nil) ⇒ DeferredBreakPoint

Returns a new instance of DeferredBreakPoint.



99
100
101
102
103
104
105
106
107
108
109
# File 'lib/rubinius/debugger/breakpoint.rb', line 99

def initialize(debugger, frame, klass, which, name, line=nil, list=nil)
  @debugger = debugger
  @frame = frame
  @klass_name = klass
  @which = which
  @name = name
  @line = line
  @list = list
  @commands = nil
  @condition = nil
end

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands.



111
112
113
# File 'lib/rubinius/debugger/breakpoint.rb', line 111

def commands
  @commands
end

#conditionObject (readonly)

Returns the value of attribute condition.



111
112
113
# File 'lib/rubinius/debugger/breakpoint.rb', line 111

def condition
  @condition
end

Instance Method Details

#delete!Object



146
147
148
149
150
# File 'lib/rubinius/debugger/breakpoint.rb', line 146

def delete!
  if @list
    @list.delete self
  end
end

#describeObject



142
143
144
# File 'lib/rubinius/debugger/breakpoint.rb', line 142

def describe
  "#{descriptor} - unknown location (deferred)"
end

#descriptorObject



113
114
115
# File 'lib/rubinius/debugger/breakpoint.rb', line 113

def descriptor
  "#{@klass_name}#{@which}#{@name}"
end

#has_commands?Boolean

Returns:

  • (Boolean)


156
157
158
# File 'lib/rubinius/debugger/breakpoint.rb', line 156

def has_commands?
  !@commands.nil?
end

#has_condition?Boolean

Returns:

  • (Boolean)


164
165
166
# File 'lib/rubinius/debugger/breakpoint.rb', line 164

def has_condition?
  !@condition.nil?
end

#resolve!Object



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/rubinius/debugger/breakpoint.rb', line 117

def resolve!
  begin
    klass = @frame.run(@klass_name)
  rescue NameError
    return false
  end

  begin
    if @which == "#"
      method = klass.instance_method(@name)
    else
      method = klass.method(@name)
    end
  rescue NameError
    return false
  end

  @debugger.info "Resolved breakpoint for #{@klass_name}#{@which}#{@name}"

  index = @debugger.breakpoints.index(self)
  @debugger.set_breakpoint_method descriptor, method, @line, @condition, @commands, index

  return true
end

#set_commands(commands) ⇒ Object



152
153
154
# File 'lib/rubinius/debugger/breakpoint.rb', line 152

def set_commands(commands)
  @commands = commands
end

#set_condition(condition) ⇒ Object



160
161
162
# File 'lib/rubinius/debugger/breakpoint.rb', line 160

def set_condition(condition)
  @condition = condition
end