Debugger watch reports nil for variable with value false
Running the following code in the debugger:
a = false
if (a.nil?)
puts "debugger thinks a is nil"
end
puts a
and setting a breakpoint at the if statement, the Variables pane reports 'a' as nil. Adding a watch for 'a' also reports nil.
On the other hand, a.class reports FalseClass, and the code inside the if block is not executed, so clearly a is not actually nil, confirmed by the final puts.
Not trying to nitpick, just confused at this sometimes misleading behavior. Is it a bug or is it me?
Please sign in to leave a comment.
Hi Alan,
It seems like it's a bug of rdebug-ide gem. Have you tried command line debugger in this case?
Regards,
Oleg
I've just checked it with command line debugger and everything works fine, thus it's a bug of rdebug-ide.
Regards,
Oleg
isn't it possible to hack that -ide so RM show values correctly?
for folks like me it completelly equal what gems or other stuff do you use -- I see in debug panel "nil" so I think it is nil while it is "false"
go ahead -- fix it)
We are already aware of this problem and investigating it, so probably expect fixes soon.
Regards,
Oleg