Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
lldbを使ってCRubyの中を覗く
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Koji NAKAMURA
August 25, 2026
Technology
29
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
lldbを使ってCRubyの中を覗く
Kashiwa.rb #26
https://kashiwarb.connpass.com/event/402700/
Koji NAKAMURA
August 25, 2026
Transcript
18 slides
lldbを使ってCRubyの中を覗く 2026.8.20 Kashiwa.rb #26 Koji NAKAMURA (@kozy4324)
自己紹介 Koji NAKAMURA • 𝕏: @kozy4324 • GitHub:@kozy4324 • Kashiwa.rb主催
最近 of kozy4324 • 書籍片手にCRubyソースコードリーディング
\CRubyムズカシイ/
lldb
lldb • デバッガ • LLVMプロジェクトの一部として開発されているもの ◦ GNUプロジェクトの方で開発されてるのは gdb • macOSでは標準的なデバッガ
◦ XCodeがLLVM/Clangを採用しているかららしい
via Ruby Documentation • https://docs.ruby-lang.org/en/master/contributing/building_ruby_md.html#debugging
今回のゴール • Rubyコード → ISeq を確認 • 確認した ISeq から何かしらの
CRuby コードが動いている ぞ!っていう部分の繋がりを確認する
Rubyコード
Rubyコードに対する ISeq
Rubyコードに対する ISeq
newhash • https://github.com/ruby/ruby/blob/v4.0.0/insns.def#L580-L598
opt_aset • https://github.com/ruby/ruby/blob/v4.0.0/insns.def#L1536-L1552
opt_aref • https://github.com/ruby/ruby/blob/v4.0.0/insns.def#L1516-L1534
Rubyコード → ISeq → CRuby実装 の繋がり • {} → newhash
→ rb_hash_new • h[:a] = → opt_aset → vm_opt_aset → rb_hash_aset • h[:a] → opt_aref → vm_opt_aref → rb_hash_aref
デモ
lldbで動かしてみて • Rubyコード → ISeq → CRuby実装 をなんとなく理解 • と同時に分からないことが複数一気に出てきた
◦ insns.defの見方 ◦ insns.defにある「attr bool leaf = false;」とは? ▪ LLM曰く「VMの世界から外に出うる命令」らしい??? ◦ insns.defにあるコード片?が実際にどう統合される? ◦ and more …
EOF
More Decks by Koji NAKAMURA
See All by Koji NAKAMURA
Lightning近況報告
kozy4324
0
350
龍昌餃子で理解するWebサーバーの並行処理モデル - 東葛.dev #9
kozy4324
1
390
Rubyで作る論理回路シミュレータの設計の話 - Kashiwa.rb #12
kozy4324
1
650
Rubyで作る論理回路シミュレータ - Shinjuku.rb #99
kozy4324
0
130
Steep導入したいRTA - Kashiwa.rb #11
kozy4324
0
260
これまで細々と作成したGemの紹介をします - Kashiwa.rb #9
kozy4324
0
330
東京Ruby会議12のお手伝いしてきた話
kozy4324
0
160
個人開発発表 LT - Shinjuku.rb #97
kozy4324
0
970
Ruby界隈を中心に2024をふりかえる - Kashiwa.rb #6
kozy4324
0
270
Other Decks in Technology
See All in Technology
AIネイティブ組織の作り方。1人のPOとAIから始める、自社での実験
ama_ch
1
680
JAWS_FESTA2026_オンプレ-AWS間プロキシサーバの移行_性能_障害対応で得た実践ノウハウ_高島一晃.pdf
tkazuaki0820
1
130
セキュリティ専任チームなしで攻撃を先回りするSREが実践したSIEM on Amazon OpenSearch Service
cscengineer
PRO
1
890
農夫は秘伝のタレを知らない - NOBODY KNOWS THE HIDDEN SOURCE - Kaggriculture 3rd Place Solution
masspeaks
0
330
「任されビリティ」で引き受けて「よしなりてぃ」に頼らず任せる / Accept tasks with "makasarebility" and hand them over without relying on "yoshinarily"
pauli
0
590
AI対話型分析を作成し、リリースするまでの話 / The Road to Release: Buiding AI Conversational Analytics
yappli_developers
0
140
異夢同船〜異なる夢でも同じ船でなんとかする〜
fortegp05
0
240
Kiro CLI 入門 (ターミナルと CI で使う) | 目指せ Kiro マスター 03
inariku
PRO
2
150
高品質と高スピードを支える品質のシフトレフトのアプローチ
goyoki
4
1.2k
市販IoT機器や自作IoT機器とHomeAssistantを駆使して家の電気代をできる限り見える化する方法の考案
harutiro
0
160
狙われているAPIの脆弱性!今こそ手をつけるべき根本的な対策とは?
nagix
0
130
DevOps Agentにあらゆるセキュリティインシデントのトリアージを任せた件
jirtosterone
1
150
Featured
See All Featured
Abbi's Birthday
coloredviolet
5
11k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
The Pragmatic Product Professional
lauravandoore
37
7.5k
The Invisible Side of Design
smashingmag
301
52k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Designing for Timeless Needs
cassininazir
1
560
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k