Abstract
We present a novel approach to avoid the debugging of optimized code through comparison checking. In the technique presented, both the unoptimized and optimized versions of an application program are executed, and computed values are compared to ensure the behaviors of the two versions are the same under the given input. If the values are different, the comparison checker displays where in the application program the differences occurred and what optimizations were involved. The user can utilize this information and a conventional debugger to determine if an error is in the unoptimized code. If the error is in the optimized code, the user can turn off those offending optimizations and leave the other optimizations in place. We implemented our comparison checking scheme, which executes the unoptimized and optimized versions of C programs, and ran experiments that demonstrate the approach is effective and practical.
Supported in part by NSF grants CCR-940226, CCR-9704350, CCR-9808590 and EIA-9806525, and a grant from Hewlett Packard Labs to the University of Pittsburgh.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Abramson, D. and Sosic, R. A Debugging Tool for Software Evolution. CASE-95, 7th International Workshop on Computer-Aided Software Engineering, pages 206–214, July 1995.
Abramson, D. and Sosic, R. A Debugging and Testing Tool for Supporting Software Evolution. Journal of Automated Software Engineering, 3:369–390, 1996.
Adl-Tabatabai, A. and Gross, T. Source-Level Debugging of Scalar Optimized Code. In Proceedings ACM SIGPLAN’96 Conf. on Programming Languages Design and Implementation, pages 33–43, May 1996.
Brooks, G., Hansen, G.J., and Simmons, S. A New Approach to Debugging Optimized Code. In Proceedings ACM SIGPLAN’92 Conf. on Programming Languages Design and Implementation, pages 1–11, June 1992.
Copperman, M. Debugging Optimized Code: Currency Determination with Data Flow. In Proceedings Supercomputer Debugging Workshop’ 92, October 1992.
Copperman, M. Debugging Optimized Code Without Being Misled. ACM Transactions on Programming Languages and Systems, 16(3):387–427, 1994.
Coutant, D.S., Meloy, S., and Ruscetta, M. DOC: A Practical Approach to Source-Level Debugging of Globally Optimized Code. In Proceedings ACM SIGPLAN’88 Conf. on Programming Languages Design and Implementation, pages 125–134, June 1988.
Dhamdhere, D. M. and Sankaranarayanan, K. V. Dynamic Currency Determina-tion in Optimized Programs. ACM Transactions on Programming Languages and Systems, 20(6):1111–1130, November 1998.
Fraser, C. and Hanson, D. A Retargetable C Compiler: Design and Implementation. Benjamin/Cummings, 1995.
Fritzson, P. A Systematic Approach to Advanced Debugging through Incremental Compilation. In Proceedings ACM SIGSOFT/SIGPLAN Software Engineering Symposium on High-Level Debugging, pages 130–139, 1983.
Gross, T. Bisection Debugging. In Proceedings of the AADEBUG’97 Workshop, pages 185–191, May, 1997.
Gupta, R. Debugging Code Reorganized by a Trace Scheduling Compiler. Structured Programming, 11(3):141–150, 1990.
Hennessy, J. Symbolic Debugging of Optimized Code. ACM Transactions on Programming Languages and Systems, 4(3):323–344, July 1982.
Holzle, U., Chambers, C., and Ungar, D. Debugging Optimized Code with Dynamic Deoptimization. In Proceedings ACM SIGPLAN’92 Conf. on Programming Languages Design and Implementation, pages 32–43, June 1992.
Jaramillo, C. Debugging of Optimized Code Through Comparison Checking. PhD dissertation, University of Pittburgh, 1999.
Jaramillo, C., Gupta, R., and Soffa, M.L. Capturing the Effects of Code Improving Transformations. In Proceedings of International Conference on Parallel Architectures and Compilation Techniques, pages 118–123, October 1998.
Kessler, P. Fast Breakpoints: Design and Implementation. In Proceedings ACM SIGPLAN’90 Conf. on Programming Languages Design and Implementation, pages 78–84, 1990.
Pineo, P.P. and Soffa, M.L. Debugging Parallelized Code using Code Liberation Techniques. Proceedings of ACM/ONR SIGPLAN Workshop on Parallel and Distributed Debugging, 26(4):103–114, May 1991.
Pollock, L.L. and Soffa, M.L. High-Level Debugging with the Aid of an Incremental Optimizer. In 21st Annual Hawaii International Conference on System Sciences, volume 2, pages 524–531, January 1988.
Seidner, R. and Tindall, N. Interactive Debug Requirements. In Proceedings ACM SIGSOFT/SIGPLAN Software Engineering Symposium on High-Level Debugging, pages 9–22, 1983.
Sosic, R. and Abramson, D. A. Guard: A Relative Debugger. Software Practice and Experience, 27(2):185–206, February 1997.
Tice, C. and Graham, S.L. OPTVIEW: A New Approach for Examining Optimized Code. Proceedings of ACM SIGPLAN Workshop on Program Analysis for Software Tools and Engineering, June 1998.
Wismueller, R. Debugging of Globally Optimized Programs Using Data Flow Analysis. In Proceedings ACM SIGPLAN’94 Conf. on Programming Languages Design and Implementation, pages 278–289, June 1994.
Wu, L., Mirani, R., Patil H., Olsen, B., and Hwu, W.W. A New Framework for Debugging Globally Optimized Code. In Proceedings ACM SIGPLAN’99 Conf. on Programming Languages Design and Implementation, pages 181–191, 1999.
Zellweger, P.T. An Interactive High-Level Debugger for Control-Flow Optimized Programs. In Proceedings ACM SIGSOFT/SIGPLAN Software Engineering Symposium on High-Level Debugging, pages 159–171, 1983.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jaramillo, C., Gupta, R., Soffa, M.L. (1999). Comparison Checking: An Approach to Avoid Debugging of Optimized Code. In: Nierstrasz, O., Lemoine, M. (eds) Software Engineering — ESEC/FSE ’99. ESEC SIGSOFT FSE 1999 1999. Lecture Notes in Computer Science, vol 1687. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48166-4_17
Download citation
DOI: https://doi.org/10.1007/3-540-48166-4_17
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66538-0
Online ISBN: 978-3-540-48166-9
eBook Packages: Springer Book Archive