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
26
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
350
龍昌餃子で理解するWebサーバーの並行処理モデル - 東葛.dev #9
kozy4324
1
390
Rubyで作る論理回路シミュレータの設計の話 - Kashiwa.rb #12
kozy4324
1
640
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
150
個人開発発表 LT - Shinjuku.rb #97
kozy4324
0
960
Ruby界隈を中心に2024をふりかえる - Kashiwa.rb #6
kozy4324
0
270
Other Decks in Technology
See All in Technology
外国人エンジニアがVueプロトタイプで仕様を合わせている話 / Vue Fes Japan 2026 LT
eluwing
0
370
キヨさん、67歳。AIコーディングエージェントに挑む
happysamurai294
0
140
WireGuard for Apache NuttX - Bringing Secure Remote Access to embedded Devices -
aki310ooooo
0
120
ひとりで始めた AI駆動開発、チームに広げて何が変わったのか
kenichiodo
1
200
Agent 活用環境の構築・運用のための AWS サービスのご紹介/agentcore-for-building-and-operating-agents
ren8k
1
310
AX時代の自治体支援リソース再配分と役割分担の再構成:戦略とロードマップ(概要)
sishi2026
0
170
「作れる」と「リリースできる」の間にあったもの── PdMを外して見えた、PdMがやるべき仕事/Buildable ≠ Shippable: What Removing the PM Taught Me About the PM’s Job
yappli_developers
0
420
書き手が人でもAIでも正しくなる道、SREを埋め込んだDeveloper Platform / tech drivers day8
chmikata
4
890
Content Mapper APIの応用例~CSS Modules、言語ファイル~
uhyo
2
490
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
140
Oracle Database Security 詳細解説
oracle4engineer
PRO
1
200
AI時代のエンジニアの情報発信〜個人の発信を組織の力に変える〜
ryo_kawamata
0
6.6k
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
550
Balancing Empowerment & Direction
lara
6
1.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Unsuck your backbone
ammeep
672
58k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Product Roadmaps are Hard
iamctodd
55
13k
Making the Leap to Tech Lead
cromwellryan
135
10k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
KATA
mclloyd
PRO
35
16k
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