<html><head></head><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">On 30.11.2011, at 02:57, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:</span></div>
<div><br></div><div></div><blockquote type="cite"><div>Hello, <div><br></div><div>I am working on integrating AddressSanitizer (aka asan, <a href="http://clang.llvm.org/docs/AddressSanitizer.html">http://clang.llvm.org/docs/AddressSanitizer.html</a>) run-time library with the llvm compiler-rt. </div>
<div>Asan needs to symbolize PCs, i.e. given a value of a PC it needs to produce the file name and the line number (if debug info is present). </div><div>Currently, this is achieved by printing the PCs as /path/to/object/file+offset and filtering the output with a script which uses addr2line/atos. </div>
<div>Ideally, symbolization should happen inside the process and should not require post processing. </div><div><br></div><div>I would expect that lldb already has such functionality, right? </div><div>Somewhere in include/lldb/Symbol/Symtab.h?</div>
<div>Does it work on both Linux and Mac? </div><div>Do you think that it is possible/desirable to have this kind of code sharing between lldb and asan? </div><div>Will that work with the current build system (where lldb and compiler-rt/lib/asan are separate subprojects)?</div>
</div></blockquote><br><div>I recently extracted the DWARF parsing that's necessary to get line numbers from addresses out of lldb into LLVM. Take a look at llvm-dwarfdump and the DebugInfo library. It requires relocations to be resolved upfront though, so it won't work on Linux out of the box (DWARF doesn't use relocations on OS X).</div>
<div><br></div><div>-Ben</div></body></html>