TR-2005-07

Embedded Debugging of C/C++ Plugins and Extension Modules

Jing Cao; David M. Beazley. 1 June, 2005.
Communicated by David Beazley.

Abstract

Today, C and C++ are frequently used to write programs that operate as dynamic link libraries, plugins, and extensions of large application frameworks and high level programming languages. An unfortunate side-effect of this programming style is that it makes debugging considerably more difficult. Traditional debuggers don't work as well with extension modules because of the complexity of execution environment. Moreover, the information they provide may be incomplete. To address this limitation, we have been exploring an alternative approach to debugging plugin modules in which a small C/C++ debugger is embedded into the application framework itself. This embedded debugger requires no modifications to the application or plugin modules. Moreover, it is able to catch many common C/C++ programming errors---turning those errors into useful diagnostic error messages. We originally developed this approach for debugging scripting language extension modules, but the approach has since proven to be more widely applicable. In this paper, we describe the embedded debugging approach, and how it can be applied to complicated applications involving plugins, scripting languages, and multiple programming languages. We provide examples of using an embedded debugger with a variety of applications including Python, PHP, and Java, as well as with the popular Apache websever.

Original Document

The original document is available in PDF (uploaded 1 June, 2005 by David Beazley).