[all-commits] [llvm/llvm-project] 2f6cc2: Add a llvm-gsymutil tool that can convert object f...

Greg Clayton via All-commits all-commits at lists.llvm.org
Tue Feb 25 21:11:13 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f6cc21f44ec9f1c3196555d2ac95dd96c48903f
      https://github.com/llvm/llvm-project/commit/2f6cc21f44ec9f1c3196555d2ac95dd96c48903f
  Author: Greg Clayton <gclayton at fb.com>
  Date:   2020-02-25 (Tue, 25 Feb 2020)

  Changed paths:
    M llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
    M llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
    A llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h
    M llvm/include/llvm/DebugInfo/GSYM/Range.h
    M llvm/lib/DebugInfo/GSYM/CMakeLists.txt
    M llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
    M llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
    M llvm/lib/DebugInfo/GSYM/GsymReader.cpp
    M llvm/lib/DebugInfo/GSYM/LookupResult.cpp
    A llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp
    M llvm/lib/DebugInfo/GSYM/Range.cpp
    A llvm/test/tools/llvm-gsymutil/cmdline.test
    A llvm/test/tools/llvm-gsymutil/elf-dwarf.yaml
    A llvm/test/tools/llvm-gsymutil/fat-macho-dwarf.yaml
    A llvm/test/tools/llvm-gsymutil/mach-dwarf.yaml
    A llvm/tools/llvm-gsym/CMakeLists.txt
    A llvm/tools/llvm-gsym/llvm-gsymutil.cpp

  Log Message:
  -----------
  Add a llvm-gsymutil tool that can convert object files to GSYM and perform lookups.

Summary:
This patch creates the llvm-gsymutil binary that can convert object files to GSYM using the --convert <path> option. It can also dump and lookup addresses within GSYM files that have been saved to disk.

To dump a file:

llvm-gsymutil /path/to/a.gsym

To perform address lookups, like with atos, on GSYM files:

llvm-gsymutil --address 0x1000 --address 0x1100 /path/to/a.gsym

To convert a mach-o or ELF file, including any DWARF debug info contained within the object files:

llvm-gsymutil --convert /path/to/a.out --out-file /path/to/a.out.gsym

Conversion highlights:
- convert DWARF debug info in mach-o or ELF files to GSYM
- convert symbols in symbol table to GSYM and don't convert symbols that overlap with DWARF debug info
- extract UUID from object files
- extract .text (read + execute) section address ranges and filter out any DWARF or symbols that don't fall in those ranges.
- if .text sections are extracted, and if the last gsym::FunctionInfo object has no size, cap the size to the end of the section the function was contained in

Dumping GSYM files will dump all sections of the GSYM file in textual format.

Reviewers: labath, aadsm, serhiy.redko, jankratochvil, xiaobai, wallace, aprantl, JDevlieghere, jdoerfert

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list