SlideShare ist ein Scribd-Unternehmen logo
1 von 15
LLDB Introduction

     Jaemok Jeong
        2012. 8.
Overview

LLDB is a next generation, high performance
debugger

Available under the standard LLVM license,
an open source ‘BSD-Style’ license



Default debugger in Xcode on MAC OS X
Features

Supports modern multi-threaded program

Upto date language support for C, C++,
Objective C



Extensible : Python scriptable and use a
plug-in architecture
General


(lldb) help <command> <subcommand>



(lldb) <noun> <verb> [-options [option-value]]
[argument [argument...]]
Execution
(lldb) r / run (run)

(lldb) s / step (source level single step in)

(lldb) n / next (source level single step over)

(lldb) si / ni (instruction level single step in)

(lldb) ïŹnish (step out of currently selected
frame)
Hooks
(lldb) target stop-hook add
Enter your stop hook command(s). Type ‘DONE’ to end.
> print i
> DONE
Stop hook #1 added
(lldb) n
(int) $32 = 1
Breakpoint
(lldb) b main (Set a break point at all function named
main)

(lldb) b test.c:12 (Set a breakpoint in ïŹle test.c at line
12)

(lldb) b -[NSString stringWithFormat:]

(lldb) br s -S count / br set -S
vtDataCenterFetchComplete:userData:

(lldb) br delete [n]
Watchpoint
(lldb) watch set var -w write global_var (set
write watchpoint)

(lldb) watch set exp -w write -- my_ptr (set
write watchpoint in pointer)

(lldb) watch set var -w read global_var (set read
watchpoint)

(lldb) watch modify -c ‘(global==5)’ (set
condition on watchpoint)
Examining Variables
(lldb) frame variable (show arguments for the
current frame)

(lldb) frame v -a (--no-args) (show the local
variables for the current frame)

(lldb) frame v isChanged (p isChanged)

(lldb) target v (show the global/static variables)

(lldb) print a_var / po a_var
Examining Thread state
 (lldb) thread backtrace (show the stack
 backtrace)

 (lldb) bt

 (lldb) up (select the stack frame that called
 the current stack frame)

 (lldb) down (select the stack frame that is
 called by the current stack frame)
Executable & Shared
      Library

(lldb) image list (list the main executable and
all dependent shared libraries)

(lldb) image dump sections (dump all sections
from the main executable and any shared
libraries)
LLDB Python

(lldb) script help(lldb)

(lldb) script help(lldb.SBFrame)

(lldb) script (Python interpreter)

DeïŹne New Command with Python

DeïŹne New Breakpoint action with Python
Tips

Alias

  (lldb) command alias bïŹ‚ breakpoint set -f
  %1 -l %2

  (lldb) bïŹ‚ foo.c 12

Init ïŹle

  Reads the ïŹle ~/.lldbinit at startup
Examples


br set -S invalidateCache

br set -S
vtDataCenterFetchComplete:userData:

watch set var -w read selectedDate
Links

Homepage

  http://lldb.llvm.org/

Source code

  svn co http://llvm.org/svn/llvm-project/
  lldb/trunk lldb

Weitere Àhnliche Inhalte

Was ist angesagt?

Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
Bartosz Kosarzycki
 
NDC 2011, C++ í”„ëĄœê·žëž˜ëšžë„Œ 위한 C#
NDC 2011, C++ í”„ëĄœê·žëž˜ëšžë„Œ 위한 C#NDC 2011, C++ í”„ëĄœê·žëž˜ëšžë„Œ 위한 C#
NDC 2011, C++ í”„ëĄœê·žëž˜ëšžë„Œ 위한 C#
tcaesvk
 
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
Sang Don Kim
 

Was ist angesagt? (20)

Triton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON ChinaTriton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON China
 
Developing android apps with java 8
Developing android apps with java 8Developing android apps with java 8
Developing android apps with java 8
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
 
Kotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developersKotlin advanced - language reference for android developers
Kotlin advanced - language reference for android developers
 
The craft of meta programming on JVM
The craft of meta programming on JVMThe craft of meta programming on JVM
The craft of meta programming on JVM
 
Kotlin in action
Kotlin in actionKotlin in action
Kotlin in action
 
How do you create a programming language for the JVM?
How do you create a programming language for the JVM?How do you create a programming language for the JVM?
How do you create a programming language for the JVM?
 
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
 
Joel Falcou, Boost.SIMD
Joel Falcou, Boost.SIMDJoel Falcou, Boost.SIMD
Joel Falcou, Boost.SIMD
 
[TECHCON 2019: MOBILE - iOS]3.ì‰œêł  ìžŹëŻžìžˆëŠ” iOS 디ëȄêč… - LLDB Command
[TECHCON 2019: MOBILE - iOS]3.ì‰œêł  ìžŹëŻžìžˆëŠ” iOS 디ëȄêč… - LLDB Command[TECHCON 2019: MOBILE - iOS]3.ì‰œêł  ìžŹëŻžìžˆëŠ” iOS 디ëȄêč… - LLDB Command
[TECHCON 2019: MOBILE - iOS]3.ì‰œêł  ìžŹëŻžìžˆëŠ” iOS 디ëȄêč… - LLDB Command
 
Session1
Session1Session1
Session1
 
Verilogspk1
Verilogspk1Verilogspk1
Verilogspk1
 
Verilog overview
Verilog overviewVerilog overview
Verilog overview
 
NDC 2011, C++ í”„ëĄœê·žëž˜ëšžë„Œ 위한 C#
NDC 2011, C++ í”„ëĄœê·žëž˜ëšžë„Œ 위한 C#NDC 2011, C++ í”„ëĄœê·žëž˜ëšžë„Œ 위한 C#
NDC 2011, C++ í”„ëĄœê·žëž˜ëšžë„Œ 위한 C#
 
Return of c++
Return of c++Return of c++
Return of c++
 
Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)
 
Eval4j @ JVMLS 2014
Eval4j @ JVMLS 2014Eval4j @ JVMLS 2014
Eval4j @ JVMLS 2014
 
RESTful API using scalaz (3)
RESTful API using scalaz (3)RESTful API using scalaz (3)
RESTful API using scalaz (3)
 
Java byte code in practice
Java byte code in practiceJava byte code in practice
Java byte code in practice
 
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
 

Ähnlich wie LLDB Introduction

Building Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual MachinesBuilding Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual Machines
Guido Chari
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924
yohanbeschi
 
Debugger Principle Overview & GDB Tricks
Debugger Principle Overview & GDB TricksDebugger Principle Overview & GDB Tricks
Debugger Principle Overview & GDB Tricks
dutor
 
Clojure and Modularity
Clojure and ModularityClojure and Modularity
Clojure and Modularity
elliando dias
 

Ähnlich wie LLDB Introduction (20)

BUD17-310: Introducing LLDB for linux on Arm and AArch64
BUD17-310: Introducing LLDB for linux on Arm and AArch64 BUD17-310: Introducing LLDB for linux on Arm and AArch64
BUD17-310: Introducing LLDB for linux on Arm and AArch64
 
2013.02.02 지앀선 í…ŒíŹë‹ˆì»Ź ì„žëŻžë‚˜ - Xcodeë„Œ 활용한 디ëȄêč… íŒ(OSXDEV)
2013.02.02 지앀선 í…ŒíŹë‹ˆì»Ź ì„žëŻžë‚˜ - Xcodeë„Œ 활용한 디ëȄêč… íŒ(OSXDEV)2013.02.02 지앀선 í…ŒíŹë‹ˆì»Ź ì„žëŻžë‚˜ - Xcodeë„Œ 활용한 디ëȄêč… íŒ(OSXDEV)
2013.02.02 지앀선 í…ŒíŹë‹ˆì»Ź ì„žëŻžë‚˜ - Xcodeë„Œ 활용한 디ëȄêč… íŒ(OSXDEV)
 
Building Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual MachinesBuilding Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual Machines
 
Usage of GDB
Usage of GDBUsage of GDB
Usage of GDB
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Lobos Introduction
Lobos IntroductionLobos Introduction
Lobos Introduction
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
 
Game development with_lib_gdx
Game development with_lib_gdxGame development with_lib_gdx
Game development with_lib_gdx
 
Apache Spark & Streaming
Apache Spark & StreamingApache Spark & Streaming
Apache Spark & Streaming
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machine
 
Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011
 
Rsltollvm
RsltollvmRsltollvm
Rsltollvm
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVM
 
Tuning and Debugging in Apache Spark
Tuning and Debugging in Apache SparkTuning and Debugging in Apache Spark
Tuning and Debugging in Apache Spark
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924
 
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Iterative Spark Developmen...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Iterative Spark Developmen...Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Iterative Spark Developmen...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Iterative Spark Developmen...
 
Swug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainathSwug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainath
 
Debugger Principle Overview & GDB Tricks
Debugger Principle Overview & GDB TricksDebugger Principle Overview & GDB Tricks
Debugger Principle Overview & GDB Tricks
 
Clojure and Modularity
Clojure and ModularityClojure and Modularity
Clojure and Modularity
 

KĂŒrzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

KĂŒrzlich hochgeladen (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

LLDB Introduction

  • 1. LLDB Introduction Jaemok Jeong 2012. 8.
  • 2. Overview LLDB is a next generation, high performance debugger Available under the standard LLVM license, an open source ‘BSD-Style’ license Default debugger in Xcode on MAC OS X
  • 3. Features Supports modern multi-threaded program Upto date language support for C, C++, Objective C Extensible : Python scriptable and use a plug-in architecture
  • 4. General (lldb) help <command> <subcommand> (lldb) <noun> <verb> [-options [option-value]] [argument [argument...]]
  • 5. Execution (lldb) r / run (run) (lldb) s / step (source level single step in) (lldb) n / next (source level single step over) (lldb) si / ni (instruction level single step in) (lldb) ïŹnish (step out of currently selected frame)
  • 6. Hooks (lldb) target stop-hook add Enter your stop hook command(s). Type ‘DONE’ to end. > print i > DONE Stop hook #1 added (lldb) n (int) $32 = 1
  • 7. Breakpoint (lldb) b main (Set a break point at all function named main) (lldb) b test.c:12 (Set a breakpoint in ïŹle test.c at line 12) (lldb) b -[NSString stringWithFormat:] (lldb) br s -S count / br set -S vtDataCenterFetchComplete:userData: (lldb) br delete [n]
  • 8. Watchpoint (lldb) watch set var -w write global_var (set write watchpoint) (lldb) watch set exp -w write -- my_ptr (set write watchpoint in pointer) (lldb) watch set var -w read global_var (set read watchpoint) (lldb) watch modify -c ‘(global==5)’ (set condition on watchpoint)
  • 9. Examining Variables (lldb) frame variable (show arguments for the current frame) (lldb) frame v -a (--no-args) (show the local variables for the current frame) (lldb) frame v isChanged (p isChanged) (lldb) target v (show the global/static variables) (lldb) print a_var / po a_var
  • 10. Examining Thread state (lldb) thread backtrace (show the stack backtrace) (lldb) bt (lldb) up (select the stack frame that called the current stack frame) (lldb) down (select the stack frame that is called by the current stack frame)
  • 11. Executable & Shared Library (lldb) image list (list the main executable and all dependent shared libraries) (lldb) image dump sections (dump all sections from the main executable and any shared libraries)
  • 12. LLDB Python (lldb) script help(lldb) (lldb) script help(lldb.SBFrame) (lldb) script (Python interpreter) DeïŹne New Command with Python DeïŹne New Breakpoint action with Python
  • 13. Tips Alias (lldb) command alias bïŹ‚ breakpoint set -f %1 -l %2 (lldb) bïŹ‚ foo.c 12 Init ïŹle Reads the ïŹle ~/.lldbinit at startup
  • 14. Examples br set -S invalidateCache br set -S vtDataCenterFetchComplete:userData: watch set var -w read selectedDate
  • 15. Links Homepage http://lldb.llvm.org/ Source code svn co http://llvm.org/svn/llvm-project/ lldb/trunk lldb

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n