Project

General

Profile

Actions

Feature #21454

closed

"undefined method 'break' for an instance of Binding"

Added by vo.x (Vit Ondruch) 24 days ago. Updated 11 days ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:122610]

Description

Running my code with rdbg and using binding.break, it is a bit unfortunate that subsequently running the code without rdbg, it fails with error such as:

     NoMethodError:
       undefined method 'break' for an instance of Binding

Could this method become no-op if the rdbg is not loaded? If there was some concern about this, then it could print some helpful warning or what not.

Updated by nobu (Nobuyoshi Nakada) 11 days ago

Use no-dbg.rb with RUBYOPT=-rno-dbg when you run without rdbg.

class Binding
  def break = nil
end

Updated by ko1 (Koichi Sasada) 11 days ago ยท Edited

  • Status changed from Open to Feedback

In today's dev meeting, we emphasized that it's important to ensure binding.break (or debugger) is removed before release, so having it as a no-op is a bad idea.


BTW debug.gem supports specifying breakpoints by adding environment variables for example, and you can ignore them without rdbg.
However, specifying the file and line number is difficult, so I think good editor support would improve the situation.

Updated by vo.x (Vit Ondruch) 11 days ago

nobu (Nobuyoshi Nakada) wrote in #note-1:

Use no-dbg.rb with RUBYOPT=-rno-dbg when you run without rdbg.

class Binding
  def break = nil
end

Interesting idea. Assuming that I should request this feature in rdbg project.

BTW debug.gem supports specifying breakpoints by adding environment variables for example, and you can ignore them without rdbg.

Sorry, could you please elaborate? Maybe share some example?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0