[cfe-users] Generating debug symbol data for lldb on OSX 10.11

Ross Inglis via cfe-users cfe-users at lists.llvm.org
Thu Jun 2 08:31:53 PDT 2016


Hi folks.

I'm trying to debug an issue on a browser plugin built on OSX 10.11 with 
clang/llvm
(sorry, I can't seem to get useful versions out - I just installed the 
toolset from Apple).

The plugin build is adapted from a build that functions back to OSX 
10.6. It uses
GNU Makefiles (not XCode).  It has been adapted to clang/llvm simply by 
tweaking the
base makefiles to swap tools: gcc to clang, g++ to clang++ etc.  The 
final shlib in this case
is presently 32-bit (to work under 32-bit browsers).

When I tried to use lldb to debug an issue, I found it had very limited 
abilities. It could
show me function names/addresses, but nothing useful on variables or 
arguments.

I suspect the problem is a lack of debug information in the final 
shlib.  I find that while
objects out of llvm have plenty of DWARF Debug info in them (-g is used 
throughout the
debug build)... the final shared library has no DWARF data at all 
(according to dwarfdump).
This is in spite of the -g option clearly being used in the final link 
(via the clang++ front-end).

(I'm assuming lldb wants DWARF right?)

Can anyone point me at the right options to use to get functional debug 
information
from clang/llvm, though to El-Capitans linker out to lldb?  I'm thinking 
this problem looks like
the linker in use  (as far as I can tell, the old system 'ld') simply 
doesn't understand the
DWARF information - or is it trying to translate DWARF to something 
else? Do I need to
install/use a different linker?  I'd hate to back off  to gcc at this 
point, but I need a
functional debugger.

Thanks in advance for any clues.

Ross.



More information about the cfe-users mailing list