Abstract
We present the InterAspect instrumentation framework for GCC, a widely used compiler infrastructure. The addition of plug-in support in the latest release of GCC makes it an attractive platform for runtime instrumentation, as GCC plug-ins can directly add instrumentation by transforming the compiler’s intermediate representation. Such transformations, however, require expert knowledge of GCC internals. InterAspect addresses this situation by allowing instrumentation plug-ins to be developed using the familiar vocabulary of Aspect-Oriented Programming: pointcuts, join points, and advice functions. Moreover, InterAspect uses specific information about each join point in a pointcut, possibly including results of static analysis, to support powerful customized instrumentation. We describe the InterAspect API and present several examples that illustrate its practical utility as a runtime-verification platform. We also introduce a tracecut system that uses InterAspect to construct program monitors that are formally specified as regular expressions.
Similar content being viewed by others
References
GCC 4.5 release series changes, new features, and fixes. http://gcc.gnu.org/gcc-4.5/changes.html
Adams B, Herzeel C, Gybels K (2008) cHALO, stateful aspects in C. In: ACP4IS ’08: Proceedings of the 2008 AOSD workshop on aspects, components, and patterns for infrastructure software, New York, NY, USA. ACM, New York, pp 1–6
Allan C, Avgustinov P, Christensen AS, Hendren L, Kuzins S, Lhoták O, de Moor O, Sereni D, Sittamplan G, Tibble J (2005) Adding trace matching with free variables to AspectJ. In: Proceedings of the 20th annual ACM SIGPLAN conference on object-oriented programming, systems, languages and applications (OOPSLA’05). ACM Press, New York
Arachne. www.emn.fr/x-info/arachne
Avgustinov P, Christensen AS, Hendren L, Kuzins S, Lhoták J, Lhoták O, de Moor O, Sereni D, Sittampalam G, Tibble J (2005) Abc: An extensible AspectJ compiler. In: Proceedings of the fourth international conference on aspect-oriented software development. ACM Press, New York
Bodden E, Havelund K (2008) Racer: Effective race detection using AspectJ. In: Proceedings of the ACM/SIGSOFT international symposium on software testing and analysis (ISSTA). ACM, New York, pp 155–165
Callanan S, Dean DJ, Zadok E (2007) Extending GCC with modular GIMPLE optimizations. In: Proceedings of the 2007 GCC developers’ summit, Ottawa, Canada, July, pp 31–37
Chen F, Roşu G (2007) MOP: an efficient and generic runtime verification framework. In: Proceedings of the 22nd annual ACM SIGPLAN conference on object-oriented programming, systems, languages and applications (OOPSLA’07)
Chiba S (1995) A metaobject protocol for C++. In: Proceedings of the ACM conference on object-oriented programming systems, languages, and applications, October, pp 285–299
Chiba S (2000) Load-time structural reflection in Java. In: Proceedings of the 14th European conference on object-oriented programming. LNCS, vol 1850. Springer, Berlin, pp 313–336
Coady Y, Kiczales G, Feeley M, Smolyn G (2001) Using AspectC to improve the modularity of path-specific customization in operating system code. In: Proceedings of the 9th ACM SIGSOFT symposium on the foundations of software engineering (FSE), pp 88–98
Douence R, Fritz T, Loriant N, Menaud J-M, Ségura-Devillechaise M, Südholt M (2005) An expressive aspect language for system applications with Arachne. In: Proceedings of the 4th international conference on aspect-oriented software development (AOSD). ACM Press, New York
Eclipse Foundation T AspectJ. www.eclipse.org/aspectj
Fei L, Midkiff SP (2005) Artemis: Practical runtime monitoring of applications for errors. Tech Rep TR-ECE-05-02, Electrical and Computer Engineering, Purdue University. docs.lib.purdue.edu/ecetr/4/
AT&T Research Labs. Graphviz, 2009. www.graphviz.org
Huang X, Seyster J, Callanan S, Dixit K, Grosu R, Smolka SA, Stoller SD, Zadok E (2012) Software monitoring with controllable overhead. Int J Softw Tools Technol Transf 14(3):327–347
InterAspect. www.fsl.cs.stonybrook.edu/interaspect
Kiczales G, Hilsdale E, Hugunin J, Kersten M, Palm J, Griswold WG (2001) An overview of AspectJ. In: Proceedings of the 15th European conference on object-oriented programming. LNCS, vol 2072, pp 327–355
Kneschke J (2009) Lighttpd. www.lighttpd.net/
Meredith PO, Jin D, Griffith D, Chen F, Roşu G (2011) An overview of the MOP runtime verification framework. Int J Softw Tech Technol Transf, to appear
Necula GC, McPeak S, Rahul SP, Weimer W (2002) CIL: Intermediate language and tools for analysis and transformation of C programs. In: Proceedings of the 11th international conference on compiler construction. Springer, Berlin, pp 213–228
Nicoara A, Alonso G, Roscoe T (2008) Controlled, systematic, and efficient code replacement for running Java programs. In: Proceedings of the ACM EuroSys conference, Glasgow, Scotland, UK, April
Objective Caml. http://caml.inria.fr/index.en.html
Poskanzer J (2006) http_load. http://www.acme.com/software/http_load/
Rohlik O, Pasetti A, Cechticky V, Birrer I (2004) Implementing adaptability in embedded software through aspect oriented programming. IEEE Mechatron Robot 85–90
Seyster J, Dixit K, Huang X, Grosu R, Havelund K, Smolka SA, Stoller SD, Zadok E (2010) Aspect-oriented instrumentation with GCC. In: Proc. of the 1st international conference on runtime verification (RV), November. Lecture Notes in Computer Science. Springer, Berlin
Spinczyk O, Lohmann D (2007) The design and implementation of AspectC++. Knowl-Based Syst 20(7):636–651
Valgrind. http://valgrind.org
Walker R, Viggers K (2004) Implementing protocols via declarative event patterns. In: Taylor R, Dwyer M (eds) ACM Sigsoft 12th international symposium on foundations of software engineering (FSE-12). ACM Press, New York, pp 159–169
Acknowledgements
We thank the anonymous reviewers for their valuable comments. Part of the research described herein was carried out at the Jet Propulsion Laboratory (JP), California Institute of Technology, under a contract with the National Aeronautics and Space Administration. Research described here was supported in part by AFOSR Grant FA9550-09-1-0481, NSF Grants CCF-0926190, CCF-0613913, CNS-0831298, and CNS-0509230, and ONR Grants N00014-07-1-0928 and N00014-09-1-0651.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Seyster, J., Dixit, K., Huang, X. et al. InterAspect: aspect-oriented instrumentation with GCC. Form Methods Syst Des 41, 295–320 (2012). https://doi.org/10.1007/s10703-012-0171-3
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10703-012-0171-3