0

I have the following software installed

  • Ruby
    • 1.8.6
  • Columnize
    • 0.3.6
  • linecache
    • 0.43
  • ruby-debug
    • 0.10.4
  • ruby-debug-base
    • 0.10.4

There is a piece of code that is almost 22,000 lines long. When rdebug moves to this piece of code, it executes it correctly, but does not display the surrounding correct lines of code or the currently executing line.

For example:

foo.a.b("a string")

Is the method. The following is an example of the code

#around line 2000
@e
@j
@h    
.
.
.
#around line 6000 
def a
  return obj_that_b_is_called_on
end
.
.
.
#around line 20000
def b(string)
 puts "Hello World"
 puts string
 string = a
end

The debugger correctly calls on a and displays the information. However, when b is called, the debugger looks at something similar to the code where @e and @j are. The functions inside b execute correctly, print the correct statements, and I can even evaluate the variable string. Is this a buffer or cache issue? Or is this a setting issue that I can configure?

Kevin
  • 557
  • 4
  • 18

1 Answers1

1

what does a debugger "backtrace" command show? Is it correct?

What does the value of

eval caller().each {|l| puts l}

show? (If autoeval is "on", you don't need the initial "eval")

Is that correct?

If caller() isn't giving the right information, it's a problem in Ruby 1.8.6. Without going into details, there have been are various weirdnesses in reporting line recording in Ruby. (Actually, I don't remember which versions have some of the problems I know are there.)

rocky
  • 26
  • 1
  • You are correct, it talked about the correct method, just not the correct line number :-/. According to one of the people I work with, the line number can be calculated using `mod 8192`. I wonder if there is a way to apply that as a patch... – Kevin Feb 16 '12 at 18:06