Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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.3k
Other Decks in Technology
See All in Technology
論理レプリケーションを使ったDB統合
kkato1
0
310
密着! Bedrockerがre:Invent 2024で過ごした5日間を紹介
minorun365
PRO
3
310
【ASW21-01】STAMPSTPAで導き出した課題に対する対策立案手法の提案
hianraku9498
0
590
sre本読んだ感想
pisakun
0
230
Nihonbashi Test Talk #3_WebDriver BiDiと最新の実装状況 / WebDriver BiDi latest status
takeyaqa
1
150
2024/11/29_失敗談から学ぶ! エンジニア向けre:Invent攻略アンチパターン集
hiashisan
0
440
AWS re:Invent 2024登壇資料(GBL206-JA: Unleashing the power of generative AI on AWS for your business)
minorun365
PRO
7
240
イノベーショントークから見るクラウド運用の未来を振り返ってみた
nyankotaro
0
310
ナレッジベースはどのようにSQLを生成するのか / Knowledge Bases supports structed data retrieval
hayaok3
1
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
52k
pmconf2024_UPSIDER
upsider_tech
0
7.4k
Replit Agent
kawaguti
PRO
2
190
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
4 Signs Your Business is Dying
shpigford
181
21k
GraphQLとの向き合い方2022年版
quramy
44
13k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Invisible Side of Design
smashingmag
298
50k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
250
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
A better future with KSS
kneath
238
17k
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 Λ͏ͱϓϩδΣΫτʹ ࠨӈ͞Εͳ͍σόοΫڥ͕ खʹ͍Γ·͢
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠