Hostname: page-component-cd9895bd7-8ctnn Total loading time: 0 Render date: 2024-12-28T15:26:41.206Z Has data issue: false hasContentIssue false

A Debugger for Standard ML1

Published online by Cambridge University Press:  07 November 2008

Andrew Tolmach
Affiliation:
Department of Computer Science, Portland State University, P.O. Box 751, Portland, OR 97207-0751, USA email: apt@cs.pdx.edu
Andrew W. Appel
Affiliation:
Department of Computer Science, Princeton University, 35 Olden Street, Princeton, NJ 08544-2087, USA email: appel@cs.princeton.edu
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

We have built a portable, instrumentation-based, replay debugger for the Standard ML of New Jersey compiler. Traditional ‘source-level’ debuggers for compiled languages actually operate at machine level, which makes them complex, difficult to port, and intolerant of compiler optimization. For secure languages like ML, however, debugging support can be provided without reference to the underlying machine, by adding instrumentation to program source code before compilation. Because instrumented code is (almost) ordinary source, it can be processed by the ordinary compiler. Our debugger is thus independent from the underlying hardware and runtime system, and from the optimization strategies used by the compiler. The debugger also provides reverse execution, both as a user feature and an internal mechanism. Reverse execution is implemented using a checkpoint and replay system; checkpoints are represented primarily by first-class continuations.

Type
Articles
Copyright
Copyright © Cambridge University Press 1995

References

Agrawal, H., DeMillo, R. A. and Spafford, E. H. (1991) An execution-backtracking approach to debugging. IEEE Software, 8(3):2126.CrossRefGoogle Scholar
Aho, A. V., Sethi, R. and Ullman, J. D. (1986) Compilers: Principles, Techniques, and Tools. Addison-Wesley.Google Scholar
Appel, A. W. (1989a) Runtime tags aren't necessary. Lisp and Symbolic Computation, 2(2):153162.CrossRefGoogle Scholar
Appel, A. W. (1989b) Simple generational garbage collection and fast allocation. Software—Practice and Experience, 19(2):171183.CrossRefGoogle Scholar
Appel, A. W. (1992) Compiling with Continuations. Cambridge University Press.Google Scholar
Appel, A. W. and MacQueen, D. B. (1991) Standard ML of New Jersey. In: Wirsing, M., editor, Third Int. Symp. on Prog. Lang. Implementation and Logic Programming, Lecture Notes in Computer Science, Vol 528, pp. 113. Springer-Verlag.Google Scholar
Appel, A. W. and Shao, Z. (1994) An Empirical and Analytic Study of Stack vs. Heap Cost for Languages with Closures, J. Functional Programming (to appear).Google Scholar
Archer, J. E. Jr, Conway, R. and Schneider, F. B. (1984) User recovery and reversal in interactive systems. ACM Trans. Programming Languages and Systems, 6(1):119.CrossRefGoogle Scholar
Balzer, R. M. (1969) EXDAMS-EXtendable Debugging and Monitoring System. In: Proc. AFIPS 1969 Spring Joint Computer Conference, volume 34, pp. 567580. AFIPS Press.Google Scholar
Beander, B. (1983) VAX DEBUG: An interactive, symbolic, multilingual debugger. In: Proc. ACM SIGSOFT/SIGPLAN Software Engineering Symposium on High Level Debugging, pp. 173179. (Published as SIGPLAN Notices, 18(8), 08 1983.)CrossRefGoogle Scholar
Bowen, D., Byrd, L., Pereira, F., Pereira, L. and Warren, D. (1984) Prolog-20 User's Manual.Google Scholar
Byrd, L. (1980) Understanding the control flow of prolog programs. In: Proc. Logic Programming Workshop, Debrecen, Hungary, pp. 127138. (Also Univ. of Edinburgh Dept. of Artificial Intelligence Research Paper 151.)Google Scholar
Cardelli, L. (1984) Compiling a functional language. In: Proc. ACM Conference on Lisp and Functional Programming, pp. 208217.Google Scholar
Cargill, T. A. and Locanthi, B. N. (1987) Cheap hardware support for software debugging and profiling. In: Proc. 2nd Int. Conf. on Architectural Support for Programming Languages and Operating Systems, pp. 8283.Google Scholar
Choi, J.-D., Miller, B. P. and Netzer, R. H. B. (1991) Techniques for debugging parallel programs with flowback analysis. ACM Trans. Programming Languages and Systems, 13(4):491530.CrossRefGoogle Scholar
Clinger, W. and Rees, J. (1991) Revised4 report on the algorithmic language Scheme. LISP Pointers, IV(3):155.Google Scholar
Coutant, D. S., Meloy, S. and Ruscetta, M. (1988) DOC: A practical approach to source-level debugging of globally optimized code. In: Proc. SIGPLAN Conf. on Programming Language Design and Implementation, pp. 125134. (Published as SIGPLAN Notices, 23(7), 07 1988.)Google Scholar
Crowley, W. P., Hendrickson, C. P. and Rudy, T. E. (1978) The SIMPLE code. Technical Report UCID 17715, Lawrence Livermore Laboratory, Livermore, CA.Google Scholar
Duba, B., Harper, R. and MacQueen, D. (1991) Typing first-class continuations in ML. In: 18th Annual ACM Symp. on Principles of Programming Languages, pp. 163173.Google Scholar
Dybvig, R. K., Friedman, D. P. and Haynes, C. T. (1988) Expansion-passing style: A general macro mechanism. Lisp and Symbolic Computation, 1(1):5375.CrossRefGoogle Scholar
Feldman, S. I. and Brown, C. B. (1988) IGOR: A system for program debugging via reversible execution. In: Proc. ACM SIGPLAN/SIGOPS Workshop on Parallel and Distributed Debugging, pp. 112123. (Published as SIGPLAN Notices, 24(1), 01 1989.)Google Scholar
Ferguson, H. E. and Berner, E. (1963) Debugging systems at the source language level. Comm. ACM, 6(8):430432.CrossRefGoogle Scholar
Friedman, D. P. and Wand, M. (1984) Reification: Reflection without metaphysics. In: Proc. ACM Conference on Lisp and Functional Programming, pp. 348355.Google Scholar
Goldberg, A. and Robson, D. (1983) Smalltalk-80: The Language and Its Implementation. Addison–Wesley.Google Scholar
Goldberg, B. and Gloger, M. (1992) Polymorphic type reconstruction for garbage collection without tags. In: Proc. 1992 ACM Conference on Lisp and Functional Programming, pp. 5365. (Published as LISP Pointers, V(1), 0103 1992.)CrossRefGoogle Scholar
Grishman, R. (1970) The debugging system AIDS. In: Proc. AFIPS Spring Joint Computer Conference, vol. 36, pp. 5964. AFIPS Press.Google Scholar
Hanson, D. R. (1978) Event associations in SNOBOL4 for program debugging. Software – Practice and Experience, 8(2):115129.CrossRefGoogle Scholar
Haynes, C. T. and Friedman, D. P. (1984) Engines build process abstractions. In: Proc. ACM Conference on Lisp and Functional Programming, pp. 1824.Google Scholar
Hennessy, J. L. (1982) Symbolic debugging of optimized code. ACM Trans. Programming Languages and Systems, 4(3):323344.CrossRefGoogle Scholar
Hoare, C. A. R. (1989) Hints on programming-language design. In: Essays in Computing Science, pp. 193216. Prentice Hall. (Keynote address to the ACM SIGPLAN Conference, 10 1973.)Google Scholar
Hölzle, U., Chambers, C. and Ungar, D. (1992) Debugging optimized code with dynamic deoptimization. In: Proc. SIGPLAN'92 Conference on Programming Language Design and Implementation, pp. 3243. (Published as SIGPLAN Notices, 27(7), 07 1992.)Google Scholar
Hudak, P. and Wadler, P. (1990) Report on the programming language Haskell: A non-strict, purely functional language, Version 1.0. Technical Report YALEU/DCS/RR-777, Yale University, Dept. of Computer Science.Google Scholar
Johnson, G. F. and Duggan, D. (1988) Stores and partial continuations as first-class objects in a language and environment. In: Proc. 15th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pp. 158168.CrossRefGoogle Scholar
Kamin, S. N. (1990) Programming Languages: An Interpreter-Based Approach. Addison-Wesley.Google Scholar
Kaufer, S., Lopez, R. and Pratap, S. (1988) Saber-C: An interpreter-based programming environment for the C language. In: Proc. Summer USENIX Conference, pp. 161172.Google Scholar
Kishon, A., Hudak, P. and Consel, C. (1991) Monitoring semantics: A formal framework for specifying, implementing, and reasoning about execution monitors. In: Proc. SIGPLAN Conference on Programming Language Design and Implementation, pp. 338352. (Published as SIGPLAN Notices, 26(6), 06 1991.)Google Scholar
Leeman, G. B. Jr (1986) A formal approach to undo operations in programming languages. ACM Trans. Programming Languages and Systems, 8(1):5087.CrossRefGoogle Scholar
Linton, M. A. (1990) The evolution of dbx. In: Proc. Summer USENIX Conference, pp. 211220.Google Scholar
Maes, P. (1987) Concepts and experiments in computational reflection. In: Proc. Conf. on Object-Oriented Programming Systems, Languages, and Applications, pp. 147155.CrossRefGoogle Scholar
Mellor-Crummey, J. and LeBlanc, T. (1989) A software instruction counter. In: Proc. 3rd Int. Conference on Architectural Support for Programming Languages and Operating Systems, pp. 7886. (Published as Computer Architecture News, 17(2), 04 1989.)Google Scholar
Milner, R., Tofte, M. and Harper, R. (1990) The Definition of Standard ML. MIT Press.Google Scholar
Morrisett, J. G. (1993) Generalizing first-class stores. In: Proc. ACM SIGPLAN Workshop on State in Programming Langauges (SIPL '93), Copenhagen, Denmark, pp. 7387. (Published as Yale University Dept. of Computer Science Tech. Rep. YALEU/DCS/RR-968.)Google Scholar
Ophel, J. L. (1991) AIMLESS: A Programming Environment for ML. PhD thesis, The Australian National University.Google Scholar
Projet Formel, INRIA-ENS (1990) Caml reference manual (version 2.6.1). Technical Report 121, INRIA.Google Scholar
Reade, C. (1989) Elements of Functional Programming. Addison-Wesley.Google Scholar
Reppy, J. H. (1990) Asynchronous signals in Standard ML. Technical Report TR 90-1144, Cornell University, Dept. of Computer Science.Google Scholar
Smith, B. (1982) Reflection and semantics in a procedural language. Technical Report MIT-LCS-TR-272, Massachusetts Institute of Technology, Cambridge, MA.Google Scholar
Stallman, R. M. and Pesch, R. H. (1991) Using GDB: A Guide to the GNU Source-Level Debugger (GDB version 4.0). Free Software Foundation, Inc.Google Scholar
Teitelbaum, T. and Reps, T. (1981) The Cornell Program Synthesizer: A syntax-directed programming environment. Comm. ACM, 24(9):563573.CrossRefGoogle Scholar
Teitelman, W. (1978) Interlisp Reference Manual. Xerox Palo Alto Research Center.Google Scholar
Tolmach, A. P. (1992) Debugging Standard ML. PhD thesis, Princeton University. (Also Princeton Univ. Dept. of Computer Science Tech. Rep. CS-TR-378-92.)Google Scholar
Tolmach, A. P. and Appel, A. W. (1991) Debuggable concurrency extensions for Standard ML. In: Proc. ACM/ONR Workshop on Parallel and Distributed Debugging, pp. 120131. (Published as SIGPLAN Notices, 26(12), 12 1991. Also Princeton Univ. Dept. of Computer Science Tech. Rep. CS-TR-352-91.)CrossRefGoogle Scholar
Turner, D. A. (1985) Miranda: A non-strict functional language with polymorphic types. In: Functional Programming Languages and Computer Architecture: Lecture Notes in Computer Science, vol. 201, pp. 116. Springer-Verlag.CrossRefGoogle Scholar
Vitter, J. S. (1984) US&R: A new framework for redoing. In: Proc. ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, pp. 168176. (Published as SIGPLAN Notices, 19(5), 05 1984.)Google Scholar
Wand, M. (1980) Continuation-based multiprocessing. In: Proc. 1980 LISP Conference, pp. 1928.Google Scholar
Wilson, P. R. and Moher, T. G. (1989) Demonic memory for process histories. In: Proc. SIGPLAN Conference on Programming Language Design and Implementation, pp. 330343. (Published as SIGPLAN Notices, 24(7), 07 1989.)Google Scholar
Zelkowitz, M. (1971) Reversible Execution as a Diagnostic Tool. PhD thesis, Cornell University.Google Scholar
Zellweger, P. T. (1984) Interactive Source-level Debugging of Optimized Programs. PhD thesis, University of California, Berkeley. (Also Xerox Corporation Palo Alto Research Center Tech. Report CSL-84-5.)Google Scholar
Zurawski, L. W. and Johnson, R. E. (1991) Debugging optimized code with expected behavior. Unpublished manuscript.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.