ruby-debug / ruby-debug-ide

An interface which glues ruby-debug to IDEs like Eclipse (RDT), NetBeans and RubyMine.
https://www.jetbrains.com/ruby/features/ruby_debugger.html
Other
371 stars 83 forks source link

Rubymine breakpoints no longer working after upgrading Ruby to 2.5.0 #139

Closed gillisd closed 6 years ago

gillisd commented 6 years ago

My debugger is no longer breaking at breakpoints in RubyMine 2017.3.3 after upgrading to Ruby 2.5.0. I'm using v0.6.1 of this gem. I've also tried v0.7.0.beta3 and v0.7.0.beta2, which cause the rails server to time out.

gillisd commented 6 years ago

Looks like bootsnap was the culprit. Got things working now after commenting it out.

matthaliski commented 6 years ago

Yup, Bootsnap seems to bork it. Breakpoints would work in views for me, but nothing else. But what if you want to take advantage of Bootsnap and have the Rubymine debugger work?

In Rubymine:

  1. Click Run > Debug
  2. Choose Edit configurations
  3. Add an ENV['DEBUG_MODE'] variable that gets applied when the debugger boots Rails

image

  1. Edit your boot.rb file:
    require 'bootsnap/setup' unless ENV['DEBUG_MODE']
  2. Be happy

Now, if you boot Rails in plain old development mode you get to leverage Bootsnap. However, it's going to get disabled if you boot with the debugger.

Hope this helps someone.

ViugiNick commented 6 years ago

@gillisd @matthaliski There is a fix that allows you to save the performance benefits https://youtrack.jetbrains.com/issue/RUBY-20684

GeorgeKaraszi commented 6 years ago

Here's what I use as a more universal way of preventing bootsnap from loading during a debug session.

boot.rb require "bootsnap/setup" unless ENV["RUBYLIB"]&.match?(/ruby-debug-ide/)

matthaliski commented 6 years ago

@GeorgeKaraszi solution is cool too (assuming they don't change the name or switch debugging gems 😉)

ViugiNick commented 6 years ago

@gillisd @matthaliski could you please try the proposed solution of the problem(https://youtrack.jetbrains.com/issue/RUBY-20684), it seems to me that it is slightly better becouse it allows to remain bootnap's benefits

ViugiNick commented 6 years ago

@gillisd @matthaliski But you can add something like Debugger.mp_load_iseq if ENV['DEBUG_MODE'] in your boot.rb