The developers of high-performance scientific applications often work in complex computing environments that place heavy demands on program analysis tools. The developers need tools that interoperate, are portable across machine architectures, and provide source-level feedback. In this paper, we describe a tool framework, the Program Database Toolkit (PDT), that supports the development of program analysis tools meeting these requirements. PDT uses compile-time information to create a complete database of high-level program information that is structured for well-defined and uniform access by tools and applications. PDT's current applications make heavy use of advanced features of C++, in particular, templates. We describe the toolkit, focussing on its most important contribution --its handling of templates --as well as its use in existing applications.
beckman @acl.lanl.gov 1. ABSTRACT Developers of static and dynamic analysis tools for C++ programs need access to information on functions, classes, templates, and macros in parsed C++ code. Existing tools, such as the EDG display tool, provide that access, but in an unsuitable format. We built a converter that prunes and reorganizes the information into the appropriate format. The converter provides the information needed for our TAU (Tuning and Analysis Utilities) tools and, in more general terms, provides C++ developers considerable opportunities for automating software development.The EDG Front End parses a C++ source file and creates an intermediate language (IL) tree representing this file. The constructs of this tree correspond closely to the analogous constructs of the C++ language. The EDG display tool walks the IL tree and reports information on each IL entity that it encounters.Not needing the entire EDG intermediate language tree, we created a converter to report only the information typically needed by analysis tools, such as function call graphs and class hierarchies. Our initial strategy was passive: report on functions and their calls, and classes and their members, as the related structures are discovered during the traversal of the IL tree. We realized, however, that not all related information could be grouped as we wanted, e.g. function calls with the calling function. Our strategy, then, became more aggressive. When processing a function construct, we also traverse that part of the tree --in another memory region --containing the IL for its executable code, and report the routine calls encountered there. The class hierarchy information is scattered in structures pertaining to base classes and their derivations: we follow the necessary pointers and compress the information given to just the direct parent classes.The IL converter processes the intermediate language file for a given source file and creates a human-readable file. This file contains all information on functions and classes, including template instantiations, as well as that for templates and macros. The routine section lists source identification, parent class and access, signature, characteristics, and functions called for each routine. The class section specifies source information, characteristics, direct parent classes, member function IDS, and information on other members. The template and macro sections will report source information, type, and the complete text of each entity.The resulting program database is useful for a variety of analysis tools. We will use it for TAU, upgrading the class browser, call graph display, and tracing/profiling mechanism. Further, our converter will allow the developers of the ACTS toolkit to create tools that selectively query the database. Such tools can, e.g., automatically generate the HPC++ stubs that are required to interface directly to POOMA objects from perl. A template instantiation browser can be developed that will enable scripting at run-time. These C++ developers now have new opt...
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.