Module: Debugger
- Defined in:
- lib/ruby-debug.rb,
lib/ruby-debug/command.rb,
lib/ruby-debug/interface.rb,
lib/ruby-debug/processor.rb,
lib/ruby-debug/xml_printer.rb,
lib/ruby-debug/commands/eval.rb,
lib/ruby-debug/commands/load.rb,
lib/ruby-debug/commands/frame.rb,
lib/ruby-debug/event_processor.rb,
lib/ruby-debug/commands/control.rb,
lib/ruby-debug/commands/inspect.rb,
lib/ruby-debug/commands/threads.rb,
lib/ruby-debug/commands/stepping.rb,
lib/ruby-debug/commands/variables.rb,
lib/ruby-debug/commands/catchpoint.rb,
lib/ruby-debug/commands/breakpoints.rb
Defined Under Namespace
Modules: FrameFunctions, Kernel Classes: AddBreakpoint, BreakpointsCommand, CatchCommand, Command, Context, ContinueCommand, ControlCommandProcessor, ControlState, DeleteBreakpointCommand, DownCommand, EvalCommand, EventProcessor, Exception, FinishCommand, FrameCommand, InspectCommand, InterruptCommand, LoadCommand, LocalInterface, NextCommand, PPCommand, QuitCommand, RemoteInterface, RestartCommand, ScriptInterface, StartCommand, State, StepCommand, ThreadCurrentCommand, ThreadListCommand, ThreadResumeCommand, ThreadStopCommand, ThreadSwitchCommand, UpCommand, VarConstantCommand, VarGlobalCommand, VarInstanceCommand, VarLocalCommand, WhereCommand, XmlPrinter
Class Attribute Summary collapse
-
.control_thread ⇒ Object
readonly
Returns the value of attribute control_thread.
-
.is_debug ⇒ Object
Returns the value of attribute is_debug.
-
.processor ⇒ Object
Returns the value of attribute processor.
Class Method Summary collapse
-
.interrupt ⇒ Object
Interrupts the current thread.
-
.interrupt_last ⇒ Object
Interrupts the last debugged thread.
- .main(host, port) ⇒ Object
- .run_prog_script ⇒ Object
- .start_control(host, port) ⇒ Object
Class Attribute Details
.control_thread ⇒ Object (readonly)
Returns the value of attribute control_thread.
42 43 44 |
# File 'lib/ruby-debug.rb', line 42 def control_thread @control_thread end |
.is_debug ⇒ Object
Returns the value of attribute is_debug.
41 42 43 |
# File 'lib/ruby-debug.rb', line 41 def is_debug @is_debug end |
.processor ⇒ Object
Returns the value of attribute processor.
41 42 43 |
# File 'lib/ruby-debug.rb', line 41 def processor @processor end |
Class Method Details
.interrupt ⇒ Object
Interrupts the current thread
47 48 49 |
# File 'lib/ruby-debug.rb', line 47 def interrupt current_context.interrupt end |
.interrupt_last ⇒ Object
Interrupts the last debugged thread
54 55 56 57 58 59 60 61 62 |
# File 'lib/ruby-debug.rb', line 54 def interrupt_last skip do if context = last_context return nil unless context.thread.alive? context.interrupt end context end end |
.main(host, port) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/ruby-debug.rb', line 64 def main(host, port) return if started? start start_control(host, port) @mutex = Mutex.new @proceed = ConditionVariable.new # wait for start command @mutex.synchronize do @proceed.wait(@mutex) end debug_load Debugger::PROG_SCRIPT end |
.run_prog_script ⇒ Object
82 83 84 85 86 |
# File 'lib/ruby-debug.rb', line 82 def run_prog_script @mutex.synchronize do @proceed.signal end end |
.start_control(host, port) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/ruby-debug.rb', line 88 def start_control(host, port) raise "Debugger is not started" unless started? return if @control_thread @control_thread = DebugThread.new do server = TCPServer.new(host, port) while (session = server.accept) begin interface = RemoteInterface.new(session) @processor = EventProcessor.new(interface) processor = ControlCommandProcessor.new(interface) processor.process_commands rescue StandardError, ScriptError => ex puts ex end end end end |