{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-debug/ruby-debug-ide/issues/152","repository_url":"https://api.github.com/repos/ruby-debug/ruby-debug-ide","labels_url":"https://api.github.com/repos/ruby-debug/ruby-debug-ide/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/ruby-debug/ruby-debug-ide/issues/152/comments","events_url":"https://api.github.com/repos/ruby-debug/ruby-debug-ide/issues/152/events","html_url":"https://github.com/ruby-debug/ruby-debug-ide/issues/152","id":334902347,"node_id":"MDU6SXNzdWUzMzQ5MDIzNDc=","number":152,"title":"Launching rspec process via spring does not attach debugging as expected","user":{"login":"CJBridges","id":7446001,"node_id":"MDQ6VXNlcjc0NDYwMDE=","avatar_url":"https://avatars1.githubusercontent.com/u/7446001?v=4","gravatar_id":"","url":"https://api.github.com/users/CJBridges","html_url":"https://github.com/CJBridges","followers_url":"https://api.github.com/users/CJBridges/followers","following_url":"https://api.github.com/users/CJBridges/following{/other_user}","gists_url":"https://api.github.com/users/CJBridges/gists{/gist_id}","starred_url":"https://api.github.com/users/CJBridges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CJBridges/subscriptions","organizations_url":"https://api.github.com/users/CJBridges/orgs","repos_url":"https://api.github.com/users/CJBridges/repos","events_url":"https://api.github.com/users/CJBridges/events{/privacy}","received_events_url":"https://api.github.com/users/CJBridges/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-22T14:36:57Z","updated_at":"2018-10-15T15:44:39Z","closed_at":null,"author_association":"NONE","body":"`spring`, at an overly simplistic level, allows for early preloading of code, with the largest leverage tending to be gems.  It functions by starting a process (`spring server`), then each time you want to run a command, it forks and the child process runs your main action (e.g. `rspec`).\r\n\r\n`rdebug-ide -- bin/rspec spec/file_spec.rb` debugs the spring process, but does not debug the actual thing we want (the rspec child process launched underneath).\r\n\r\n## Steps to reproduce:\r\n\r\n### Case 1 (not working):\r\n```\r\n# bin/rspec\r\nbegin\r\n  load File.expand_path('../spring', __FILE__)\r\nrescue LoadError => e\r\n  raise unless e.message.include?('spring')\r\nend\r\n\r\nrequire 'bundler/setup'\r\n\r\nload Gem.bin_path('rspec-core', 'rspec')\r\n```\r\n\r\n`rdebug-ide --host 127.0.0.1 --port 2345 -- bin/rspec spec/file_spec.rb`\r\n\r\n`nc 127.0.0.1 2345` then...\r\n```\r\nbreak spec/file_spec.rb:5\r\ncont\r\n```\r\n\r\n*Expected*: Break at line 5\r\n*Current*: does not break at all\r\n\r\n### Case 2 (works, but slow):\r\n`DISABLE_SPRING=1 rdebug-ide --host 127.0.0.1 --port 2345 -- bin/rspec spec/file_spec.rb`\r\n(other steps same as above)\r\n\r\nThis breaks at line 5 as expected, but as spring is not used, we incur the whole cost of launching the app.  This is > 10 seconds longer on an app I'm using it on.\r\n\r\n-------\r\n\r\nIn GDB, this is supported as `set follow-fork-mode child` - http://visualgdb.com/gdbreference/commands/set_follow-fork-mode.\r\n\r\nPlease let me know of any suggested fixes or workarounds, and I might be able to tackle it.\r\n\r\nOther info: Note that my intended use case at the end of the day is to start an rspec process under debugger from vscode, with the launch speed benefits of spring, so vscode specific workarounds are fine too.  I'm also familiar with other methods of debugging (e.g. `binding.pry` and `byebug`), but really trying to get first class IDE debugging support working."},"comment":{"url":"https://api.github.com/repos/ruby-debug/ruby-debug-ide/issues/comments/429907015","html_url":"https://github.com/ruby-debug/ruby-debug-ide/issues/152#issuecomment-429907015","issue_url":"https://api.github.com/repos/ruby-debug/ruby-debug-ide/issues/152","id":429907015,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTkwNzAxNQ==","user":{"login":"ViugiNick","id":6137315,"node_id":"MDQ6VXNlcjYxMzczMTU=","avatar_url":"https://avatars2.githubusercontent.com/u/6137315?v=4","gravatar_id":"","url":"https://api.github.com/users/ViugiNick","html_url":"https://github.com/ViugiNick","followers_url":"https://api.github.com/users/ViugiNick/followers","following_url":"https://api.github.com/users/ViugiNick/following{/other_user}","gists_url":"https://api.github.com/users/ViugiNick/gists{/gist_id}","starred_url":"https://api.github.com/users/ViugiNick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ViugiNick/subscriptions","organizations_url":"https://api.github.com/users/ViugiNick/orgs","repos_url":"https://api.github.com/users/ViugiNick/repos","events_url":"https://api.github.com/users/ViugiNick/events{/privacy}","received_events_url":"https://api.github.com/users/ViugiNick/received_events","type":"User","site_admin":false},"created_at":"2018-10-15T15:44:39Z","updated_at":"2018-10-15T15:44:39Z","author_association":"CONTRIBUTOR","body":"@CJBridges all forks are debuggable, as you can see here https://github.com/ruby-debug/ruby-debug-ide/blob/b4c8f15cb4ad48b636a381757363e9a3d705baf5/lib/ruby-debug-ide/multiprocess/monkey.rb#L8\r\n"}}
{"actor":{"display_login":"ViugiNick"}}