cldwalker/debugger — pull request #34 by FooBarWidget (2012-07-14 08:36:17+00:00)
Title: Add ability to query the command and control port when starting remote debugging

This patch allows one to start remote debugging on random available TCP ports and to query the ports that the OS has chosen. I need it in Phusion Passenger where there are multiple (constantly changing number of) background processes with no console.

Usage is something like this:

Debugger.start_remote('127.0.0.1', [0, 0])
write_to_log_file("#{Debugger.cmd_port}, #{Debugger.ctrl_port}")
Debugger.start

A similar patch was olso submitted to the original ruby-debug 2 years ago: http://rubyforge.org/tracker/index.php?func=detail&aid=27889&group_id=1900&atid=7438