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
How to Play LLDB in iOS runtime?
Search
Sting Su
May 28, 2019
Programming
0
220
How to Play LLDB in iOS runtime?
Sting Su
May 28, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
Site Reliability Engineering for GMO
pyama86
7
1k
見た目から始める生産性向上
ikumatadokoro
7
760
Rethinking UI building strategies @ SFI 2024
letelete
0
270
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
640
try! Swift Tokyo 2024のLT枠に採択されたプロポーザルを出すときに考えていたこと
ski
0
350
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
3.9k
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
870
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
18k
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.1k
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
データアナリストが行うDatabricksを活用したETLの自動化事例
shinoa
0
260
Ruby Pattern Matching
bkuhlmann
0
920
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
59
5k
The Cult of Friendly URLs
andyhume
74
5.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
1
1.3k
The Invisible Side of Design
smashingmag
294
49k
Designing for humans not robots
tammielis
248
25k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
Raft: Consensus for Rubyists
vanstee
132
6.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Code Reviewing Like a Champion
maltzj
513
39k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
154
14k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
Transcript
How to play with LLDB in iOS runtime? @stinge
• slide url https://ppt.cc/fhdtqx • QR Code
Background stinge • Mercari iOS Engineer • twitter: @StingeSu •
hobby: traveling & cooking
Outline • Why LLDB(Low Level Debugger)? • How LLDB works?
• LLDB OSS • Custom LLDB command
Why LLDB? • high-performance debugger • Clang expression parser &
LLVM disassembler • Default debugger in Xcode • Run Swift REPL & python supported • Save your time
Clang v.s GCC(GNU Compiler Collection) Clang • Apple official compiler
• Frontend for LLVM • High performance • BSD license • …… GCC • Linux based • Support more languages • GPL license
Clang (Xcode 10.2.1) GCC (Darwin Kernel on Raspberry Pi)
• How Apple deprecated GCC Front-end Back-end Xcode 3 GCC
GCC Xcode 4 GCC LLVM Xcode 5 Clang LLVM
• gcc hello.c
Is it good for iOS?
Is it good for iOS? NO
build process
Clang-Swift • The compiler process of swift cmd+B
Clang-Swift • The compiler process of swift Clang AST Reference
https://ppt.cc/fnA4Qx
Clang-Swift • The compiler process of swift
How LLDB works?
How LLDB works? command action option argument
None
• p(print) → expr -- expr -- foo • po(print
object) → expr -O -- expr -O -- foo
p v.s po
None
• Changes the value of variables • Creates temporary variables
• Validates the values
• DEMO • Tasks 1. Changes UIButton title into red
2. Moves UIView up
• Can we use a efficient way to finish these
commands? - YES
LLDB Python API https://lldb.llvm.org/python_reference/index.html
LLDB OSS • Facebook/chisel • DEMO
Customized command • nudge(swift) • DEMO https://gist.github.com/sTinGe/059dc4c15347b7fef4ee537efdcc6e53