[all-commits] [llvm/llvm-project] e144ae: [symbolizer] Support symbol lookup

Serge Pavlov via All-commits all-commits at lists.llvm.org
Wed Nov 1 00:42:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e144ae54dcb96838a6176fd9eef21028935ccd4f
      https://github.com/llvm/llvm-project/commit/e144ae54dcb96838a6176fd9eef21028935ccd4f
  Author: Serge Pavlov <sepavloff at gmail.com>
  Date:   2023-11-01 (Wed, 01 Nov 2023)

  Changed paths:
    M llvm/docs/CommandGuide/llvm-symbolizer.rst
    M llvm/docs/ReleaseNotes.rst
    M llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
    M llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
    M llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
    M llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
    M llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
    M llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
    M llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
    M llvm/test/Support/interrupts.test
    M llvm/test/tools/llvm-symbolizer/Inputs/addr.inp
    M llvm/test/tools/llvm-symbolizer/Inputs/discrim.inp
    A llvm/test/tools/llvm-symbolizer/Inputs/symbols.h
    A llvm/test/tools/llvm-symbolizer/Inputs/symbols.part1.cpp
    A llvm/test/tools/llvm-symbolizer/Inputs/symbols.part2.cpp
    A llvm/test/tools/llvm-symbolizer/Inputs/symbols.part3.c
    A llvm/test/tools/llvm-symbolizer/Inputs/symbols.part4.c
    A llvm/test/tools/llvm-symbolizer/Inputs/symbols.so
    M llvm/test/tools/llvm-symbolizer/output-style-json-code.test
    M llvm/test/tools/llvm-symbolizer/output-style-json-data.test
    M llvm/test/tools/llvm-symbolizer/output-style-json-frame.ll
    A llvm/test/tools/llvm-symbolizer/symbol-search.test
    M llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
    M llvm/unittests/ProfileData/MemProfTest.cpp

  Log Message:
  -----------
  [symbolizer] Support symbol lookup

Recent versions of GNU binutils starting from 2.39 support symbol+offset
lookup in addition to the usual numeric address lookup. This change adds
symbol lookup to llvm-symbolize and llvm-addr2line.

Now llvm-symbolize behaves closer to GNU addr2line, - if the value specified
as address in command line or input stream is not a number, it is treated as
a symbol name. For example:

    llvm-symbolize --obj=abc.so func_22
    llvm-symbolize --obj=abc.so "CODE func_22"

This lookup is now supported only for functions. Specification with
offset is not supported yet.

This is a recommit of 2b27948783e4bbc1132d3220d8517ef62607b558, reverted
in 39fec5457c0925bd39f67f63fe17391584e08258 because the test
llvm/test/Support/interrupts.test started failing on Windows. The test was
changed in 18f036d0105589c3175bb51a518c5d272dae61e2 and is also updated in
this commit.

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




More information about the All-commits mailing list