This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 190574 - Variables window shows incorrect frame
Summary: Variables window shows incorrect frame
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-24 00:42 UTC by djlewis
Modified: 2011-01-28 20:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description djlewis 2010-09-24 00:42:54 UTC
When stopped at a breakpoint in a block that calls an iterator, the variables window shows the frame of the iterator, not the calling block which contains the breakpoint. This (otherwise pointless) code reproduces it:

  class Huh

    def initialize
      each_sorted( %w{cat elk dog bee ant}) do |w|
        x = w
        y = 0
      end
    end
  
    def each_sorted( s)
      s2 = s.sort
      s2.each {|str| yield str}
    end

  end

h = Huh.new

Set a breakpoint on "y = 0" in initialize. When it stops there, the variables window shows the frame of the iterator, each_sorted, with s, s2 and str, rather than the frame of the calling proc, initialize, which would show w and x.

This seems wrong and is quite a hindrance in debugging. I can get the right frame by going down the call stack two frames to the call of each_sorted in initialize, but that's a nuisance.  I don't believe it worked this way last time I used NB/ruby (6.5 or 6.7, I think).
Comment 1 djlewis 2010-09-24 02:06:54 UTC
Note -- this only occurs with the native ruby platform, 1.9.2, not with JRuby.
Comment 2 djlewis 2010-09-24 11:55:17 UTC
Also, going to a different stack frame does not really solve the problem, as it does not show variables local to the iterated block itself.