This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/15231] New: Local variables in lambdas are not accessible
- From: "poenitz at htwm dot de" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 05 Mar 2013 22:07:46 +0000
- Subject: [Bug c++/15231] New: Local variables in lambdas are not accessible
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=15231
Bug #: 15231
Summary: Local variables in lambdas are not accessible
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned@sourceware.org
ReportedBy: poenitz@htwm.de
Classification: Unclassified
The local variable x does not seem to be "visible" for the debugger in the
following:
echo "
void breaker() {}
struct Z
{
int b;
Z() {
auto a = [&]() {
int x = 32;
breaker();
return x;
};
b = a();
}
};
int main()
{
Z z;
return z.b;
}
" | g++ -g -xc++ -std=c++11 -
gdb -ex 'b breaker' -ex 'run' -ex 'up' -ex 'p x' -ex 'bt full' ./a.out
-> GNU gdb (GDB) 7.5.50.20121013-cvs
-> [...]
-> 10 in <stdin>
-> No symbol "x" in current context.
-> #0 breaker () at <stdin>:2
-> No locals.
-> #1 0x0804840e in Z::Z()::{lambda()#1}::operator()() const () at
-> <stdin>:10
-> No locals.
-> #2 0x08048425 in Z::Z (this=0xbffff34c) at <stdin>:13
-> a = {<No data fields>}
-> #3 0x080483f6 in main () at <stdin>:20
-> z = {b = -1208270848}
$ gcc --version
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.