0
@@ -57,15 +57,6 @@ ARGV.options do |opts|
0
"Show this help message."
0
- opts.on("-v", "--version",
0
- "Display the version information."
0
- puts id.sub("Id: ", "")
0
- puts "(Breakpoint::Version = #{Breakpoint::Version})"
0
@@ -77,60 +68,6 @@ trap("INT"){$running = false}
0
puts "Waiting for initial breakpoint..."
0
- def breakpoint_handler(workspace, message)
0
- IRB.start(nil, nil, workspace)
0
- puts "", "Resumed execution. Waiting for next breakpoint...", ""
0
- def eval_handler(code)
0
- result = eval(code, TOPLEVEL_BINDING)
0
- def collision_handler()
0
- " *** Breakpoint service collision ***",
0
- " Another Breakpoint service tried to use the",
0
- " port already occupied by this one. It will",
0
- " keep waiting until this Breakpoint service",
0
- " If you are using the Breakpoint library for",
0
- " debugging a Rails or other CGI application",
0
- " this likely means that this Breakpoint",
0
- " session belongs to an earlier, outdated",
0
- " request and should be shut down via 'exit'."
0
- if RUBY_PLATFORM["win"] then
0
- # This sucks. Sorry, I'm not doing this because
0
- # I like funky message boxes -- I need to do this
0
- # because on Windows I have no way of displaying
0
- # my notification via puts() when gets() is still
0
- # being performed on STDIN. I have not found a
0
- root = TkRoot.new { withdraw }
0
- Tk.messageBox('message' => msg, 'type' => 'ok')
0
DRb.start_service(options[:ClientURI])
0
@@ -153,9 +90,55 @@ loop do
0
- service.eval_handler = Handlers.method(:eval_handler)
0
- service.collision_handler = Handlers.method(:collision_handler)
0
- service.handler = Handlers.method(:breakpoint_handler)
0
+ service.register_eval_handler do |code|
0
+ result = eval(code, TOPLEVEL_BINDING)
0
+ service.register_collision_handler do
0
+ " *** Breakpoint service collision ***",
0
+ " Another Breakpoint service tried to use the",
0
+ " port already occupied by this one. It will",
0
+ " keep waiting until this Breakpoint service",
0
+ " If you are using the Breakpoint library for",
0
+ " debugging a Rails or other CGI application",
0
+ " this likely means that this Breakpoint",
0
+ " session belongs to an earlier, outdated",
0
+ " request and should be shut down via 'exit'."
0
+ if RUBY_PLATFORM["win"] then
0
+ # This sucks. Sorry, I'm not doing this because
0
+ # I like funky message boxes -- I need to do this
0
+ # because on Windows I have no way of displaying
0
+ # my notification via puts() when gets() is still
0
+ # being performed on STDIN. I have not found a
0
+ root = TkRoot.new { withdraw }
0
+ Tk.messageBox('message' => msg, 'type' => 'ok')
0
+ service.register_handler do |workspace, message|
0
+ IRB.start(nil, nil, workspace)
0
+ puts "", "Resumed execution. Waiting for next breakpoint...", ""
0
puts "Connection established. Waiting for breakpoint...", "" if options[:Verbose]
0
@@ -170,9 +153,7 @@ loop do
0
- service.eval_handler = nil
0
- service.collision_handler = nil
0
+ service.unregister_handler
0
rescue Exception => error
Comments
No one has commented yet.