lib/debug/session.rb in debug-1.0.0.alpha0 vs lib/debug/session.rb in debug-1.0.0.alpha1
- old
+ new
@@ -80,16 +80,15 @@
end
end
end
@management_threads = [@session_server]
+ @management_threads << @ui.reader_thread if @ui.respond_to? :reader_thread
setup_threads
end
- attr_reader :management_threads
-
def source path
@sr.get(path)
end
def inspect
@@ -592,7 +591,21 @@
::DEBUGGER__::SESSION.add_line_breakpoint file, line, if_not_given ? nil : binding.local_variable_get(:if)
end
def self.add_catch_breakpoint pat
::DEBUGGER__::SESSION.add_catch_breakpoint pat
+ end
+
+ class << self
+ define_method :initialize_session do |ui|
+ ::DEBUGGER__.const_set(:SESSION, Session.new(ui))
+
+ # default breakpoints
+ ::DEBUGGER__.add_catch_breakpoint 'RuntimeError'
+
+ Binding.module_eval do
+ ::DEBUGGER__.add_line_breakpoint __FILE__, __LINE__ + 1
+ def bp; nil; end
+ end
+ end
end
end