This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How to debug C++ functor in gdb?
- From: Andreas Schwab <schwab at suse dot de>
- To: "Peng Yu" <pengyu dot ut at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 15 Nov 2006 02:23:02 +0100
- Subject: Re: How to debug C++ functor in gdb?
- References: <366c6f340610291301p523de441r6b691975822a9131@mail.gmail.com> <jed58ak8vb.fsf@sykes.suse.de> <366c6f340611141612s2ccd04d0i826c5c8253ec74d@mail.gmail.com>
"Peng Yu" <pengyu.ut@gmail.com> writes:
> On 10/29/06, Andreas Schwab <schwab@suse.de> wrote:
>> "Peng Yu" <pengyu.ut@gmail.com> writes:
>>
>> > I set a break point at the line indicated in the comment. Then I call
>> > the following command in gdb. It failed. Is there any way that I can
>> > call the functor _f?
>> >
>> > (gdb) p _f(10)
>> > Couldn't find method functor<function<int> >::_f
>>
>> (gdb) p _f.'operator()'(10)
>> $1 = 10
>>
>> Andreas.
>
> Hi,
>
> Is it syntax described in the manual somewhere?
operator() is normal C++ syntax.
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."