This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: c++0x lambdas, single steeping
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Larroy <pedro dot larroy dot lists at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Sat, 25 Jun 2011 20:21:07 +0200
- Subject: Re: c++0x lambdas, single steeping
- References: <BANLkTikwdN7w7awFWYGHFgWhQNUMJvo3Ew@mail.gmail.com>
On Tue, 21 Jun 2011 00:29:47 +0200, Pedro Larroy wrote:
> Is there support in gdb for single stepping into them? Last attempt
> with 7.2-debian was not successful.
At least with unpatched FSF GCC+GDB releases it works for me.
In general only line granularity is supported for debugging - separate
stepping of multiple statements ona a single line are not supported.
gcc (GCC) 4.6.1 20110625 (prerelease)
GNU gdb (GDB) 7.2
g++ -std=c++0x -Wall -g
1 int
2 main ()
3 {
4 int i = 0, j = 0;
5 auto l = [&]()
6 {
7 i++;
8 j++;
9 return 0;
10 };
11 return l ();
12 }
(gdb) start
Temporary breakpoint 1, main () at lambda.C:4
4 int i = 0, j = 0;
(gdb) step
10 };
(gdb) step
11 return l ();
(gdb) step
operator() (this=0x7fffffffdc90) at lambda.C:7
7 i++;
(gdb) step
8 j++;
(gdb) step
9 return 0;
(gdb) step
10 };
(gdb) step
main () at lambda.C:12
12 }
(gdb) _
Regards,
Jan