This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: How to get debug mode version of libstdc++ when compiling GCC
- From: Dhruv Matani <dhruvbird at gmx dot net>
- To: Pit Cuppens <pcuppens at gmx dot net>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: 23 Jul 2004 19:22:45 +0530
- Subject: Re: How to get debug mode version of libstdc++ when compiling GCC
- Organization:
- References: <24655.1090589043@www66.gmx.net>
Hi,
Prof Dijkstra once said:
"Testing can only show the presence of bugs, not their absence."
So, try avoiding the debug mode, an the likes, etc...
I agree that it is required at times, but you should not be stranded
because of the debug mode being absent!
The more hair you start losing after debugging, the more intellectual
will the above statement sound ;-)
(That's correct English grammar BTW)
I'm not advising you to do or not do anything, but am just expressing my
opinion about the futility of debugging in the larger scenario. So, if
you feel offended, please forgive me, I meant not harm.
On Fri, 2004-07-23 at 18:54, Pit Cuppens wrote:
> > Those options are nothing to do with the debug mode, they will install
> > copies of the libstdc++ libs with debugging symbols included.
> >
> > Please read http://gcc.gnu.org/onlinedocs/libstdc++/debug.html
> >
> > (which hasn't been updated to include my comment that the debug mode was
> > introduced in version 3.4)
> >
> > jon
>
> I have read this, but if I understand it correctly, then
> something like
>
> /home/pc/software/gcc-3.3.2/bin/g++ -g3 -O0 -D_GLIBCXX_DEBUG tmp.c -o
> tmp
>
> should enable debug mode. Which it doesn't:
>
> ./tmp
> Segmentation fault
> Exit 139
>
> What I am saying is that the directory
>
> /home/pc/software/gcc-3.3.2/include
>
> does not contain any debugging code at all.
> I can see the files 'vector', etc. there,
> but the directory 'debug/' is missing. (I
> assume here that it is indeed true that
> libstdc++ has a debug/ directory, as is
> the case in my gcc-3.4.1 installation.) So
> the flag '-D_GLIBCXX_DEBUG' in the above
> compiler call doesn't have any effect at all.
>
> Or do I missinterpret the text in
>
> http://gcc.gnu.org/onlinedocs/libstdc++/debug.html ?
>
> Many thanks,
> Pit
>
> P.S. My file tmp.c looks as follows:
>
> #include <iostream>
> #include <vector>
>
> int main(int,char **) {
> std::vector<int> vsds;
> vsds[4] = 1;
> }
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
template<typename Signature>
class CustomSignature : public Signature
{ };