Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-debug-base.rb

Instance Method Summary collapse

Instance Method Details

#debug_method(meth) ⇒ Object

Wraps the meth method with Debugger.start … block.



274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/ruby-debug-base.rb', line 274

def debug_method(meth)
  old_meth = "__debugee_#{meth}"
  old_meth = "#{$1}_set" if old_meth =~ /^(.+)=$/
  alias_method old_meth.to_sym, meth
  class_eval "  def \#{meth}(*args, &block)\n    Debugger.start do\n      debugger 2\n      \#{old_meth}(*args, &block)\n    end\n  end\n  EOD\nend\n"

#post_mortem_method(meth) ⇒ Object

Wraps the meth method with Debugger.post_mortem … block.



291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/ruby-debug-base.rb', line 291

def post_mortem_method(meth)
  old_meth = "__postmortem_#{meth}"
  old_meth = "#{$1}_set" if old_meth =~ /^(.+)=$/
  alias_method old_meth.to_sym, meth
  class_eval "  def \#{meth}(*args, &block)\n    Debugger.start do |dbg|\n      dbg.post_mortem do\n        \#{old_meth}(*args, &block)\n      end\n    end\n  end\n  EOD\nend\n"