Debugging C++ template metaprograms. Structure Template metaprogramming (TMP) Debugging –In general –TMP Templight framework –Idea –implementation Results.

Slides:



Advertisements
Similar presentations
Boost Writing better code faster with Boost. Boost Introduction Collection of C++ libraries Boost includes 52 libraries, 1.31 will have at least.
Advertisements

MDS4 Roadmap Items Laura Pearlman USC Information Sciences Institute.
Software Analysis at Philips Healthcare MSc Project Matthijs Wessels 01/09/2009 – 01/05/2010.
Debugging Natural Semantics Specifications Adrian Pop and Peter Fritzson Programming Environment Laboratory Department of Computer and Information Science.
Introduction to Programming in C++ John Galletly.
1 If we modify the machine for the language from F12 p. 47 we can easily construct a machine for the language Observation Turing machine for the language.
Systems Software.
Dynamic Typing COS 441 Princeton University Fall 2004.
Programming Types of Testing.
Documentation Generators: Internals of Doxygen John Tully.
Java Review 2 – Errors, Exceptions, Debugging Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Templates. Objectives At the conclusion of this lesson, students should be able to Explain how function templates are used Correctly create a function.
The Basic Tools Presented by: Robert E., & Jonathan Chase.
Chapter 1 Introduction to Programming. Computer Hardware CPU Memory –Main or primary –Secondary or auxiliary Input device(s) Output device(s)
© 2006 by IBM 1 How to use Eclipse to Build Rich Internet Applications With PHP and AJAX Phil Berkland IBM Software Group Emerging.
Struts 2.0 an Overview ( )
ITM352 PHP and Dynamic Web Pages: Server Side Processing.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
+ Atomic Design By Pattern Lab Delaney Metzger. + Goal of Atomic Design Atomic Design is an idea that can be used to translate the creative side into.
COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
5/5/2005Toni Räikkönen Internet based data collection from enterprises using XML questionnaires and XCola engine CoRD Meeting May 11th 2005.
Its all just code by group 8 张亚东,杨杰,甘伟,余青龙,肖春亮 chapter 2.
XML and XSL Institutional Web Management 2001: Organising Chaos.
Marković Miljan 3139/2011
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
CSC141 Introduction to Computer Programming
Lesson 6. GCSE Computing – programming languages Candidates should be able to:  describe common tools and facilities available in an integrated development.
XML – Tools and Trends Schematron Tim Bornholtz Session 55.
Support for Debugging Automatically Parallelized Programs Robert Hood Gabriele Jost CSC/MRJ Technology Solutions NASA.
1 SEG4912 University of Ottawa by Jason Kealey Software Engineering Capstone Project Tools and Technologies.
CakePHP is an open source web development framework. It follows Model-View- Controller and is developed using PHP. IT is the basic for user to create.
Program documentation Using the Doxygen tool Program documentation1.
Compiler Support for Profiling C++ Template Metaprograms József Mihalicza, Norbert Pataki, Zoltán Porkoláb Eötvös Loránd University Faculty of Informatics.
CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction.
Lecture 6: Computer Languages. Programming Environments (IDE) COS120 Software Development Using C++ AUBG, COS dept.
Jonathan Rile Brandon Strickland Dr. Leslie Cottrell Dr. Roy Nutter.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
1 Chapter 17-1 Templates and Exceptions Dale/Weems.
C Hints and Tips The preprocessor and other fun toys.
Implementing a Domain-Specific Modeling Environment For a Family of Thick-Client GUI Components Milosz Muszynski Tanner AG
CSE 232: C++ Programming in Visual Studio Graphical Development Environments for C++ Eclipse –Widely available open-source debugging environment Available.
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
Debugging and Profiling With some help from Software Carpentry resources.
Eclipse Simple Profiler Ben Xu Mar 7,2011. About Eclipse simple profiler is a open source project to analyze your plug-ins/RCPs performance.
Allegro CL Certification Program Lisp Programming Series Level I Session Basic Lisp Development in the IDE.
Ruby on Rails Evaluation – Cognitive Dimensions Joshua Sunshine
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 05, 2005 Lecture Number: 4.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
Computing Simulation in Orders Based Transparent Parallelizing Pavlenko Vitaliy Danilovich, Odessa National Polytechnic University Burdeinyi Viktor Viktorovych,
 Programming - the process of creating computer programs.
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Outline Announcements: –HW I key online this afternoon –HW II due Friday –Sign up to discuss projects Debugging Testging for correctness.
1 Project 3: Farey Sequences. 2 Farey Sequences Further details about Farey sequences, and more examples, can be found in the Wikipedia article:
Principles of Programming CSEB134 : BS/ CHAPTER Fundamentals of the C Programming Language.
Design Pattern Support based on principles of model driven development Zihao Zhao.
Chapter 1: Introduction to Computers and Programming.
CS422 Principles of Database Systems Stored Procedures and Triggers Chengyu Sun California State University, Los Angeles.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Powerpoint Templates Page 1 Powerpoint Templates Unit Testing Ari Seppi
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Presentation transcript:

Debugging C++ template metaprograms

Structure Template metaprogramming (TMP) Debugging –In general –TMP Templight framework –Idea –implementation Results

Template metaprogramming C++ generics are Turing complete, we can implement algorithms that run in compile time Factorial example

Comparison Run time vs. compile time

TMP ontology 1 Ill-formed and well-formed programs well-formed = according to language rules

TMP ontology 2

Debugging in general

Debugging TMP

Today’s possibilities Compiler support (preferred long term solution) Language elements Since we don’t have compiler support, use the existing language elements and the analogue between run time and metaprograms

If we had a trace file? We can debug a program a posteriori if we have a trace of the run Therefore if we had such a trace file for template metaprograms then we would be able to debug them

Warnings are talkative Today’s compilers usually display warning messages that contain essential contextual information Artificially generate such warnings

Portable warning Consider the following line: … Build outputs G++Watcom MSVC 7.1, 8.0Comeau Etc.

Step #1: preprocessing Use the existing preprocessor to obtain a single source file

Step #2: instrumentation Insert our specially designed warnings to the interested positions

Step #3: Build -> warnings Feed the compiler with this modified source and save the warnings

Step #4: warnings -> trace file Gather the information from the warnings and create a trace file for further use

Results: TMP debugger IDE How it looks like in real

Ideal compiler support Special output to migrate these hacks into the compiler

Limitations Different levels (no output, only partial info) Simple pattern matching is not strong enough, ambiguity

Related work Profiling TMP book efficieny measurements Tracer Mpl::print archetype

Future directions Eliminate limitations Profiling IDE integration Compiler support

Conclusion This is a prototype that works with limitations With compiler support useful tools could be easily created

Contact Home page