Class: Rubinius::SetTrace::Frame
- Inherits:
-
Object
- Object
- Rubinius::SetTrace::Frame
- Defined in:
- app/frame.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#vm_location ⇒ Object
readonly
Returns the value of attribute vm_location.
Instance Method Summary collapse
- #binding ⇒ Object
- #describe ⇒ Object
- #file ⇒ Object
-
#initialize(debugger, number, vm_location) ⇒ Frame
constructor
A new instance of Frame.
- #ip ⇒ Object
- #line ⇒ Object
- #local_variables ⇒ Object
- #method ⇒ Object
- #run(code) ⇒ Object
- #variables ⇒ Object
Constructor Details
#initialize(debugger, number, vm_location) ⇒ Frame
Returns a new instance of Frame.
3 4 5 6 7 |
# File 'app/frame.rb', line 3 def initialize(debugger, number, vm_location) @debugger = debugger @number = number @vm_location = vm_location end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
9 10 11 |
# File 'app/frame.rb', line 9 def number @number end |
#vm_location ⇒ Object (readonly)
Returns the value of attribute vm_location.
9 10 11 |
# File 'app/frame.rb', line 9 def vm_location @vm_location end |
Instance Method Details
#binding ⇒ Object
15 16 17 18 19 20 |
# File 'app/frame.rb', line 15 def binding @binding ||= Binding.setup( @vm_location.variables, @vm_location.method, @vm_location.static_scope) end |
#describe ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'app/frame.rb', line 46 def describe if method.required_args > 0 locals = [] 0.upto(method.required_args-1) do |arg| locals << method.local_names[arg].to_s end arg_str = locals.join(", ") else arg_str = "" end context = @vm_location if loc.is_block if arg_str.empty? recv = "{ } in #{context.describe_receiver}#{context.name}" else recv = "{|#{arg_str}| } in #{context.describe_receiver}#{context.name}" end else if arg_str.empty? recv = loc.describe else recv = "#{context.describe}(#{arg_str})" end end str = "#{recv} at #{context.method.active_path}:#{context.line} (@#{context.ip})" end |
#file ⇒ Object
30 31 32 |
# File 'app/frame.rb', line 30 def file @vm_location.file end |
#ip ⇒ Object
34 35 36 |
# File 'app/frame.rb', line 34 def ip @vm_location.ip end |
#line ⇒ Object
26 27 28 |
# File 'app/frame.rb', line 26 def line @vm_location.line end |
#local_variables ⇒ Object
42 43 44 |
# File 'app/frame.rb', line 42 def local_variables method.local_names end |
#method ⇒ Object
22 23 24 |
# File 'app/frame.rb', line 22 def method @vm_location.method end |
#run(code) ⇒ Object
11 12 13 |
# File 'app/frame.rb', line 11 def run(code) eval(code, binding) end |
#variables ⇒ Object
38 39 40 |
# File 'app/frame.rb', line 38 def variables @vm_location.variables end |