Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

ruby 2.0.0-p0 compatible patch. #68

Merged
merged 5 commits into from Mar 6, 2013

Conversation

windwiny
Copy link

@windwiny windwiny commented Mar 2, 2013

No description provided.

code from ruby-debug-base19x-0.11.30.pre11 .
On ruby 1.9.3-xxx GET_THREAD is a macro, on ruby 2.0.0-p0 is a function. <ruby-ver>/vm_core.h
Call rb_thread_current() before use GET_THREAD.
@bcardarella
Copy link

👍

@bcardarella
Copy link

@windwiny could you add 2.0.0 to .travs.yml so it can be ensured this passes for 2.0?

@windwiny
Copy link
Author

windwiny commented Mar 3, 2013

@bcardarella Travis use 2.0.0dev? gem occur error.

@bcardarella
Copy link

@windwiny you should be able to do something similar to: https://github.com/dockyard/party_foul/blob/master/.travis.yml#L1-L4

@camsong
Copy link

camsong commented Mar 4, 2013

👍 hope it can be done quickly

@bcardarella
Copy link

@cldwalker thoughts?

@cldwalker
Copy link
Owner

@windwiny Thanks for the pull! travis is using 2.0.0-rc1 instead of 2.0.0, probably since they're using an older version of rvm. I ran the tests locally on 2.0 and I did see failure:

$ rake
** Invoke default (first_time)
** Invoke test (first_time)
** Execute test
/Users/me/Developer/.rbenv/versions/2.0.0-p0/bin/ruby -I"lib" -I"/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib" "/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/breakpoints_test.rb" "test/conditions_test.rb" "test/continue_test.rb" "test/display_test.rb" "test/edit_test.rb" "test/eval_test.rb" "test/finish_test.rb" "test/frame_test.rb" "test/help_test.rb" "test/info_test.rb" "test/irb_test.rb" "test/jump_test.rb" "test/kill_test.rb" "test/list_test.rb" "test/method_test.rb" "test/post_mortem_test.rb" "test/quit_test.rb" "test/reload_test.rb" "test/restart_test.rb" "test/save_test.rb" "test/set_test.rb" "test/show_test.rb" "test/source_test.rb" "test/stepping_test.rb" "test/thread_test.rb" "test/tmate_test.rb" "test/trace_test.rb" "test/variables_test.rb" 
/Users/me/code/gems/debugger/lib/ruby_debug.bundle: warning: already initialized constant Debugger::VERSION
/Users/me/code/gems/debugger/lib/debugger/version.rb:4: warning: previous definition of VERSION was here
Run options: --seed 21745

# Running tests:

................................................................S.....dyld: lazy symbol binding failed: Symbol not found: _rb_vm_get_sourceline
  Referenced from: /Users/me/code/gems/debugger/lib/ruby_debug.bundle
  Expected in: flat namespace

dyld: Symbol not found: _rb_vm_get_sourceline
  Referenced from: /Users/me/code/gems/debugger/lib/ruby_debug.bundle
  Expected in: flat namespace

rake aborted!
Command failed with status (): [/Users/me/Developer/.rbenv/versions/2.0.0-...]
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/file_utils.rb:82:in `ruby'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/testtask.rb:99:in `block (2 levels) in define'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:60:in `verbose'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/testtask.rb:98:in `block in define'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/me/Developer/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/me/code/gems/debugger/bundle/ruby/2.0.0/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'

I don't mind pulling this in as is but I'm not going to close #47 until at least tests can finish. Thoughts?

@deivid-rodriguez
Copy link

It seems like we are running in the same problem as @denofevil, the author of ruby-debug-base19, which is the source of this Pull Request. He opened an issue about this: https://bugs.ruby-lang.org/issues/7259, which happened to be a duplicate of this other one. This last issue has been inactive for the last three months with the status "Third Party Issue" and the comment "Debuggers should use new TracePoint feature now". Apparently there's a new API to be used, so that call to _rb_vm_get_sourceline (there's only one) should be made "the new way". I've been playing around with the code but my knowledge is not enough to fix it... :(

You can still use debugger in spite of this, but some functionality is broken: line numbers seem messed up sometimes and it crashed when I used the backtrace command. Salute.

@deivid-rodriguez
Copy link

I'm sorry, I hadn't checked issue #47, where basically everything I said is already said... I'll follow the discussion there...

@windwiny
Copy link
Author

windwiny commented Mar 5, 2013

@cldwalker Do as you said, i am just test on rubymine5, that look like is work.
@deivid-rodriguez I've been playing around with the code but my knowledge is not enough to fix it... :( ,me too.

@TylerRick
Copy link

Thanks for this! It is working for me so far.

gem 'debugger', github: 'windwiny/debugger', branch: 'rb200p0compatible-patch'

@Crossverse
Copy link

How to trying install gem? gem install debugger make errors.

@cldwalker cldwalker merged commit 173bf0a into cldwalker:master Mar 6, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants