Source-Level Debugging for Multiple Languages with Modest Programming Effort

  • Sukyoung Ryu
  • Norman Ramsey
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3443)


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.


Programming Effort Source Language Multiple Language Type Constructor Target Machine 
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.


  1. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers, Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)Google Scholar
  2. Appel, A.W.: Modern Compiler Implementation. Cambridge University Press, Cambridge (1998), Available in three editions: C, Java, and MLGoogle Scholar
  3. Appel, A.W., Palsberg, J.: Modern Compiler Implementation in Java, 2nd edn. Cambridge University Press, Cambridge (2002)zbMATHGoogle Scholar
  4. 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)CrossRefGoogle Scholar
  5. 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)CrossRefGoogle Scholar
  6. Fraser, C.W., Hanson, D.R.: A Retargetable C Compiler: Design and Implementation. Addison-Wesley, Reading (1995)zbMATHGoogle Scholar
  7. 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)Google Scholar
  8. Hanson, D.R., Raghavachari, M.: A machine-independent debugger. Software–Practice and Experience 26(11), 1277–1299 (1996)CrossRefGoogle Scholar
  9. Hennessy, J.: Symbolic debugging of optimized code. ACM Transactions on Programming Languages and Systems 4(3), 323–344 (1982)zbMATHCrossRefGoogle Scholar
  10. Hosking, A.: The MiniJava compiler (2003), Provided by the author, whose email address is Google Scholar
  11. 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)CrossRefGoogle Scholar
  12. 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)CrossRefGoogle Scholar
  13. Larus, J.: SPIM: A MIPS R2000/R3000 simulator (2003)
  14. Linton, M.A.: The evolution of Dbx. In: Proceedings of the Summer USENIX Conference, pp. 211–220 (June 1990)Google Scholar
  15. Ramsey, N.: A Retargetable Debugger. PhD thesis, Princeton University. Also technical report CS-TR-403-92 (January 1993)Google Scholar
  16. 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)CrossRefGoogle Scholar
  17. Ryu, S., Ramsey, N.: The ldb interface. Technical Report TR-23-04, Division of Engineering and Applied Sciences, Harvard University (2004)Google Scholar
  18. 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)Google Scholar
  19. 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)CrossRefGoogle Scholar
  20. Tolmach, A.P.: Debugging Standard ML. PhD thesis, Princeton University. Also technical report CS-TR-378-92 (October 1992)Google Scholar
  21. 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)Google Scholar
  22. Unix Int’l. DWARF Debugging Information Format. Unix International, Parsippany, NJ (July 1993)Google Scholar
  23. Winterbottom, P.: Acid: A debugger based on a language. In: Proceedings of the Winter 1994 USENIX Conference, pp. 211–222 (1994)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Sukyoung Ryu
    • 1
  • Norman Ramsey
    • 1
  1. 1.Division of Engineering and Applied SciencesHarvard University 

Personalised recommendations