Execution Continues After Exception Occurs In Evaluator

已回答

While debugging a script, if I evaluate an expression in the Evaluator window, and the expression throws an exception, then script execution continues.  I would expect the script to remain at the debug point.  Is there a setting I can toggle somewhere to fix this?

An example exception: my_variable is NOT defined.  If I execute puts my_variable in the evaluator, the expression fails as expected; but then script execution continues, which is not expected.

This issue began to show up after I upgraded from jruby 9.3.4.0 to jruby 9.4.0.0.

I am using RubyMine 2022.3.1.

0

Hello,

I tried to reproduce it in RubyMine 2022.3.1 with the same jruby-9.4.0.0, but didn't manage to. Here's the sample code I used

p 'begin'
my_variable # breakpoint here
p 'continue after exception'

So I stopped on the breakpoint and tried to evaluate `my_variable`, but the debugger didn't resume, just showed that the variable is undefined.

My debug gems were ruby-debug-ide 0.7.3 + ruby-debug-base 0.10.7. Please let me know if your steps were the same.

0

Thanks for your reply.

I have one difference in my code, using the example you provided. I try to print my_variable to console, and run that line in the evaluator:

p 'begin'
p my_variable # breakpoint here
p 'continue after exception'

I also noticed that 'continue after exception' was not printed out, but instead the exception and stacktrace were output, and execution stopped as in a failure.  Here is the output:

C:/jruby-9.4.0.0/bin/jruby.exe -x C:\jruby-9.4.0.0\bin\bundle exec C:\jruby-9.4.0.0\bin\jruby.exe -X+O -J-Djruby.compile.mode=OFF -J-Djruby.debug.fullTrace=true C:\jruby-9.4.0.0\lib\ruby\gems\shared\gems\ruby-debug-ide-0.7.3\bin\rdebug-ide --key-value --disable-int-handler --evaluation-timeout 60 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port #{int value} --host 0.0.0.0 --dispatcher-port #{int value} -- C:/path/to/file/script.rb
Evaluation memory limit is ineffective in JRuby and MRI < 2.0
Fast Debugger (ruby-debug-ide 0.7.3, ruby-debug-base 0.11.0, file filtering is supported) listens on 0.0.0.0:52078
"begin"
Uncaught exception: undefined local variable or method `my_variable' for main:Object
      C:/path/to/file/script.rb:2:in `<main>'
        org/jruby/debug/RubyDebugger.java:209:in `debug_load'
      C:\jruby-9.4.0.0\lib\ruby\gems\shared\gems\ruby-debug-ide-0.7.3\bin\rdebug-ide:193:in `<main>'

Process finished with exit code 0

 

0

I tried the same, but in the evaluation console I placed `my_variable` only. Would it be possible to record a screencast showing your steps?

0

Oh I see, in the evaluation console, you have to put `p my_variable`.  Let me know if that changes anything.  If not, I will look into recording a screencast.

0

Yes, the result is the same, but it stops if I expand the node with the result. Is it what you're doing?

0

Here are some screenshots of before and after I click "Evaluate". I am on Windows.

Before:

 

After:

0

Voted, thank you!

0

Olga Kuvardina Looks like upgrading to jruby 9.4.1.0 fixes the issue

0

请先登录再写评论。