Abstract
We present techniques that enable source-level debugging for multiple languages at the cost of only modest programming effort. The key idea is to avoid letting debugging requirements constrain the internal structure of the compiler. Constraints are minimized primarily by hiding the source-language type system and target-machine representations from the debugger. This approach enables us to support a new language and compiler while reusing existing elements: a multi-language, multi-platform debugger; the compiler’s implementation of source-language types and expressions; information already present in the compiler’s private data structures; and our compile-time support library, which helps the compiler meet its obligations to the debugger without exposing language-dependent details. We evaluate our approach using two case studies: the production compiler lcc and an instructional compiler for MiniJava.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers, Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)
Appel, A.W.: Modern Compiler Implementation. Cambridge University Press, Cambridge (1998), Available in three editions: C, Java, and ML
Appel, A.W., Palsberg, J.: Modern Compiler Implementation in Java, 2nd edn. Cambridge University Press, Cambridge (2002)
Brooks, G., Hansen, G.J., Simmons, S.: A new approach to debugging optimized code. In: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation; SIGPLAN Notices 27(7), 1–11 (1992)
Feldman, S.I., Brown, C.B.: IGOR: A system for program debugging via reversible execution. In: Proceedings of the ACM SIGPLAN/SIGOPS Workshop on Parallel and Distributed Debugging; SIGPLAN Notices 24(1), 112–123 (1988)
Fraser, C.W., Hanson, D.R.: A Retargetable C Compiler: Design and Implementation. Addison-Wesley, Reading (1995)
Gilmore, J.: GDB internals—a guide to the internals of the GNU debugger, Found in the doc directory of gdb distribution version 5.1.1 (2000)
Hanson, D.R., Raghavachari, M.: A machine-independent debugger. Software–Practice and Experience 26(11), 1277–1299 (1996)
Hennessy, J.: Symbolic debugging of optimized code. ACM Transactions on Programming Languages and Systems 4(3), 323–344 (1982)
Hosking, A.: The MiniJava compiler (2003), Provided by the author, whose email address is hosking@acm.org
Jaramillo, C., Gupta, R., Soffa, M.L.: Comparison checking: An approach to avoid debugging of optimized code. In: Nierstrasz, O., Lemoine, M. (eds.) ESEC 1999 and ESEC-FSE 1999. LNCS, vol. 1687, pp. 268–284. Springer, Heidelberg (1999)
Jaramillo, C., Gupta, R., Soffa, M.L.: FULLDOC: A full reporting debugger for optimized code. In: Palsberg, J. (ed.) SAS 2000. LNCS, vol. 1824, pp. 240–260. Springer, Heidelberg (2000)
Larus, J.: SPIM: A MIPS R2000/R3000 simulator (2003) http://www.cs.wisc.edu/larus/spim.html
Linton, M.A.: The evolution of Dbx. In: Proceedings of the Summer USENIX Conference, pp. 211–220 (June 1990)
Ramsey, N.: A Retargetable Debugger. PhD thesis, Princeton University. Also technical report CS-TR-403-92 (January 1993)
Ramsey, N., Hanson, D.R.: A retargetable debugger. In: ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, SIGPLAN Notices 27(7), 22–31 (1992)
Ryu, S., Ramsey, N.: The ldb interface. Technical Report TR-23-04, Division of Engineering and Applied Sciences, Harvard University (2004)
Ryu, S., Ramsey, N.: Source-level debugging for multiple languages with modest programming effort (expanded version). Technical Report TR-01-05, Division of Engineering and Applied Sciences, Harvard University (January 2005)
Tice, C., Graham, S.L.: OPTVIEW: A new approach for examining optimized code. In: Proceedings of the 1998 ACM SIGPLAN/ SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, SIGPLAN Notices 33(7), 19–26 (1998)
Tolmach, A.P.: Debugging Standard ML. PhD thesis, Princeton University. Also technical report CS-TR-378-92 (October 1992)
Tolmach, A.P., Appel, A.W.: Debugging Standard ML without reverse engineering. In: Proceedings of the 1990 ACM Conference on LISP and Functional Programming, pp. 1–12 (June 1990)
Unix Int’l. DWARF Debugging Information Format. Unix International, Parsippany, NJ (July 1993)
Winterbottom, P.: Acid: A debugger based on a language. In: Proceedings of the Winter 1994 USENIX Conference, pp. 211–222 (1994)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Ryu, S., Ramsey, N. (2005). Source-Level Debugging for Multiple Languages with Modest Programming Effort. In: Bodik, R. (eds) Compiler Construction. CC 2005. Lecture Notes in Computer Science, vol 3443. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-31985-6_2
Download citation
DOI: https://doi.org/10.1007/978-3-540-31985-6_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-25411-9
Online ISBN: 978-3-540-31985-6
eBook Packages: Computer ScienceComputer Science (R0)