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
5k
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
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
160
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
130
型情報を用いたLintでコード品質を向上させる
sansantech
PRO
2
140
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
290
5分でわかるDuckDB
chanyou0311
10
3.3k
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
150
Google Cloud で始める Cloud Run 〜AWSとの比較と実例デモで解説〜
risatube
PRO
0
120
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
280
pg_bigmをRustで実装する(第50回PostgreSQLアンカンファレンス@オンライン 発表資料)
shinyakato_
0
110
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
18
5.6k
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
380
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
9k
Embracing the Ebb and Flow
colly
84
4.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
RailsConf 2023
tenderlove
29
940
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
A Philosophy of Restraint
colly
203
16k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
180
Music & Morning Musume
bryan
46
6.2k
BBQ
matthewcrist
85
9.4k
It's Worth the Effort
3n
183
28k
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 Λ͏ͱϓϩδΣΫτʹ ࠨӈ͞Εͳ͍σόοΫڥ͕ खʹ͍Γ·͢
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠