skip to main content
research-article

Debug all your code: portable mixed-environment debugging

Published:25 October 2009Publication History
Skip Abstract Section

Abstract

Programmers build large-scale systems with multiple languages to reuse legacy code and leverage languages best suited to their problems. For instance, the same program may use Java for ease-of-programming and C to interface with the operating system. These programs pose significant debugging challenges, because programmers need to understand and control code across languages, which may execute in different environments. Unfortunately, traditional multilingual debuggers require a single execution environment.

This paper presents a novel composition approach to building portable mixed-environment debuggers, in which an intermediate agent interposes on language transitions, controlling and reusing single-environment debuggers. We implement debugger composition in Blink, a debugger for Java, C, and the Jeannie programming language. We show that Blink is (1) relatively simple: it requires modest amounts of new code; (2) portable: it supports multiple Java Virtual Machines, C compilers, operating systems, and component debuggers; and (3) powerful: composition eases debugging, while supporting new mixed-language expression evaluation and Java Native Interface (JNI) bug diagnostics. In real-world case studies, we show that language-interface errors require single-environment debuggers to restart execution multiple times, whereas Blink directly diagnoses them with one execution. We also describe extensions for other mixed-environments to show debugger composition will generalize.

References

  1. C. Bailey. Java technology, IBM style: Introduction to the IBM developer kit. http://www.ibm.com/developerworks/java/library/j-ibmjava1.html, May 2006.Google ScholarGoogle Scholar
  2. D. M. Beazley. SWIG: An easy to use tool for integrating scripting languages with C and C++. In USENIX Tcl/Tk Workshop (TCLTK), 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khang, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. P. Bothner. Compiling Java with GCJ. http://www.linuxjournal.com/article/4860, Jan. 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Free Standards Group. DWARF 3 debugging information format. http://www.dwarfstd.org/Dwarf3.pdf, Dec. 2005.Google ScholarGoogle Scholar
  6. M. Furr and J. S. Foster. Checking type safety of foreign function calls. In Programming Language Design and Implementation (PLDI), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Furr and J. S. Foster. Polymorphic type inference for the JNI. In European Symposium on Programming (ESOP), 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Furr and J. S. Foster. Checking type safety of foreign function calls. Transactions on Programming Languages and Systems (TOPLAS), 30(4), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Grimm. xtc -- eXTensible C. http://www.cs.nyu.edu/rgrimm/xtc/.Google ScholarGoogle Scholar
  10. R. Grimm. Better extensibility through modular syntax. In Programming Language Design and Implementation (PLDI), 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. R. Hanson. A machine-independent debugger--revisited. Softw. Pract. Exper., 29(10):849--862, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Hirzel and R. Grimm. Jeannie: Granting Java native interface developers their wishes. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. Kondoh and T. Onodera. Finding bugs in Java native interface programs. In International Symposium on Software Testing and Analysis (ISSTA), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Liang. The Java Native Interface: Programmer's Guide and Specification. Addison-Wesley, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Lind-Nielsen. BuDDy. http://buddy.sourceforge.net/.Google ScholarGoogle Scholar
  16. M. A. Linton. The evolution of Dbx. In Usenix Technical Conference, 1990.Google ScholarGoogle Scholar
  17. G. C. Necula, S. McPeak, and W. Weimer. CCured: Typesafe retrofitting of legacy code. In Principles of Programming Languages (POPL), 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. V. Providin and C. Elford. Debugging native methods in Java applications. In EclipseCon User Conference, Mar. 2007.Google ScholarGoogle Scholar
  19. N. Ramsey and D. R. Hanson. A retargetable debugger. In Programming Language Design and Implementation (PLDI), 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. B. Rosenberg. How Debuggers Work: Algorithms, Data Structures, and Architecture. John Wiley&Sons, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. S. Ryu and N. Ramsey. Source-level debugging for multiple languages with modest programming effort. In International Conference on Compiler Construction (CC), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Stall. Mike Stall's .NET debugging blog. http://blogs.msdn.com/jmstall/default.aspx.Google ScholarGoogle Scholar
  23. Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, March 1999.Google ScholarGoogle Scholar
  24. Sun Microsystems, Inc. Bug database Bug 4207056 was opened 1999-01-29. http://bugs.sun.com.Google ScholarGoogle Scholar
  25. Sun Microsystems, Inc. Java SE HotSpot at a glance. http://java.sun.com/javase/technologies/hotspot/.Google ScholarGoogle Scholar
  26. Sun Microsystems, Inc. JVMTM tool interface, version 1.1. http://java.sun.com/javase/6/docs/platform/jvmti/jvmti.html, 2006.Google ScholarGoogle Scholar
  27. Sun Microsystems, Inc. Debugging a Java application with dbx. http://docs.sun.com/app/docs/doc/819-5257/blamm?a=view, 2007.Google ScholarGoogle Scholar
  28. G. Tan, A. W. Appel, S. Chakradhar, A. Raghunathan, S. Ravi, and D. Wang. Safe Java native interface. In International Symposium on Secure Software Engineering (ISSSE), 2006.Google ScholarGoogle Scholar
  29. G. Tan and J. Croft. An empirical security study of the native code in the JDK. In Usenix Security Symposium (SS), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. G. Tan and G. Morrisett. ILEA: Inter-language analysis across Java and C. In Object-Oriented Programming Systems and Applications (OOPSLA), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Z. Tatlock, C. Tucker, D. Shuffelton, R. Jhala, and S. Lerner. Deep typechecking and refactoring. In Object-Oriented Programming Systems Languages and Applications (OOPSLA), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. A. P. Tolmach and A. W. Appel. Debugging standard ML without reverse engineering. In LISP and Functional Programming (LFP), 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. M. van den Brand, B. Cornelissen, P. Olivier, and J. Vinju. TIDE: A generic debugging framework -- tool demonstration. Electronic Notes in Theoretical Computer Science, 141(4), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Visual studio debugger extensibility. http://msdn.microsoft.com/en-us/library/bb161718(VS.80).aspx.Google ScholarGoogle Scholar
  35. M. White. Debugging integrated Java and C/C++ code. http://web.archive.org/web/20041205063318/www-106.ibm.com/developerworks/java/library/j-jnidebug/, Nov. 2001.Google ScholarGoogle Scholar
  36. M. White. Integrated Java technology and C debugging using the Eclipse platform. In JavaOne Conference, 2006.Google ScholarGoogle Scholar
  37. A. Zeller. Why Programs Fail: A Guide to Systematic Debugging. Morgan Kaufmann, Oct. 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Debug all your code: portable mixed-environment debugging

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 44, Issue 10
      OOPSLA '09
      October 2009
      554 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1639949
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '09: Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications
        October 2009
        590 pages
        ISBN:9781605587660
        DOI:10.1145/1640089

      Copyright © 2009 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 October 2009

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!