diff --git a/README.md b/README.md index d0522d6..0125c3b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,32 @@ -[gem]: https://rubygems.org/gems/ruby-debug-ide -# ruby-debug-ide -An interface which glues ruby-debug to IDEs like Eclipse (RDT), NetBeans and RubyMine. - [![official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) [![Gem Version](https://badge.fury.io/rb/ruby-debug-ide.svg)][gem] [![Build Status](https://travis-ci.org/ruby-debug/ruby-debug-ide.svg?branch=master)](https://travis-ci.org/ruby-debug/ruby-debug-ide) + +[gem]: https://rubygems.org/gems/ruby-debug-ide +# ruby-debug-ide + +The 'ruby-debug-ide' gem provides the protocol to establish communication between the debugger engine (such as [debase](https://rubygems.org/gems/debase) or [ruby-debug-base](https://rubygems.org/gems/ruby-debug-base)) and IDEs (for example, RubyMine, Visual Studio Code, or Eclipse). 'ruby-debug-ide' redirect commands from the IDE to the debugger engine. Then, it returns answers/events received from the debugger engine to the IDE. To learn more about a communication protocol, see the following document: [ruby-debug-ide protocol](protocol-spec.md). + +## Install debugging gems +Depending on the used Ruby version, you need to add/install the following debugging gems to the Gemfile: +- Ruby 2.x - [ruby-debug-ide](https://rubygems.org/gems/ruby-debug-ide) and [debase](https://rubygems.org/gems/debase) +- Ruby 1.9.x - [ruby-debug-ide](https://rubygems.org/gems/ruby-debug-ide) and [ruby-debug-base19x](https://rubygems.org/gems/ruby-debug-base19x) +- jRuby or Ruby 1.8.x - [ruby-debug-ide](https://rubygems.org/gems/ruby-debug-ide) and [ruby-debug-base](https://rubygems.org/gems/ruby-debug-base) +> For Windows, make sure that the Ruby [DevKit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit) is installed. + +## Start debugging session +To start the debugging session for a Rails application, run the following command: +```shell +rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 1234 -- bin/rails s +``` +If you want to debug a Rails application run using Docker Compose, you need to start the Rails server from the Docker in the following way: +```yaml +command: bundle exec rdebug-ide --host 0.0.0.0 --port 1234 -- bin/rails s -p 3000 -b 0.0.0.0 +volumes: + - .:/sample_rails_app +ports: + - "1234:1234" + - "3000:3000" + - "26162:26162" +``` +Note that all ports above should be exposed in the Dockerfile. \ No newline at end of file diff --git a/protocol-spec.md b/protocol-spec.md new file mode 100644 index 0000000..b6f42c0 --- /dev/null +++ b/protocol-spec.md @@ -0,0 +1,406 @@ +ruby-debug-ide protocol +======================= + +* * * + +Next: [Summary](#Summary), Previous: [(dir)](#dir), Up: [(dir)](#dir) + +_ruby-debug-ide_ protocol +------------------------- + +This file contains specification of the protocol used by _ruby-debug-ide_. + +* [Summary](#Summary) +* [Specification](#Specification) +* [Changes](#Changes) + +* * * + +Next: [Specification](#Specification), Previous: [Top](#Top), Up: [Top](#Top) + +1 Summary +--------- + +This document describes protocol used by _ruby-debug-ide_ for communication between debugger engine and a frontend. It is a work in progress and might, and very likely will, change in the future. If you have any comments or questions please [send me](mailto:martin.krauskopf@gmail.com) an email. + +The communication has two parts/sides. First ones are _commands_ sent from a frontend to the debugger engine and the second is the opposite way, _answers_ and _events_ sent from the debugger engine to the frontend. + +_commands_ are almost the same as the ones used by CLI ruby-debug. So you might want to contact [the _ruby-debug-ide_ document](http://bashdb.sourceforge.net/ruby-debug.html). + +_answers_ and _events_ are sent in XML format described in the specification [below](#Specification). + +**Specification is far from complete.** Will be completed as time permits. In the meantime, source code is always the best spec. + +* * * + +Next: [Changes](#Changes), Previous: [Summary](#Summary), Up: [Top](#Top) + +2 Specification +--------------- + +* [Commands](#Commands) +* [Events](#Events) + +Terms: + +* _Command_ is what frontend sends to the debugger engine +* _Answer_ is what debugger engine sends back to the frontend +* _Example_ shows simple example + +* * * + +Next: [Events](#Events), Up: [Specification](#Specification) + +### 2.1 Commands + +* [Adding Breakpoint](#Adding-Breakpoint) +* [Deleting Breakpoint](#Deleting-Breakpoint) +* [Enabling Breakpoint](#Enabling-Breakpoint) +* [Disabling Breakpoint](#Disabling-Breakpoint) +* [Condition](#Condition) +* [Catchpoint](#Catchpoint) +* [Threads](#Threads) +* [Frames](#Frames) +* [Variables](#Variables) + +* * * + +Next: [Deleting Breakpoint](#Deleting-Breakpoint), Up: [Commands](#Commands) + +#### 2.1.1 Adding Breakpoint + +Command: + + break