LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2011, 06:16 PM   #1
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
An interesting article on debugging C++ templates


http://gsd.web.elte.hu/contents/articles/gpce06.pdf
 
Old 11-26-2011, 08:30 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I just glanced at that article, but it seems to be on a different topic than your post seems to suggest.

The article title is
Debugging C++ Template Metaprograms

Metaprogramming is a very specialized small subset of C++ template programming.

The debugging needed in metaprogramming (and apparently documented in that article) is for events that occur at compile time, rather than run time.

Compilers (GCC included) tend to be very flawed in the debugging info they generate to support run time debugging of templated code. So your post caused me to guess incorrectly this article was about dealing with those problems.

Debugging compile time events in metaprogramming is an even more interesting topic, but for a much narrower audience. I wasn't aware tools even existed.
 
Old 11-26-2011, 12:03 PM   #3
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Original Poster
Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by johnsfine View Post
I just glanced at that article, but it seems to be on a different topic than your post seems to suggest.

The article title is
Debugging C++ Template Metaprograms

Metaprogramming is a very specialized small subset of C++ template programming.

The debugging needed in metaprogramming (and apparently documented in that article) is for events that occur at compile time, rather than run time.

Compilers (GCC included) tend to be very flawed in the debugging info they generate to support run time debugging of templated code. So your post caused me to guess incorrectly this article was about dealing with those problems.

Debugging compile time events in metaprogramming is an even more interesting topic, but for a much narrower audience. I wasn't aware tools even existed.
The template engine in C++ is Turing-complete. The template specialization/instantiation happens at compile time, so debugging it needs to be done at compile time. In other word, that template code implemented in a Turing-complete language is run at compile time.

The article is exactly about it. I.e. about debugging/tracing template code which runs at compile time. And because it happens at compile (and no other) time, I didn't mention compile time in the the thread name. I also think that it's universally known that C++ templates in particular and metaprogramming in general are closely interrelated - the former being a subset/particular realization of the latter.

In more detail, it's about an external to both compiler and the original template containing program tools/code (including a Boost library component) which allow to equivalently modify the original template containing program so that template specialization/instantiation can be traced.

The fundamental idea is to introduce special format warnings which later can be parsed, and as the article says, "visualized".
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
interesting Microsoft article newbiesforever General 5 02-15-2010 12:02 PM
Interesting Article here shazam75 General 3 01-24-2007 12:35 PM
Interesting Article Risc91 Linux - General 1 10-21-2003 10:14 AM
interesting article ??? bigjohn Linux - General 1 01-12-2003 07:14 PM
Really interesting article. Opinions ? Bert Linux - General 6 02-20-2002 12:05 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration