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.9k
魅せるデバッグ技術
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
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
複雑なState管理からの脱却
sansantech
PRO
1
150
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.4k
Application Development WG Intro at AppDeveloperCon
salaboy
0
190
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
140
AIチャットボット開発への生成AI活用
ryomrt
0
170
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
6
650
Zennのパフォーマンスモニタリングでやっていること
ryosukeigarashi
0
130
Featured
See All Featured
Ruby is Unlike a Banana
tanoku
97
11k
How STYLIGHT went responsive
nonsquared
95
5.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Producing Creativity
orderedlist
PRO
341
39k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Teambox: Starting and Learning
jrom
133
8.8k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
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 Λ͏ͱϓϩδΣΫτʹ ࠨӈ͞Εͳ͍σόοΫڥ͕ खʹ͍Γ·͢
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠