WWDC Notes

LLDB: Beyond "po"

Show Apple's description.
LLDB is a powerful tool for exploring and debugging your app at runtime. Discover the various ways to display values in your app, how to format custom data types, and how to extend LLDB using your own Python 3 scripts.

po, Print Object Description

  • Textual representation of the instance at hand.
  • The runtime system provides a default representation, however we can customize it for any type by conforming to the CustomDebugStringConvertible protocol.
  • Conforming to this protocol changes only the top level description of that type (not the nested properties)
  • po is actually an alias to expression --object-description

p, print

  • In p we can see that the result of the expression is assigned to a $Rx value that later we can use to reference that object in our debugging.

v, frame variable

  • v doesn’t compile any code, and has a different syntax than the language that you’re debugging

po vs. p vs. v

Missing anything? Corrections? Contributions are welcome 😃

Written by

zntfdr

Federico Zanetello

Federico Zanetello is an iOS Engineer with strong passion for Swift, minimalism, and design. When he’s not busy automating things, he can be found writing at fivestars.blog and/or playing with the latest shiny toys.