Next  |  Prev  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Debugging STK Programs in gdb

[The remainder of this intro can be omitted on a first reading. However, remember that it's here when you are ready to debug an STK program by single-stepping in gdb.]

One of the nicest aspects of working with STK programs is that all source (C++) is available, facilitating debugging. Single-stepping someone else's STK program is a good way to learn how it works. Object oriented software is often hard to read because its functionality is spread out over many member functions in many class files, some of which may be in separate libraries. Single-stepping the code in a debugger solves this problem by showing you exactly what code is being executed and in a natural order, complete with the ability to inspect variables, stack frames, and even larger data structures such as arrays, structs, and objects.

On Windows platforms, development tools such as Microsoft Visual C++ provide all the debugging support you need.

On the Mac, the standard IDE (``Integrated Development Environment'') is Xcode.app. In that environment, C++ source files have extension .mm to distinguish them from purely Objective C source files (.m).

An IDE commonly used in Linux environments is eclipse. It can handle all kinds of languages by means of its plugin architecture, and is used extensively for Web programmin (Javascript, Java, and many others, in addition to C++).

Another IDE of sorts is the powerful text editor (and process manager) Emacs. Emacs (like other IDEs) can serve as a front end for the standard UNIX-style software development tools such as make, compilers, linkers, and debuggers such as gdb. Since Emacs is available on all major platforms, we will use that case below. For an introduction to many of its features, see Travis Skare's video intro:

https://docs.google.com/file/d/0B85zuZBDyib8Q0Q2Q0lRSnNsdnM/edit?pli=1

On UNIX platforms (including Linux and Mac OS X, and even Windows systems using Cygwin), the standard C++ debugger for decades has been gdb.2



Subsections
Next  |  Prev  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Download stkintro.pdf
[Comment on this page via email]

``Getting Started with the Synthesis Tool Kit (STK)'', by Julius O. Smith III, Music 420 Reader supplementing the text).
Copyright © 2015-03-31 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA