Closed tompng closed 1 month ago
Debug evaluates code in frame.eval_binding, not frame.binding
frame.eval_binding
frame.binding
irb(main):001> debug irb:rdbg(main):002> tc = DEBUGGER__::SESSION.instance_variable_get(:@tc) #<DBG:TC 1:running@a.rb:1:in `<main>'> irb:rdbg(main):003> foobar = 1 1 irb:rdbg(main):004> tc.current_frame.binding.local_variables [:_] irb:rdbg(main):005> tc.current_frame.eval_binding.local_variables [:foobar, :tc, :_]
Fixes this command and colorization bug. (left: master branch, right: this pull request)
eval_binding is added in debug-1.0.0.rc1 https://github.com/ruby/debug/commit/4c873939864ef650cd135ba1fb1bd7fe123f27ac,
eval_binding
Debug evaluates code in
frame.eval_binding
, notframe.binding
Fixes this command and colorization bug. (left: master branch, right: this pull request)
eval_binding
is added in debug-1.0.0.rc1 https://github.com/ruby/debug/commit/4c873939864ef650cd135ba1fb1bd7fe123f27ac,