[PATCH] D111658: [WIP] Add JSON output option to llvm-readelf

Jayson Yan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 12 09:33:37 PDT 2021


Jaysonyan created this revision.
Jaysonyan added reviewers: leonardchan, phosek, kzhuravl.
Herald added subscribers: s.egerton, rupprecht, simoncook, emaste.
Herald added a reviewer: jhenderson.
Jaysonyan requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

This change adds JSON output to llvm-readelf. It is enabled through the --elf-output-style
option which now supports JSON in addition to the existing LLVM and GNU. It uses the
json::OStream to format and output information.

Currently this is mostly skeleton code but includes implementation for:

- printFileHeaders() (accessed through --file-headers or -h)
- printGroupSections() (accessed through --section-groups or -g)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111658

Files:
  llvm/test/tools/llvm-readobj/ELF/file-headers.test
  llvm/test/tools/llvm-readobj/ELF/groups.test
  llvm/test/tools/llvm-readobj/ELF/output-style.test
  llvm/tools/llvm-readobj/ELFDumper.cpp
  llvm/tools/llvm-readobj/llvm-readobj.cpp
  llvm/tools/llvm-readobj/llvm-readobj.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111658.379072.patch
Type: text/x-patch
Size: 38836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211012/766e6c66/attachment.bin>


More information about the llvm-commits mailing list