Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
LLDB + chisel = ∞
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Toshihiro Morimoto
April 26, 2014
Technology
11
3.8k
LLDB + chisel = ∞
yidev東京第二回の発表内容です。
デモ動画 =>
https://www.youtube.com/watch?v=5NdfK33pEH8
Toshihiro Morimoto
April 26, 2014
Tweet
Share
More Decks by Toshihiro Morimoto
See All by Toshihiro Morimoto
Xcode8 で開発はどうかわったのか
dealforest
10
6.3k
魅せるデバッグ技術
dealforest
4
1.6k
LLDB の世界からみた Swift
dealforest
4
5.4k
Xcode で快適なデバッグライフを追い求める
dealforest
29
24k
Intrducing debug in WWDC2016
dealforest
3
790
swift build と Xcode での Build の違い
dealforest
3
2.1k
RIP Xcode Plugin 🙏
dealforest
0
4.8k
Introducing Xcode Editor Extension
dealforest
2
4.6k
Introducing Anglerfish
dealforest
2
3.4k
Other Decks in Technology
See All in Technology
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
690
Greatest Disaster Hits in Web Performance
guaca
0
160
今日から始めるAmazon Bedrock AgentCore
har1101
4
400
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
190
GSIが複数キー対応したことで、俺達はいったい何が嬉しいのか?
smt7174
3
150
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
380
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
180
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
170
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
630
生成AI時代にこそ求められるSRE / SRE for Gen AI era
ymotongpoo
5
3k
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Rails Girls Zürich Keynote
gr2m
96
14k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Crafting Experiences
bethany
1
48
Prompt Engineering for Job Search
mfonobong
0
160
A designer walks into a library…
pauljervisheath
210
24k
Paper Plane
katiecoart
PRO
0
46k
Fireside Chat
paigeccino
41
3.8k
The SEO Collaboration Effect
kristinabergwall1
0
350
Raft: Consensus for Rubyists
vanstee
141
7.3k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
430
Transcript
LLDB + chisel = ∞ 2014/04/26 yidev౦ژୈೋճ @dealforest Toshihro Morimoto
ࣗݾհ http://about.me/dealforest ! ! iOS App / Web Application(perl, ruby)
@dealforest Toshihro Morimoto
Έͳ͞Μ LLDB ͔ͭͬͯ·͔͢ʁ
ͱ͋Δੲ…
LLDB ͕σϑΥϧτͷ Debugger ͱͳΓ·͕ͨ͠ OS X 10.8.4 Ͱ Xcode ͔ΒΞϓϦέʔγϣϯΛ
iOS Simulator Ͱ࣮ߦͨ͠ͱ͖ʹ SIGABRT Ͱ ΞϓϦ͕ىಈͤͣʹ crash ͢Δ (※Xcode 4.6.3 Ͱमਖ਼͞Ε·ͨ͠)
ղܾࡦ σόοΨΛ LLDB ͔Β GDB ʹมߋ͢Δ
ͱ͍͏͜ͱ͕Γ·͕ͨ͠ Xcode 5.1.1 ͷࡢࠓ Έͳ͞Μ LLDB ͬͯ·͢ΑͶʁ
ͳͥ LLDB(σόοΨ) ʹ ݻࣥ͢Δͷ͔ʁ
ϓϩδΣΫτʹґଘͤͣ͠ʹ σόοά͍ͨ͠
؆୯ͳ͓͞Β͍
iOS Advent Calendar 2013 6
͓͞Β͍ͷ༰ • object ͷදࣔ/มߋ/ఆٛ/ • Python ͷ࣮ߦ • Inspector ͷΧελϚΠζ
• ΧελϜίϚϯυͷ࡞ • ઃఆϑΝΠϧ
object Λදࣔ (llbd) po [“obejct” or “address”] (lldb) p [“primitive
value” or “address”]
object ͷΛมߋ (lldb) po self.title = @“hoge”
object Λఆٛ (lldb) po NSString *$hoge = @“hoge” (lldb) po
$hoge
Python ͷ࣮ߦ (lldb) script print 'hoge'
Python ͷ࣮ߦ (lldb) script import os (lldb) script print os.getcwd()
ΧελϜίϚϯυͷ࡞ ΊΜͲ͍͘͞ͷͰ Qiita Λݟ͍ͯͩ͘͞
Inspector ͷΧελϚΠζ http://stavash.wordpress.com/2013/01/06/advanced-issues-creating-custom-lldb- object-summaries/
Inspector ͷΧελϚΠζ
Inspector ͷΧελϚΠζ
ઃఆϑΝΠϧ 1. ~/.lldbinit-Xcode • Xcode ͔Βىಈͨ͠ࡍͷઃఆΛهೖ 2. ~/.lldbinit • shell
͔Βىಈͨ͠ࡍͷઃఆΛهೖ
ઃఆϑΝΠϧ ~/.lldbinit-Xcode ͕͋Δ߹ ~/.lldbinit ͕ಡΈࠐ·Εͳ͍ͷͰཁҙ
ઃఆϑΝΠϧ ~/.lldbinit-Xcode ʹ command source ~/.lldbinit Λهೖ͓ͯ͘͜͠ͱͰճආՄೳ
ઃఆϑΝΠϧʹ alias Λॻ͘͜ͱ͕Ͱ͖·͢
ศརͳ alias Λհ
stacktrace Λදࣔ (lldb) st ! command regex st 's/^[[:space:]]*$/po [NSThread
callStackSymbols]/'
ڥมΛදࣔ (lldb) pe ! command regex pe 's/^[[:space:]]*$/po [[NSProcessInfo processInfo]
environment]/'
NSDate Λ NSString ʹมͯ͠දࣔ (lldb) pd [NSDate] ! command regex
pd 's/^(.+)$/po [[NSString alloc] initWithData: %1 encoding:4]/'
CALayer ͷ Animation ͷมߋ (lldb) pa 0.4 # slow (lldb)
pa 1 # normal ! command regex pa 's/^(.+)$/p [(CALayer *)[[[[UIApplication sharedApplication] windows] objectAtIndex: 0] layer] setSpeed:%1]/'
؆୯ͳ͓͞Β͍͓ΘΓ
ຊ
Xcode 5.1 ͔Β break தʹ QuickLook Ͱදࣔ͞ΕΔΑ͏ʹͳΓ·ͨ͠
None
͋͘·Ͱίʔυ্ʹ ରͷ Object ͕ͳ͍ͱ ͍͚ͳ͔ͬͨΓԿ͔ͱෆศͰ͢
ͬͱࣗ༝ʹௐ͍ͨ
ίϚϯυΛཧ͢ΔͷΊΜͲ͍͘͞
alias Λཧ͢ΔͷΊΜͲ͍͘͞
ϝϯςφϯε͢ΔͷΊΜͲ͍͘͞
ͦΜͳଵଦͳΈͳ͞·ͷ ͨΊʹศརͳͷ͕͋Γ·͢
facebook/chisel https://github.com/facebook/chisel
Install $ brew install chisel or $ git clone https://github.com/
facebook/chisel.git
Install $ echo “command script import / path/to/fblldb.py” >> ~/.lldbinit
chisel - version 1.1.0 • Python Ͱॻ͔Ε͍ͯ·͢ • LLDB ༻ͷ
Debug ʹཱͭίϚϯυू • ࣮ػͰ͑Δ • ֤ʑͷ։ൃڥͰઃఆͯ͠Ε͍͍
தͰศརͳίϚϯυΛհ͠·͢
border/unborder ઢΛදࣔ/ඇදࣔ
pclass ࢠؔ(inherits from)Λදࣔ
pvc/pviews/ptv/pcells recursiveDiscription ͷ݁ՌΛ filtering
presponder Responder Chain Λදࣔ
bmessage ࢦఆͨ͠ selector ʹ breakpoint Λઃఆ
visualize ը૾ͱͯ͠ग़ྗ
taplog tap ͨ͠ object ͷ description Λදࣔ
DEMO
·ͱΊ chisel Λ͏ͱϓϩδΣΫτʹ ࠨӈ͞Εͳ͍σόοΫڥ͕ खʹ͍Γ·͢
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠