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
Toshihiro Morimoto
April 26, 2014
Technology
11
3.7k
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
5.8k
魅せるデバッグ技術
dealforest
4
1.5k
LLDB の世界からみた Swift
dealforest
4
4.9k
Xcode で快適なデバッグライフを追い求める
dealforest
29
22k
Intrducing debug in WWDC2016
dealforest
3
750
swift build と Xcode での Build の違い
dealforest
3
2k
RIP Xcode Plugin 🙏
dealforest
0
4.7k
Introducing Xcode Editor Extension
dealforest
2
4.5k
Introducing Anglerfish
dealforest
2
3.2k
Other Decks in Technology
See All in Technology
IaC運用を楽にするためにCDK Pipelinesを導入したけど、思い通りにいかなかった話
smt7174
1
110
プロポーザルのつくり方 〜個人技編〜 / How to come up with proposals
ohbarye
1
110
小規模に始めるデータメッシュとデータガバナンスの実践
kimujun
3
590
ネット広告に未来はあるか?「3rd Party Cookie廃止とPrivacy Sandboxの効果検証の裏側」 / third-party-cookie-privacy
cyberagentdevelopers
PRO
1
130
独自ツール開発でスタジオ撮影をDX!「VLS(Virtual LED Studio)」 / dx-studio-vls
cyberagentdevelopers
PRO
1
180
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
430
Aurora_BlueGreenDeploymentsやってみた
tsukasa_ishimaru
1
130
わたしとトラックポイント / TrackPoint tips
masahirokawahara
1
240
AWS CodePipelineでコンテナアプリをデプロイした際に、古いイメージを自動で削除する
smt7174
1
110
グローバル展開を見据えたサービスにおける機械翻訳プラクティス / dp-ai-translating
cyberagentdevelopers
PRO
1
150
10分でわかるfreeeのQA
freee
1
3.4k
omakaseしないための.rubocop.yml のつくりかた / How to Build Your .rubocop.yml to Avoid Omakase #kaigionrails
linkers_tech
3
740
Featured
See All Featured
For a Future-Friendly Web
brad_frost
175
9.4k
Documentation Writing (for coders)
carmenintech
65
4.4k
Speed Design
sergeychernyshev
24
570
Music & Morning Musume
bryan
46
6.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
328
21k
The Language of Interfaces
destraynor
154
24k
How to Ace a Technical Interview
jacobian
275
23k
Code Review Best Practice
trishagee
64
17k
Optimizing for Happiness
mojombo
376
69k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Faster Mobile Websites
deanohume
304
30k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
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 Λ͏ͱϓϩδΣΫτʹ ࠨӈ͞Εͳ͍σόοΫڥ͕ खʹ͍Γ·͢
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠