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 181929 - Ruby debugger incorrectly updates a hash (assoc. array)
Summary: Ruby debugger incorrectly updates a hash (assoc. array)
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-12 10:21 UTC by peterkehl
Modified: 2011-01-28 20:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot of how the Variables presents the hash incorrectly (57.56 KB, application/pdf)
2010-03-12 10:21 UTC, peterkehl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description peterkehl 2010-03-12 10:21:39 UTC
Created attachment 95100 [details]
screenshot of how the Variables presents the hash incorrectly

A simple Ruby program. It creates a hash (assoc. array), and it adds 2 entries to the hash. Both entries have value 'true' but different keys. After adding the 1st entry with key=0 the Variables debugger view shows the entry correctly. But after adding the 2nd entry with key=1 the Variables view shows the hash incorrectly - it shows 2 entries, both with same key '1'.

Ruby actually works fine, because when I print the hash in a loop, it shows up correctly.

If I use a string (for example 'cuckoo') as a value instead of true, then Variables view works fine.
-------------------
hash= Hash.new
# When debugging the following lines,
# You get the same behaviour when you use string keys instead of numbers.
hash[0]= true
hash[1]= true
hash[0]= true
# If you use strings as values instead of true, then debugging works correctly:
#hash[0]= 'cuckoo'
#hash[1]= 'cuckoo'
#hash[0]= 'cuckoo'

hash.each do |key, value|
    $stderr.print key.to_s+ " => " +value.to_s+ "\n"
end
-------------------

I'm using the native Ruby, not JRuby, with fast debugger gem.
Ruby 1.8.6-p287

Product Version: NetBeans IDE 6.8 (Build 200912041610)
Java: 1.5.0_22; Java HotSpot(TM) Client VM 1.5.0_22-147
System: Mac OS X version 10.5.8 running on i386

debugger gems:
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.9)