Giter Club home page Giter Club logo

vim-ruby-debugger's Introduction

Disclaimer

This is a new version of the plugin, which uses debugger-xml gem, and works only with Ruby >= 1.9. If you want to use ruby-debug-ide gem and/or Ruby <= 1.8.7, you should check 'v1.0' branch (http://github.com/astashov/vim-ruby-debugger/tree/v1.0)

Description

This Vim plugin implements interactive Ruby debugger in Vim.

This version of the plugin works only with Ruby >= 1.9. It uses debugger-xml under the hood, which is just a XML/IDE extension for the debugger gem, which supports Ruby 1.9.2 and 1.9.3 out-of-the-box, but doesn't support Ruby <= 1.8.7.

Features

  1. It can debug any Ruby application (Rails, by default), debugger-xml gem
  2. The debugger looks like in any IDE - you can go through the code, watch variables, breakpoints in a separate window, set and remove breakpoints.
  3. It supports execution of commands in the context of stopped line. E.g., you can execute ':RdbEval User.all' in the Vim command line and it will display the results like usual echo Vim command.

Requirements

  1. Vim >= 7.0, compiled with +signs, +clientserver and +ruby. You can verify it by VIM command:

    :echo has("signs") && has("clientserver") && has("ruby") && v:version > 700
    

    It should show result '1'.

  2. debugger-xml gem.

  3. For OS X:

    The vim that ships with OS X does not use ruby, nor does it support --servername, so MacVim must be used.

    Make sure that both MacVim, and mvim are installed.

    If they are not, you can use homebrew (http://mxcl.github.com/homebrew/):

    brew install macvim
    

    This will install MacVim, along with the mvim command line utility.

Installation

  1. Clone the repo

    git clone git://github.com/astashov/vim-ruby-debugger.git
    

    or just download the archive from here:

    http://github.com/astashov/vim-ruby-debugger/tarball/master
    

    You will get the 'vim-ruby-debugger' dir with the plugin.

  2. Copy contents of the 'vim-ruby-debugger' dir to your ~/.vim/ (or to ~/.vim/bundle/vim-ruby-debugger if you use pathogen).

  3. Generate the local tags file

    :helptags ~/.vim/doc
    

    Now, you can use

    :help ruby-debugger
    

    to get help for the ruby-debugger plugin.

  4. If using MacVim:

    Modify your ~/.vimrc to add the following line:

    let g:ruby_debugger_progname = 'mvim'

Windows is not supported, sorry, Windows users.

Using

  1. Run Vim. If you use gvim/mvim, it will automatically start the server, but if you use vim, you need to set servername explicitly, e.g., vim --servername VIM

  2. Go to the directory with some your Rails application.

     :cd ~/projects/rails
    
  3. Run Server with Debugger:

     :Rdebugger
    

    It will run debugger-xml's rdebug-vim executable, create a UNIX socket in tmp directory, and connect to debugger-xml through it.

  4. Set a breakpoint somewhere by <Leader>b (e.g., '\b'). You should see 'xx' symbol at current line.

  5. Open a page with the breakpoint in a browser. Vim should automatically set the current line to the breakpoint.

  6. After this, you can use commands:

     <Leader>b - set breakpoint at current line
     <Leader>v - open/close window with variables. You can expand/collapse variables by 'o' in normal mode or left-mouse double-click
     <Leader>n - step over
     <Leader>s - step into
     <Leader>c - continue
    
  7. You may find useful to override default shortcut commands by F5-F8 shortcuts. Add these to your .vimrc:

      map <F7>  :call g:RubyDebugger.step()<CR>
      map <F5>  :call g:RubyDebugger.next()<CR>
      map <F8>  :call g:RubyDebugger.continue()<CR>
    

Testing

If you want to run tests, replace in /autoload directory ruby_debugger.vim to ruby_debugger.vim from additionals/autoload directory. And then, in command mode execute

     :call g:TU.run()

Screenshot

Screenshot

Thanks

Special thanks to tpope (for rails.vim) and Marty Grenfell (for NERDTree), mostly, I learn Vim Scripting from their projects.

vim-ruby-debugger's People

Contributors

antonwiklund99 avatar astashov avatar ecoffey avatar rweng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-ruby-debugger's Issues

Debugger doesn't seem to work when workling is being used.

Not sure if this is a bug or an FYI. My app makes use of workling and starling to do async processing. It seem some part of this debugger stack is doesn't work if a workling process is being used.

I started the debugger with :Rdebugger and set a breakpoint in a controller with \b, The line was highlighted in red. The ruby_debugger_log indicated the break point was set. I refreshed the web page, but the app didn't break at the breakpoint.

In my ruby_debugger_log:
cat ruby_debugger_log

2009/06/10 11:20:47 Start debugger
2009/06/10 11:21:38 Set breakpoint to: /home/scott/git/RepgenDataLoader/app/controllers/database_controller.rb:108
2009/06/10 11:21:56 Set breakpoint to: /home/scott/git/RepgenDataLoader/app/controllers/database_controller.rb:5

There must be some kind of workling incompatibility. I noticed this odd thing:
After I start the debugger netstat shows the debugger listening) (note that I modifed the debugger to listen on 39997 and 39998):
tcp 0 0 127.0.0.1:39997 0.0.0.0:* LISTEN 25586/ruby1.8
tcp 0 0 127.0.0.1:39998 0.0.0.0:* LISTEN 25589/ruby

After I stop the debugger using :RdbStop netstat shows this:
tcp 0 0 127.0.0.1:39997 0.0.0.0:* LISTEN 25634/workling

Workling seems to have take over the debugger port. Very strange.

I cannot start the debugger because workling is listening on the debugger port. No matter what port I start the debugger on this seems to happen. I need to kill the workling process.

When I don't start my workling/starling processes the debugger works fine.

ruby 1.9.2 + rvm + rails 3.0.7 + pathogen + macvim

Hi,

I'm unable to get this to work - it never stops on my breakpoints. It's not clear from the README what server to even use. :Rdebugger doesn't start a server. Trying :Rdebugger 'script/rails server' or :Rdebugger 'script/rails start' just results in E77: Too many file names.

How can I use this?

Thanks

$ which rdebug-ide
/Users/trevorhartman/.rvm/gems/ruby-1.9.2-p180/bin/rdebug-ide

$ which ruby
/Users/trevorhartman/.rvm/rubies/ruby-1.9.2-p180/bin/ruby

Fast Debugger (ruby-debug-ide 0.4.9) listens on :39767
  /Users/trevorhartman/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_load'
  /Users/trevorhartman/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_program'
  /Users/trevorhartman/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide:87:in `<top (required)>'
  /Users/trevorhartman/.rvm/gems/ruby-1.9.2-p180/bin/rdebug-ide:19:in `load'
  /Users/trevorhartman/.rvm/gems/ruby-1.9.2-p180/bin/rdebug-ide:19:in `<main>'
Uncaught exception: no such file to load -- script/server not found

debugger starts but webserver doesn't listen to 3000 under OsX

Hi,

I can't get the debugger working with MacVim (actual Snapshot 45) under OsX. Two processes are startet (see below), but webrick doesn't listen anywhere (at least where I was looking for it).

two ruby-processes:

fw 493 0.2 0,2 607008 6832 ?? S 4:44pm 0:02.49 ruby /Users/fw/.vim/bin/ruby_debugger.rb localhost 39767 39768 Vim VIM /Users/fw/.vim/tmp/ruby_debugger posix

fw 490 0.2 0,2 610664 10044 ?? S 4:44pm 0:02.87 /opt/local/bin/ruby /opt/local/bin/rdebug-ide -p 39767 -- script/server webrick

their open ports:

ruby 493 fw 7u IPv6 0x6ed8720 0t0 TCP localhost:49366->localhost:39767 (ESTABLISHED)
ruby 493 fw 8u IPv6 0x6ed8258 0t0 TCP localhost:39768 (LISTEN)

ruby 490 fw 7u IPv6 0x6ed7664 0t0 TCP *:39767 (LISTEN)
ruby 490 fw 8u IPv6 0x6ed84bc 0t0 TCP localhost:39767->localhost:49366 (ESTABLISHED)

with no port 3000 open.

the logfiles:

2009/06/26 16:43:55 Set breakpoint to: /Users/fw/devel/rwatch/app/views/rwatches/index.erb:12

2009/06/26 16:44:01 Start debugger

Fast Debugger (ruby-debug-ide 0.4.6) listens on :39767

-- Frank

ruby ~/.vim/bin/ruby_debugger.rb doesent start

I follow debug steps as was asked in issue 16 and found that
ruby ~/.vim/bin/ruby_debugger.rb doesent started.

ruby /home/antono/.vim/bin/ruby_debugger.rb 39767 39768 vim VIM /home/antono/.vim/tmp/ruby_debugger posix
/home/antono/.vim/bin/ruby_debugger.rb:38:in initialize': getaddrinfo: Servname not supported for ai_socktype (SocketError) from /home/antono/.vim/bin/ruby_debugger.rb:38:innew'
from /home/antono/.vim/bin/ruby_debugger.rb:38

cat /home/antono/.vim/tmp/ruby_debugger_{log,output}
2009/05/22 04:16:02 Start debugger
2009/05/22 04:16:12 Set breakpoint to: /home/antono/Projects/blogo.old/app/controllers/articles_controller.rb:9

netstat -tapn | grep -E ":39767|:39768"
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:39767 0.0.0.0:* LISTEN 12831/ruby1.8

ps aux | grep debug
antono 12831 0.2 0.5 20240 10516 pts/2 Sl+ 04:15 0:00 /usr/bin/ruby1.8 /var/lib/gems/1.8/bin/rdebug-ide -p 39767 -- script/server webrick
antono 13131 0.0 0.0 3336 808 pts/1 S+ 04:20 0:00 grep --color=auto debug

Infinit Window blinking on windows.

After running :Rdebugger my gvim window starts blinking.
Text editing area doesn't respond to any command. But upper GUI menu works fine.

The command line says: Loading Debugger...

current execution line is not highlighted

Hello!

I start vim with ' vim --servername VIM'
:cd <root_of_test_app>
:Rdebugger
Then I open test controller (:o app/controllers/test_controller.rb) and set breakpoint with \b. Breakpoint appears correctly.
When I run app it stops, if I type \c app runs again, so apparently breakpoint works. But I can't see current line mark.
Also variables window is empty, although there is one initialized before breakpoint

what have I missed?

cat ruby_debugger_log
2009/11/17 23:11:59 Killed server with pid: 25730
2009/11/17 23:11:59 Killed server with pid: 25733
2009/11/17 23:11:59 Start debugger
2009/11/17 23:12:07 Set breakpoint to: /root/test/app/controllers/test_controller.rb:5
2009/11/17 23:12:19 Toggling window with name: variables
2009/11/17 23:12:19 Opened window with name: variables
2009/11/17 23:12:19 Start displaying data in window with name: variables
2009/11/17 23:12:19 Set focus to window with name: variables
2009/11/17 23:12:19 Inserted data to window with name: variables
2009/11/17 23:12:19 Restored view of window with name: variables
2009/11/17 23:12:19 Complete displaying data in window with name: variables
2009/11/17 23:12:19 Opened variables window
2009/11/17 23:12:29 Toggling window with name: variables
2009/11/17 23:12:29 Set focus to window with name: variables
2009/11/17 23:12:29 Closed window with name: variables
2009/11/17 23:12:29 Opened variables window
2009/11/17 23:12:30 Toggling window with name: frames
2009/11/17 23:12:30 Opened window with name: frames
2009/11/17 23:12:30 Start displaying data in window with name: frames
2009/11/17 23:12:30 Set focus to window with name: frames
2009/11/17 23:12:30 Inserted data to window with name: frames
2009/11/17 23:12:30 Restored view of window with name: frames
2009/11/17 23:12:30 Complete displaying data in window with name: frames
2009/11/17 23:12:30 Opened frames window
2009/11/17 23:12:32 Toggling window with name: frames
2009/11/17 23:12:32 Set focus to window with name: frames
2009/11/17 23:12:32 Closed window with name: frames
2009/11/17 23:12:32 Opened frames window
2009/11/17 23:12:33 Toggling window with name: breakpoints
2009/11/17 23:12:33 Opened window with name: breakpoints
2009/11/17 23:12:33 Start displaying data in window with name: breakpoints
2009/11/17 23:12:33 Set focus to window with name: breakpoints
2009/11/17 23:12:33 Inserted data to window with name: breakpoints
2009/11/17 23:12:33 Restored view of window with name: breakpoints
2009/11/17 23:12:33 Complete displaying data in window with name: breakpoints
2009/11/17 23:12:33 Opened breakpoints window
2009/11/17 23:13:11 Continue

cat ruby_debugger_output
Fast Debugger (ruby-debug-ide 0.4.9) listens on :39767
=> Booting WEBrick
=> Rails 2.3.4 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2009-11-17 23:12:01] INFO WEBrick 1.3.1
[2009-11-17 23:12:01] INFO ruby 1.8.7 (2009-06-12) [x86_64-linux]
[2009-11-17 23:12:01] INFO WEBrick::HTTPServer#start: pid=28052 port=3000
SQL (0.1ms) SET NAMES 'utf8'
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0

Processing TestController#index (for 127.0.0.1 at 2009-11-17 23:12:13) [GET]
Completed in 58319ms (View: 5, DB: 0) | 200 OK [http://localhost/test]

Doesn't debug Sinatra app on OS X

I do precisely following:

  1. Open my sinatra app in MacVim. :pwd shows the right directory
  2. Run :Rdebugger sinatra_app.rb. Output says "Debugger started"
  3. Set a breakpoint
  4. Open up a browser, go to the page with a breakpoint and... the server is not running, so nothing happens.

Clearly debugger does not even start the app.

Work in Windows

Make sure the plugin works in WIndows. Find WIndows related issues.

Feature request: watch expression

This is not an issue, but a feature request. It would be great to have the ability to watch some expression, like 'params' or 'User.last' or "@my_attribute". Currently it is possible to evaluate them with RdbEval but it would be great to add some expressions to the watcher window like we can do in other IDEs like Netbeans and Rubymine.

Thank you for your excelent vim plugin.

Error, then clear all beackpoints

I have this error, then I try to clear all breackpoints ("\d")

E121: Неопределенная переменная: message
E116: Параметры для функции 211 заданы неверно
строка 2:
E716: Key not present in Dictionary: debugger_id
E15: Недопустимое выражение: 'delete ' . self.debugger_id
строка 3:
E121: Неопределенная переменная: message
E116: Параметры для функции 211 заданы неверно

What I do wrong?

Loading debugger... in Fedora 13 with Gvim

Hi,

I installed all required gems (ruby-debug-ide, ruby-debug), placed Vim files on right directories and after that I launched gvim and opened my Sinatra 1.0 server.rb file.
Then I started debugger using ':Rdebugger' and I got 'Loading debugger....' which is great but unfortunately this message stays here for a long time (about 2 minutes) and also my Vim looks 'blocked'. It possible to avoid this delay ? Maybe I missed some setting or some file.

can't detect rdebug-ide with lsof on Mac OS X

Please take a look at the following patch
http://pastebin.com/m3caabf6f

-    let pid = system("lsof -i 4tcp@" . a:bind . ':' . a:port . " | grep LISTEN 
+    if has("macunix")
+      let lsof = "lsof -i tcp:" . a:port
+    else
+      let lsof = "lsof -i 4tcp@" . a:bind . ':' . a:port
+    endif
+    let pid = system(lsof . " | grep LISTEN | awk '{print $2}'")

Update variables after next suspending, but don't recreate them

Now variables are destroyed after next/step/cont command and recreated after suspending on next breakpoint. So, after next suspending all variables are closed again. Need to save ids of opened variables and open them after next suspending (if they exists still) .

Directory with space bug

Directory name with script "Test project" and file test.rb
:Rdebugger test.rb hangs with "Loading debugger ..." because of string

let rdebug = 'rdebug-ide -p ' . self.rdebug_port . ' -- ' . script_name

produces broken output.

Ugly fix for this issue is to replace string with:

let rdebug = 'rdebug-ide -p ' . self.rdebug_port . ' -- ' . '''' . script_name . ''''

Добавить переменную отвечающую за скрипт по-умолчанию вместо 'script/server webrick'

https://github.com/astashov/vim-ruby-debugger/blob/master/autoload/ruby_debugger.vim#L437

let script_string = a:0 && !empty(a:1) ? a:1 : 'script/server webrick'

Было бы здорово сделать 'script/server webrick' какой-нибудь переменной, которую можно править в ~/.vimrc. Потому что, скажем, в моём случае 70% проектов -- Rails 3 и я бы поставил себе по-умолчанию 'script/rails s'.

Incompatible with Rails RVM and/or Rails3?

Does this plugin work with the Rails RVM plugin which allows switching between different local Ruby environments. Link: http://rvm.beginrescueend.com/rvm/basics/

After getting it to work w/out RVM I installed Rails 1.9.2 under RVM and found that the debugger no longer worked - again possible issue with the ruby-ide-debugger gem. (I did reinstall this gem into the RVM environment but this did not seem to help).

Can anyone else check this and confirm this as a bug/problem?

Doesn't stop at breakpoint

This looks like a great tool! However, I haven't been able to make it stop at a breakpoint.

I start mvim with ' vim --servername VIM'
I go to the root of my Rails app in vim and enter ':Rdebugger'
I type \b and the breakpoint appears in the file
I run my app, but it doesn't stop. If I put a 'raise' statement right above the breakpoint, that does get executed.
When I look back at the Terminal window, I see '2009-05-16 10:31:26.794 MacVim[86024:10b] [processInputQueues:] WARNING: No Vim controller for identifier=17'
When I look in "~/.vim/tmp/ruby_debugger_log" it is empty.

locally set listchars for better reading

Some users (like me) don't like tabs or trailing spaces, so we use something like
set list listchars=tab:»·,trail:·
In order to see them (and then delete them with a nice :%s/\t/ /g | %s/\s+$//g ).
It would be super cool if you could set listchars to something non obstrusive regarding the variable window and any other window you use with the debugger (I've heard somewhere it can be done on a buffer basis) or just replace tabs with 2 spaces.

rdebug-ide: command not found

Got $subj message when tried to run :Rdebugger inside rails project dir.

OS: Ubuntu 10.10, nothing special.

ruby-debug-ide is installed:

$ gem list | grep debug
ruby-debug-base19 (0.11.25)
ruby-debug-ide19 (0.4.12)
ruby-debug19 (0.11.6)

Running rdebug-ide in console succesful, but running whereis rdebug-ide returns nothing. It's correct behavior?

I'm using pathogen and rvm (maybe trouble is there):

$ rvm info

ruby-1.9.2-p180:

  system:
    uname:       "Linux v-Dell-500 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 19:00:26 UTC 2011 i686 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.1.5(1)-release (i686-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.5.2 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p180"
    date:         "2011-02-18"
    platform:     "i686-linux"
    patchlevel:   "2011-02-18 revision 30909"
    full_version: "ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]"

  homes:
    gem:          "/home/v/.rvm/gems/ruby-1.9.2-p180"
    ruby:         "/home/v/.rvm/rubies/ruby-1.9.2-p180"

  binaries:
    ruby:         "/home/v/.rvm/rubies/ruby-1.9.2-p180/bin/ruby"
    irb:          "/home/v/.rvm/rubies/ruby-1.9.2-p180/bin/irb"
    gem:          "/home/v/.rvm/rubies/ruby-1.9.2-p180/bin/gem"
    rake:         "/home/v/.rvm/gems/ruby-1.9.2-p180/bin/rake"

  environment:
    PATH:         "/home/v/.rvm/gems/ruby-1.9.2-p180/bin:/home/v/.rvm/gems/ruby-1.9.2-p180@global/bin:/home/v/.rvm/rubies/ruby-1.9.2-p180/bin:/home/v/.rvm/bin:/home/v/repos/ioke/bin:/home/v/pseudo-root/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    GEM_HOME:     "/home/v/.rvm/gems/ruby-1.9.2-p180"
    GEM_PATH:     "/home/v/.rvm/gems/ruby-1.9.2-p180:/home/v/.rvm/gems/ruby-1.9.2-p180@global"
    MY_RUBY_HOME: "/home/v/.rvm/rubies/ruby-1.9.2-p180"
    IRBRC:        "/home/v/.rvm/rubies/ruby-1.9.2-p180/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

Debugger doesn't work with Bundler

I opened _spec.rb file in VIM and then called :RdbTest. I got such output:

Fast Debugger (ruby-debug-ide 0.4.16, ruby-debug-base 0.10.4) listens on 127.0.0.1:39767
        /home/petrushka/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:341:in `bin_path'
        /usr/bin/spec:19
        /home/petrushka/.rvm/gems/ruby-1.8.7-p334/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_load'
        /home/petrushka/.rvm/gems/ruby-1.8.7-p334/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_program'
        /home/petrushka/.rvm/gems/ruby-1.8.7-p334/gems/ruby-debug-ide-0.4.16/bin/rdebug-ide:87
        /home/petrushka/.rvm/gems/ruby-1.8.7-p334/bin/rdebug-ide:19:in `load'
        /home/petrushka/.rvm/gems/ruby-1.8.7-p334/bin/rdebug-ide:19
Uncaught exception: can't find gem rspec-core (>= 0) with executable spec

ok. I tried to call Rdebugger 'bundle exec rspec spec/models/user_spec.rb'. It run ok, but didn't stop on breakpoints in user_spec.rb and user.rb. I have full rspec output in :RdbLog

Loading debugger hangs

under Mac OSX 10.6, macvim 7.3 installed via homebrew with ruby-debug19. I think the problem might be related to the error i get when trying to open autoload/ruby-debugger: error detected while processing function <SNR>55_Tlist_Refresh ...

As far as I've researched, it might be related to the omni-completion feature of vim 7.

Doesn't run in my MacVim, Test-Unit fails

Thanks for developing such a great tool,
if I only could use it..

Im using mvim on Mac OS X and followed precisely your installing instructions.
I have ruby-debug-ide, lsof and ruby-debugger in ~/.vim/bundles/vim-ruby-debugger
installed with the pathogen-mechanism.

If I start the ruby-debugger, it takes several minutes to be up and running and then no variables or anything is displayed. In the log I find no error messages.

Running the Test-Unit takes almost 20 minutes (and is still not terminated). The output is:

"~/.vim/tmp/ruby_debugger_test_file" 2L, 17C written
Sorry, but you can set Exceptional Breakpoints only with running debugger
Loading debugger...
Debugger started
Sorry, but you can set Exceptional Breakpoints only with running debugger
Loading debugger...
Killing server with pid 62810

Please HELP me!
Thank you very much in advance

Support\detect Rails 3

If I try
:Rdebugger rails server
I get error E172 ( Only one file name allowed).

P.S. Непонятно как отлаживать rails 3 в таком разе :)

Unable to run tests on Windows

I wrote a patch (modified autoload/ruby_debugger.vim) to make debugging RSpec tests work, as there was an issue with the get_escaped_absolute_path(command) method in ruby_debugger.vim. I assume this will also work for Cucumber features and Unit::Test but I want to run the vim-ruby-debugger unit tests to confirm. However, when I try to run them on Windows I get the following error:

E121: Undefined variable: g:TU

By the way, the patch is replacing the following lines (around line 111) with my changes.

Original (line 111 of autoload/ruby_debugger.vim)
if given_path[0] == '/'
let absolute_path = given_path

Updated:
let is_windows = (has("win32") || has("win64"))
let is_windows_start_path = (given_path =~ '' || given_path =~ '^\w:(|/)')
let is_windows_absolute_path = is_windows && is_windows_start_path
if given_path[0] == '/' || is_windows_absolute_path
let absolute_path = given_path

This change will have to be applied to both autoload/ruby_debugger.vim and additionals/ruby_debugger.vim (as its the file that declares the g:TU variable). I can't quite figure out why running the vim-ruby-debugger test cases isn't working...

How to debug the debugger?

Hi,
This seems like it should be the best plugin ever, if only I could get it to do anything.

I've followed all the instructions and everything seems to work, except there is no rails server process started.
I'm on Ubuntu, RVM, 1.9.2, rails 3.

which rdebug-ide

/home/stephen/.rvm/gems/ruby-1.9.2-p180@salonsquirrel/bin/rdebug-ide

:Rdebugger

Loading debugger...
Debugger started

ps aux | grep ruby

stephen 15207 1.2 0.5 18248 10944 ? Sl 20:56 0:00 ruby /home/stephen/Dropbox/config/.vim/bin/ruby_debugger.rb 127.0.0.1 39767 39768 gvim GVIM /home/stephen/Dropbox/config/.vim/tmp/ruby_debugger posix 0 /home/stephen/Dropbox/config/.vim/tmp/ruby_debugger_log

There is no server process started, the ruby_debugger_log is empty, where can I go from here?

Really appreciate any help you can give!

Thanks a lot.

Cannot connect to debugger from vim

I tried to debug rails3 application in gvim with your plugin. I changed default ports settings for debugger from 39767, 39768 to 3000 and 3001 and then " Rdebugger 'script/rails server' " in vim and it return:

Loading debugger...
Debugger started
localhost:3001 can not be opened
Error detected while processing function 174..170..88_send_message_to_debugger:
line 28:
SystemExit: (eval):55:in `exit': exit

In my process I see 2 new processes:
~/.rvm/rubies/ree-1.8.7-2010.02/bin/ruby ~/.rvm/gems/ree-1.8.7-2010.02@rails3/bin/rdebug-ide -p 3000 -- script/rails server
~/.vim/bundle/vim-ruby-debugger/bin/ruby_debugger.rb localhost 3000 3001 gvim GVIM ~/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger posix

Also i tried to invoke RdbCommand but it returns the same results. (localhost:3001 can not be open).

So as i understood vim cannot connect to rdebug-ide server. I tried connect with telnet to localhost:3000, 3001 and connections was established.
Why vim doesn't connect to debugger?
additional info:
vim 7.2.330
ruby ree1.8.7-2010.02
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.10)

<leader>c crashes vim when debugger is not already on.

Hello Astashov,
Any way you can prevent the debugger from crashing all of vim if c is used when the debugger is not running?

I'm not sure how else to describe this. But if you need more information, please let me know.

Improve logging performance

Now to add one line to the log file, it reads whole the file into memory, adds one line and writes all that stuff back to the file. When the log file is large, it will affect performance very much. Need to find some way to write only to the end of the log file (preferably - the crossplatform way). If there is no chance to do it by VimL, then maybe Ruby?

Deleting a breakpoint using MASTER appears to raise

The xx disappears and I get this:

Error detected while processing function 152..223..234:
line 2:
E716: Key not present in Dictionary: debugger_id
E15: Invalid expression: 'delete ' . self.debugger_id
line 3:
E121: Undefined variable: message
E116: Invalid arguments for function 143

Debugging Rack apps

Is it possible to visit a URL of any Rack app (ex. Rails, Sinatra, Rack middleware) and have Rdebugger hit the breakpoints?

Please forgive my ignorance. It seems that if its possible to debug Rails apps it should be trivial to debug any Rack app, so I must be doing something wrong. I've installed the debugger and I can run and hit breakpoints in individual files of my Sinatra app (:Rdebugger somefile.rb), but not by visiting pages in the browser.

I've got Passenger running over nginx and its serving the app correctly. I'd like to run :Rdebugger in root of my Rack app, visit the page in the browser, and have it break in vim (per the docs thats exactly what happens for a Rails app). Does Rdebugger listen on a specific port that I have to visit (ie http://devsite.local:39767)? Or is the debugger just tailored for Rails only and won't work with other Rack apps?

Either way, the tool is irreplaceable. Thank you!

Multiplying ruby processes

Running :Rdebugger second time on the same file results to starting two new ruby processes, while old ones keep running.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.