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

danliew via All-commits all-commits at lists.llvm.org
Tue Nov 19 10:04:59 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b9a92206b6ef8b369dc266d8cb70553ebef293bd
      https://github.com/llvm/llvm-project/commit/b9a92206b6ef8b369dc266d8cb70553ebef293bd
  Author: Dan Liew <dan at su-root.co.uk>
  Date:   2019-11-19 (Tue, 19 Nov 2019)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
    M compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-no-external-symbolizer.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