Class: WebTools::Support::Debugger::Frame
- Defined in:
- lib/web_tools/support/debugger.rb
Defined Under Namespace
Classes: Context
Instance Attribute Summary collapse
-
#block_nesting ⇒ Object
readonly
Returns the value of attribute block_nesting.
-
#debug_info ⇒ Object
readonly
Returns the value of attribute debug_info.
-
#defining_class ⇒ Object
readonly
Returns the value of attribute defining_class.
-
#gsmethod ⇒ Object
readonly
Returns the value of attribute gsmethod.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
Instance Method Summary collapse
- #context_eval(str) ⇒ Object
- #context_object ⇒ Object
- #debug_info! ⇒ Object
-
#delete ⇒ Object
Pop frame off the stack, effectively restarting it.
-
#initialize(params) ⇒ Frame
constructor
A new instance of Frame.
- #initialize_frame_info ⇒ Object
-
#step(symbol = :over) ⇒ Object
Step.
- #to_hash ⇒ Object
Constructor Details
#initialize(params) ⇒ Frame
Returns a new instance of Frame.
162 163 164 165 166 167 |
# File 'lib/web_tools/support/debugger.rb', line 162 def initialize(params) @gsmethod = params[:method] @thread = params[:thread] @index = params[:index] initialize_frame_info end |
Instance Attribute Details
#block_nesting ⇒ Object (readonly)
Returns the value of attribute block_nesting.
159 160 161 |
# File 'lib/web_tools/support/debugger.rb', line 159 def block_nesting @block_nesting end |
#debug_info ⇒ Object (readonly)
Returns the value of attribute debug_info.
159 160 161 |
# File 'lib/web_tools/support/debugger.rb', line 159 def debug_info @debug_info end |
#defining_class ⇒ Object (readonly)
Returns the value of attribute defining_class.
159 160 161 |
# File 'lib/web_tools/support/debugger.rb', line 159 def defining_class @defining_class end |
#gsmethod ⇒ Object (readonly)
Returns the value of attribute gsmethod.
159 160 161 |
# File 'lib/web_tools/support/debugger.rb', line 159 def gsmethod @gsmethod end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
159 160 161 |
# File 'lib/web_tools/support/debugger.rb', line 159 def index @index end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
159 160 161 |
# File 'lib/web_tools/support/debugger.rb', line 159 def method_name @method_name end |
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
159 160 161 |
# File 'lib/web_tools/support/debugger.rb', line 159 def thread @thread end |
Instance Method Details
#context_eval(str) ⇒ Object
188 189 190 |
# File 'lib/web_tools/support/debugger.rb', line 188 def context_eval(str) context_object.instance_eval(str) end |
#context_object ⇒ Object
192 193 194 195 196 |
# File 'lib/web_tools/support/debugger.rb', line 192 def context_object @context ||= Context.create_for(self, debug_info![:self], debug_info![:context]) end |
#debug_info! ⇒ Object
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/web_tools/support/debugger.rb', line 215 def debug_info! @debug_info ||= begin ary = @thread.__gsi_debugger_detailed_report_at(@index) context = {} # First the named temps, matched to values ary[6].each_with_index {|name,idx| context[name] = ary[7][idx] } # Then the remaining scope values with temporary names ary[7][ary[6].size..-1].each_with_index {|v,i| context[:'t#{i}'] = v} context[:'(receiver)'] = ary[1] context[:'(class)'] = ary[1].class context[:'(self)'] = ary[2] { :gsMethod => ary[0], :receiver => ary[1], :self => ary[2], :method => ary[3], :stepOffset => ary[4], :stepPoints => ary[5], :source => ary[8], :context => context } end end |
#delete ⇒ Object
Pop frame off the stack, effectively restarting it
170 171 172 |
# File 'lib/web_tools/support/debugger.rb', line 170 def delete @thread.__trim_stack_to_level(@index) end |
#initialize_frame_info ⇒ Object
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/web_tools/support/debugger.rb', line 198 def initialize_frame_info label = @gsmethod.__name @block_nesting = 0 m = @gsmethod while label.nil? m = m.__home_method label = m.__name @block_nesting += 1 end @defining_class = m.__in_class @class = @gsmethod.__in_class @method_name = label if @gsmethod.__source_location @source_location = @gsmethod.__source_location.join(":") end end |
#step(symbol = :over) ⇒ Object
Step. The manner of stepping defaults to :over, but :into or the number of steps can be passed as arguments
176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/web_tools/support/debugger.rb', line 176 def step(symbol = :over) raise RuntimeError, "can only step top frame" unless @index === 1 case symbol when :into @thread.__step_over_in_frame(0) when :over @thread.__step_over_in_frame(1) when Fixnum @thread.__step_over_in_frame(arg) end end |
#to_hash ⇒ Object
238 239 240 241 242 243 244 245 246 |
# File 'lib/web_tools/support/debugger.rb', line 238 def to_hash { :method_name => @method_name, :class => @class, :index => @index, :defining_class => @defining_class, :source_location => @source_location, :block_nesting => @block_nesting, :debug_info => @debug_info } end |