{"id":578997,"date":"2025-06-10T08:34:53","date_gmt":"2025-06-10T07:34:53","guid":{"rendered":"https:\/\/blog.jetbrains.com\/ruby\/2025\/06\/inside-ruby-debuggers\/"},"modified":"2025-07-05T14:42:00","modified_gmt":"2025-07-05T13:42:00","slug":"inside-ruby-debuggers","status":"publish","type":"ruby","link":"https:\/\/blog.jetbrains.com\/ja\/ruby\/2025\/06\/inside-ruby-debuggers\/","title":{"rendered":"Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u4ed5\u7d44\u307f: TracePoint\u3001\u547d\u4ee4\u5217\u3001CRuby API"},"content":{"rendered":"\n<p>Ruby \u958b\u767a\u8005\u306e\u7686\u3055\u3093\u3001\u3053\u3093\u306b\u3061\u306f\uff01<\/p>\n\n\n\n<p>\u30c7\u30d0\u30c3\u30b0\u306f\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u958b\u767a\u306b\u304a\u3051\u308b\u91cd\u8981\u306a\u5de5\u7a0b\u3067\u3059\u304c\u3001\u307b\u3068\u3093\u3069\u306e\u958b\u767a\u8005\u306f\u5b9f\u969b\u306e\u30c7\u30d0\u30c3\u30b0\u306e\u4ed5\u7d44\u307f\u3092\u7406\u89e3\u305b\u305a\u306b\u30c7\u30d0\u30c3\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002RubyMine \u30c1\u30fc\u30e0\u306f\u6570\u5e74\u306b\u308f\u305f\u3063\u3066 Ruby \u7528\u306e\u30c7\u30d0\u30c3\u30b0\u30c4\u30fc\u30eb\u3092\u958b\u767a\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u958b\u767a\u306e\u884c\u7a0b\u3067\u5f97\u305f\u77e5\u898b\u306e\u4e00\u90e8\u3092\u5171\u6709\u3057\u305f\u3044\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u80cc\u5f8c\u306b\u3042\u308b TracePoint\u3001\u547d\u4ee4\u5217\u3001\u304a\u3088\u3073 Ruby \u306e C \u30ec\u30d9\u30eb\u30c7\u30d0\u30c3\u30b0 API \u3068\u3044\u3046\u4e3b\u306a\u6280\u8853\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u306f TracePoint \u306b\u3064\u3044\u3066\u53d6\u308a\u4e0a\u3052\u3001\u305d\u308c\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30d0\u30c3\u30ac\u30fc\u306b\u91cd\u8981\u306a\u30a4\u30d9\u30f3\u30c8\u3067\u30b3\u30fc\u30c9\u3092\u505c\u6b62\u3055\u305b\u308b\u4ed5\u7d44\u307f\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u305d\u306e\u5f8c\u3001\u6700\u5c0f\u9650\u306e\u6a5f\u80fd\u3092\u5099\u3048\u305f\u30c7\u30d0\u30c3\u30ac\u30fc\u3092\u69cb\u7bc9\u3057\u3066\u5b9f\u969b\u306e\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u6b21\u306b\u3001Ruby \u306e\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u6982\u8981\u3068\u305d\u306e TracePoint \u3068\u306e\u9023\u643a\u306e\u4ed5\u7d44\u307f\u3092\u7406\u89e3\u3059\u308b\u305f\u3081\u3001\u547d\u4ee4\u5217\u306b\u3064\u3044\u3066\u53d6\u308a\u4e0a\u3052\u307e\u3059\u3002\u6700\u5f8c\u306b\u3001Ruby \u306e C \u30ec\u30d9\u30eb API \u3068\u305d\u306e\u30e1\u30ea\u30c3\u30c8\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u306f\u3001<a href=\"https:\/\/2024.euruko.org\/speakers\/dmitry_pogrebnoy\" data-type=\"link\" data-id=\"https:\/\/2024.euruko.org\/speakers\/dmitry_pogrebnoy\" target=\"_blank\" rel=\"noopener\">EuRuKo 2024<\/a> \u3068 <a href=\"https:\/\/rubykaigi.org\/2025\/presentations\/DmitryPogrebnoy.html\" data-type=\"link\" data-id=\"https:\/\/rubykaigi.org\/2025\/presentations\/DmitryPogrebnoy.html\" target=\"_blank\" rel=\"noopener\">RubyKaigi 2025<\/a> \u3067 RubyMine \u306e\u30c1\u30fc\u30e0\u30ea\u30fc\u30c0\u30fc\u3067\u3042\u308b Dmitry Pogrebnoy \u304c\u8b1b\u6f14\u3057\u305f\u300c<em>Demystifying Debuggers<\/em>\u300d\u306b\u57fa\u3065\u304f\u9023\u8f09\u306e\u7b2c 2 \u90e8\u3067\u3059\u3002\u6700\u521d\u306e\u8a18\u4e8b\u3092\u307e\u3060\u3054\u89a7\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u65b9\u306f\u3001<a href=\"https:\/\/blog.jetbrains.com\/ruby\/2024\/12\/mastering_ruby_debugging\/\" data-type=\"link\" data-id=\"https:\/\/blog.jetbrains.com\/ruby\/2024\/12\/mastering_ruby_debugging\/\">\u3053\u3061\u3089<\/a>\u3092\u5148\u306b\u304a\u8aad\u307f\u3044\u305f\u3060\u304f\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u52d5\u753b\u3092\u3054\u5e0c\u671b\u3067\u3059\u304b\uff1f\u5143\u306e\u8b1b\u6f14\u306f\u3001<a href=\"https:\/\/www.youtube.com\/watch?v=ynrXsbuApXM\" data-type=\"link\" data-id=\"https:\/\/www.youtube.com\/watch?v=ynrXsbuApXM\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u304b\u3089\u3054\u8996\u8074\u3044\u305f\u3060\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6e96\u5099\u306f\u3067\u304d\u307e\u3057\u305f\u304b\uff1f\u3067\u306f\u3001\u59cb\u3081\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u80cc\u5f8c\u306b\u3042\u308b\u30b3\u30a2\u6280\u8853<\/h2>\n\n\n\n<p>\u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u5185\u90e8\u3092\u8a73\u3057\u304f\u898b\u308b\u524d\u306b\u3001Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u3092\u5b9f\u73fe\u3057\u3066\u3044\u308b TracePoint \u3068\u547d\u4ee4\u5217\u3068\u3044\u3046 2 \u3064\u306e\u30b3\u30a2\u6280\u8853\u3092\u7406\u89e3\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4f7f\u7528\u3059\u308b\u30c7\u30d0\u30c3\u30ac\u30fc\u3092\u554f\u308f\u305a\u3001\u3069\u308c\u3082 Ruby \u81ea\u4f53\u306b\u7d44\u307f\u8fbc\u307e\u308c\u305f\u3053\u308c\u3089\u306e\u57fa\u672c\u6a5f\u80fd\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u5404\u6280\u8853\u306e\u4ed5\u7d44\u307f\u3068\u305d\u306e\u91cd\u8981\u6027\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">TracePoint: \u30b3\u30fc\u30c9\u5b9f\u884c\u3078\u306e\u30d5\u30c3\u30af<\/h3>\n\n\n\n<p>\u307e\u305a\u306f TracePoint \u304b\u3089\u8aac\u660e\u3057\u307e\u3059\u3002\u3053\u308c\u306f 2013 \u5e74\u306b Ruby 2.0 \u3067\u5c0e\u5165\u3055\u308c\u305f\u5f37\u529b\u306a\u30a4\u30f3\u30b9\u30c8\u30eb\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u6280\u8853\u3067\u3042\u308a\u3001\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u3073\u51fa\u3057\u3001\u884c\u306e\u5b9f\u884c\u3001\u307e\u305f\u306f\u4f8b\u5916\u306e\u767a\u751f\u306a\u3069\u306e\u7279\u5b9a\u306e\u5b9f\u884c\u6642\u30a4\u30d9\u30f3\u30c8\u3092\u30a4\u30f3\u30bf\u30fc\u30bb\u30d7\u30c8\u3057\u3001\u3053\u308c\u3089\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u30ab\u30b9\u30bf\u30e0\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u6a5f\u80fd\u3057\u307e\u3059\u3002TracePoint \u306f\u307b\u307c\u3059\u3079\u3066\u306e Ruby \u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3067\u6a5f\u80fd\u3057\u3001\u30b9\u30ec\u30c3\u30c9\u3068\u30d5\u30a1\u30a4\u30d0\u30fc\u3068\u3046\u307e\u304f\u9023\u643a\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u73fe\u6642\u70b9\u3067\u306f <a href=\"https:\/\/bugs.ruby-lang.org\/projects\/ruby-master\/search?q=Ractor+TracePoint&amp;scope=&amp;all_words=&amp;all_words=1&amp;titles_only=&amp;issues=1&amp;open_issues=1&amp;attachments=0&amp;options=1&amp;commit=Search\" target=\"_blank\" rel=\"noopener\">Ractor \u306e\u30b5\u30dd\u30fc\u30c8\u306b\u5236\u9650<\/a>\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3092\u898b\u306a\u304c\u3089 TracePoint \u306e\u6a5f\u80fd\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"ruby\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def say_hello\n puts \"Hello Ruby developers!\"\nend\n\n\nTracePoint.new(:call) do |tp|\n puts \"Calling method '#{tp.method_id}'\"\nend.enable\n\n\nsay_hello\n# => Calling method 'say_hello'\n# => Hello Ruby developers!\n<\/pre>\n\n\n\n<p>\u3053\u306e\u4f8b\u306b\u306f\u3001<code>puts<\/code> \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u542b\u3080\u5358\u7d14\u306a <code>say_hello<\/code> \u30e1\u30bd\u30c3\u30c9\u3068\u3001<code>call<\/code> \u578b\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u30a6\u30a9\u30c3\u30c1\u3059\u308b <code>TracePoint<\/code> \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<code>TracePoint<\/code> \u306e\u4e2d\u3067\u306f\u3001<code>method_id<\/code> \u3092\u4f7f\u7528\u3057\u3066\u547c\u3073\u51fa\u3057\u5bfe\u8c61\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u540d\u524d\u3092\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u30b3\u30e1\u30f3\u30c8\u306e\u51fa\u529b\u3092\u898b\u308b\u3068\u3001<code>say_hello<\/code> \u30e1\u30bd\u30c3\u30c9\u306b\u5165\u308b\u969b\u306b <code>TracePoint<\/code> \u304c\u30c8\u30ea\u30ac\u30fc\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u308c\u304c\u5b8c\u4e86\u3057\u3066\u521d\u3081\u3066\u30e1\u30bd\u30c3\u30c9\u81ea\u4f53\u304c\u5b9f\u969b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u4f8b\u306f\u3001TracePoint \u3092\u4f7f\u7528\u3057\u3066\u666e\u901a\u306e\u30b3\u30fc\u30c9\u306e\u5b9f\u884c\u3092\u7279\u5225\u306a\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3059\u308b\u7279\u5b9a\u306e\u30dd\u30a4\u30f3\u30c8\u3067\u30a4\u30f3\u30bf\u30fc\u30bb\u30d7\u30c8\u3057\u3001\u72ec\u81ea\u306e\u30ab\u30b9\u30bf\u30e0\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3067\u30c7\u30d0\u30c3\u30ac\u30fc\u304c\u505c\u6b62\u3059\u308b\u305f\u3073\u306b\u3001TracePoint \u304c\u51e6\u7406\u3092\u62c5\u3044\u307e\u3059\u3002\u3053\u306e\u6280\u8853\u306f\u30c7\u30d0\u30c3\u30b0\u4ee5\u5916\u306b\u3082\u5f79\u7acb\u3064\u305f\u3081\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u76e3\u8996\u3001\u30ed\u30b0\u306e\u8a18\u9332\u3001\u3055\u3089\u306b\u306f\u5b9f\u884c\u6642\u306e\u6319\u52d5\u306b\u95a2\u3059\u308b\u77e5\u898b\u3092\u5f97\u305f\u308a\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u52d5\u4f5c\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u305f\u308a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305d\u306e\u4ed6\u306e\u5834\u9762\u3067\u3082\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">TracePoint \u3092\u4f7f\u7528\u3057\u305f\u3054\u304f\u5358\u7d14\u306a Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u69cb\u7bc9<\/h3>\n\n\n\n<p>TracePoint \u306e\u6280\u8853\u306e\u307f\u3092\u4f7f\u7528\u3057\u3001\u53ef\u80fd\u306a\u9650\u308a\u5358\u7d14\u306a Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"ruby\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def say_hello\n puts \"Hello Ruby developers!\"\nend\n\n\nTracePoint.new(:call) do |tp|\n puts \"Call method '#{tp.method_id}'\"\n while (input = gets.chomp) != \"cont\"\n   puts eval(input)\n end\nend.enable\n\n\nsay_hello<\/pre>\n\n\n\n<p>\u3053\u308c\u306f TracePoint \u306e\u4f8b\u3068\u307b\u307c\u540c\u3058\u30b3\u30fc\u30c9\u3067\u3059\u304c\u3001\u4eca\u56de\u306f &lt;0>TracePoint \u30b3\u30fc\u30c9\u306e\u672c\u6587\u304c\u82e5\u5e72\u5909\u66f4\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u6319\u52d5\u3092\u8a73\u3057\u304f\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<code>TracePoint<\/code> \u30d6\u30ed\u30c3\u30af\u306f <code>gets.chomp<\/code> \u7d4c\u7531\u3067\u30e6\u30fc\u30b6\u30fc\u306e\u5165\u529b\u3092\u53d7\u3051\u4ed8\u3051\u3066\u304a\u308a\u3001\u305d\u306e\u5165\u529b\u3092\u73fe\u5728\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u5185\u3067 <code>eval<\/code> \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u8a55\u4fa1\u3057\u3001\u305d\u306e\u7d50\u679c\u3092 <code>puts<\/code> \u3067\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u672c\u5f53\u306b\u305d\u308c\u3060\u3051\u306e\u3053\u3068\u3067\u3059\u3002\u305f\u3063\u305f\u6570\u884c\u306e\u30b3\u30fc\u30c9\u3067\u5358\u7d14\u660e\u5feb\u304b\u3064\u52b9\u679c\u7684\u306a\u30c7\u30d0\u30c3\u30b0\u306e\u4ed5\u7d44\u307f\u304c\u69cb\u7bc9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u5404\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u3073\u51fa\u3057\u3067\u73fe\u5728\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u30a4\u30f3\u30c8\u30ed\u30b9\u30da\u30af\u30c8\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u72b6\u614b\u3092\u5909\u66f4\u3059\u308b\u3068\u3044\u3046\u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u30b3\u30a2\u6a5f\u80fd\u306e 1 \u3064\u304c\u5b9f\u73fe\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u65b0\u3057\u3044 Ruby \u5b9a\u6570\u306e\u5b9a\u7fa9\u3001\u305d\u306e\u5834\u3067\u306e\u30af\u30e9\u30b9\u306e\u4f5c\u6210\u3001\u5b9f\u884c\u4e2d\u306e\u5909\u6570\u306e\u5024\u5909\u66f4\u306a\u3069\u304c\u53ef\u80fd\u3067\u3059\u3002\u7c21\u5358\u3067\u5f37\u529b\u306a\u4ed5\u7d44\u307f\u3060\u3068\u601d\u3044\u307e\u305b\u3093\u304b\uff1f\u305c\u3072\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n\n\n\n<p>\u305f\u3060\u3001\u3053\u308c\u304c\u5b8c\u6210\u5f62\u306e\u30c7\u30d0\u30c3\u30ac\u30fc\u3067\u306a\u3044\u3053\u3068\u306f\u660e\u3089\u304b\u3067\u3059\u3002\u4f8b\u5916\u51e6\u7406\u3084\u305d\u306e\u4ed6\u591a\u304f\u306e\u57fa\u672c\u6a5f\u80fd\u304c\u6b20\u843d\u3057\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u305d\u308c\u4ee5\u5916\u306e\u8981\u7d20\u3092\u7121\u8996\u3057\u3066\u9aa8\u7d44\u307f\u3060\u3051\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u3053\u308c\u304c\u3059\u3079\u3066\u306e Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u57fa\u790e\u3068\u306a\u308b\u57fa\u672c\u7684\u306a\u4ed5\u7d44\u307f\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u5358\u7d14\u306a\u4f8b\u306f\u3001TracePoint \u304c Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u57fa\u790e\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002TracePoint \u306e\u6280\u8853\u304c\u306a\u3051\u308c\u3070\u3001\u30e2\u30c0\u30f3\u306a Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u69cb\u7bc9\u306f\u4e0d\u53ef\u80fd\u3060\u3063\u305f\u3053\u3068\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u547d\u4ee4\u5217: Ruby \u306e\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u306e\u89e3\u660e<\/h3>\n\n\n\n<p>Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u3082\u3046 1 \u3064\u306e\u91cd\u8981\u306a\u6280\u8853\u306f\u547d\u4ee4\u5217\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\u5217\uff08\u77ed\u7e2e\u5f62\u306f <code>iseq<\/code>\uff09\u306f\u3001Ruby \u4eee\u60f3\u30de\u30b7\u30f3\u304c\u5b9f\u884c\u3059\u308b\u30b3\u30f3\u30d1\u30a4\u30eb\u6e08\u307f\u306e\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u3092\u8868\u3057\u307e\u3059\u3002\u3053\u308c\u306f Ruby \u306e\u300c\u30a2\u30bb\u30f3\u30d6\u30ea\u8a00\u8a9e\u300d\uff08\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u305f\u5f8c\u306e Ruby \u30b3\u30fc\u30c9\u306e\u4f4e\u4f4d\u8868\u73fe\uff09\u3060\u3068\u8003\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u547d\u4ee4\u5217\u306f Ruby VM \u306e\u5185\u90e8\u52d5\u4f5c\u306b\u7dca\u5bc6\u306b\u7d50\u3073\u4ed8\u3044\u3066\u3044\u308b\u305f\u3081\u3001Ruby \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u7570\u306a\u308c\u3070\u3001\u540c\u3058 Ruby \u30b3\u30fc\u30c9\u3067\u3082\u547d\u4ee4\u306e\u89b3\u70b9\u3060\u3051\u3067\u306a\u304f\u3001\u5168\u4f53\u7684\u306a\u69cb\u9020\u3084\u7570\u306a\u308b\u547d\u4ee4\u5217\u9593\u306e\u95a2\u4fc2\u306b\u304a\u3044\u3066\u3082\u7570\u306a\u308b <code>iseq<\/code> \u304c\u751f\u6210\u3055\u308c\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\u5217\u306b\u3088\u308a\u3001Ruby \u30b3\u30fc\u30c9\u306e\u4f4e\u4f4d\u8868\u73fe\u306b\u76f4\u63a5\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30c7\u30d0\u30c3\u30ac\u30fc\u306f\u7279\u5b9a\u306e\u5185\u90e8\u30d5\u30e9\u30b0\u3092\u5207\u308a\u66ff\u3048\u305f\u308a\u3001 <code>iseq<\/code> \u5185\u306e\u547d\u4ee4\u3092\u5909\u66f4\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u3067\u3053\u306e\u6a5f\u80fd\u3092\u6d3b\u7528\u3057\u3001\u5b9f\u884c\u6642\u306b\u5143\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306a\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c\u65b9\u6cd5\u3092\u52b9\u679c\u7684\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3068\u3048\u3070\u3001\u30c7\u30d0\u30c3\u30ac\u30fc\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30c8\u30ec\u30fc\u30b9\u30a4\u30d9\u30f3\u30c8\u304c\u306a\u3044\u7279\u5b9a\u306e\u547d\u4ee4\u3067\u30c8\u30ec\u30fc\u30b9\u30a4\u30d9\u30f3\u30c8\u3092\u6709\u52b9\u306b\u3059\u308b\u3068\u3001\u305d\u306e\u30dd\u30a4\u30f3\u30c8\u306b\u5230\u9054\u3057\u305f\u6642\u70b9\u3067 Ruby VM \u304c\u4e00\u6642\u505c\u6b62\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u7279\u5b9a\u306e\u8a00\u8a9e\u69cb\u9020\u3068\u547c\u3073\u51fa\u3057\u306e\u30b9\u30c6\u30c3\u30d7\u5b9f\u884c\u30c1\u30a7\u30fc\u30f3\u306b\u304a\u3051\u308b\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u52d5\u4f5c\u3067\u3059\u3002\u958b\u767a\u8005\u304c\u30c7\u30d0\u30c3\u30b0\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u633f\u5165\u3057\u305f\u308a\u3001\u4f55\u3089\u304b\u306e\u65b9\u6cd5\u3067\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u306a\u304f\u900f\u660e\u7684\u306b\u52d5\u4f5c\u3059\u308b\u30c7\u30d0\u30c3\u30ac\u30fc\u3092\u69cb\u7bc9\u3059\u308b\u306b\u306f\u3001\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u3092\u76f4\u63a5\u30a4\u30f3\u30b9\u30c8\u30eb\u30e1\u30f3\u30c8\u5316\u3059\u308b\u6a5f\u80fd\u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002<\/p>\n\n\n\n<p>Ruby \u30b3\u30fc\u30c9\u3067\u547d\u4ee4\u5217\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"ruby\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def say_hello\n puts \"Hello Ruby developers ?!\"\nend\n\n\nmethod_object = method(:say_hello)\niseq = RubyVM::InstructionSequence.of(method_object)\n\n\nputs iseq.disasm<\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3092\u3055\u3089\u306b\u8a73\u3057\u304f\u8abf\u3079\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u307e\u305a\u3001\u5148\u8ff0\u306e <code>puts<\/code> \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u542b\u3080 &lt;0>say_hello \u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306b <code>method(:say_hello)<\/code> \u3092\u4f7f\u7528\u3057\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u304b\u3089\u30e1\u30bd\u30c3\u30c9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u6700\u5f8c\u306b <code>disasm<\/code> \u3092\u4f7f\u7528\u3057\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u547d\u4ee4\u5217\u3092\u53d6\u5f97\u3057\u3066\u4eba\u9593\u304c\u8aad\u307f\u53d6\u308c\u308b\u5f62\u5f0f\u3067\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5185\u90e8\u52d5\u4f5c\u3092\u8abf\u67fb\u3057\u3001Ruby \u304c\u5b9f\u884c\u3059\u308b\u5b9f\u969b\u306e\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u547d\u4ee4\u3092\u78ba\u8a8d\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u51fa\u529b\u3092\u8abf\u67fb\u3057\u3001\u3069\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u306e\u304b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">== disasm: #&amp;lt;ISeq:say_hello@iseq_example.rb:1 (1,0)-(3,3)>\n0000 putself                                                          (   2)[LiCa]\n0001 putchilledstring                       \"Hello Ruby developers ?!\"\n0003 opt_send_without_block                 &amp;lt;calldata!mid:puts, argc:1, FCALL|ARGS_SIMPLE>\n0005 leave                                                            (   3)[Re]<\/pre>\n\n\n\n<p>\u6700\u521d\u306e\u884c\u306b Ruby \u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u306b\u95a2\u3059\u308b\u30e1\u30bf\u30c7\u30fc\u30bf\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u3001<code>(1,0)-(3,3)<\/code> \u306e\u4f4d\u7f6e\u7bc4\u56f2\u3067 <code>iseq_example.rb<\/code> \u306b <code>say_hello<\/code> \u30e1\u30bd\u30c3\u30c9\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u60c5\u5831\u3067\u3059\u3002\u305d\u306e\u4e0b\u306b\u306f\u3001Ruby VM \u304c\u5b9f\u884c\u3059\u308b\u5b9f\u969b\u306e\u547d\u4ee4\u304c\u3042\u308a\u307e\u3059\u3002\u5404\u884c\u306f 1 \u3064\u306e\u547d\u4ee4\u3092\u8868\u3057\u3066\u304a\u308a\u3001\u4eba\u9593\u304c\u8aad\u307f\u53d6\u308c\u308b\u5f62\u5f0f\u3067\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u300cHello Ruby developers ?!\u300d\u6587\u5b57\u5217\u5f15\u6570\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u5185\u306e\u8a18\u8ff0\u5185\u5bb9\u304c\u7dad\u6301\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u7c21\u5358\u306b\u8aad\u307f\u53d6\u308c\u307e\u3059\u3002\u8907\u96d1\u306a\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3084\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3082\u3001\u975e ASCII \u6587\u5b57\u5217\u3082\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u306e\u3088\u3046\u306a\u900f\u660e\u6027\u306b\u3088\u308a\u3001\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u30ec\u30d9\u30eb\u3067\u306e\u6319\u52d5\u3092\u3088\u308a\u7c21\u5358\u306b\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\u5217\u306f\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u5185\u306e\u91cd\u8981\u306a\u5b9f\u884c\u30dd\u30a4\u30f3\u30c8\u3092\u30de\u30fc\u30af\u3059\u308b\u3053\u3068\u3067\u3001Ruby \u306e\u30c7\u30d0\u30c3\u30b0\u306b\u304a\u3044\u3066\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u3044\u307e\u3059\u3002\u51fa\u529b\u5185\u306e\u89d2\u62ec\u5f27\u8868\u8a18\u3067\u306f\u3001\u884c\u30a4\u30d9\u30f3\u30c8\u306e <code>Li<\/code> \u3084\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u306e <code>Ca<\/code>\u3001\u305d\u3057\u3066\u8fd4\u5374\u51e6\u7406\u306e <code>Re<\/code> \u3068\u3044\u3063\u305f\u30de\u30fc\u30ab\u30fc\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30de\u30fc\u30ab\u30fc\u306f\u3001Ruby VM \u306b\u5b9f\u884c\u6642\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u52d5\u3055\u305b\u308b\u3079\u304d\u30bf\u30a4\u30df\u30f3\u30b0\u3092\u6307\u793a\u3057\u3066\u3044\u307e\u3059\u3002TracePoint \u306f\u3053\u308c\u3089\u306e\u30de\u30fc\u30ab\u30fc\u3092\u53c2\u7167\u3057\u3066\u5b9f\u884c\u4e2d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30d5\u30c3\u30af\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u30ea\u30c3\u30b9\u30f3\u3057\u3001\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3059\u308b\u969b\u306b\u4ecb\u5165\u3059\u308b\u306e\u3067\u3059\u30022 \u3064\u306e\u6280\u8853\u304c\u3053\u306e\u3088\u3046\u306b\u7dca\u5bc6\u306b\u7d50\u3073\u4ed8\u3044\u3066\u3044\u308b\u3053\u3068\u3067\u3001\u30c7\u30d0\u30c3\u30ac\u30fc\u304c\u5b9f\u884c\u3092\u4e00\u6642\u505c\u6b62\u3057\u3001\u72b6\u614b\u3092\u691c\u67fb\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u3055\u3089\u306b\u8e0f\u307f\u8fbc\u3080: Ruby \u306e C \u30ec\u30d9\u30eb\u30c7\u30d0\u30c3\u30b0 API<\/h3>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u3067\u3001Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u80cc\u5f8c\u306b\u3042\u308b TracePoint \u3068\u547d\u4ee4\u5217\u3068\u3044\u3046 2 \u3064\u306e\u30b3\u30a2\u6280\u8853\u3092\u8aac\u660e\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u5b9f\u7528\u7684\u306a Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u3092\u69cb\u7bc9\u3059\u308b\u306b\u306f\u3053\u308c\u3089\u3060\u3051\u3067\u3082\u5341\u5206\u3067\u3059\u304c\u3001RubyMine \u304c\u63d0\u4f9b\u3059\u308b\u9ad8\u5ea6\u306a\u6a5f\u80fd\uff08\u30b9\u30de\u30fc\u30c8\u30b9\u30c6\u30c3\u30d7\u5b9f\u884c\u3084\u30b3\u30fc\u30eb\u30b9\u30bf\u30c3\u30af\u5185\u306e\u524d\u5f8c\u79fb\u52d5\u306a\u3069\uff09\u3092\u5b9f\u88c5\u3059\u308b\u5834\u5408\u306f\u3001TracePoint \u3068\u547d\u4ee4\u5217\u3060\u3051\u3067\u306f\u4e0d\u53ef\u80fd\u3067\u3059\u3002\u305d\u306e\u3088\u3046\u306a\u6a5f\u80fd\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u306b\u306f\u3001\u3082\u3046\u4e00\u6bb5\u968e\u8e0f\u307f\u8fbc\u307f\u3001Ruby \u81ea\u4f53\u304c\u63d0\u4f9b\u3059\u308b\u4f4e\u30ec\u30d9\u30eb\u306e\u30c7\u30d0\u30c3\u30b0 API \u3092\u6d3b\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>CRuby \u306f\u3001\u4e00\u822c\u516c\u958b\u3055\u308c\u3066\u3044\u308b Ruby API \u306b\u3088\u3063\u3066\u6b8b\u3055\u308c\u305f\u30ae\u30e3\u30c3\u30d7\u3092\u57cb\u3081\u308b\u591a\u6570\u306e\u5185\u90e8\u30e1\u30bd\u30c3\u30c9\u3092\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u3088\u3046\u306a\u30e1\u30bd\u30c3\u30c9\u306b\u306f\u3001<a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/vm_core.h\" target=\"_blank\" rel=\"noopener\">vm_core.h<\/a>\u3001<a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/vm_callinfo.h\" target=\"_blank\" rel=\"noopener\">vm_callinfo.h<\/a>\u3001<a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/iseq.h\" target=\"_blank\" rel=\"noopener\">iseq.h<\/a>\u3001<a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/include\/ruby\/debug.h\" target=\"_blank\" rel=\"noopener\">debug.h<\/a> \u306a\u3069\u306e C \u30d8\u30c3\u30c0\u30fc\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5185\u90e8\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3088\u308a\u3001\u4e00\u822c\u516c\u958b\u306e API \u306e\u5bfe\u5fdc\u7bc4\u56f2\u3092\u8d85\u3048\u308b\u5f37\u529b\u306a\u6a5f\u80fd\u3092\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u91cd\u8981\u306a\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u304c\u4f34\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306f CRuby \u306b\u7279\u5316\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u3053\u308c\u3089\u3092\u4f7f\u7528\u3059\u308b\u30c7\u30d0\u30c3\u30ac\u30fc\u306f JRuby \u3084 TruffleRuby \u306a\u3069\u306e\u4ed6\u306e\u5b9f\u88c5\u3067\u306f\u6a5f\u80fd\u3057\u307e\u305b\u3093\u3002\u3053\u308c\u3089\u306e API \u306f\u3001\u3059\u3079\u3066\u306e Ruby \u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u516c\u958b\u7248\u3067\u3082\u5b89\u5b9a\u7248\u3067\u3082\u306a\u3044\u3068\u3044\u3046\u6b20\u70b9\u3082\u3042\u308a\u307e\u3059\u3002\u4e9b\u7d30\u306a\u66f4\u65b0\u3067\u3082\u6a5f\u80fd\u3057\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u3053\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u30c7\u30d0\u30c3\u30ac\u30fc\u306f Ruby \u306e\u5909\u66f4\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u306b\u5e38\u306b\u6ce8\u610f\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u3053\u306e\u4f4e\u4f4d API \u304c\u3069\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3001\u30c7\u30d0\u30c3\u30ac\u30fc\u30c4\u30fc\u30eb\u306b\u4f55\u3092\u63d0\u4f9b\u3059\u308b\u306e\u304b\u3092\u628a\u63e1\u3057\u3066\u304a\u304f\u305f\u3081\u3001\u3053\u306e\u3088\u3046\u306a\u5185\u90e8\u30e1\u30bd\u30c3\u30c9\u3092\u3044\u304f\u3064\u304b\u8abf\u67fb\u3059\u308b\u4fa1\u5024\u306f\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/include\/ruby\/debug.h#L423\" target=\"_blank\" rel=\"noopener\"><code>rb_tracepoint_new(\u2026)<\/code><\/a> \u304b\u3089\u59cb\u3081\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);<\/pre>\n\n\n\n<p>\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f Ruby \u30b3\u30fc\u30c9\u306b\u30c8\u30ec\u30fc\u30b9\u30dd\u30a4\u30f3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u306e\u3068\u540c\u3058\u3088\u3046\u306b\u6a5f\u80fd\u3057\u307e\u3059\u304c\u3001\u3088\u308a\u67d4\u8edf\u6027\u304c\u9ad8\u304f\u3001\u9ad8\u5ea6\u306a\u7528\u9014\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002Ruby VM \u306b\u3088\u308a\u6df1\u304f\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5fc5\u8981\u306e\u3042\u308b C \u62e1\u5f35\u6a5f\u80fd\u3068\u3057\u3066\u4f5c\u6210\u3055\u308c\u305f\u4f4e\u30ec\u30d9\u30eb\u306e\u30c7\u30d0\u30c3\u30ac\u30fc\u3067\u306f\u7279\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002RubyMine \u30c7\u30d0\u30c3\u30ac\u30fc\u3067\u306f\u3053\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u63a1\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c8\u30ec\u30fc\u30b9\u30dd\u30a4\u30f3\u30c8\u3092\u6709\u52b9\/\u7121\u52b9\u5316\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3068\u5834\u6240\u3092\u3088\u308a\u6b63\u78ba\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u30b9\u30de\u30fc\u30c8\u30b9\u30c6\u30c3\u30d7\u5b9f\u884c\u306e\u5b9f\u88c5\u306b\u4e0d\u53ef\u6b20\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/include\/ruby\/debug.h#L227\" target=\"_blank\" rel=\"noopener\"><code>rb_debug_inspector_open(\u2026)<\/code><\/a> \u3068\u3044\u3046\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c9\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);<\/pre>\n\n\n\n<p>\u3053\u306e C \u30ec\u30d9\u30eb\u306e API \u3067\u306f\u3001VM \u306e\u72b6\u614b\u3092\u5909\u66f4\u305b\u305a\u306b\u30b3\u30fc\u30eb\u30b9\u30bf\u30c3\u30af\u3092\u8abf\u67fb\u3067\u304d\u307e\u3059\u3002<code>func<\/code> \u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u306f\u3001\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3001\u4f4d\u7f6e\u3001\u547d\u4ee4\u5217\u3001\u304a\u3088\u3073\u305d\u306e\u4ed6\u306e\u30d5\u30ec\u30fc\u30e0\u306e\u8a73\u7d30\u3092\u63d0\u4f9b\u3059\u308b <a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/include\/ruby\/debug.h#L207\" target=\"_blank\" rel=\"noopener\"><code>rb_debug_inspector_t<\/code><\/a> \u69cb\u9020\u4f53\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002RubyMine \u30c7\u30d0\u30c3\u30ac\u30fc\u3067\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u30c7\u30d0\u30c3\u30ac\u30fc\u306b\u3088\u3063\u3066\u4e2d\u65ad\u3055\u308c\u305f\u969b\u306b\u30d5\u30ec\u30fc\u30e0\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3057\u3001\u30b3\u30fc\u30eb\u30b9\u30bf\u30c3\u30af\u4e0a\u3067\u30d5\u30ec\u30fc\u30e0\u3092\u5207\u308a\u66ff\u3048\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e API \u304c\u306a\u3044\u5834\u5408\u3001Ruby \u3067\u306e\u30d5\u30ec\u30fc\u30e0\u5185\u306e\u79fb\u52d5\u64cd\u4f5c\u3068\u30ab\u30b9\u30bf\u30e0\u30d5\u30ec\u30fc\u30e0\u306e\u691c\u67fb\u306f\u304b\u306a\u308a\u56f0\u96e3\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u6700\u5f8c\u306e\u4f8b\u306f\u3001<code>iseq<\/code> \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u9023\u643a\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u30da\u30a2\u3067\u3059\u3002<a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/iseq.h#L221\" target=\"_blank\" rel=\"noopener\"><code>rb_iseqw_to_iseq(\u2026)<\/code><\/a> \u30e1\u30bd\u30c3\u30c9\u306f Ruby \u306e\u5024\u304b\u3089 C \u306e\u5024\u306b <code>iseq<\/code> \u3092\u5909\u63db\u3059\u308b\u306e\u306b\u5bfe\u3057\u3001<a href=\"https:\/\/github.com\/ruby\/ruby\/blob\/a0fe0095ab2711ba54b29cdd2a5957f993cfc1de\/iseq.h#L203\" target=\"_blank\" rel=\"noopener\"><code>rb_iseq_original_iseq(\u2026)<\/code><\/a> \u30e1\u30bd\u30c3\u30c9\u306f C \u304b\u3089 Ruby \u306b\u5909\u63db\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u306f\u6b63\u78ba\u306a\u4f4e\u30ec\u30d9\u30eb\u306e\u5236\u5fa1\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b Ruby \u30b3\u30fc\u30c9\u3068 C \u62e1\u5f35\u6a5f\u80fd\u30b3\u30fc\u30c9\u9593\u3092\u5207\u308a\u66ff\u3048\u3066\u3044\u307e\u3059\u3002RubyMine \u30c7\u30d0\u30c3\u30ac\u30fc\u3067\u306f\u3001\u3053\u308c\u3089\u306f\u30b9\u30de\u30fc\u30c8\u30b9\u30c6\u30c3\u30d7\u5b9f\u884c\u306e\u5b9f\u88c5\u3067\u6d3b\u767a\u306b\u4f7f\u7528\u3055\u308c\u3066\u304a\u308a\u3001\u3069\u306e\u30b3\u30fc\u30c9\u304c\u30c7\u30d0\u30c3\u30b0\u4e2d\u306b\u30b9\u30c6\u30c3\u30d7\u30a4\u30f3\u3055\u308c\u308b\u3079\u304d\u304b\u3092\u5224\u65ad\u3059\u308b\u4e0a\u3067\u5f79\u7acb\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u4f4e\u30ec\u30d9\u30eb\u306e API \u306f\u3001TracePoint \u3068\u547d\u4ee4\u5217\u3060\u3051\u3067\u306f\u4e0d\u53ef\u80fd\u306a\u9ad8\u5ea6\u306a\u30c7\u30d0\u30c3\u30b0\u6a5f\u80fd\u306e\u69cb\u7bc9\u306b\u4f7f\u7528\u3067\u304d\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u3053\u308c\u3089\u306b\u306f\u30b3\u30b9\u30c8\u304c\u4f34\u3044\u307e\u3059\u3002\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u304c CRuby \u306b\u56fa\u5b9a\u3055\u308c\u3001\u8907\u6570\u306e Ruby \u30d0\u30fc\u30b8\u30e7\u30f3\u9593\u3067\u52d5\u4f5c\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u308b\u305f\u3081\u306b\u4fdd\u5b88\u306e\u8ca0\u62c5\u304c\u5927\u304d\u304f\u306a\u308b\u306e\u3067\u3059\u3002\u3068\u306f\u3044\u3048\u3001Ruby VM \u3068\u306e\u7dca\u5bc6\u306a\u7d71\u5408\u3092\u5fc5\u8981\u3068\u3059\u308b\u30c7\u30d0\u30c3\u30ac\u30fc\u3067\u306f\u3001\u3053\u308c\u3089\u306f\u4f9d\u7136\u3068\u3057\u3066\u4e0d\u53ef\u6b20\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u3092\u5f37\u529b\u306b\u3059\u308b TracePoint \u3068\u547d\u4ee4\u5217\u3068\u8a00\u3046\u57fa\u672c\u6280\u8853\u3092\u8aac\u660e\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e 2 \u3064\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u3001\u30e2\u30c0\u30f3\u306a Ruby \u30c7\u30d0\u30c3\u30ac\u30fc\u304c\u5b9f\u884c\u4e2d\u306e Ruby \u30b3\u30fc\u30c9\u3092\u3069\u306e\u3088\u3046\u306b\u89b3\u6e2c\u3057\u3001\u5bfe\u8a71\u3059\u308b\u304b\u306e\u57fa\u790e\u3092\u5f62\u6210\u3059\u308b\u3082\u306e\u3067\u3059\u3002TracePoint \u306f\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u3073\u51fa\u3057\u3084\u884c\u306e\u5b9f\u884c\u3068\u3044\u3063\u305f\u7279\u5b9a\u306e\u5b9f\u884c\u6642\u30a4\u30d9\u30f3\u30c8\u3078\u306e\u30d5\u30c3\u30af\u3092\u53ef\u80fd\u306b\u3059\u308b\u306e\u306b\u5bfe\u3057\u3001\u547d\u4ee4\u5217\u3067\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u6e08\u307f\u306e Ruby VM \u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u3078\u306e\u4f4e\u30ec\u30d9\u30eb\u30a2\u30af\u30bb\u30b9\u3092\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u4f4e\u30ec\u30d9\u30eb\u306e CRuby C API \u306b\u3088\u3063\u3066\u30b3\u30fc\u30c9\u5b9f\u884c\u3092\u3055\u3089\u306b\u6b63\u78ba\u306b\u5236\u5fa1\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7c21\u5358\u306b\u8aac\u660e\u3057\u3001RubyMine \u306a\u3069\u306e\u30c7\u30d0\u30c3\u30ac\u30fc\u304c\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3092\u3069\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u3066\u3044\u308b\u304b\u306b\u3064\u3044\u3066\u306e\u7406\u89e3\u3092\u6df1\u3081\u307e\u3057\u305f\u3002\u3053\u3053\u3067\u306f\u5b8c\u5168\u306a\u30c7\u30d0\u30c3\u30ac\u30fc\u306e\u5b9f\u88c5\u306b\u3064\u3044\u3066\u306f\u8aac\u660e\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u3053\u306e\u57fa\u790e\u306f\u3053\u308c\u3089\u306e\u30c4\u30fc\u30eb\u306e\u52d5\u4f5c\u3092\u7406\u89e3\u3059\u308b\u305f\u3081\u306e\u57fa\u76e4\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u5f8c\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30e2\u30c0\u30f3\u306a\u30c7\u30d0\u30c3\u30ac\u30fc\u304c\u3053\u306e\u57fa\u76e4\u306e\u4e0a\u306b\u3069\u306e\u3088\u3046\u306b\u69cb\u7bc9\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u3055\u3089\u306b\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u304a\u697d\u3057\u307f\u304f\u3060\u3055\u3044\u3002\u30d0\u30b0\u304c\u5c11\u306a\u304f\u3001\u7c21\u5358\u306b\u4fee\u6b63\u3067\u304d\u308b\u3053\u3068\u3092\u9858\u3063\u3066\u3044\u307e\u3059\uff01<\/p>\n\n\n\n<p>RubyMine \u30c1\u30fc\u30e0\u4e00\u540c\u3088\u308a<\/p>\n","protected":false},"author":1504,"featured_media":573832,"comment_status":"closed","ping_status":"closed","template":"","categories":[4156],"tags":[],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/ruby\/578997"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/ruby"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/types\/ruby"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/users\/1504"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/comments?post=578997"}],"version-history":[{"count":5,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/ruby\/578997\/revisions"}],"predecessor-version":[{"id":579014,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/ruby\/578997\/revisions\/579014"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/media\/573832"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/media?parent=578997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/categories?post=578997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/tags?post=578997"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/cross-post-tag?post=578997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}