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
Koji NAKAMURA
August 25, 2026
Technology
24
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
More Decks by Koji NAKAMURA
See All by Koji NAKAMURA
Lightning近況報告
kozy4324
0
320
龍昌餃子で理解するWebサーバーの並行処理モデル - 東葛.dev #9
kozy4324
1
370
Rubyで作る論理回路シミュレータの設計の話 - Kashiwa.rb #12
kozy4324
1
630
Rubyで作る論理回路シミュレータ - Shinjuku.rb #99
kozy4324
0
130
Steep導入したいRTA - Kashiwa.rb #11
kozy4324
0
250
これまで細々と作成したGemの紹介をします - Kashiwa.rb #9
kozy4324
0
320
東京Ruby会議12のお手伝いしてきた話
kozy4324
0
140
個人開発発表 LT - Shinjuku.rb #97
kozy4324
0
950
Ruby界隈を中心に2024をふりかえる - Kashiwa.rb #6
kozy4324
0
260
Other Decks in Technology
See All in Technology
MCPゲートウェイを作って運用してわかったこと — Agent時代の権限管理の現在地
mtpooh
10
3.3k
大型犬好きによるPugの紹介
yamanoku
1
120
今さら理解するウェブフォントver.2026
takanorip
3
660
継続的なAIコスト最適化
bgpat
1
280
ai_cording_with_k8s_knowledge.pdf
mochizuki875
1
330
SDDの運用にめげずに向き合った話
sansantech
PRO
1
140
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
Running Kotlin + Quarkus with Lambda
nealle
0
400
メルペイ 会計システム概要と歴史
mewuto
0
210
予測不能な実行エージェントを安全にサクッと試せるサンドボックス環境の話
sansantech
PRO
1
140
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
780
1万名の社員が使う認証基盤で どう信頼性を担保するか?
kairim0
0
230
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.2k
Six Lessons from altMBA
skipperchong
29
4.5k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Balancing Empowerment & Direction
lara
6
1.3k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
470
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Transcript
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