llvm / llvm-project

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

Unable to step into __cxa_allocate_exception #35786

Open llvmbot opened 6 years ago

llvmbot commented 6 years ago
Bugzilla Link 36438
Version 6.0
OS Linux
Attachments Sample program
Reporter LLVM Bugzilla Contributor
CC @jimingham,@yuanfang-chen

Extended Description

$ /home/dantipov/.local/llvm-6.0.0/bin/lldb t-throw (lldb) target create "t-throw" Current executable set to 't-throw' (x86_64). (lldb) b t-throw.cc:10 Breakpoint 1: where = t-throw`main + 18 at t-throw.cc:10, address = 0x00000000004009a9 (lldb) r Process 22330 launched: '/home/dantipov/tmp/t-throw' (x86_64) Process 22330 stopped

vs:

$ gdb -q t-throw Reading symbols from t-throw...done. (gdb) b t-throw.cc:10 Breakpoint 1 at 0x4009a9: file t-throw.cc, line 10. (gdb) r Starting program: /home/dantipov/tmp/t-throw [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main (argc=1, argv=0x7fffffffe2f8) at t-throw.cc:10 10 throw new T (); (gdb) s cxxabiv1::cxa_allocate_exception (thrown_size=8) at ../../../../libstdc++-v3/libsupc++/eh_alloc.cc:280 280 { (gdb) bt

​0 cxxabiv1::cxa_allocate_exception (thrown_size=8) at ../../../../libstdc++-v3/libsupc++/eh_alloc.cc:280

​1 0x00000000004009b3 in main (argc=1, argv=0x7fffffffe2f8) at t-throw.cc:10

llvmbot commented 6 years ago

Step log

jimingham commented 6 years ago

Can you do:

(lldb) log enable -f /tmp/lldb-step-log.txt lldb step

right before the "step" command, and then run the step. Then add that log to the radar. I can generally see what went wrong from there.

jimingham commented 6 years ago

Works correctly on macOS. __cxa_allocate_exception was a re-exported symbol on macOS, maybe it is also on linux, and we aren't handling those properly?