<div dir="ltr">Hi,<div><br></div><div>We have a lot of non-trivial logic accumulated in the</div><div>implementation of llvm-symbolizer tool (tools/llvm-symbolizer/LLVMSymbolize.{h,cpp}), for instance:</div><div><br></div><div>* dynamic dispatch between DWARF and PDB debug info;</div><div>* building address->symbol_name mapping from object file (with special cases for PowerPC function descriptor section, and COFF export tables);</div><div>* finding debug info stored in separate files (.dSYM files on Darwin, ELF .gnu_debuglink section, etc.);</div><div>* demangling (with platform-specific implementations for Windows and Unix).</div><div><br></div><div>I propose to move this code into a separate library LLVMSymbolize (stored under lib/DebugInfo/Symbolize), and make llvm-symbolizer a short and simple tool using it. This would allow to:</div><div><br></div><div>* implement in-process symbolized stack trace printers (for the cases when it's possible to link in a bunch of LLVM libraries into the executable).</div><div>* easily write more tools that can make use of symbolized code locations, such as coverage data visualizers.</div><div>* (at least sometimes) write unit tests instead of testing functionality by running "llvm-symbolizer" executable on pre-built executables checked in repository.</div><div><br></div><div>Any comments/objections?</div><div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div></div>