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)
Hi Guys, I have not abandoned my commitment. So far i have isolated the 2 problems but within the blog/rails context:
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