O'Reilly Open Source Convention
oreilly.comO'Reilly Network

Arrow Home
Arrow Registration
Arrow Hotel/Travel
Arrow See & Do
Arrow Tutorials
Arrow Sessions
Arrow Evening Events
Arrow BOFs
Arrow Speakers
Arrow Press
Arrow Mail List
Arrow Exhibitors
Arrow Sponsors
O'Reilly Open Source Convention
Sheraton San Diego Hotel, San Diego, CA
July 23-27, 2001

News Coverage


PyDebug: A New Application for Integrated Debugging of Python with C and Fortran Extensions

Peter Stoltz, Tech-X Corporation

Track: Python
Date: Thursday, July 26
Time: 3:45pm - 4:15pm
Location: Bel Aire North

A popular technique for debugging C and Fortran extensions to Python is to run Python under the gdb debugger. If the code crashes inside a compiled extension module, this event is caught by gdb. One can then use gdb in the usual way -- see the stack, examine local variable values, etc. However, one cannot set a break point, restart Python, and have that break point survive the restart. Setting a break point requires that one pause the code after importing the appropriate extension module, then send an interrupt to Python in order to enter gdb, and finally set the break point in the usual way.

We have developed a new Python application, called PyDebug, which introduces a middle-ware layer between gdb and the code being debugged. PyDebug enables the user to set break points seamlessly inside compiled C and Fortran extensions to Python and have these break points persist through code crashes and restarts. Our middle-ware approach, which requires careful use of both pipes and threading, enables the user to issue any gdb command from the Python prompt and have it passed through to the gdb application. One can also embed gdb commands as comments within a Python script. PyDebug could easily be extended to debuggers other than gdb.

oreilly.com Home | Conferences Home | Open Source Convention Home
Registration | Hotels/Travel | Tutorials | Sessions | Speakers
Press | Mail List | Exhibitors | Sponsors

© 2001, O'Reilly Media, Inc.