473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

any tool for template debugging ?

Hi,
Is there any tool for template debugging, during compilation process
? Just like gdb or visual studio debugger do it during program
execution, a step by step debug for the program,
I am looking for something which will do the process during
compilation and show what is getting substituted for which call.
Otherwise sometimes, compilation fails saying some value_type can't be
substituted by value_type& and etc inside a template call, but it never
reports who calls it, and in turn all of the steps the compiler follow
to substitute it.
Thus I want to get through the template substitution states that the
compiler uses , and the type parameters that it substitutes, and the
exact specialization that it makes, which will give a justification of
the compiler error that it generates, rather than at run time

thanks
abir

Nov 24 '06 #1
1 3594

toton wrote:
Hi,
Is there any tool for template debugging, during compilation process
? Just like gdb or visual studio debugger do it during program
execution, a step by step debug for the program,
I am looking for something which will do the process during
compilation and show what is getting substituted for which call.
Otherwise sometimes, compilation fails saying some value_type can't be
substituted by value_type& and etc inside a template call, but it never
reports who calls it, and in turn all of the steps the compiler follow
to substitute it.
Thus I want to get through the template substitution states that the
compiler uses , and the type parameters that it substitutes, and the
exact specialization that it makes, which will give a justification of
the compiler error that it generates, rather than at run time
This is a major problem in C++. The 'Big Idea' to attempt to do
something about the problem is Concepts:

http://www.generic-programming.org/l...es/conceptcpp/

The idea is that instead of using 'raw' template parameters for a
function or class template, that you specify the allowable types for
the template parameter by only allowing types that conform to a
Concept. When you invoke the function on a particular type the
compiler checks whether the type conforms to the Concept and if not
should in theory give you a much more precise error message as to what
the problem is, and point you at the place where the problem is.

There is a downloadable compiler based on gcc which you can use to test
out how this scheme might look:

http://www.generic-programming.org/software/ConceptGCC/

It isnt finished and is far from perfect but is well worth trying out.
There is a good chance Concepts will become part of C++, but currently
the scheme needs lots more user feedback to improve it.

FWIW Here is my ConceptGCC installation for Windows guide:

You need to have Cygwin installed:

http://www.cygwin.com/

Download the ConceptGCC compiler:

http://www.generic-programming.org/s...C/download.php

Assuming cygwin is installed correctly you can unzip the download
using:

'tar -xvjf conceptgcc-VERSION-cygwin.tar.bz2

Move the resulting 'opt' directory to your Cygwin installation. In my
case
C:/Cygwin

So in my case the result is C:/Cygwin/opt

Head for Start>Control Panel.
Head for System>Advanced>Environment Variables.
Find 'Path' environment variable
Add The ConceptGcc bin directory e.g
PREVIOUS_Stuff;C:/Cygwin/opt/conceptgcc-VERSION/bin
Now check it works. Open a command prompt. (If you have Cygwin
correctly
installed you shouldnt need to be in Cygwin shell)

type conceptg++.

If all is working ok you should get:

C:\my_current_dir>conceptg++
conceptg++: no input files

C:\my_current_dir>

You can invoke the compiler from a command prompt in your current
directory by:
// (compile followed by link)

conceptg++ -c test.cpp
conceptg++ -o testprog.exe test.o

Next.. Head for the tutorial:

http://www.generic-programming.org/l...tcpp/tutorial/

regards
Andy Little

Nov 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ColdCanuck | last post by:
Greetings All! I'm hoping some of you .NET gurus can help me out. I've search google but I cannot find the answers I'm looking for. I have a small business client that would like to replace...
3
by: Gordan | last post by:
I'm just wondering - is there a JS developing tool? I'm using Notepad, IE and a lot of F5 key :-)) using some better text editor that highlights code is definitely better but I never found...
2
by: Alex Traud | last post by:
hello ng, is there a possibility to debug a template class? i have a template class Polyom<T> (which implements a polynomial) defined in the file polynom.h. thanks in advance alex
2
by: Steven T. Hatton | last post by:
If I understand correctly, a template is translated into its source equivalence, either explicitly, or implicitly. It seems to me, a tool that would show me that intermediate form of the template...
0
by: Daniel Perron | last post by:
Hi, I was trying to use Galois.Net to specify code generators and I had to look for some text template tool to simplify the syntax. I was looking for something similar to the syntax of an...
11
by: Alvin Bruney | last post by:
I've run iis lockdown and debugging stopped working. I've added the debug verb to urlscan. The error message is asp.net and atl server cannot be debugged. I haven't seen this one before. If I...
4
by: Jim Davis | last post by:
I've been working on a new release of my "debug" library. The original allowed the developer to "dump" complex objects (even those with circular references) to the screen for review. This version...
3
by: keithb | last post by:
It has been years since I worked with ASP, having moved on to ASP.NET. However, I have just inherited a project adding some enhancements to an existing ASP site. What is the best tool to use for...
2
by: Zhang Weiwu | last post by:
Hello. I am looking for a commandline tool to take an html document (or html document segment, a.k.a. without beginign "<html><head>..</head><body>") and process it by removing all css style...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.