These are chat archives for deivid-rodriguez/byebug

28th
Oct 2015
Oleg Sukhodolsky
@os97673
Oct 28 2015 05:29
@deivid-rodriguez the problem for debugger is that it incorrectly count stack size and stops in the wrong place, so the test should do something like
stop at some point, do step over (I believe this is next in byebug's terms)
and stops in wrong place
the code should be something like
class A
  define_method "method1" do
    return 1
  end

  def foo
    method1 # suspect we may stop here instead
  end
end
A.new.foo # breakpoint (stops here)
puts '1' # after step over should should stop here
Oleg Sukhodolsky
@os97673
Oct 28 2015 05:36
I have not tried but hope it illustrates the idea
David Rodríguez
@deivid-rodriguez
Oct 28 2015 08:43
yes, that's what I've been trying but I haven't found a failing test case. I know it involves define_method but it's definitely not that simple. Your example passes against all supported versions in byebug.
Oleg Sukhodolsky
@os97673
Oct 28 2015 12:34
Perhaps you need add more code in foo after method1 call, to have line event to stop at.
If this doesn't work could you please create a branch with the test and I will play with it.
David Rodríguez
@deivid-rodriguez
Oct 28 2015 14:03
@os97673 Your suggestion worked! Thanks!
But now there's one concern. I thought it was a regression in 2.2.3 that didn't affect 2.1, but it fails in 2.1 too. In that case, we would need to ask for a backport. Can you confirm?
David Rodríguez
@deivid-rodriguez
Oct 28 2015 14:09
Oleg Sukhodolsky
@os97673
Oct 28 2015 15:03
I have never tested it with 2.1 because user has not complained about it :)
And, unfortunately, I don't have test for this :(