HK15
HK15

Reputation: 807

Ruby debugger: weird sort of caching

I'm using Ruby debugger gem in my RoR project. Ruby 1.9.3 and Rails 3.2

Debugger works fine by a sort of weird file caching occurs.

I mean:

First example

[4, 13] in /.../app/controllers/fork_controller.rb
   4    def index
   5  
   6        debugger
   7        a = "hello"
   8  
=> 9        puts "#{a}"
   10  
   11    end
   12  
   13    def requesting    
(rdb:4) eval a
"hello"
(rdb:4) continue

Then I change var "a" to "hello2"

def index

    debugger
    a = "hello2"

    puts "#{a}"

  end

this is the result:

[4, 13] in /.../app/controllers/fork_controller.rb
   4    def index
   5  
   6        debugger
   7        a = "hello"
   8  
=> 9        puts "#{a}"
   10  
   11    end
   12  
   13    def requesting    
(rdb:4) eval a
"hello2"
(rdb:4) continue

So ... the variable evaluation is correct "hello2" instead of "hello" but ... the "breakpoint view" show the first variable content "hello".

What is wrong?

Thanks in advance.

Upvotes: 0

Views: 47

Answers (0)

Related Questions