debugger-xml icon indicating copy to clipboard operation
debugger-xml copied to clipboard

Add byebug support

Open astashov opened this issue 10 years ago • 50 comments

Summoning @os97673 :)

I'd like to add byebug support, it seems like the most popular debugging gem for Ruby >= 2.0. I could add it to this gem, and remove debugger from the dependencies, and slightly rename the classes here (remove all Debugger, rename them to DebuggerXml, remove all ties to the debugger gem).

Oleg, are you guys interested in supporting byebug in RubyMine? How hard would it be for you to add another gem (e.g. byebug-xml) to supported debugger gems in RubyMine? The API would be absolutely the same, just different gem name. Or you'd prefer to use the same debugger-xml, and let it decide what should be used - byebug or debugger, depending on what gems are loaded into the app.

What do you think?

astashov avatar Oct 10 '14 05:10 astashov

Hi @astashov :)

we do interested (new Rails add byebug to Gemfile by default (we have not found any problem yet but I'd expect to have some). As for implementation both approach are ok for me.
BTW may I also ask you to rename rdebug-ide (our users have problems when both ruby-debug-ide and debugger-xml are installed in the same gemset)

os97673 avatar Oct 10 '14 18:10 os97673

Sure, np, what would you want me to rename it to?

astashov avatar Oct 10 '14 18:10 astashov

Anything you like (what about rdebug-xml?)

os97673 avatar Oct 10 '14 18:10 os97673

That sounds good.

astashov avatar Oct 10 '14 18:10 astashov

@astashov what is the status of the support? It looks like you have changed something but I'm not sure you have finished. BTW I'm unable to install debugger-xml 0.4.1 for ruby 1.9 because it tries to install byebug which requires ruby 2.0 :(

os97673 avatar Feb 24 '15 08:02 os97673

@os97673 @astashov Any news guys?

deivid-rodriguez avatar Mar 23 '15 00:03 deivid-rodriguez

@os97673 @astashov Any news guys?

@deivid-rodriguez it is a good question :) It looks like @astashov is too busy right now, I will try to do the changes and check if everything works ok.

os97673 avatar Mar 23 '15 06:03 os97673

Sorry guys, it's not there yet. It's close though. It mostly works, but I get all these INTERNAL ERROR!!! Destination frame (0) is out of range (-1) errors from time to time, which I don't really understand why they happen.

astashov avatar Mar 23 '15 07:03 astashov

@astashov is the code available so I could reproduce the problem and, perhaps, help?

os97673 avatar Mar 23 '15 07:03 os97673

@os97673 The code involved should be byebug 4.0.3 + latest debugger-xml master, but I'm not sure how to reproduce the problem...

deivid-rodriguez avatar Mar 24 '15 12:03 deivid-rodriguez

as far as I can see master contains no changes to make it possible to use debugger-xml from IDE (rdebug executable is not updated), so I'm not sure if all changes are there. And yes, it would be useful to know how to reproduce the problem.

os97673 avatar Mar 24 '15 20:03 os97673

Hey! Sorry for delayed answer.

So, it works on simple scripts, but sometimes fails on large projects. I tried it on our mixbook.com's site and it failed like that there, I obviously can't share the code pieces from there. :)

I'm trying to find some open source project where I could reproduce that problem.

Meanwhile, Oleg, could you please adjust rdebug-ide executable so it works with RubyMine? I unfortunately am not really familiar with how to integrate it into RubyMine. You can use rdebug-vim changes as a reference.

Thanks!

astashov avatar Mar 25 '15 05:03 astashov

@astashov ok, I will

os97673 avatar Mar 25 '15 06:03 os97673

@astashov There's an open issue in byebug that might be related to this: https://github.com/deivid-rodriguez/byebug/issues/127. I haven't been able to reproduce it but I'm going to add some commits that I hope will fix it. Once I do that I'll ping you so you can try it.

deivid-rodriguez avatar Mar 25 '15 17:03 deivid-rodriguez

I think you should be able to repeat it on some large-enough Ruby project, e.g. some Rails project.

astashov avatar Mar 25 '15 17:03 astashov

I've tried to reproduce it in my current Rails projects without luck... :(

deivid-rodriguez avatar Mar 25 '15 17:03 deivid-rodriguez

I'll try to generate some Rails project tonight and debug it there, maybe I'll be lucky :)

astashov avatar Mar 25 '15 17:03 astashov

Thanks!

Can you try byebug's branch issue_127? I'm not very confident it will fix the issue, but it's worth a try.

deivid-rodriguez avatar Mar 25 '15 22:03 deivid-rodriguez

I've just pushed changes which make it possible to start debugger-xml+byebug from RubyMine (patched for now because I've renamed executable) But thread list command doesn't work because of incorrect state (for some reason it takes control state). @astashov does the command works in vim? Also it looks like current gem can not be installed with ruby 1.9 because it requires byebug which doesn't support 1.9. So it looks like the "magic" we have in gemspec doesn't work :( Do you know a better way to specify different dependencies for different version of ruby?

os97673 avatar Mar 26 '15 18:03 os97673

Hmm, I tried it with Ruby 1.9, and it successfully installed 'debugger' gem and didn't require byebug at all. What "magic" are you referring to?

astashov avatar Mar 26 '15 19:03 astashov

I frankly don't have threads list in Vim plugin... :blush:

astashov avatar Mar 26 '15 19:03 astashov

Hmm, I tried it with Ruby 1.9, and it successfully installed 'debugger' gem and didn't require byebug at all. What "magic" are you referring to?

I mean - https://github.com/astashov/debugger-xml/blob/master/debugger-xml.gemspec#L21-L25 And here is the result of installing the gem (from rubygems, not from github)

Using ruby-1.9.3-p551 with gemset test $ gem install debugger-xml Fetching: byebug-4.0.3.gem (100%) ERROR: Error installing debugger-xml: byebug requires Ruby version >= 2.0.0. $ rvm current ruby-1.9.3-p551@test

os97673 avatar Mar 26 '15 19:03 os97673

I frankly don't have threads list in Vim plugin...

Well, it comes from byebug, but perhaps you do not provide interface to it

os97673 avatar Mar 26 '15 19:03 os97673

I tried to install through bundle install though, maybe gem install doesn't respect that thing? I'll try...

astashov avatar Mar 26 '15 19:03 astashov

Well, it comes from byebug, but perhaps you do not provide interface to it

Yeah, exactly.

astashov avatar Mar 26 '15 19:03 astashov

Well, it comes from byebug, but perhaps you do not provide interface to it Yeah, exactly. you are lucky ;)

os97673 avatar Mar 26 '15 19:03 os97673

I tried to install through bundle install though, maybe gem install doesn't respect that thing? I'll try...

bundler doesn't work for me :(

$ bundle install Fetching gem metadata from https://rubygems.org/..... Resolving dependencies... Installing builder 3.2.2 Installing columnize 0.9.0

Gem::InstallError: byebug requires Ruby version >= 2.0.0. An error occurred while installing byebug (4.0.3), and Bundler cannot continue. Make sure that gem install byebug -v '4.0.3' succeeds before bundling. $ cat Gemfile source "https://rubygems.org"

gem 'debugger-xml' $ rvm current ruby-1.9.3-p551@temp

os97673 avatar Mar 26 '15 19:03 os97673

Try from master:

$ cat Gemfile
source 'https://rubygems.org'

gem 'debugger-xml', git: "[email protected]:astashov/debugger-xml.git"

$ bundle install
Fetching gem metadata from https://rubygems.org/....
Fetching [email protected]:astashov/debugger-xml.git
Installing builder 3.2.2
Installing columnize 0.9.0
Installing debugger-linecache 1.2.0
Installing debugger-ruby_core_source 1.3.8
Installing debugger 1.6.8
Using debugger-xml 0.4.1 from [email protected]:astashov/debugger-xml.git (at master)
Using bundler 1.7.3
Your bundle is complete!
It was installed into ./vendor/bundle

astashov avatar Mar 26 '15 20:03 astashov

@os97673 Apparently you can do what you want using a C-extension: https://www.tiredpixel.com/2014/01/05/curses-conditional-ruby-gem-installation-within-a-gemspec/. But I would probably just fork the gem and add byebug support there (or remove debugger support and release byebug support as a new major version).

deivid-rodriguez avatar Mar 26 '15 20:03 deivid-rodriguez

But I would probably just fork the gem and add byebug support there (or remove debugger support and release byebug support as a new major version).

@astashov what do you think about creating byebug-xml? ;)

os97673 avatar Mar 26 '15 20:03 os97673