This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++0x lambdas, single steeping


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]