10

Debugging Swift Applications

WHAT'S IN THIS CHAPTER?

  • Developing techniques for debugging
  • Learning about debugging tools
  • Understanding how a debugger helps diagnose and track down bugs in programs
  • Interfacing with the debugger
  • Investigating code at runtime

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the wrox.com downloads for this chapter at http://www.wrox.com/go/proswift on the Download Code tab. The code for this chapter is contained in the following files:

  • CircleView.zip
  • DebuggerExplorer.zip

In a perfect world, debugging software would not be necessary. Everything programmers created would be perfect. Unfortunately, the world is not perfect, and occasionally you will write buggy software. However, with the right tools at your disposal, even the most challenging of bugs can be detected with ease. Xcode includes a very important tool, the debugger that you can use to track down problems in your code, helping you to detect and diagnose bugs and, more importantly, fix them with a minimal amount of effort. This chapter introduces you to debugging concepts and the use of lldb, the debugger that ships with Xcode as part of its LLVM compilation suite.

THE ART OF DEBUGGING

Even the best of programmers write buggy software. Often, bugs are fairly obvious. In the worst case, they cause programs to crash, or to behave improperly, or to not work at all. These bugs are often easy to re-create and track down, and merely having some knowledge of how the software is written ...

Get Professional Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.