[all-commits] [llvm/llvm-project] 8678af: [Symbolizers] On Darwin compute function offset wh...

Dan Liew via All-commits all-commits at lists.llvm.org
Mon Oct 28 23:42:30 PDT 2019


  Branch: refs/heads/radar_56695185
  Home:   https://github.com/llvm/llvm-project
  Commit: 8678afce2c8cb2b392a02459350023093ab7eb17
      https://github.com/llvm/llvm-project/commit/8678afce2c8cb2b392a02459350023093ab7eb17
  Author: Dan Liew <dliew at apple.com>
  Date:   2019-10-28 (Mon, 28 Oct 2019)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
    A compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-function-offset-atos.cpp
    A compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-function-offset-dladdr.cpp

  Log Message:
  -----------
  [Symbolizers] On Darwin compute function offset when possible.

Summary:
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

Reviewers: kubamracek, yln

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D69549




More information about the All-commits mailing list