[PATCH] D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 08:58:54 PDT 2019


clayborg created this revision.
clayborg added reviewers: jakehehrlich, echristo, markmentovai, JDevlieghere, lemo, phosek, aprantl.
Herald added a subscriber: mgorny.
Herald added a project: LLVM.

The full GSYM patch started with: https://reviews.llvm.org/D53379

This patch add the ability to encode data using the new llvm::gsym::FileWriter class.

FileWriter is a simplified binary data writer class that doesn't require targets, target definitions, architectures, or require any other optional compile time libraries to be enabled via the build process.  This class needs the ability to seek to different spots in the binary data that it produces to fix up offsets and sizes in GSYM data. It currently uses std::ostream over llvm::raw_ostream because llvm::raw_ostream doesn't support seeking which is required when encoding and decoding GSYM data.

AddressRange objects are encoded and decoded to be relative to a base address. This will be the FunctionInfo's start address if the AddressRange is directly contained in a FunctionInfo, or a base address of the containing parent AddressRange or AddressRanges. This allows address ranges to be efficiently encoded using ULEB128 encodings as we encode the offset and size of each range instead of full addresses. This also makes encoded addresses easy to relocate as we just need to relocate one base address.


Repository:
  rL LLVM

https://reviews.llvm.org/D63828

Files:
  include/llvm/DebugInfo/GSYM/FileWriter.h
  include/llvm/DebugInfo/GSYM/Range.h
  lib/DebugInfo/GSYM/CMakeLists.txt
  lib/DebugInfo/GSYM/FileWriter.cpp
  lib/DebugInfo/GSYM/Range.cpp
  unittests/DebugInfo/GSYM/GSYMTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63828.206692.patch
Type: text/x-patch
Size: 13737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190626/2aeabd64/attachment.bin>


More information about the llvm-commits mailing list