[lldb-dev] [Bug 20657] New: Failure to find an enumerator within its enclosing namespace
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Aug 13 17:12:17 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=20657
Bug ID: 20657
Summary: Failure to find an enumerator within its enclosing
namespace
Product: lldb
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: lldb-dev at cs.uiuc.edu
Reporter: chandlerc at gmail.com
CC: david.majnemer at gmail.com, tfiala at google.com
Classification: Unclassified
% cat x.cpp
namespace N {
enum E { E1, E2, E3 };
}
int main() {
N::E e = N::E2;
}
% nl x.cpp
1 namespace N {
2 enum E { E1, E2, E3 };
3 }
4 int main() {
5 N::E e = N::E2;
6 }
% clang++ -g -o x x.cpp
% lldb -- ./x
Current executable set to './x' (x86_64).
(lldb) b x.cpp:5
Breakpoint 1: where = x`main + 9 at x.cpp:6, address = 0x00000000004005c9
(lldb) r
Process 12194 launching
Process 12194 launched: './x' (x86_64)
Process 12194 stopped
* thread #1: tid = 12194, 0x00007fed45a6e2d0, name = 'x', stop reason = trace
frame #0: 0x00007fed45a6e2d0
error: No such process
Process 12194 stopped
* thread #1: tid = 12194, 0x00000000004005c9 x`main + 9 at x.cpp:6, name = 'x',
stop reason = breakpoint 1.1
frame #0: 0x00000000004005c9 x`main + 9 at x.cpp:6
3 }
4
5 int main() {
-> 6 N::E e = N::E2;
7 }
(lldb) p N::E2
error: no member named 'E2' in namespace 'N'
error: 1 errors parsing expression
BUG! There is an E2 in the namespace N, this is an unscoped enum.
LLDB does have the enum type:
(lldb) p e
(N::E) $0 = E1
(lldb) p N::E::E2
(int) $1 = 1
So the problem seems to be that we don't form the correct AST from the debug
information here, in particular that the DeclContext of the namespace isn't
getting the names for the enumerators inserted into it.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140814/47fc5a8c/attachment.html>
More information about the lldb-dev
mailing list