* Re: How to print the return value of template member functions (C++)?
[not found] <366c6f340701031704i5437d6a9m6c5d3454b9fdce01@mail.gmail.com>
@ 2007-01-04 13:37 ` Andreas Schwab
2007-01-04 19:22 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2007-01-04 13:37 UTC (permalink / raw)
To: Peng Yu; +Cc: gdb
"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.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to print the return value of template member functions (C++)?
2007-01-04 13:37 ` How to print the return value of template member functions (C++)? Andreas Schwab
@ 2007-01-04 19:22 ` Daniel Jacobowitz
2007-01-04 22:06 ` Peng Yu
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-01-04 19:22 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Peng Yu, gdb
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to print the return value of template member functions (C++)?
2007-01-04 19:22 ` Daniel Jacobowitz
@ 2007-01-04 22:06 ` Peng Yu
2007-01-04 22:09 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Peng Yu @ 2007-01-04 22:06 UTC (permalink / raw)
To: gdb
On 1/4/07, Daniel Jacobowitz <drow@false.org> wrote:
> 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.
I tried on 6.6 as well. The same error is gotten. Would you please let
me know what kind of environmental stuffs are relevant so that I
narrow down the problem?
Thanks,
Peng
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to print the return value of template member functions (C++)?
2007-01-04 22:06 ` Peng Yu
@ 2007-01-04 22:09 ` Daniel Jacobowitz
2007-01-04 22:34 ` Peng Yu
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-01-04 22:09 UTC (permalink / raw)
To: Peng Yu; +Cc: gdb
On Thu, Jan 04, 2007 at 04:06:34PM -0600, Peng Yu wrote:
> I tried on 6.6 as well. The same error is gotten. Would you please let
> me know what kind of environmental stuffs are relevant so that I
> narrow down the problem?
It could be related to your platform or your GCC version.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to print the return value of template member functions (C++)?
2007-01-04 22:09 ` Daniel Jacobowitz
@ 2007-01-04 22:34 ` Peng Yu
2007-01-04 22:45 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Peng Yu @ 2007-01-04 22:34 UTC (permalink / raw)
To: Peng Yu, gdb
On 1/4/07, Daniel Jacobowitz <drow@false.org> wrote:
> On Thu, Jan 04, 2007 at 04:06:34PM -0600, Peng Yu wrote:
> > I tried on 6.6 as well. The same error is gotten. Would you please let
> > me know what kind of environmental stuffs are relevant so that I
> > narrow down the problem?
>
> It could be related to your platform or your GCC version.
>
g++-3.4 (GCC) 3.4.4 20050314 (prerelease) (Debian 3.4.3-13sarge1)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The gcc version is shown above. But how to make sure it is because gcc
bugs? Shall I use a later version?
Thanks,
Peng
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to print the return value of template member functions (C++)?
2007-01-04 22:34 ` Peng Yu
@ 2007-01-04 22:45 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-01-04 22:45 UTC (permalink / raw)
To: Peng Yu; +Cc: gdb
On Thu, Jan 04, 2007 at 04:34:36PM -0600, Peng Yu wrote:
> g++-3.4 (GCC) 3.4.4 20050314 (prerelease) (Debian 3.4.3-13sarge1)
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> The gcc version is shown above. But how to make sure it is because gcc
> bugs? Shall I use a later version?
I tried it for you. It fails with 3.4 and succeeds with 4.1.
I don't know if it's a GDB bug or a g++ bug; they are definitely very
different debug info. It really could be either.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-01-04 22:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <366c6f340701031704i5437d6a9m6c5d3454b9fdce01@mail.gmail.com>
2007-01-04 13:37 ` How to print the return value of template member functions (C++)? Andreas Schwab
2007-01-04 19:22 ` Daniel Jacobowitz
2007-01-04 22:06 ` Peng Yu
2007-01-04 22:09 ` Daniel Jacobowitz
2007-01-04 22:34 ` Peng Yu
2007-01-04 22:45 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox