This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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 print the return value of template member functions (C++)?


On Thu, Jan 04, 2007 at 02:36:55PM +0100, Andreas Schwab wrote:
> "Peng Yu" <pengyu.ut@gmail.com> writes:
> 
> > $ cat main.cc
> > #include <boost/tuple/tuple.hpp>
> > #include <iostream>
> >
> > int main() {
> >  boost::tuple<int, int> a(10, 10);
> >  std::cout << a.get<0>() << " " << a.get<1>() << std::endl;
> > }
> >
> >
> > (gdb) p a.get<0>()
> > Couldn't find method
> > boost::tuples::tuple<int,int,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::get<0>
> 
> I can't reproduce that with gdb 6.6.

I can't with either 6.5 or 6.6.  It must be some other environmental
difference.

I'm somewhat impressed that it works - GDB doesn't handle templates
well.

-- 
Daniel Jacobowitz
CodeSourcery


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