Skip to content

vscode-debug-specs/ruby

Repository files navigation

Ruby

Summary

Basic

Spec

  • OS _ ✅ MacOS _ ✅ Windows * ✅ Linux
  • Break Point _ ✅ break point _ ✅ condition break point : it does not work on my machine, always breaks _ ❌ function breakpoint _ ❌ uncaught exception breakpoint * ❌ all exception breakpoint
  • Step Execution _ ✅ Step Over _ ✅ Step Into _ ✅ Step Out _ ✅ Continue
  • Variables _ ✅ variables views _ ✅ watch variables
  • Call Stack * ✅ call stack
  • Evaluation _ ✅ eval expression to show variables _ ✅ eval expression to change variables
  • Type of Execution _ ✅ debug unit test _ ✅ debug executable package * ✅ remote debugging

Instruction

install some gems https://github.com/rubyide/vscode-ruby/wiki/1.-Debugger-Installation

install extension.

If you use Ubuntu 18.04, it needs sudo apt install libruby ruby-dev.

module code

debug Unix Test

test/unit

test code

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug test/unit",
      "type": "Ruby",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "program": "${workspaceFolder}/test_bubble_sort.rb",
      "args": ["--name=test_bubble_sort"]
    }
  ]
}

debug executable script

code

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug execute File",
      "type": "Ruby",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "program": "${workspaceFolder}/bin.rb"
    }
  ]
}

debug remote process

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug remote",
      "type": "Ruby",
      "request": "attach",
      "cwd": "${workspaceFolder}",
      "remoteHost": "192.168.1.24",
      "remotePort": "1234",
      "remoteWorkspaceRoot": "/home/nnyn/vscode-debug-specs/ruby"
    }
  ]
}

how to

  1. start remote process
rdebug-ide --host 0.0.0.0 --port 1234 -- bin/bin.rb
  1. start vscode debugger

About

How to Debug ruby with VS Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published