This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to get debug mode version of libstdc++ when compiling GCC


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
{ };



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]