llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.19k stars 11.14k forks source link

LLDB Not Stepping into Multiple Inheritance Virtual Functions #43413

Open rdtscp opened 4 years ago

rdtscp commented 4 years ago
Bugzilla Link 44068
Version 9.0
OS Linux
Attachments Reproducer program.
CC @rdtscp,@JDevlieghere,@jimingham

Extended Description

Overview:

Using LLDB to debug polymorphic objects that have multiple inheritance will not step into virtual functions.

Steps to Reproduce:

$ clang++ -std=c++11 -g -O0 reproducer.cpp -o clang.out
$ lldb clang.out
(lldb) target create "clang.out"
Current executable set to 'clang.out' (x86_64).
(lldb) b 36                                                                                                                                                                       Breakpoint 1: where = clang.out`main + 103 at reproducer.cpp:36:16, address = 0x0000000000400d67
(lldb) r
Process 2764 launched: '/home/rdtscp/Documents/lldb_reproducer/clang.out' (x86_64)
Process 2764 stopped
* thread #​1, name = 'clang.out', stop reason = breakpoint 1.1
    frame #​0: 0x0000000000400d67 clang.out`main(argc=1, argv=0x00007fffffffe808) at reproducer.cpp:36:16
   33   int main(int argc, char **argv) {
   34     using namespace Test;
   35     std::shared_ptr<Interface> object = std::shared_ptr<Concrete>(new Concrete());
-> 36     int output = object->vFun();
   37     std::cout << output << std::endl;
   38     return output;
   39   }
(lldb) s
Process 2764 stopped
* thread #&#8203;1, name = 'clang.out', stop reason = step in
    frame #&#8203;0: 0x0000000000400d86 clang.out`main(argc=1, argv=0x00007fffffffe808) at reproducer.cpp:37:16
   34     using namespace Test;
   35     std::shared_ptr<Interface> object = std::shared_ptr<Concrete>(new Concrete());
   36     int output = object->vFun();
-> 37     std::cout << output << std::endl;
   38     return output;
   39   }
(lldb)

Altering the Concrete class to be:

class Concrete : // public Base,
         public Interface {
public:
  virtual int vFun() override {
    volatile int x = rand();
    if (x > 0)
      return x;
    else
      return 0;
  }
};

Will result in:

$ clang++ -std=c++11 -g -O0 reproducer.cpp -o clang.out
$ lldb clang.out
(lldb) target create "clang.out"
Current executable set to 'clang.out' (x86_64).
(lldb) b 36
Breakpoint 1: where = clang.out`main + 104 at reproducer.cpp:36:16, address = 0x0000000000400cf8
(lldb) r
Process 2869 launched: '/home/rdtscp/Documents/lldb_reproducer/clang.out' (x86_64)
Process 2869 stopped
* thread #&#8203;1, name = 'clang.out', stop reason = breakpoint 1.1
    frame #&#8203;0: 0x0000000000400cf8 clang.out`main(argc=1, argv=0x00007fffffffe808) at reproducer.cpp:36:16
   33   int main(int argc, char **argv) {
   34     using namespace Test;
   35     std::shared_ptr<Interface> object = std::shared_ptr<Concrete>(new Concrete());
-> 36     int output = object->vFun();
   37     std::cout << output << std::endl;
   38     return output;
   39   }
(lldb) s
Process 2869 stopped
* thread #&#8203;1, name = 'clang.out', stop reason = step in
    frame #&#8203;0: 0x0000000000400fec clang.out`Test::Concrete::vFun(this=0x0000000000615c20) at reproducer.cpp:23:24
   20              public Interface {
   21     public:
   22       virtual int vFun() override {
-> 23         volatile int x = rand();
   24         if (x > 0)
   25       return x;
   26         else
(lldb)

The above shows that making the Concrete class inherit from the Base class prevents us from stepping into vFun().

System Settings:

OS: Debian GNU/Linux 9.11 (stretch) x86_64
Model: VirtualBox 1.2
Kernel: 4.9.0-11-amd64
Uptime: 1 hour, 3 minutes
Packages: 1722
Shell: zsh 5.3.1
CPU: Intel i5-7360U (1) @ 2.3GHz
GPU: VMware SVGA II Adapter
Memory: 219MB / 996MB
$ clang++ --version
clang version 9.0.0-svn364966-1~exp1+0~20190702204433.1332~1.gbpb44072 (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ lldb --version
lldb version 9.0.0

Additional Information: I tried using:

g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git

To see if my code was incorrect, but g++ and gdb were able to step into "vFun()" fun.

jimingham commented 4 years ago

Various of us are working on bringing over all the relevant diffs between the swift fork of lldb and the llvm.org version. I don't know when we'll get to this bit, however. If you wanted to try your hand at it, you can grab the swift fork from https://github.com/apple/llvm-project/ and look at all the differences involving IsSymbolARuntimeThunk and start pulling them over. That does not seem like not a good starter task, however. Otherwise, you can monitor checkins to llvm's github, looking for this code to come over.

rdtscp commented 4 years ago

Thanks for the explanation Jim,

I actually originally experienced this behaviour in a hobby compiler project (compiling/debugging on macos with apple clang/lldb 11) and your explanation aligns with my (albeit rough) findings when I was stepping through the code instruction-by-instruction. Similarly I was not able to reproduce on macos using reproducer.cpp. Although I have no formal experience working with LLVM, I am very keen to get involved, and following this issue through to its resolution would be of interest to me(even as a spectator). If there are plans to introduce changes to LLDB here, could I kindly ask where the best place to track the changes/submissions would be?

Many thanks, Alexander

macos config:

OS: macOS 10.15.2 19C39d x86_64 Host: MacBookPro14,1 Kernel: 19.2.0

alexanderwilson•~» clang++ --version
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin19.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
alexanderwilson•~» lldb --version
lldb-1100.0.30.6
Apple Swift version 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9)
jimingham commented 4 years ago

Interesting. It looks like when calling into vFun, the code in main doesn't call the vtable entry for vFun directly, but instead steps into:

clang.out`non-virtual thunk to Test::Concrete::vFun()

and that function has no debug information . Presumably if we kept on stepping we would eventually get to vFun, but lldb's general rule is that if you step into a function that doesn't have debug information, lldb just steps back out from there. You can control this either by passing "-a 0" to "step" or by setting the setting "target.process.thread.step-in-avoid-nodebug" to false. In general, however, setting this setting to false tends to make for really annoying debugging sessions...

lldb has support for languages with "thunks". The easiest way to do this is with the LanguageRuntime::IsSymbolARuntimeThunk, the support for which is sadly still on the swift fork of lldb but wouldn't be that hard to bring over. If the runtime says a symbol is a runtime thunk, lldb interprets that to mean "this is a trivial function that will dispatch to something interesting if you stepi through it" and will do that.

That's probably the simplest way to solve this. Grab the implementation from the swift lldb and then have the C++ language runtime identify these thunk symbols when asked "IsSymbolARuntimeThunk".

rdtscp commented 4 years ago

Hi Jim,

Many thanks for looking into this issue. Please excuse the large comment with the debug info. If there is anything else I can assist with please let me know.

Alexander

rdtscp commented 4 years ago

$ lldb clang.out (lldb) target create "clang.out" Current executable set to 'clang.out' (x86_64). (lldb) b 36 Breakpoint 1: where = clang.out`main + 103 at reproducer.cpp:36:16, address = 0x0000000000400d67 (lldb) r Process 5800 launched: '/home/rdtscp/Documents/lldb_reproducer/clang.out' (x86_64) Process 5800 stopped

0x0000000000400d00: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:33 0x0000000000400d1b: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:35:65 0x0000000000400d20: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:35:69 0x0000000000400d36: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:35:39 0x0000000000400d5e: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:35:30 0x0000000000400d67: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:36:16 0x0000000000400d6c: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:36:24 0x0000000000400d80: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp 0x0000000000400d83: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:36:7 0x0000000000400d86: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:37:16 0x0000000000400d89: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:37:13 0x0000000000400d9c: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:37:23 0x0000000000400daf: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:38:10 0x0000000000400db2: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:38:3 0x0000000000400db5: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:39:1 0x0000000000400de0: /usr/include/c++/6.3.0/ext/atomicity.h:79 0x0000000000400def: /usr/include/c++/6.3.0/ext/atomicity.h:81:9 0x0000000000400df7: /usr/include/c++/6.3.0/ext/atomicity.h:81:9 0x0000000000400dfd: /usr/include/c++/6.3.0/ext/atomicity.h:82:33 0x0000000000400e01: /usr/include/c++/6.3.0/ext/atomicity.h:82:40 0x0000000000400e04: /usr/include/c++/6.3.0/ext/atomicity.h:82:14 0x0000000000400e09: /usr/include/c++/6.3.0/ext/atomicity.h:82:7 0x0000000000400e11: /usr/include/c++/6.3.0/ext/atomicity.h:84:40 0x0000000000400e15: /usr/include/c++/6.3.0/ext/atomicity.h:84:47 0x0000000000400e18: /usr/include/c++/6.3.0/ext/atomicity.h:84:14 0x0000000000400e1d: /usr/include/c++/6.3.0/ext/atomicity.h:84:7 0x0000000000400e20: /usr/include/c++/6.3.0/ext/atomicity.h:88:3 0x0000000000400e30: /usr/include/x86_64-linux-gnu/c++/6.3.0/bits/gthr-default.h:248 0x0000000000400e34: /usr/include/x86_64-linux-gnu/c++/6.3.0/bits/gthr-default.h:251:3 0x0000000000400e50: /usr/include/c++/6.3.0/ext/atomicity.h:49 0x0000000000400e5b: /usr/include/c++/6.3.0/ext/atomicity.h:49:31 0x0000000000400e5f: /usr/include/c++/6.3.0/ext/atomicity.h:49:38 0x0000000000400e62: /usr/include/c++/6.3.0/ext/atomicity.h:49:12 0x0000000000400e72: /usr/include/c++/6.3.0/ext/atomicity.h:49:5 0x0000000000400e80: /usr/include/c++/6.3.0/ext/atomicity.h:66 0x0000000000400e8b: /usr/include/c++/6.3.0/ext/atomicity.h:67:30 0x0000000000400e8f: /usr/include/c++/6.3.0/ext/atomicity.h:67:29 0x0000000000400e91: /usr/include/c++/6.3.0/ext/atomicity.h:67:18 0x0000000000400e94: /usr/include/c++/6.3.0/ext/atomicity.h:68:15 0x0000000000400e97: /usr/include/c++/6.3.0/ext/atomicity.h:68:6 0x0000000000400e9b: /usr/include/c++/6.3.0/ext/atomicity.h:68:12 0x0000000000400e9f: /usr/include/c++/6.3.0/ext/atomicity.h:69:12 0x0000000000400ea2: /usr/include/c++/6.3.0/ext/atomicity.h:69:5 0x0000000000400ea4: /usr/include/c++/6.3.0/ext/atomicity.h:69:5

0x0000000000400eb0: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19 0x0000000000400ec0: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19:9 0x0000000000400f0c: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19:9

0x0000000000400f10: /usr/include/c++/6.3.0/bits/shared_ptr.h:117 0x0000000000400f24: /usr/include/c++/6.3.0/bits/shared_ptr.h:117:29 0x0000000000400f28: /usr/include/c++/6.3.0/bits/shared_ptr.h:117:11 0x0000000000400f30: /usr/include/c++/6.3.0/bits/shared_ptr.h:117:36 0x0000000000400f36: /usr/include/c++/6.3.0/bits/shared_ptr.h:117:36

0x0000000000400f40: /usr/include/c++/6.3.0/bits/shared_ptr.h:239 0x0000000000400f54: /usr/include/c++/6.3.0/bits/shared_ptr.h:239:32 0x0000000000400f5c: /usr/include/c++/6.3.0/bits/shared_ptr.h:239:22 0x0000000000400f65: /usr/include/c++/6.3.0/bits/shared_ptr.h:239:4 0x0000000000400f6d: /usr/include/c++/6.3.0/bits/shared_ptr.h:239:40 0x0000000000400f73: /usr/include/c++/6.3.0/bits/shared_ptr.h:239:40

0x0000000000400f80: /usr/include/c++/6.3.0/bits/shared_ptr.h:93 0x0000000000400f90: /usr/include/c++/6.3.0/bits/shared_ptr.h:93:11 0x0000000000400f98: /usr/include/c++/6.3.0/bits/shared_ptr.h:93:11 0x0000000000400f9e: /usr/include/c++/6.3.0/bits/shared_ptr.h:93:11

0x0000000000400fa0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:1056 0x0000000000400fac: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:1058:9 0x0000000000400faf: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:1058:2 0x0000000000400fb1: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:1058:2

0x0000000000400fc0: /usr/include/c++/6.3.0/bits/shared_ptr.h:93 0x0000000000400fd0: /usr/include/c++/6.3.0/bits/shared_ptr.h:93:11 0x0000000000400fd8: /usr/include/c++/6.3.0/bits/shared_ptr.h:93:11 0x0000000000400fde: /usr/include/c++/6.3.0/bits/shared_ptr.h:93:11

0x0000000000400fe0: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:7 0x0000000000400ffc: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:7:9 0x0000000000401001: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:7:9

0x0000000000401010: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:12 0x000000000040102c: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:12:9 0x0000000000401031: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:12:9

0x0000000000401040: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19 0x0000000000401050: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19:9 0x0000000000401072: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19:9 0x0000000000401078: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19:9

0x0000000000401080: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19 0x0000000000401090: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19:9 0x00000000004010ae: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:19:9

0x00000000004010b0: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:22 0x00000000004010bc: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:23:24 0x00000000004010c1: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:23:20 0x00000000004010c4: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:24:11 0x00000000004010c7: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:24:13 0x00000000004010ca: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:24:11 0x00000000004010d0: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:25:9 0x00000000004010d3: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:25:2 0x00000000004010db: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:27:2 0x00000000004010e2: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:28:5 0x00000000004010eb: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:28:5

0x00000000004010f0: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp 0x0000000000401109: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp

0x0000000000401110: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp 0x0000000000401129: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp

0x0000000000401130: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp 0x0000000000401149: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp

0x0000000000401150: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:9 0x0000000000401158: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:9:29 0x000000000040115a: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:9:29

0x0000000000401160: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:9 0x0000000000401170: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:9:29 0x000000000040118e: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:9:29

0x0000000000401190: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:14 0x0000000000401198: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:14:34 0x000000000040119a: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:14:34

0x00000000004011a0: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:14 0x00000000004011a8: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:14:34 0x00000000004011aa: /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp:14:34

0x00000000004011b0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:928 0x00000000004011c0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:928:31 0x00000000004011ce: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:928:31 0x00000000004011d4: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:928:31

0x00000000004011e0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:660 0x00000000004011f0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:661:12 0x00000000004011f8: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:661:6 0x00000000004011fe: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x0000000000401202: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:662:4 0x0000000000401205: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:662:11 0x000000000040120a: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:663:7 0x0000000000401210: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:663:7

0x0000000000401210: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:144 0x0000000000401220: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:147:46 0x000000000040122c: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:147:6 0x0000000000401240: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x0000000000401243: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:147:64 0x0000000000401246: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:147:6 0x000000000040124c: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x0000000000401250: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:150:6 0x0000000000401260: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:162:50 0x0000000000401269: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:162:10 0x0000000000401279: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x000000000040127c: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:163:18 0x000000000040127f: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:162:10 0x0000000000401285: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x0000000000401289: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:166:10 0x0000000000401292: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:168:4 0x0000000000401297: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:169:7 0x000000000040129d: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:147:6 0x00000000004012a8: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:147:6

0x00000000004012c0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:928 0x00000000004012d0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:928:31 0x00000000004012de: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:928:31 0x00000000004012e4: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:928:31

0x00000000004012f0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:886 0x0000000000401304: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:885:18 0x0000000000401308: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:885:11 0x000000000040130b: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:885:24 0x0000000000401315: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:885:36 0x0000000000401319: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:885:24 0x0000000000401329: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:890:37 0x000000000040132f: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:890:50 0x0000000000401333: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:890:55 0x0000000000401337: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:890:4 0x0000000000401341: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:891:2 0x0000000000401347: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:891:2

0x0000000000401350: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:569 0x0000000000401364: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:568:29 0x0000000000401374: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:572:16 0x0000000000401382: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x0000000000401386: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:572:47 0x000000000040138a: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:572:20 0x000000000040139e: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:572:14 0x00000000004013a1: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:573:6 0x00000000004013a6: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:579:2 0x00000000004013ad: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:573:6 0x00000000004013b6: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:576:15 0x00000000004013ba: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:576:8 0x00000000004013c8: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x00000000004013cc: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:576:8 0x00000000004013d5: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:577:8 0x00000000004013df: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:579:2 0x00000000004013e6: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:578:6 0x00000000004013f5: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:579:2 0x00000000004013fb: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:578:6 0x000000000040140f: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:578:6

0x0000000000401410: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:866 0x0000000000401418: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:866:7 0x000000000040141a: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:866:7

0x0000000000401420: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:368 0x0000000000401434: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:368:21 0x0000000000401437: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:367:7 0x0000000000401457: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:368:21 0x000000000040145a: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:368:16 0x000000000040145e: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:368:9 0x0000000000401462: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:368:23 0x0000000000401468: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:368:23

0x0000000000401470: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:113 0x000000000040148c: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:113:43 0x000000000040148f: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:113:9 0x0000000000401496: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:113:26 0x000000000040149d: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:113:45 0x000000000040149f: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:113:45

0x00000000004014a0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:363 0x00000000004014b0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:363:11 0x00000000004014b8: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:363:11 0x00000000004014be: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:363:11

0x00000000004014c0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:363 0x00000000004014d0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:363:11 0x00000000004014ee: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:363:11

0x00000000004014f0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:372 0x0000000000401500: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:372:16 0x0000000000401504: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:372:9 0x0000000000401512: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x0000000000401516: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:372:9 0x000000000040151f: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:372:24 0x0000000000401525: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:372:24

0x0000000000401530: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:376 0x0000000000401540: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:376:9 0x000000000040154e: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x0000000000401552: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:376:9 0x000000000040155b: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:376:22 0x0000000000401561: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:376:22

0x0000000000401570: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:380 0x000000000040157e: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:380:9 0x0000000000401580: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:380:9

0x0000000000401580: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:117 0x0000000000401588: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:117:9 0x000000000040158a: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:117:9

0x0000000000401590: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:117 0x0000000000401598: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:117:7 0x000000000040159a: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:117:7

0x00000000004015a0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:127 0x00000000004015b0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:127:9 0x00000000004015be: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x00000000004015c2: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:127:9 0x00000000004015cb: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:127:22 0x00000000004015d1: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:127:22

0x00000000004015e0: /usr/include/c++/6.3.0/bits/move.h:102 0x00000000004015e8: /usr/include/c++/6.3.0/bits/move.h:102:71 0x00000000004015ec: /usr/include/c++/6.3.0/bits/move.h:102:7 0x00000000004015ee: /usr/include/c++/6.3.0/bits/move.h:102:7

0x00000000004015f0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:945 0x0000000000401608: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:944:11 0x000000000040160c: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:944:15 0x000000000040160f: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:944:11 0x0000000000401625: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x0000000000401629: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:944:11 0x0000000000401633: /usr/include/c++/6.3.0/bits/shared_ptr_base.h 0x000000000040163b: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:944:4 0x000000000040163e: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:944:24 0x0000000000401651: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:946:4 0x0000000000401657: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:946:24 0x000000000040165b: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:946:28 0x0000000000401662: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:946:16 0x000000000040166d: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:947:4 0x0000000000401671: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:947:15 0x0000000000401678: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:948:2 0x000000000040167e: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:948:2

0x0000000000401680: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:564 0x000000000040168c: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:563:45 0x0000000000401693: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:564:9 0x0000000000401695: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:564:9

0x00000000004016a0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:689 0x00000000004016b0: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:690:33 0x00000000004016b4: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:690:37 0x00000000004016b7: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:690:25 0x00000000004016bb: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:691:14 0x00000000004016be: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:691:2 0x00000000004016c2: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:691:12 0x00000000004016c5: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:692:10 0x00000000004016c9: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:692:8 0x00000000004016cc: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:693:7 0x00000000004016ce: /usr/include/c++/6.3.0/bits/shared_ptr_base.h:693:7

(lldb) log enable lldb step (lldb) s lldb Finding frames between libc_start_main and main, retn-pc=0x7ffff71bd2e1 lldb GetCallEdges: Attempting to parse call site info for libc_start_main lldb No call edge outgoing from __libc_start_main with retn-PC == 0x7ffff71bd2e1 lldb Thread::PushPlan(0x0x12bf8f0): "Stepping in through line reproducer.cpp:36:16.", tid = 0x16a8. lldb Process::PrivateResume() m_stop_id = 6, public state: stopped private state: stopped lldb Failed to create new thread notification breakpoint. lldb Thread::PushPlan(0x0x12bf8f0): "Single stepping past breakpoint site 2 at 0x400d67", tid = 0x16a8. lldb WillResume Thread #​1 (0x0x12bf8f0): tid = 0x16a8, pc = 0x00400d67, sp = 0x7fffffffe6b0, fp = 0x7fffffffe720, plan = 'Step over breakpoint trap', state = stepping, stop others = 1 intern-state Current Plan for thread 1(0x12bf8f0) (0x16a8, stepping): Step over breakpoint trap being asked whether we should report run. lldb Process thinks the process has resumed. intern-state intern-state ThreadList::ShouldStop: 1 threads, 1 unsuspended threads intern-state Thread::ShouldStop(0x12bf8f0) for tid = 0x16a8 0x16a8, pc = 0x0000000000400fa0 intern-state ^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^ intern-state Plan stack initial state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:16 using ranges:[0x0000000000400d67-0x0000000000400d6c). Element 2: Single stepping past breakpoint site 2 at 0x400d67

intern-state Step over breakpoint stopped for reason: trace. intern-state Plan Step over breakpoint trap explains stop, auto-continue 0. intern-state Plan Step over breakpoint trap should stop: 1. intern-state Completed step over breakpoint plan. intern-state Popping plan: "Step over breakpoint trap", tid = 0x16a8. intern-state ThreadPlanStepInRange reached 0x0000000000400fa0. intern-state Couldn't find step through plan from address 0x400fa0. intern-state No step through plan found. intern-state Stepping out of function "std::shared_ptr<Test::Interface, (__gnu_cxx::_Lock_policy)2>::operator->" because it matches the avoid regexp "^std::" - match substring: "std::". intern-state ShouldStopHere callback returned 0 from 0x400fa0. intern-state Finding frames between main and std::shared_ptr<Test::Interface, (gnu_cxx::_Lock_policy)2>::operator->() const, retn-pc=0x400d6c intern-state GetCallEdges: Attempting to parse call site info for main intern-state No call edge outgoing from main with retn-PC == 0x400d6c intern-state Thread::PushPlan(0x0x12bf8f0): "Stepping out from clang.out`std::__shared_ptr<Test::Interface, (gnu_cxx::_Lock_policy)2>::operator->() const at shared_ptr_base.h:1056 returning to frame at clang.outmain + 118 at reproducer.cpp:36:24 ", tid = 0x16a8. intern-state Plan Step Range stepping in should stop: 0. intern-state Plan stack final state: thread #&#8203;1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:16 using ranges:[0x0000000000400d67-0x0000000000400d6c). Element 2: Stepping out from clang.outstd::__shared_ptr<Test::Interface, (__gnu_cxx::_Lock_policy)2>::operator->() const at shared_ptr_base.h:1056 returning to frame at clang.out`main + 118 at reproducer.cpp:36:24 using breakpoint site -2

Completed Plan Stack:
  Element 0: Single stepping past breakpoint site 2 at 0x400d67

intern-state vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv intern-state ThreadList::ShouldStop overall should_stop = 0 intern-state ThreadList::ShouldReportStop 1 threads intern-state Thread::ShouldReportStop() tid = 0x16a8: returning vote for complete stack's back plan intern-state Returning vote: no intern-state Returning no intern-state Process::PrivateResume() m_stop_id = 7, public state: running private state: stopped intern-state WillResume Thread #​1 (0x0x12bf8f0): tid = 0x16a8, pc = 0x00400fa0, sp = 0x7fffffffe6a8, fp = 0x7fffffffe720, plan = 'Step out', state = running, stop others = 0 intern-state Process thinks the process has resumed. intern-state intern-state ThreadList::ShouldStop: 1 threads, 1 unsuspended threads intern-state Thread::ShouldStop(0x12bf8f0) for tid = 0x16a8 0x16a8, pc = 0x0000000000400d76 intern-state ^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^ intern-state Plan stack initial state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:16 using ranges:[0x0000000000400d67-0x0000000000400d6c). Element 2: Stepping out from clang.outstd::__shared_ptr<Test::Interface, (__gnu_cxx::_Lock_policy)2>::operator->() const at shared_ptr_base.h:1056 returning to frame at clang.outmain + 118 at reproducer.cpp:36:24 using breakpoint site -2

intern-state Plan Step out explains stop, auto-continue 0. intern-state Plan Step out should stop: 1. intern-state Completed step out plan. intern-state Popping plan: "Step out", tid = 0x16a8. intern-state ThreadPlanStepInRange reached 0x0000000000400d76. intern-state Step range plan stepped to another range of same line: [0x0000000000400d6c-0x0000000000400d80), file = /home/rdtscp/Documents/lldb_reproducer/reproducer.cpp, line = 36, column = 24 intern-state Plan Step Range stepping in should stop: 0. intern-state Plan stack final state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86). Completed Plan Stack: Element 0: Stepping out from clang.outstd::__shared_ptr<Test::Interface, (__gnu_cxx::_Lock_policy)2>::operator->() const at shared_ptr_base.h:1056 returning to frame at clang.outmain + 118 at reproducer.cpp:36:24 using breakpoint site 0

intern-state vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv intern-state ThreadList::ShouldStop overall should_stop = 0 intern-state ThreadList::ShouldReportStop 1 threads intern-state Thread::ShouldReportStop() tid = 0x16a8: returning vote for complete stack's back plan intern-state Returning vote: no intern-state Returning no intern-state Process::PrivateResume() m_stop_id = 8, public state: running private state: stopped intern-state Failed to create new thread notification breakpoint. intern-state WillResume Thread #​1 (0x0x12bf8f0): tid = 0x16a8, pc = 0x00400d76, sp = 0x7fffffffe6b0, fp = 0x7fffffffe720, plan = 'Step Range stepping in', state = stepping, stop others = 1 intern-state Process thinks the process has resumed. intern-state intern-state ThreadList::ShouldStop: 1 threads, 1 unsuspended threads intern-state Thread::ShouldStop(0x12bf8f0) for tid = 0x16a8 0x16a8, pc = 0x0000000000401130 intern-state ^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^ intern-state Plan stack initial state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86).

intern-state Plan Step Range stepping in explains stop, auto-continue 0. intern-state ThreadPlanStepInRange reached 0x0000000000401130. intern-state Couldn't find step through plan from address 0x401130. intern-state No step through plan found. intern-state ShouldStopHere callback returned 0 from 0x401130. intern-state Stopped in a function with only line 0 lines, just stepping out. intern-state Finding frames between main and non-virtual thunk to Test::Concrete::vFun(), retn-pc=0x400d78 intern-state No call edge outgoing from main with retn-PC == 0x400d78 intern-state Thread::PushPlan(0x0x12bf8f0): "Stepping out from clang.outnon-virtual thunk to Test::Concrete::vFun() at reproducer.cpp returning to frame at clang.outmain + 123 at reproducer.cpp:36:24 ", tid = 0x16a8. intern-state Plan Step Range stepping in should stop: 0. intern-state Plan stack final state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86). Element 2: Stepping out from clang.outnon-virtual thunk to Test::Concrete::vFun() at reproducer.cpp returning to frame at clang.outmain + 123 at reproducer.cpp:36:24 using breakpoint site -3

intern-state vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv intern-state ThreadList::ShouldStop overall should_stop = 0 intern-state ThreadList::ShouldReportStop 1 threads intern-state Returning vote: no intern-state Thread::ShouldReportStop() tid = 0x16a8: returning vote -1 for current plan intern-state Returning no intern-state Process::PrivateResume() m_stop_id = 9, public state: running private state: stopped intern-state WillResume Thread #​1 (0x0x12bf8f0): tid = 0x16a8, pc = 0x00401130, sp = 0x7fffffffe6a8, fp = 0x7fffffffe720, plan = 'Step out', state = running, stop others = 0 intern-state Process thinks the process has resumed. intern-state intern-state ThreadList::ShouldStop: 1 threads, 1 unsuspended threads intern-state Thread::ShouldStop(0x12bf8f0) for tid = 0x16a8 0x16a8, pc = 0x0000000000400d7b intern-state ^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^ intern-state Plan stack initial state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86). Element 2: Stepping out from clang.outnon-virtual thunk to Test::Concrete::vFun() at reproducer.cpp returning to frame at clang.outmain + 123 at reproducer.cpp:36:24 using breakpoint site -3

intern-state Plan Step out explains stop, auto-continue 0. intern-state Plan Step out should stop: 1. intern-state Completed step out plan. intern-state Popping plan: "Step out", tid = 0x16a8. intern-state ThreadPlanStepInRange reached 0x0000000000400d7b. intern-state Plan Step Range stepping in should stop: 0. intern-state Plan stack final state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86). Completed Plan Stack: Element 0: Stepping out from clang.outnon-virtual thunk to Test::Concrete::vFun() at reproducer.cpp returning to frame at clang.outmain + 123 at reproducer.cpp:36:24 using breakpoint site 0

intern-state vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv intern-state ThreadList::ShouldStop overall should_stop = 0 intern-state ThreadList::ShouldReportStop 1 threads intern-state Thread::ShouldReportStop() tid = 0x16a8: returning vote for complete stack's back plan intern-state Returning vote: no intern-state Returning no intern-state Process::PrivateResume() m_stop_id = 10, public state: running private state: stopped intern-state Failed to create new thread notification breakpoint. intern-state WillResume Thread #​1 (0x0x12bf8f0): tid = 0x16a8, pc = 0x00400d7b, sp = 0x7fffffffe6b0, fp = 0x7fffffffe720, plan = 'Step Range stepping in', state = stepping, stop others = 1 intern-state Process thinks the process has resumed. intern-state intern-state ThreadList::ShouldStop: 1 threads, 1 unsuspended threads intern-state Thread::ShouldStop(0x12bf8f0) for tid = 0x16a8 0x16a8, pc = 0x0000000000400d80 intern-state ^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^ intern-state Plan stack initial state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86).

intern-state Plan Step Range stepping in explains stop, auto-continue 0. intern-state ThreadPlanStepInRange reached 0x0000000000400d80. intern-state Plan Step Range stepping in should stop: 0. intern-state Plan stack final state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86).

intern-state vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv intern-state ThreadList::ShouldStop overall should_stop = 0 intern-state ThreadList::ShouldReportStop 1 threads intern-state ThreadPlanStepRange::ShouldReportStop() returning vote -1

intern-state Thread::ShouldReportStop() tid = 0x16a8: returning vote -1 for current plan intern-state Returning no intern-state Process::PrivateResume() m_stop_id = 11, public state: running private state: stopped intern-state Failed to create new thread notification breakpoint. intern-state WillResume Thread #​1 (0x0x12bf8f0): tid = 0x16a8, pc = 0x00400d80, sp = 0x7fffffffe6b0, fp = 0x7fffffffe720, plan = 'Step Range stepping in', state = stepping, stop others = 1 intern-state Process thinks the process has resumed. intern-state intern-state ThreadList::ShouldStop: 1 threads, 1 unsuspended threads intern-state Thread::ShouldStop(0x12bf8f0) for tid = 0x16a8 0x16a8, pc = 0x0000000000400d83 intern-state ^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^ intern-state Plan stack initial state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86).

intern-state Plan Step Range stepping in explains stop, auto-continue 0. intern-state ThreadPlanStepInRange reached 0x0000000000400d83. intern-state Plan Step Range stepping in should stop: 0. intern-state Plan stack final state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86).

intern-state vvvvvvvv Thread::ShouldStop End (returning 0) vvvvvvvv intern-state ThreadList::ShouldStop overall should_stop = 0 intern-state ThreadList::ShouldReportStop 1 threads intern-state ThreadPlanStepRange::ShouldReportStop() returning vote -1

intern-state Thread::ShouldReportStop() tid = 0x16a8: returning vote -1 for current plan intern-state Returning no intern-state Process::PrivateResume() m_stop_id = 12, public state: running private state: stopped intern-state Failed to create new thread notification breakpoint. intern-state WillResume Thread #​1 (0x0x12bf8f0): tid = 0x16a8, pc = 0x00400d83, sp = 0x7fffffffe6b0, fp = 0x7fffffffe720, plan = 'Step Range stepping in', state = stepping, stop others = 1 intern-state Process thinks the process has resumed. intern-state intern-state ThreadList::ShouldStop: 1 threads, 1 unsuspended threads intern-state Thread::ShouldStop(0x12bf8f0) for tid = 0x16a8 0x16a8, pc = 0x0000000000400d86 intern-state ^^^^^^^^ Thread::ShouldStop Begin ^^^^^^^^ intern-state Plan stack initial state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Element 1: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86).

intern-state Plan Step Range stepping in explains stop, auto-continue 0. intern-state ThreadPlanStepInRange reached 0x0000000000400d86. intern-state Step range plan out of range to 0x400d86 intern-state Plan Step Range stepping in should stop: 1. intern-state Completed step through range plan. intern-state Popping plan: "Step Range stepping in", tid = 0x16a8. intern-state Plan stack final state: thread #​1: tid = 0x16a8: Active plan stack: Element 0: Base thread plan. Completed Plan Stack: Element 0: Stepping in through line reproducer.cpp:36:24 using ranges: 0: [0x0000000000400d67-0x0000000000400d6c) 1: [0x0000000000400d6c-0x0000000000400d86).

intern-state vvvvvvvv Thread::ShouldStop End (returning 1) vvvvvvvv intern-state ThreadList::ShouldStop overall should_stop = 1 dbg.evt-handler ThreadPlanStepInRange reached 0x0000000000400d86. Process 5800 stopped

jimingham commented 4 years ago

I can't reproduce this on the current TOT lldb - at least on macOS. Regardless of whether Concrete inherits from "Base" or not, we always step into vFun.

To help me look at this further, can you run to line 36 then do:

(lldb) dis -f (lldb) dis -n vFun (lldb) image dump line-table reproducer.cpp (lldb) log enable lldb step (lldb) s

Then gather up all the console output those commands produced and add them to the radar. That should show what went wrong.

timblechmann commented 3 weeks ago

i've been seeing the same (or a similar) issue with lldb-18 on linux. makes me wonder if there is any progress on this? it is the biggest inconvenience of using lldb instead of gdb