[lldb-dev] [Bug 21662] LLDB's name lookup is completely wrong for C++

via lldb-dev lldb-dev at lists.llvm.org
Thu Aug 1 13:56:55 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=21662

Jonas Devlieghere <jdevlieghere at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jdevlieghere at apple.com
         Resolution|---                         |WORKSFORME

--- Comment #1 from Jonas Devlieghere <jdevlieghere at apple.com> ---
Both issues appear to have been fixed.

(lldb) target create "/tmp/a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) b f
Breakpoint 1: where = a.out`f(int, int) + 10 at main.cpp:5:12, address =
0x0000000100000f8a
(lldb) r
Process 48254 launched: '/tmp/a.out' (x86_64)
Process 48254 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000f8a a.out`f(N=1, M=2) at main.cpp:5:12
   2    namespace M { volatile int x; }
   3
   4    void f(int N, int M) {
-> 5      ::N::x = N;
   6      ::M::x = M;
   7    }
   8
(lldb) p N
(int) $0 = 1
(lldb) p M
(int) $1 = 2
(lldb) p ::N::x
(volatile int) $2 = 0
(lldb) p ::N
error: reference to 'N' is ambiguous

...

(lldb) target create "/tmp/a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) b f
Breakpoint 1: where = a.out`N::S1::f(N::S2&) + 12 at main.cpp:16:18, address =
0x0000000100000f6c
(lldb) r
Process 60495 launched: '/tmp/a.out' (x86_64)
Process 60495 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000f6c a.out`N::S1::f(this=0x00007ffeefbff658,
M1=0x00007ffeefbff650) at main.cpp:16:18
   13   using namespace N;
   14
   15   void S1::f(S2 &M1) {
-> 16     N::M1::M2::x = M1.x;
   17   }
   18
   19   int main() {
(lldb) p M1
(N::S2) $0 = (x = 42)

-- 
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/20190801/a9454baf/attachment.html>


More information about the lldb-dev mailing list