Package: libllvm6.0-dbgsym
Version: 1:6.0.1-9.2

Backtraces into libllvm6.0 (in either gdb or lldb-6.0) aren't any more complete with the libllvm6.0-dbgsym package installed than without it: they have function names but no local variables or source line numbers.

I don't know how long this problem has existed, but the traces in #852746 + #851371 (LLVM 3.9) and #868745 (LLVM 4.0, non-x86) show that at least the source line numbers used to work. It also affects libllvm7 version 7-6 (from buster but tested in sid); current libllvm7 doesn't have a -dbgsym at all due to #913946.

This _isn't_ an exact match for either #851371 or #913946: it doesn't have either of their error messages, and the -dbgsym package size is about right (i.e. not simply empty).

$ gdb --args clang++-6.0 -o bug913141 bug913141.cpp -lOpenCL -g
[...various other breakpoints...]
(gdb) break llvm::sys::Wait
Breakpoint 5 at 0x7ffff4925d50 (2 locations)
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/clang++-6.0 -o bug913141 bug913141.cpp -lOpenCL -g
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 5, 0x00007ffff4925d50 in llvm::sys::Wait(llvm::sys::ProcessInfo const&, unsigned int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)@plt ()
   from /usr/lib/llvm-6.0/bin/../lib/libLLVM-6.0.so.1
(gdb) bt full
#0 0x00007ffff4925d50 in llvm::sys::Wait(llvm::sys::ProcessInfo const&, unsigned int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)@plt ()
   from /usr/lib/llvm-6.0/bin/../lib/libLLVM-6.0.so.1
No symbol table info available.
#1 0x00007ffff4ad4005 in llvm::sys::ExecuteAndWait(llvm::StringRef, char const**, char const**, llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) ()
   from /usr/lib/llvm-6.0/bin/../lib/libLLVM-6.0.so.1
No symbol table info available.
#2 0x0000555555cabb30 in clang::driver::Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const ()
No symbol table info available.
#3 0x0000555555c8bb17 in clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const ()
No symbol table info available.
#4 0x0000555555c8c24b in clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const ()
No symbol table info available.
#5 0x0000555555c97239 in clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) ()
No symbol table info available.
---Type <return> to continue, or q <return> to quit---q
Quit


$ lldb-6.0 -- clang++-6.0 -o bug913141 bug913141.cpp -lOpenCL -g
(lldb) target create "clang++-6.0"
Current executable set to 'clang++-6.0' (x86_64).
(lldb) settings set -- target.run-args "-o" "bug913141" "bug913141.cpp" "-lOpenCL" "-g"
(lldb) breakpoint set --name llvm::sys::Wait
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) breakpoint set --name llvm::sys::Wait()
Breakpoint 2: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) run
Process 8503 launched: '/usr/bin/clang++-6.0' (x86_64)
1 location added to breakpoint 1
Process 8503 stopped
* thread #1, name = 'clang++-6.0', stop reason = breakpoint 1.1
frame #0: 0x00007ffff4ad1a30 libLLVM-6.0.so.1`llvm::sys::Wait(llvm::sys::ProcessInfo const&, unsigned int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)
libLLVM-6.0.so.1`llvm::sys::Wait:
->  0x7ffff4ad1a30 <+0>: pushq  %r15
    0x7ffff4ad1a32 <+2>: movq   %rcx, %r15
    0x7ffff4ad1a35 <+5>: pushq  %r14
    0x7ffff4ad1a37 <+7>: movq   %rdi, %r14
(lldb) frame variable
(lldb) thread backtrace
* thread #1, name = 'clang++-6.0', stop reason = breakpoint 1.1
* frame #0: 0x00007ffff4ad1a30 libLLVM-6.0.so.1`llvm::sys::Wait(llvm::sys::ProcessInfo const&, unsigned int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) frame #1: 0x00007ffff4ad4005 libLLVM-6.0.so.1`llvm::sys::ExecuteAndWait(llvm::StringRef, char const**, char const**, llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) + 181 frame #2: 0x0000555555cabb30 clang++-6.0`clang::driver::Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const + 928 frame #3: 0x0000555555c8bb17 clang++-6.0`clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const + 135 frame #4: 0x0000555555c8c24b clang++-6.0`clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const + 107 frame #5: 0x0000555555c97239 clang++-6.0`clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) + 137
    frame #6: 0x0000555555987d37 clang++-6.0`main + 7527
    frame #7: 0x00007ffff3ab3b17 libc.so.6`__libc_start_main + 231
    frame #8: 0x000055555599665a clang++-6.0`_start + 42

Reply via email to