From: "Peng Yu" <pengyu.ut@gmail.com>
To: gdb@sourceware.org
Subject: How to print the return value of a template member function
Date: Wed, 15 Nov 2006 22:53:00 -0000 [thread overview]
Message-ID: <366c6f340611151453s4c938231pc8cc9096a6f1d9b1@mail.gmail.com> (raw)
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;
}
next reply other threads:[~2006-11-15 22:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-15 22:53 Peng Yu [this message]
2006-11-15 23:08 ` Andreas Schwab
2006-11-16 1:09 ` Peng Yu
2006-11-16 1:22 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=366c6f340611151453s4c938231pc8cc9096a6f1d9b1@mail.gmail.com \
--to=pengyu.ut@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox