September 2008
Intermediate to advanced
280 pages
6h 31m
English
SWIG (Simplified Wrapper and Interface Generator) is a popular open source tool for interfacing Java, Perl, Python, and a number of other interpreted languages with C/C++. It is included with most Linux distributions and can also be downloaded from the Web. It allows you to write most of an application's code in an interpreted language and incorporate specific sections that you have written in C/C++, for example, to enhance performance.
The question arises of how to run GDB/DDD on such code. Here we will present a small example using Python and C. The C code will manage a first in, first out (FIFO) queue:
1 // fifo.c, SWIG example; manages a FIFO queue of characters 2 3 char *fifo; // the queue 4 5 int nfifo = 0, ...