[PATCH] D69549: [Symbolizers] On Darwin compute function offset when possible.
Dan Liew via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 28 23:41:27 PDT 2019
delcypher created this revision.
delcypher added reviewers: kubamracek, yln.
Herald added projects: Sanitizers, LLVM.
Herald added a subscriber: Sanitizers.
The sanitizer symbolizers support printing the function offset
(difference between pc and function start) of a stackframe using the
`%q` format specifier.
Unfortunately this didn't actually work because neither the atos
or dladdr symbolizer set the `AddressInfo::function_offset` field.
This patch teaches both symbolizers to try to compute the function
offset. In the case of the atos symbolizer, atos might not report the
function offset (e.g. it reports a source location instead) so in this
case it fallsback to using `dladdr()` to compute the function offset.
Two test cases are included.
rdar://problem/56695185
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D69549
Files:
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-function-offset-atos.cpp
compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-function-offset-dladdr.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69549.226842.patch
Type: text/x-patch
Size: 5674 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191029/2ecdefa2/attachment.bin>
More information about the llvm-commits
mailing list