Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* How to print the return value of a template member function
@ 2006-11-15 22:53 Peng Yu
  2006-11-15 23:08 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Yu @ 2006-11-15 22:53 UTC (permalink / raw)
  To: gdb

Hi,

I have the following program listed below this email. I want to
inspect 'a.get<0>()' from gdb. But I got the following error message.
Can you show me what the right way should be?

(gdb) start
Breakpoint 1 at 0x80489a4: file main.cc, line 5.
[Thread debugging using libthread_db enabled]
[New Thread -1217684800 (LWP 6424)]
[Switching to Thread -1217684800 (LWP 6424)]
main () at main.cc:5
5         boost::tuple<int, int> a(10, 10);
(gdb) n
6         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>
(gdb)

Thanks,
Peng

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-16  1:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-15 22:53 How to print the return value of a template member function Peng Yu
2006-11-15 23:08 ` Andreas Schwab
2006-11-16  1:09   ` Peng Yu
2006-11-16  1:22     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox