What did you do?
I enabled Freezolite in a Rails app using Bootsnap and attempted to debug the Rails server with RubyMine.
I tried normal IDE gutter breakpoints in application code while serving a request that definitely executed that
code. I also tried moving require "freezolite/auto" from early boot to after Bundler.require(...), but the
debugger behavior did not change.
To narrow it down, I verified that:
- RubyMine/debase had attached to the server process.
- Pause worked.
- Exception breakpoints worked.
- The configured line breakpoint was registered and considered valid.
- The file path matched the method
source_location.
- A broad manual
TracePoint.new(:line) for the same file/line did fire.
- Removing Freezolite resolved the issue.
What did you expect to happen?
RubyMine/debase line breakpoints should stop execution when the Rails server executes the matching application code.
What actually happened?
RubyMine attached to the Rails server process, but normal IDE gutter breakpoints in application code did not stop execution.
The server continued to run and serve requests. The debugger was not completely broken: pause worked, exception breakpoints worked, and debugging specs still worked. The failure seemed isolated to normal line breakpoints in the Rails server process.
The interesting part is that a broad manual Ruby TracePoint(:line) did fire for the same file/line, but the IDE/
debase targeted breakpoint did not.
Additional context
From looking at Freezolite’s implementation, this does not seem like a simple line-number offset from inserting # frozen_string_literal: true. In the normal mode I was using, Freezolite appears to install RequireHooks wrappers and temporarily change RubyVM::InstructionSequence.compile_option around file loads.
Since debase line breakpoints target specific RubyVM::InstructionSequence objects, my suspicion is that there is an interaction between Freezolite/RequireHooks/Bootsnap and the instruction sequences debase attaches breakpoints to.
I was not using Freezolite’s experimental constant-freezing/source-transform mode.
Environment
Ruby Version: 3.4.9
Framework Version (Rails, whatever): Rails app using Bootsnap
Freeze The Lits Version: Freezolite 0.7.0
Sample Project
https://github.com/jbaxendale-ut/freezolite-debug
What did you do?
I enabled Freezolite in a Rails app using Bootsnap and attempted to debug the Rails server with RubyMine.
I tried normal IDE gutter breakpoints in application code while serving a request that definitely executed that
code. I also tried moving
require "freezolite/auto"from early boot to afterBundler.require(...), but thedebugger behavior did not change.
To narrow it down, I verified that:
source_location.TracePoint.new(:line)for the same file/line did fire.What did you expect to happen?
RubyMine/debase line breakpoints should stop execution when the Rails server executes the matching application code.
What actually happened?
RubyMine attached to the Rails server process, but normal IDE gutter breakpoints in application code did not stop execution.
The server continued to run and serve requests. The debugger was not completely broken: pause worked, exception breakpoints worked, and debugging specs still worked. The failure seemed isolated to normal line breakpoints in the Rails server process.
The interesting part is that a broad manual Ruby
TracePoint(:line)did fire for the same file/line, but the IDE/debase targeted breakpoint did not.
Additional context
From looking at Freezolite’s implementation, this does not seem like a simple line-number offset from inserting
# frozen_string_literal: true. In the normal mode I was using, Freezolite appears to installRequireHookswrappers and temporarily changeRubyVM::InstructionSequence.compile_optionaround file loads.Since debase line breakpoints target specific
RubyVM::InstructionSequenceobjects, my suspicion is that there is an interaction between Freezolite/RequireHooks/Bootsnap and the instruction sequences debase attaches breakpoints to.I was not using Freezolite’s experimental constant-freezing/source-transform mode.
Environment
Ruby Version: 3.4.9
Framework Version (Rails, whatever): Rails app using Bootsnap
Freeze The Lits Version: Freezolite 0.7.0
Sample Project
https://github.com/jbaxendale-ut/freezolite-debug