An Embedded Error Recovery and Debugging Mechanism for Scripting Language Extensions

In recent years, scripting languages such as Perl, Python, and Tcl have become popular development tools for the creation of sophisticated application software. One of the most useful features of these languages is their ability to easily interact with compiled languages such as C and C++. Although this mixed language approach has many benefits, one of the greatest drawbacks is the complexity of debugging that results from using interpreted and compiled code in the same application. In part, this is due to the fact that scripting language interpreters are unable to recover from catastrophic errors in compiled extension code. Moreover, traditional C/C++ debuggers do not provide a satisfactory degree of integration with interpreted languages. This paper describes an experimental system in which fatal extension errors such as segmentation faults, bus errors, and failed assertions are handled as scripting language exceptions. This system, which has been implemented as a general purpose shared library, requires no modifications to the target scripting language, introduces no performance penalty, and simplifies the debugging of mixed interpreted-compiled application software.

[1]  Harlan Sexton Foreign functions and common Lisp , 1987, LIPO.

[2]  Ken Kennedy,et al.  A Practical Environment for Scientific Programming , 1987, Computer.

[3]  John H. Reppy,et al.  Asynchronous Signals is Standard ML , 1990 .

[4]  John K. Ousterhout,et al.  Tcl: An Embeddable Command Language , 1989, USENIX Winter.

[5]  W. Richard Stevens,et al.  Unix network programming , 1990, CCRV.

[6]  Jr. Guy L. Steele,et al.  Common LISP: the language (2nd ed.) , 1990 .

[7]  Roger Faulkner,et al.  The Process File System and Process Model in UNIX System V , 1991, USENIX Winter.

[8]  Wade L. Hennessey,et al.  WCL: Delivering efficient Common Lisp applications under Unix , 1992 .

[9]  Wade Henessey WCL: Delivering Efficient Common Lisp Applications Under Unix , 1992, LISP and Functional Programming.

[10]  Frank Mueller,et al.  A Library Implementation of POSIX Threads under UNIX , 1993, USENIX Winter.

[11]  David L Weaver,et al.  The SPARC architecture manual : version 9 , 1994 .

[12]  Wolfgang Heidrich,et al.  Automatic Generation of Tcl Bindings for C and C++ Libraries , 1995, Tcl/Tk Workshop.

[13]  Thomas Lord An Anatomy of Guile: The Interface to Tcl/Tk , 1995, Tcl/Tk Workshop.

[14]  Jonathan B. Rosenberg How Debuggers Work: Algorithms, Data Structures, and Architecture , 1996 .

[15]  Larry Wall,et al.  Programming Perl - covers Perl 5, 2nd Edition , 1996, A nutshell handbook.

[16]  David M. Beazley,et al.  SWIG: An Easy to Use Tool for Integrating Scripting Languages with C and C++ , 1996, Tcl/Tk Workshop.

[17]  Ken Martin Automated Wrapping of a C++ Class Library into Tcl , 1996, Tcl/Tk Workshop.

[18]  Sriram Srinivasan,et al.  Advanced Perl Programming , 1997 .

[19]  D. M. Beazley,et al.  Feeding a large-scale physics application to Python , 1997 .

[20]  John K. Ousterhout,et al.  Scripting: Higher-Level Programming for the 21st Century , 1998, Computer.

[21]  W. Richard Stevens,et al.  UNIX network programming, volume 2 (2nd ed.): interprocess communications , 1998 .

[22]  Thomas E. Ferrin,et al.  Wrappy — a Python Wrapper Generator for C++ Classes , 1999 .

[23]  Michael L. Scott,et al.  Programming Language Pragmatics , 1999 .

[24]  Peter A. Buhr,et al.  Advanced Exception Handling Mechanisms , 2000, IEEE Trans. Software Eng..

[25]  Alexander Romanovsky,et al.  Guest Editors' Introduction - Current Trends in Exception Handling , 2000, IEEE Trans. Software Eng..

[26]  Alexander Romanovsky,et al.  Guest Editors' Introduction-Current Trends in Exception Handling , 2000, IEEE Trans. Software Eng..

[27]  Till Gerken,et al.  Web Application Development with PHP 4.0 , 2000 .

[28]  Parasuram Anantharam Programming ruby , 2001, SOEN.

[29]  Pearu Peterson,et al.  Fortran to Python Interface Generator with an Application to Aerospace Engineering , 2001 .

[30]  Simon L. Peyton Jones,et al.  Asynchronous exceptions in Haskell , 2001, PLDI '01.

[31]  Andreas Zeller Visual debugging with ddd , 2001 .