Chapter 19: Debugging
The most difficult part in writing software is debugging. Debugging is hard. It’s even harder when you’re writing software in a low-level language (compared to high-level languages like Java/C#). Instead of a stack trace, you’ll often hear iOS developers using buzzwords like dSYM files, symbolication, crash dumps.
This chapter introduces you to LLDB, Apple’s Lower Level DeBugger. I’ll explain some commonly used terms like dSYM, symbolication, and others that are traditionally different from other programming languages. A lot changed when Apple replaced GDB with LLDB, and nearly everything that I talk about in this chapter is specific to LLDB. If you’re still using GDB, it’s high time to change to the newer LLDB. I’ll show you some of Xcode’s features that will help you with debugging and that will unleash the power of the LLDB console. Later in this chapter, you’ll find different techniques for collecting crash reports, including a couple of third-party services.
LLDB is a next-generation high-performance debugger built using reusable components from LLVM, including the complete LLVM compiler, that includes LLVM’s Clang expression parser and the disassembler. What this means to you, the end user/developer, is that LLDB understands the same syntax that your compiler understands, including Objective-C literals and Objective-C’s dot notation for properties. A debugger with compiler-level accuracy means that any new feature added to LLVM will automatically ...