byebug: debugger hangs at eval statement

I’m trying to see how Rails at ``startup time’’ creates Javascripts within the Clientside of the browser.

rails s #starting my program

I’ve used both Byebug within Ruby code and Firefoxe’s debugger within the browser. ==> Firefox’s debug shows me the generated scripts like jquery etc but this is after the fact: the code producing the scripts has already executed. I want to observe how/when it generates the script and how various callbacks are registered particularly in jquery. Eg plot function using flot.

==> Byebug stops when the Ruby code does an eval expression when tracing from config/application.rb: I used byebug’s set linetrace to observe the following: Tracing: /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:33 options = {} Tracing: /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:34 if config =~ /.ru$/ Tracing: /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:35 cfgfile = ::File.read(config) Tracing: /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:36 if cfgfile[/^#(.)/] && opts Tracing: /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:39 cfgfile.sub!(/^END\n.\Z/m, ‘’) Tracing: /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:40 app = new_from_string cfgfile, config Tracing: /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49 eval “Rack::Builder.new {\n” + builder_script + “\n}.to_app”, Tracing: /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49 eval “Rack::Builder.new {\n” + builder_script + “\n}.to_app”,

where the eval statement just sits and waits. At that point I had to abort the program at startup using Cntl C

Other Eval statements like the above has the same behavior.

Is there a work around? so that I can continue viewing the source code’s execution paths? Or is it more of a hit-miss with avoidance attempts to Eval statements to continue debugging? Thank you for considering this. Dave

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Comments: 37 (18 by maintainers)

Most upvoted comments

Hi Guys, I have not abandoned my commitment. So far i have isolated the 2 problems but within the blog/rails context:

  1. linetrace on stops at eval statement — looks like output device capacity or context capacity blocking the linetrace’s outputing source lines and continuing blog’s execution. By placing linetrace off before the eval statement, program behaves well and continues to its browser wait loop
  2. linetrace outputs blocks the blog’s stderr device logging its own messages. When linetrace turned off between 2 of blog’s messages, it re-establishes blog’s stderr device to output its messages

I am exploring dtrace to determine a reduced context as per Kakashi Kokubun’s request.

Apple’s detour: El Capitan’s SID I develop on a Mac and have its latest OS running. El Captitan now uses digital signatures and blocks certain directories/programs like dtrace to run against /usr/local … programs etc.

I am currently looking at a work around to see where dtrace exploration takes me. Will keep u posted. Dave

On May 16, 2016, at 6:53 PM, Takashi Kokubun notifications@github.com wrote:

I admit that some issue may exist in the combination of rack, webrick, rails and byebug. But the scope is too large and personally I have no time to do such hard investigation. Could you investigate it further and provide minimal code to reproduce the two issues? I mean, ideally the issue report to byebug should not include WEBrick, Rack and config/* of Rails.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub